:root {
  --bg-base: #07080b;
  --bg-surface: rgba(12, 15, 20, 0.84);
  --bg-raised: rgba(19, 22, 28, 0.94);
  --bg-overlay: rgba(8, 10, 14, 0.78);
  --text-primary: #fff3cc;
  --text-secondary: #b9a878;
  --text-muted: #5a5855;
  --border-soft: rgba(237, 198, 106, 0.28);
  --border-strong: rgba(237, 198, 106, 0.52);
  --gold: #edc66a;
  --gold-strong: #ffd877;
  --teal: #38d1c3;
  --teal-dim: #1b756e;
  --ruby: #c63d35;
  --ruby-dim: #5b1719;
  --coral: #ff5f7d;
  --emerald: #2fe58a;
  --sky: #5dc8ff;
  --cream: #fff1b8;
  --green: #6bd873;
  --success: #3ecf8e;
  --danger: #e05252;
  --warning: #f5a623;
  --info: #4fa3e0;
  --bg: var(--bg-base);
  --surface: var(--bg-surface);
  --surface-strong: var(--bg-raised);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: rgba(237, 198, 106, 0.42);
  --cell-gap: 3px;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur-mid: 220ms;
  --dur-slow: 380ms;
  --nav-h: calc(60px + env(safe-area-inset-bottom));
  --dock-height: var(--nav-h);
  --board-width: clamp(220px, min(82vw, 360px, calc((100dvh - 360px) * 0.625)), 360px);
  color-scheme: dark;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100dvh;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  padding-bottom: var(--dock-height);
  overflow-x: hidden;
  overflow-y: visible;
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0.06), rgba(7, 8, 11, 0.74) 42%, rgba(7, 8, 11, 0.96)),
    url("../media/rsg-upgrade/rsg-mobile-hero.png") center top / cover no-repeat,
    #07080b;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.64), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.64)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: #07080b;
  color: var(--gold-strong);
}

.boot-mark,
.brand-mark {
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(56, 209, 195, 0.16), rgba(198, 61, 53, 0.12)),
    #12151b;
  color: var(--gold-strong);
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 28px rgba(0, 0, 0, 0.42);
}

.boot-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-display);
}

.mobile-top {
  position: relative;
  z-index: 2;
  padding: calc(env(safe-area-inset-top) + 7px) 10px 6px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.brand-button,
.hud-button,
.tab-button,
.primary-action,
.secondary-action,
.board-action,
.chip-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 240, 185, 0.08), rgba(0, 0, 0, 0.16)),
    var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 20px rgba(0, 0, 0, 0.28);
}

.brand-button {
  padding: 0;
  background: transparent;
  border: 0;
}

.top-rank {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.78);
  padding: 6px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  backdrop-filter: blur(12px);
}

.top-rank strong,
.player-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-rank strong {
  color: var(--gold-strong);
  font-size: 13px;
  font-family: var(--font-display);
  letter-spacing: 0;
}

.top-rank span,
.player-copy span,
.mission-copy span {
  color: var(--muted);
  font-size: 11px;
}

.rank-pill {
  border: 1px solid color-mix(in srgb, var(--tier-color, var(--teal)) 72%, transparent);
  border-radius: 999px;
  color: #bffff7;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tier-color, var(--teal)) 22%, transparent), rgba(8, 42, 39, 0.72));
  font-family: var(--font-display);
}

.hud-button {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.game-main {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 6px;
  padding: 0 10px;
}

.hub-main {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  justify-self: center;
  min-height: 0;
  padding: 10px 10px calc(var(--nav-h) + 14px);
}

.hub-panel {
  display: grid;
  gap: 10px;
}

.player-strip {
  width: min(100%, 490px);
  justify-self: center;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(237, 198, 106, 0.34);
  border-radius: 8px;
  background: rgba(7, 9, 12, 0.78);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.player-strip.active {
  border-color: rgba(56, 209, 195, 0.88);
  box-shadow: 0 0 0 2px rgba(56, 209, 195, 0.16), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.player-strip.must-capture {
  border-color: rgba(198, 61, 53, 0.88);
  box-shadow: 0 0 0 2px rgba(198, 61, 53, 0.2), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.avatar {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 216, 119, 0.18), rgba(56, 209, 195, 0.1)),
    #11161d;
  color: var(--gold-strong);
  font-size: 13px;
  font-weight: 900;
}

.avatar.small {
  width: 28px;
  font-size: 10px;
}

.avatar.large {
  width: 54px;
  font-size: 16px;
}

.player-clock {
  min-width: 52px;
  text-align: right;
  color: var(--gold-strong);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-family: var(--font-display);
}

.arena {
  min-height: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 6px;
}

.status-banner {
  width: min(100%, 490px);
  border: 1px solid rgba(237, 198, 106, 0.34);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.78);
  color: var(--gold-strong);
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  backdrop-filter: blur(10px);
}

.status-banner strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-banner span {
  color: var(--muted);
  font-size: 11px;
}

.status-danger {
  border-color: rgba(198, 61, 53, 0.78);
  box-shadow: 0 0 0 2px rgba(198, 61, 53, 0.16), 0 16px 30px rgba(0, 0, 0, 0.32);
}

.status-epic {
  border-color: rgba(255, 216, 119, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 216, 119, 0.14), 0 16px 30px rgba(0, 0, 0, 0.32);
}

.status-complete {
  border-color: rgba(107, 216, 115, 0.78);
}

.combo-meter {
  min-width: 48px;
  text-align: center;
  border: 1px solid rgba(56, 209, 195, 0.54);
  border-radius: 8px;
  padding: 4px 6px;
  color: #bffff7;
  background: rgba(9, 48, 45, 0.62);
  font-size: 11px;
  font-weight: 900;
}

.board-frame {
  position: relative;
  width: calc(var(--board-width) + 24px);
  max-width: 100%;
  padding: 12px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 216, 119, 0.2), rgba(56, 209, 195, 0.1) 32%, rgba(198, 61, 53, 0.12)),
    #0c0f14;
  border: 1px solid rgba(237, 198, 106, 0.52);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.board-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(237, 198, 106, 0.24);
  border-radius: 6px;
  pointer-events: none;
}

.board-grid {
  width: var(--board-width);
  aspect-ratio: 5 / 8;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: var(--cell-gap);
  padding: var(--cell-gap);
  border: 1px solid rgba(237, 198, 106, 0.48);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 216, 119, 0.14), rgba(0, 0, 0, 0.12)),
    #141821;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.46);
}

.ranked-panel-link {
  color: var(--gold-strong);
}

.square {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(3, 4, 6, 0.62);
  border-radius: 5px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #1b2430;
}

.square.light {
  background:
    linear-gradient(145deg, rgba(255, 216, 119, 0.18), transparent 48%),
    #915d2c;
}

.square.dark {
  background:
    linear-gradient(145deg, rgba(56, 209, 195, 0.11), transparent 52%),
    #27313a;
}

.square.promo::before {
  content: "";
  position: absolute;
  width: 42%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 216, 119, 0.66);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(255, 216, 119, 0.2);
}

.square.legal::after,
.square.capture::after {
  content: "";
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 14px rgba(56, 209, 195, 0.86);
}

.square.capture::after {
  width: 74%;
  background: rgba(198, 61, 53, 0.2);
  border: 2px solid rgba(255, 160, 138, 0.92);
  box-shadow: 0 0 20px rgba(198, 61, 53, 0.76);
}

.square.selected {
  outline: 3px solid var(--gold-strong);
  z-index: 3;
}

.square.hint-best {
  box-shadow: inset 0 0 0 3px rgba(255, 216, 119, 0.92), 0 0 18px rgba(255, 216, 119, 0.28);
}

.square.hint-capture {
  box-shadow: inset 0 0 0 3px rgba(198, 61, 53, 0.72);
}

.square.hint-promo {
  box-shadow: inset 0 0 0 3px rgba(107, 216, 115, 0.72);
}

.square.last-from {
  box-shadow: inset 0 0 0 3px rgba(56, 209, 195, 0.74);
}

.square.last-to {
  box-shadow: inset 0 0 0 3px rgba(255, 216, 119, 0.9);
}

.square.forced .piece-token {
  animation: forcedPulse 1s infinite;
}

.piece-token {
  width: 86%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.piece-token img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.44));
}

.piece-token.king img {
  filter: drop-shadow(0 0 8px rgba(255, 216, 119, 0.48)) drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
}

.piece-token.arrive {
  animation: arrive 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.move-badge {
  position: absolute;
  right: 5%;
  bottom: 5%;
  z-index: 4;
  min-width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 236, 172, 0.9);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #2a1508;
  background: linear-gradient(180deg, #ffe9a8, #bf7d2d);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.36);
}

.king-badge {
  position: absolute;
  top: 4%;
  right: 5%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 236, 172, 0.9);
  background: #7b1d1a;
  color: #ffe9a8;
  display: grid;
  place-items: center;
  font-size: clamp(10px, 2.5vw, 15px);
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.spark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 8px;
}

.spark {
  position: absolute;
  width: 16px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--gold-strong);
  box-shadow: 0 0 18px rgba(255, 216, 119, 0.86);
  animation: spark 540ms ease-out both;
}

.board-actions {
  width: min(100%, 490px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.board-action {
  min-height: 36px;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.board-action.active {
  border-color: rgba(56, 209, 195, 0.9);
  color: #c8fff8;
  background: rgba(9, 48, 45, 0.88);
}

.bottom-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  padding: 6px 10px calc(env(safe-area-inset-bottom) + 8px);
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0), rgba(7, 8, 11, 0.88) 16%, rgba(7, 8, 11, 0.98));
}

.panel-shelf {
  width: min(100%, 490px);
  justify-self: center;
  border: 1px solid rgba(237, 198, 106, 0.34);
  border-radius: 8px;
  background: rgba(9, 11, 15, 0.86);
  max-height: min(360px, 44dvh);
  overflow: auto;
  padding: 10px;
  backdrop-filter: blur(12px);
}

.app-shell[data-tab="practice"] .panel-shelf {
  display: none;
}

.bottom-panel.nav-only {
  padding-top: 8px;
}

.app-shell[data-mode="challenge"] .panel-shelf,
.app-shell[data-mode="match"] .panel-shelf {
  max-height: min(210px, 28dvh);
}

.app-shell[data-view="hub"] {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-bottom: var(--nav-h);
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.12), rgba(5, 10, 18, 0.44) 42%, rgba(7, 8, 11, 0.98)),
    url("./assets/rsg-mobile-hub-art.png") center top / cover no-repeat,
    #07080b;
}

.app-shell[data-mode="challenge"] {
  padding-bottom: calc(var(--dock-height) + min(210px, 28dvh));
  --board-width: clamp(240px, 64vw, 250px);
}

.app-shell[data-mode="challenge"][data-tab="bite"] {
  padding-bottom: var(--dock-height);
}

.app-shell[data-mode="challenge"][data-tab="bite"] .panel-shelf {
  display: none;
}

.app-shell[data-mode="match"] {
  padding-bottom: calc(var(--dock-height) + min(210px, 28dvh));
  --board-width: clamp(200px, min(72vw, 330px, calc((100dvh - 500px) * 0.625)), 330px);
}

.app-shell[data-mode="challenge"] .player-strip {
  display: none;
}

.mission-list,
.online-list,
.move-list,
.home-stack,
.bite-stack {
  display: grid;
  gap: 8px;
}

.segmented-tabs {
  display: grid;
  grid-template-columns: repeat(var(--segment-count, 3), minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(237, 198, 106, 0.22);
  border-radius: var(--radius-md);
  padding: 4px;
  background: rgba(5, 7, 10, 0.62);
}

.segmented-chip {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.segmented-chip.active {
  color: #2a1508;
  background: linear-gradient(180deg, #ffe9a8, #bf7d2d);
}

.home-hero {
  position: relative;
  min-height: 242px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 119, 0.62);
  border-radius: var(--radius-md);
  padding: 118px 10px 10px;
  background:
    linear-gradient(180deg, rgba(4, 9, 14, 0.02) 0%, rgba(4, 9, 14, 0.22) 40%, rgba(4, 9, 14, 0.88) 100%),
    rgba(12, 15, 20, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 40px rgba(0, 0, 0, 0.38);
  isolation: isolate;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  z-index: -1;
  background:
    linear-gradient(180deg, transparent, rgba(8, 10, 14, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 216, 119, 0.18) 0 1px, transparent 1px 34px);
  pointer-events: none;
}

.home-hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.02);
  animation: heroDrift 9s var(--ease-out) infinite alternate;
}

.hero-sparkles {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-sparkles span {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 241, 184, 0.92);
  background: var(--gold-strong);
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(255, 216, 119, 0.75);
  animation: sparkleFloat 2.8s ease-in-out infinite;
}

.hero-sparkles span:nth-child(1) {
  left: 16%;
  top: 18%;
}

.hero-sparkles span:nth-child(2) {
  right: 20%;
  top: 22%;
  animation-delay: 0.55s;
  background: var(--teal);
}

.hero-sparkles span:nth-child(3) {
  left: 29%;
  top: 54%;
  animation-delay: 1.1s;
  background: var(--coral);
}

.hero-sparkles span:nth-child(4) {
  right: 13%;
  top: 58%;
  animation-delay: 1.55s;
  background: var(--emerald);
}

.home-copy,
.home-tile,
.home-season div {
  min-width: 0;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: var(--text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.home-copy strong,
.tier-badge strong,
.home-tile strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-copy strong {
  margin-top: 2px;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 18px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.home-copy span:last-child,
.home-tile small {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--text-xs);
}

.tier-badge {
  min-width: 76px;
  border: 1px solid color-mix(in srgb, var(--tier-color, var(--gold)) 70%, transparent);
  border-radius: var(--radius-md);
  padding: 7px 8px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tier-color, var(--gold)) 28%, transparent), transparent 64%),
    rgba(8, 12, 16, 0.82);
}

.tier-badge span {
  display: block;
  color: color-mix(in srgb, var(--tier-color, var(--gold)) 86%, white);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.tier-badge strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.home-actions .primary-action,
.home-actions .secondary-action {
  min-height: 42px;
  padding-inline: 7px;
  white-space: normal;
  text-align: center;
}

.home-actions .primary-action {
  background:
    linear-gradient(180deg, #fff1b8, #ffd45f 48%, #f06c56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 22px rgba(240, 108, 86, 0.24);
}

.home-actions .secondary-action {
  border-color: rgba(93, 200, 255, 0.54);
  background:
    linear-gradient(180deg, rgba(93, 200, 255, 0.2), rgba(9, 48, 45, 0.88));
}

.hub-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hub-option {
  position: relative;
  min-width: 0;
  min-height: 136px;
  display: grid;
  align-content: end;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(237, 198, 106, 0.38);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(160deg, rgba(255, 216, 119, 0.16), rgba(56, 209, 195, 0.14) 42%, rgba(255, 95, 125, 0.1)),
    rgba(8, 12, 16, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 28px rgba(0, 0, 0, 0.28);
}

.hub-option::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(5, 7, 10, 0.18) 42%, rgba(5, 7, 10, 0.84) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
  pointer-events: none;
}

.hub-option::after {
  content: "";
  position: absolute;
  inset: 8px 8px auto auto;
  width: 34px;
  height: 18px;
  border-top: 3px solid var(--gold-strong);
  border-right: 3px solid var(--gold-strong);
  opacity: 0.82;
  pointer-events: none;
}

.hub-option.featured {
  border-color: rgba(255, 216, 119, 0.7);
  background:
    linear-gradient(160deg, rgba(255, 216, 119, 0.36), rgba(56, 209, 195, 0.18) 50%, rgba(255, 95, 125, 0.18)),
    rgba(12, 15, 20, 0.9);
}

.hub-option:nth-child(2) {
  border-color: rgba(255, 95, 125, 0.52);
  background:
    linear-gradient(160deg, rgba(255, 95, 125, 0.26), rgba(255, 216, 119, 0.14) 54%, rgba(47, 229, 138, 0.1)),
    rgba(12, 15, 20, 0.9);
}

.hub-option:nth-child(3) {
  border-color: rgba(93, 200, 255, 0.5);
  background:
    linear-gradient(160deg, rgba(93, 200, 255, 0.24), rgba(56, 209, 195, 0.16) 52%, rgba(255, 216, 119, 0.1)),
    rgba(12, 15, 20, 0.9);
}

.hub-option:nth-child(4) {
  border-color: rgba(47, 229, 138, 0.48);
  background:
    linear-gradient(160deg, rgba(47, 229, 138, 0.22), rgba(255, 216, 119, 0.14) 50%, rgba(255, 95, 125, 0.12)),
    rgba(12, 15, 20, 0.9);
}

.hub-option img {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.42));
  opacity: 0.92;
  transform: rotate(8deg);
  animation: pieceBob 4.2s ease-in-out infinite;
  pointer-events: none;
}

.hub-option:nth-child(2) img,
.hub-option:nth-child(4) img {
  animation-delay: 0.8s;
  transform: rotate(-7deg);
}

.hub-option span,
.hub-option strong,
.hub-option small {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-option span {
  color: var(--cream);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}

.hub-option strong {
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 15px;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hub-option small {
  color: #f7e0a6;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.home-tile {
  min-height: 68px;
  border: 1px solid rgba(255, 216, 119, 0.32);
  border-radius: var(--radius-md);
  padding: 8px;
  background:
    linear-gradient(145deg, rgba(93, 200, 255, 0.1), rgba(255, 95, 125, 0.08)),
    rgba(8, 12, 16, 0.78);
}

.home-tile span {
  display: block;
  color: var(--cream);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-tile strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.guild-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(56, 209, 195, 0.36);
  border-radius: 8px;
  padding: 9px;
  background:
    linear-gradient(135deg, rgba(56, 209, 195, 0.13), rgba(255, 216, 119, 0.08)),
    rgba(8, 12, 16, 0.78);
}

.guild-card.hero {
  min-height: 74px;
  border-color: rgba(255, 216, 119, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 216, 119, 0.14), rgba(56, 209, 195, 0.12) 46%, rgba(198, 61, 53, 0.1)),
    rgba(12, 15, 20, 0.86);
}

.guild-card strong,
.guild-member-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.guild-card span,
.guild-member-row small {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}

.guild-crest {
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold-strong);
  background: rgba(5, 7, 10, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.guild-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.guild-stats div {
  min-width: 0;
  border: 1px solid rgba(237, 198, 106, 0.26);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 12, 16, 0.72);
}

.guild-stats strong,
.guild-stats span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-stats strong {
  color: var(--gold-strong);
  font-size: 12px;
}

.guild-stats span {
  color: var(--muted);
  font-size: 10px;
}

.guild-member-list {
  display: grid;
  gap: 6px;
}

.guild-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.guild-member-row > span:last-child {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.guild-battle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(255, 216, 119, 0.34);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(198, 61, 53, 0.18), rgba(255, 216, 119, 0.12) 46%, rgba(56, 209, 195, 0.1)),
    rgba(8, 12, 16, 0.82);
}

.guild-battle-card.signed {
  border-color: rgba(62, 207, 142, 0.5);
}

.battle-copy {
  min-width: 0;
}

.battle-copy span,
.battle-copy small,
.battle-note {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}

.battle-copy span {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
}

.battle-copy strong {
  display: block;
  min-width: 0;
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 14px;
}

.battle-meter {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.battle-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ruby), var(--gold-strong), var(--teal));
  transition: width var(--dur-mid) var(--ease-out);
}

.battle-roster {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
}

.battle-roster span {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 216, 119, 0.42);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-strong);
  background: rgba(5, 7, 10, 0.58);
  font-size: 9px;
  font-weight: 900;
}

.battle-note {
  grid-column: 1 / -1;
  color: var(--warning);
}

.theme-grid,
.settings-grid {
  display: grid;
  gap: 7px;
}

.theme-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-tile {
  min-height: 74px;
  border: 1px solid rgba(56, 209, 195, 0.34);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(56, 209, 195, 0.12), rgba(255, 216, 119, 0.05)),
    rgba(8, 12, 16, 0.78);
}

.theme-tile span,
.theme-tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.theme-tile strong {
  display: block;
  min-width: 0;
  margin: 3px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.ladder-card {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--tier-color, var(--gold)) 64%, transparent);
  border-radius: var(--radius-md);
  padding: 11px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--tier-color, var(--gold)) 24%, transparent), transparent 62%),
    rgba(12, 15, 20, 0.84);
}

.ladder-card strong {
  display: block;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 16px;
}

.ladder-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.tier-list {
  display: grid;
  gap: 5px;
}

.tier-row,
.leaderboard-row,
.setting-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(237, 198, 106, 0.18);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  background: rgba(8, 12, 16, 0.64);
}

.tier-row span {
  width: 10px;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--tier-color, var(--gold));
}

.tier-row.active {
  border-color: color-mix(in srgb, var(--tier-color, var(--gold)) 74%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-color, var(--gold)) 18%, transparent);
}

.tier-row strong,
.leaderboard-row strong,
.setting-row strong,
.profile-hero strong,
.rating-chart strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.tier-row small,
.leaderboard-row small,
.setting-row span,
.profile-hero span,
.rating-chart span {
  color: var(--muted);
  font-size: 10px;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
}

.leaderboard-row {
  grid-template-columns: 36px auto minmax(0, 1fr) auto;
}

.leaderboard-row.self {
  position: sticky;
  bottom: 0;
  border-color: rgba(56, 209, 195, 0.7);
  background: rgba(9, 48, 45, 0.9);
}

.leaderboard-row > span {
  color: color-mix(in srgb, var(--tier-color, var(--gold)) 86%, white);
  font-size: 11px;
  font-weight: 900;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--tier-color, var(--gold)) 56%, transparent);
  border-radius: var(--radius-md);
  padding: 9px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tier-color, var(--gold)) 14%, transparent), rgba(8, 12, 16, 0.76)),
    rgba(8, 12, 16, 0.78);
}

.rating-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
  align-items: center;
  min-height: 64px;
  border: 1px solid rgba(56, 209, 195, 0.32);
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--teal);
  background: rgba(8, 12, 16, 0.7);
}

.rating-chart svg {
  width: 100%;
  height: 48px;
  overflow: visible;
}

.setting-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 50px;
}

.recent-list {
  display: grid;
  gap: 6px;
}

.recent-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.recent-header strong {
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 12px;
}

.recent-header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.recent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(237, 198, 106, 0.18);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  background: rgba(8, 12, 16, 0.62);
}

.recent-row > span {
  min-width: 44px;
  color: #c8fff8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.recent-row strong,
.recent-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-row strong {
  color: var(--ink);
  font-size: 11px;
}

.recent-row small {
  color: var(--muted);
  font-size: 10px;
}

.analysis-chip {
  min-height: 30px;
  border: 1px solid rgba(56, 209, 195, 0.48);
  border-radius: 8px;
  padding: 5px 7px;
  color: #c8fff8;
  background: rgba(9, 48, 45, 0.72);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.matchmaking-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.search-orb {
  position: relative;
  width: 88px;
  aspect-ratio: 1;
  border: 1px solid rgba(56, 209, 195, 0.5);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 216, 119, 0.22), transparent 58%),
    rgba(9, 48, 45, 0.52);
  animation: searchPulse 1.3s var(--ease-out) infinite;
}

.search-orb span {
  position: absolute;
  width: 12px;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--gold-strong);
  box-shadow: 0 0 18px rgba(255, 216, 119, 0.65);
}

.search-orb span:nth-child(1) { transform: translateY(-30px); }
.search-orb span:nth-child(2) { transform: rotate(120deg) translateY(-30px); }
.search-orb span:nth-child(3) { transform: rotate(240deg) translateY(-30px); }

.matchmaking-copy strong {
  display: block;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 18px;
}

.matchmaking-copy small {
  color: var(--muted);
  font-size: 11px;
}

.matchmaking-stats,
.post-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.post-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.matchmaking-stats div,
.post-stats div {
  border: 1px solid rgba(237, 198, 106, 0.24);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  background: rgba(8, 12, 16, 0.72);
}

.matchmaking-stats strong,
.post-stats strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
}

.matchmaking-stats span,
.post-stats span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.match-state-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(56, 209, 195, 0.42);
  border-radius: var(--radius-md);
  padding: 9px;
  background: rgba(8, 12, 16, 0.74);
}

.match-state-card strong,
.match-state-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-state-card strong {
  color: var(--gold-strong);
  font-size: 13px;
}

.match-state-card small {
  color: var(--muted);
  font-size: 11px;
}

.match-orbit {
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid rgba(56, 209, 195, 0.7);
  border-radius: var(--radius-full);
  background: radial-gradient(circle, var(--teal), transparent 54%);
  box-shadow: 0 0 18px rgba(56, 209, 195, 0.26);
}

.match-found-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255, 216, 119, 0.34), rgba(7, 8, 11, 0.82) 58%),
    rgba(7, 8, 11, 0.64);
  pointer-events: none;
  animation: matchFlash 900ms var(--ease-out) both;
}

.match-found-overlay strong {
  display: block;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 28px;
}

.match-found-overlay small {
  color: var(--ink);
  font-size: 13px;
}

.post-game-modal h2 {
  margin: 4px 0 4px;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 34px;
}

.post-game-modal.result-loss h2 {
  color: #ff8b82;
}

.post-game-modal.result-draw h2 {
  color: #c8fff8;
}

.rating-swing {
  border: 1px solid rgba(255, 216, 119, 0.42);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  background: rgba(8, 12, 16, 0.7);
}

.rating-swing strong {
  display: block;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 24px;
}

.rating-swing span {
  color: var(--muted);
  font-size: 12px;
}

.versus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: center;
}

.versus-row div {
  border: 1px solid rgba(56, 209, 195, 0.24);
  border-radius: var(--radius-md);
  padding: 8px 5px;
  background: rgba(9, 48, 45, 0.44);
  min-width: 0;
}

.versus-row strong,
.versus-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus-row strong {
  color: var(--ink);
  font-size: 12px;
}

.versus-row span,
.versus-row small {
  color: var(--muted);
  font-size: 10px;
}

.bite-hero,
.prestige-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 216, 119, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 216, 119, 0.14), rgba(198, 61, 53, 0.1) 48%, rgba(56, 209, 195, 0.1)),
    rgba(12, 15, 20, 0.82);
  padding: 10px;
}

.bite-hero strong,
.prestige-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold-strong);
  font-size: 13px;
}

.bite-hero span,
.prestige-card span {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.share-card-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 209, 195, 0.42);
  border-radius: 8px;
  min-height: 96px;
  padding: 10px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background:
    linear-gradient(145deg, rgba(56, 209, 195, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(198, 61, 53, 0.18), transparent 42%),
    #0b1015;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.share-card-preview::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(237, 198, 106, 0.22);
  border-radius: 6px;
  pointer-events: none;
}

.share-card-top,
.share-card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.share-card-top span {
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold-strong);
  font-size: 10px;
  font-weight: 900;
}

.share-card-top strong,
.share-card-move {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-card-top strong {
  color: var(--ink);
  font-size: 12px;
}

.share-card-move {
  position: relative;
  z-index: 1;
  color: #c8fff8;
  font-size: 18px;
  font-weight: 900;
}

.share-card-bottom span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.cosmetic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.cosmetic-tile {
  min-height: 54px;
  border: 1px solid rgba(237, 198, 106, 0.28);
  border-radius: 8px;
  padding: 7px;
  background: rgba(8, 12, 16, 0.72);
  display: grid;
  align-content: center;
  gap: 2px;
}

.cosmetic-tile.claimable {
  border-color: rgba(56, 209, 195, 0.72);
  box-shadow: inset 0 0 0 1px rgba(56, 209, 195, 0.14);
}

.cosmetic-tile.locked {
  opacity: 0.62;
  border-style: dashed;
}

.cosmetic-tile strong,
.cosmetic-tile span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cosmetic-tile strong {
  color: var(--gold-strong);
  font-size: 11px;
}

.cosmetic-tile span {
  color: var(--muted);
  font-size: 10px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.inventory-tile {
  min-width: 0;
  min-height: 74px;
  border: 1px solid rgba(237, 198, 106, 0.28);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 216, 119, 0.08), rgba(56, 209, 195, 0.06)),
    rgba(8, 12, 16, 0.72);
}

.inventory-tile.equipped {
  border-color: rgba(56, 209, 195, 0.82);
  box-shadow: inset 0 0 0 1px rgba(56, 209, 195, 0.18);
}

.inventory-tile strong,
.inventory-tile span,
.inventory-tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-tile strong {
  color: var(--ink);
  font-size: 12px;
}

.inventory-tile span {
  margin-top: 3px;
  color: var(--gold-strong);
  font-size: 10px;
  font-weight: 800;
}

.inventory-tile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.coach-card,
.season-row,
.difficulty-row {
  margin-bottom: 8px;
}

.coach-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(56, 209, 195, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(56, 209, 195, 0.12), rgba(255, 216, 119, 0.06)),
    rgba(8, 12, 16, 0.76);
  padding: 8px;
}

.coach-orb {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 209, 195, 0.72);
  background: rgba(9, 48, 45, 0.78);
  color: #c8fff8;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(56, 209, 195, 0.22);
}

.coach-copy,
.season-row div,
.profile-stat-row div {
  min-width: 0;
}

.coach-copy strong,
.season-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.coach-copy span,
.season-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.season-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 9px;
  align-items: center;
  min-height: 38px;
}

.season-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.season-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold-strong), var(--ruby));
}

.difficulty-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.difficulty-chip {
  min-height: 32px;
  border: 1px solid rgba(237, 198, 106, 0.32);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.difficulty-chip.active {
  border-color: rgba(56, 209, 195, 0.82);
  color: #c8fff8;
  background: rgba(9, 48, 45, 0.78);
}

.mission-row,
.online-row,
.move-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
}

.mission-icon {
  width: 32px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(56, 209, 195, 0.46);
  display: grid;
  place-items: center;
  color: #bffff7;
  background: rgba(9, 48, 45, 0.66);
  font-size: 12px;
  font-weight: 900;
}

.mission-copy strong,
.online-row strong,
.move-row strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  width: 58px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold-strong));
}

.primary-action,
.secondary-action,
.chip-button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

.primary-action {
  border-color: rgba(255, 216, 119, 0.9);
  color: #2a1508;
  background:
    linear-gradient(180deg, #ffe9a8, #bf7d2d);
}

.secondary-action {
  color: #c8fff8;
  border-color: rgba(56, 209, 195, 0.52);
  background: rgba(9, 48, 45, 0.78);
}

.chip-button {
  min-height: 32px;
  color: var(--gold-strong);
}

.profile-xp {
  color: #c8fff8;
  font-size: 11px;
  font-weight: 900;
}

.tabbar {
  width: min(100%, 490px);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.tab-button {
  min-width: 0;
  min-height: 52px;
  padding: 5px 3px;
  display: grid;
  place-items: center;
  gap: 1px;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.nav-icon {
  width: 22px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  background: rgba(255, 216, 119, 0.09);
}

.tab-button strong {
  font-size: 10px;
}

.tab-button span {
  color: var(--muted);
  font-size: 9px;
}

.tab-button.active {
  color: #c8fff8;
  border-color: rgba(56, 209, 195, 0.88);
  background:
    linear-gradient(180deg, rgba(56, 209, 195, 0.16), rgba(0, 0, 0, 0.14)),
    rgba(9, 48, 45, 0.86);
  transform: translateY(-1px);
}

.tab-button.active .nav-icon {
  color: #c8fff8;
  background: rgba(56, 209, 195, 0.18);
}

.app-shell[data-view="hub"] .tab-button {
  border-color: rgba(255, 216, 119, 0.28);
  background:
    linear-gradient(180deg, rgba(93, 200, 255, 0.1), rgba(0, 0, 0, 0.2)),
    rgba(10, 14, 20, 0.92);
}

.app-shell[data-view="hub"] .tab-button.active {
  border-color: rgba(255, 216, 119, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 216, 119, 0.22), rgba(255, 95, 125, 0.12)),
    rgba(24, 18, 18, 0.94);
}

.app-shell[data-view="hub"] .nav-icon {
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 216, 119, 0.22), rgba(255, 95, 125, 0.12));
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 70px);
  z-index: 15;
  transform: translateX(-50%);
  width: min(92vw, 440px);
  border: 1px solid rgba(255, 216, 119, 0.68);
  border-radius: 8px;
  background: rgba(14, 9, 7, 0.95);
  color: #ffe6aa;
  padding: 10px 12px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
  font-size: 13px;
}

.empty-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.modal-cover {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.76);
}

.modal {
  width: min(420px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid rgba(237, 198, 106, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(56, 209, 195, 0.12), rgba(198, 61, 53, 0.12)),
    #11151c;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

.modal h2 {
  margin: 0;
  color: var(--gold-strong);
  font-size: 24px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.analysis-modal {
  gap: 10px;
}

.analysis-summary-card,
.analysis-moment,
.analysis-move,
.analysis-loading,
.analysis-error {
  border: 1px solid rgba(237, 198, 106, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.72);
}

.analysis-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.analysis-summary-card strong,
.analysis-summary-card small,
.analysis-moment strong,
.analysis-moment small,
.analysis-move strong,
.analysis-move small,
.analysis-loading span,
.analysis-error span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-summary-card strong {
  color: var(--ink);
  font-size: 12px;
}

.analysis-summary-card small,
.analysis-moment small,
.analysis-move small,
.analysis-loading span,
.analysis-error span {
  color: var(--muted);
  font-size: 11px;
}

.analysis-confidence {
  min-width: 70px;
  border: 1px solid rgba(56, 209, 195, 0.42);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  background: rgba(9, 48, 45, 0.52);
}

.analysis-confidence strong {
  display: block;
  color: #c8fff8;
  font-family: var(--font-display);
  font-size: 20px;
}

.analysis-confidence span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-moments,
.analysis-move-list {
  display: grid;
  gap: 6px;
}

.analysis-moments > strong,
.analysis-move-list > strong {
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 13px;
}

.analysis-moment,
.analysis-move {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.analysis-move {
  grid-template-columns: auto minmax(0, 1fr);
}

.analysis-moment > span,
.analysis-move > span {
  min-width: 30px;
  color: #c8fff8;
  font-size: 10px;
  font-weight: 900;
}

.analysis-moment strong,
.analysis-move strong {
  color: var(--ink);
  font-size: 11px;
}

.analysis-moment em {
  color: var(--gold-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.analysis-loading,
.analysis-error {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.analysis-loading strong,
.analysis-error strong {
  color: var(--gold-strong);
  font-size: 13px;
}

.result-reward {
  border: 1px solid rgba(56, 209, 195, 0.42);
  border-radius: 8px;
  background: rgba(9, 48, 45, 0.42);
  padding: 10px;
}

.result-reward strong,
.result-reward span {
  display: block;
}

.result-reward strong {
  color: #c8fff8;
  font-size: 13px;
}

.result-reward span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@keyframes arrive {
  0% {
    opacity: 0.52;
    transform: translateY(-18%) scale(0.78);
  }
  75% {
    opacity: 1;
    transform: translateY(4%) scale(1.07);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes forcedPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

@keyframes spark {
  0% {
    opacity: 0.95;
    transform: scale(0.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-38px) scale(1.4);
  }
}

@keyframes heroDrift {
  0% {
    transform: scale(1.02) translateY(0);
  }
  100% {
    transform: scale(1.06) translateY(-8px);
  }
}

@keyframes sparkleFloat {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(0) rotate(45deg) scale(0.82);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) rotate(45deg) scale(1.18);
  }
}

@keyframes pieceBob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 7px;
  }
}

@keyframes searchPulse {
  0%,
  100% {
    transform: scale(0.98);
    box-shadow: 0 0 0 0 rgba(56, 209, 195, 0.26);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 10px rgba(56, 209, 195, 0);
  }
}

@keyframes matchFlash {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  26% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

@media (min-width: 760px) {
  :root {
    --board-width: min(430px, calc((100dvh - 270px) * 0.625));
  }

  .app-shell {
    background-size: min(100%, 760px) auto, cover;
    background-position: center top;
  }
}

@media (max-height: 760px) {
  :root {
    --board-width: clamp(205px, min(76vw, calc((100dvh - 380px) * 0.625)), 285px);
  }

  .panel-shelf {
    max-height: 108px;
  }

  .player-strip {
    min-height: 50px;
  }

  .avatar {
    width: 32px;
  }
}

@media (max-height: 680px) {
  :root {
    --board-width: clamp(198px, min(72vw, calc((100dvh - 300px) * 0.625)), 270px);
  }

  .mobile-top {
    padding-top: calc(env(safe-area-inset-top) + 5px);
  }

  .player-strip {
    min-height: 44px;
  }

  .status-banner span,
  .player-copy span {
    font-size: 10px;
  }

  .tab-button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
