/* ============================================================================
   سِباق — interface v50
   One design system for the landing, the phone controller and the big screen.
   Night-sky game show: deep indigo stage, gold headline, chunky "pressable"
   buttons, team colours carried by --tc everywhere.
   ========================================================================== */

:root {
  --bg0: #0c0922;
  --bg1: #15103b;
  --bg2: #211861;
  --surface: rgba(255, 255, 255, .055);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-3: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .11);
  --line-2: rgba(255, 255, 255, .2);
  --ink: #f7f4ff;
  --ink-2: #cdc6f2;
  --ink-3: #9089be;
  --gold: #ffc93c;
  --gold-d: #d99a12;
  --pink: #ff5ca8;
  --violet: #7c5cff;
  --violet-d: #5a3ad6;
  --ok: #34d98f;
  --ok-d: #1f9e64;
  --bad: #ff5c6c;
  --bad-d: #c93445;
  --warn: #ffb547;
  --o1: #ff5c6c; --o1d: #c93445;
  --o2: #3aa7ff; --o2d: #1f73c2;
  --o3: #ffc93c; --o3d: #c9900f;
  --o4: #34d98f; --o4d: #1f9e64;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --shadow: 0 18px 50px rgba(5, 3, 20, .45);
  --display: "Baloo Bhaijaan 2", "Tajawal", system-ui, sans-serif;
  --body: "Tajawal", "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tc: var(--violet);
  --myc: var(--violet);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg0);
  background-image:
    radial-gradient(120vmax 80vmax at 85% -10%, #2a1d78 0%, transparent 55%),
    radial-gradient(90vmax 70vmax at -10% 110%, #11307a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 70%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
img { max-width: 100%; }
::selection { background: rgba(255, 201, 60, .35); }

/* ------------------------------------------------------------ the sky */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.sky .g1 { width: 46vmax; height: 46vmax; background: #5b2bd6; top: -18vmax; inset-inline-end: -10vmax; animation: drift 22s ease-in-out infinite alternate; }
.sky .g2 { width: 38vmax; height: 38vmax; background: #1650c9; bottom: -16vmax; inset-inline-start: -12vmax; animation: drift 26s ease-in-out infinite alternate-reverse; }
.sky .g3 { width: 22vmax; height: 22vmax; background: #c2338c; top: 40%; inset-inline-start: 45%; opacity: .18; animation: drift 30s ease-in-out infinite alternate; }
.sky .star { position: absolute; inset: 0; background-repeat: repeat; opacity: .55; }
.sky .s1 { background-image: radial-gradient(1.2px 1.2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 140px 90px, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 230px 180px, #fff 50%, transparent 51%); background-size: 260px 220px; animation: twinkle 6s ease-in-out infinite; }
.sky .s2 { background-image: radial-gradient(1px 1px at 60px 140px, #d9d2ff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 190px 40px, #fff 50%, transparent 51%); background-size: 330px 280px; animation: twinkle 9s ease-in-out infinite reverse; }
.sky .s3 { background-image: radial-gradient(1px 1px at 90px 60px, #ffe7a3 50%, transparent 51%); background-size: 410px 360px; animation: twinkle 12s ease-in-out infinite; }
@keyframes drift { to { transform: translate(6vmax, 5vmax) scale(1.12); } }
@keyframes twinkle { 50% { opacity: .2; } }

#app { position: relative; z-index: 1; }
.muted { color: var(--ink-3); }

/* ------------------------------------------------------------ buttons */
.btn {
  --b: var(--surface-2); --bd: rgba(0, 0, 0, .35); --bi: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.3em;
  border: 0; border-radius: 16px;
  background: var(--b); color: var(--bi);
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.1;
  text-decoration: none; cursor: pointer; user-select: none;
  box-shadow: 0 5px 0 var(--bd), 0 10px 24px rgba(0, 0, 0, .22);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease, background .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd), 0 4px 10px rgba(0, 0, 0, .2); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.btn:focus-visible, .hud-btn:focus-visible, .pill-btn:focus-visible, .opt:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-primary { --b: linear-gradient(180deg, #ffd65c, var(--gold)); --bd: var(--gold-d); --bi: #2a1a00; }
.btn-violet { --b: linear-gradient(180deg, #9478ff, var(--violet)); --bd: var(--violet-d); --bi: #fff; }
.btn-ok { --b: linear-gradient(180deg, #5ce8a8, var(--ok)); --bd: var(--ok-d); --bi: #052a18; }
.btn-danger { --b: linear-gradient(180deg, #ff7f8c, var(--bad)); --bd: var(--bad-d); --bi: #fff; }
.btn-ghost { --b: var(--surface-2); --bd: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 5px 0 var(--bd); }
.btn-lg { min-height: 56px; font-size: 1.15rem; padding: .7em 1.6em; border-radius: 18px; }
.btn-xl { min-height: 64px; font-size: 1.3rem; padding: .75em 1.8em; border-radius: 20px; }
.btn-sm { min-height: 38px; font-size: .92rem; padding: .4em .9em; border-radius: 12px; box-shadow: 0 3px 0 var(--bd); }
.btn-block { width: 100%; }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 5px 0 var(--bd), 0 0 0 10px rgba(255, 201, 60, .18), 0 10px 30px rgba(255, 201, 60, .35); } }
.link { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: .4em; }
.pill-btn, .hud-btn {
  display: inline-flex; align-items: center; gap: .35em;
  min-height: 38px; padding: .35em .95em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.pill-btn:hover, .hud-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.hud-btn.danger { color: #ffb3bb; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .28em .8em; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .85rem; font-weight: 700; color: var(--ink-2); white-space: nowrap;
}
.chip b { color: var(--ink); }
.chip.ok { background: rgba(52, 217, 143, .14); border-color: rgba(52, 217, 143, .35); color: #9ff0c9; }
.chip.warn { background: rgba(255, 181, 71, .14); border-color: rgba(255, 181, 71, .35); color: #ffd79c; }
.chip.bad { background: rgba(255, 92, 108, .14); border-color: rgba(255, 92, 108, .35); color: #ffb3bb; }
.chip.lvl-easy { color: #9ff0c9; } .chip.lvl-mid { color: #ffe08a; } .chip.lvl-hard { color: #ffb37a; } .chip.lvl-extreme { color: #ff9aa6; }

/* ------------------------------------------------------------ monsters */
.mon { display: inline-block; width: 64px; aspect-ratio: 1.15; line-height: 0; }
.mon svg, .mon-svg { width: 100%; height: 100%; overflow: visible; }
.mon svg path[fill="#d8d8d8"] { fill: rgba(0, 0, 0, .28); }   /* the baked ground shadow reads as a soft shadow on dark */
.mon.idle svg { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.mon.cheer svg { animation: cheer .7s ease-in-out infinite; transform-origin: 50% 95%; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-6%) scale(.98, 1.02); } }
@keyframes cheer { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-14%) rotate(-6deg); } 75% { transform: translateY(-14%) rotate(6deg); } }

/* ================================================================ LANDING */
#landing { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
#topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  margin: 0 -20px; padding: 12px 20px;
  background: linear-gradient(180deg, rgba(12, 9, 34, .92), rgba(12, 9, 34, .65));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.45rem; }
.logo-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--pink)); color: #2a1300;
  font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1;
  box-shadow: 0 4px 0 #a8326b, 0 6px 18px rgba(255, 92, 168, .35);
}
.nav-links { display: flex; gap: 22px; margin-inline-start: 18px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.nav-links a:hover { color: var(--ink); }
.nav-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
#home-user:empty { display: none; }
.userchip2 { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-size: .9rem; }
.userchip2 img, .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--surface-3); }
.userchip2 .uchip { color: var(--gold); }
#home-user { display: inline-flex; align-items: center; gap: 4px; }
#home-user .xout { color: var(--ink-3); text-decoration: none; padding: 4px 6px; }
.minibtn { display: inline-flex; padding: .35em .95em; border-radius: 999px; background: var(--gold); color: #2a1a00; font-weight: 800; text-decoration: none; font-size: .9rem; }

/* hero */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px;
  min-height: min(720px, calc(100vh - 70px)); padding: 40px 0 30px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 201, 60, .12); border: 1px solid rgba(255, 201, 60, .35);
  color: #ffe08a; font-weight: 800; font-size: .9rem;
}
.wordmark { margin: 10px 0 6px; font-family: var(--display); font-weight: 800; line-height: .95; font-size: clamp(5rem, 13vw, 9.5rem); letter-spacing: 0; }
.wordmark span {
  display: inline-block;
  background: linear-gradient(180deg, #fff3c4 0%, var(--gold) 45%, #ff9a3c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 #8a3c12) drop-shadow(0 18px 30px rgba(255, 150, 60, .35));
  animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.hero-tag { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--ink-2); max-width: 34ch; margin: 8px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-hint { color: var(--ink-3); margin: 16px 0 22px; font-weight: 500; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 110px; }
.stat b { font-family: var(--display); font-size: 1.45rem; line-height: 1.1; color: var(--ink); }
.stat span { font-size: .82rem; color: var(--ink-3); font-weight: 700; }

/* hero stage: a little live race on a "TV" + phones */
.hero-stage { position: relative; padding-bottom: 40px; }
.stage-screen {
  position: relative; border-radius: 28px; padding: 22px 22px 18px;
  background: linear-gradient(180deg, #1d1650, #120d35);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .03), 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: rise .9s .1s cubic-bezier(.2, 1.2, .4, 1) both;
}
.stage-screen::after { content: ""; position: absolute; bottom: -26px; left: 50%; width: 34%; height: 14px; transform: translateX(-50%); border-radius: 0 0 14px 14px; background: #0b0820; border: 1px solid var(--line); border-top: 0; }
.stage-q { font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-align: center; margin-bottom: 14px; min-height: 2.6em; display: grid; place-items: center; }
.stage-track { display: grid; gap: 10px; }
.s-lane { --p: 0; position: relative; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); overflow: visible; }
.s-lane::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: calc(var(--p) * 100%); border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 45%, transparent), color-mix(in srgb, var(--tc) 20%, transparent)); transition: width 1.1s cubic-bezier(.3, 1.3, .5, 1); }
[dir="rtl"] .s-lane::before { background: linear-gradient(270deg, color-mix(in srgb, var(--tc) 45%, transparent), color-mix(in srgb, var(--tc) 20%, transparent)); }
.s-lane .mon { position: absolute; top: -12px; width: 56px; inset-inline-start: calc(var(--p) * (100% - 56px)); transition: inset-inline-start 1.1s cubic-bezier(.3, 1.3, .5, 1); }
.s-lane .flag { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
.stage-phones { position: absolute; inset-inline-start: -18px; bottom: -6px; display: flex; gap: 10px; }
.s-phone { width: 74px; height: 128px; border-radius: 16px; padding: 10px 7px; background: #0e0a2b; border: 2px solid var(--line-2); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); display: grid; grid-template-columns: 1fr 1fr; gap: 5px; align-content: end; animation: float 4s ease-in-out infinite; }
.s-phone:nth-child(2) { animation-delay: -1.4s; transform: rotate(5deg); }
.s-phone i { height: 22px; border-radius: 6px; }
.s-phone i:nth-child(1) { background: var(--o1); } .s-phone i:nth-child(2) { background: var(--o2); } .s-phone i:nth-child(3) { background: var(--o3); } .s-phone i:nth-child(4) { background: var(--o4); }
.s-phone .tap { animation: tap 2.4s ease-in-out infinite; }
@keyframes tap { 0%, 70%, 100% { transform: none; filter: none; } 78% { transform: scale(.85); filter: brightness(1.5); } }
@keyframes float { 50% { translate: 0 -10px; } }

/* bands */
.band { padding: 64px 0 10px; scroll-margin-top: 70px; }
.band-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 8px; text-align: center; }
.band-sub { color: var(--ink-2); text-align: center; max-width: 60ch; margin: 0 auto 26px; font-size: 1.08rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.step { position: relative; padding: 26px 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step-n { position: absolute; top: -18px; inset-inline-start: 22px; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; background: var(--gold); color: #2a1a00; box-shadow: 0 4px 0 var(--gold-d); }
.step-ico { font-size: 2.4rem; line-height: 1; margin: 8px 0 12px; }
.step h3 { font-family: var(--display); margin: 0 0 6px; font-size: 1.3rem; }
.step p { margin: 0; color: var(--ink-2); }

.flow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 0 0 26px; }
.flow .chip { font-size: .95rem; padding: .45em 1em; }
.flow .arr { color: var(--ink-3); font-weight: 800; }
.attack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.attack-card { --ac: var(--violet); padding: 20px; border-radius: var(--r-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--ac) 22%, transparent), rgba(255, 255, 255, .03)); border: 1px solid color-mix(in srgb, var(--ac) 40%, transparent); }
.attack-card .ac-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: color-mix(in srgb, var(--ac) 30%, transparent); margin-bottom: 12px; }
.attack-card h3 { font-family: var(--display); margin: 0 0 4px; font-size: 1.15rem; }
.attack-card p { margin: 0 0 12px; color: var(--ink-2); font-size: .95rem; }
.k-adv { --ac: #34d98f; } .k-hinder { --ac: #ff5c6c; } .k-tile { --ac: #ffc93c; } .k-freeze { --ac: #5fd0ff; }

.sample-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.sample { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sample .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sample-q { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0 0 12px; line-height: 1.35; }
.sample .opts { grid-template-columns: 1fr 1fr; gap: 8px; }
.sample .opt { min-height: 46px; font-size: .95rem; padding: 8px 10px; box-shadow: 0 3px 0 var(--od); }
.cats-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }

.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.price-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--ink); font: inherit; transition: transform .15s, border-color .2s, background .2s; }
.price-card:hover { transform: translateY(-4px); border-color: rgba(255, 201, 60, .6); background: var(--surface-2); }
.price-card .kd { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--gold); }
.price-card .kd small { font-size: 1rem; color: var(--ink-2); margin-inline-start: 4px; }
.price-card .games { font-weight: 800; font-size: 1.05rem; }
.price-card .bonus { color: #9ff0c9; font-weight: 700; font-size: .9rem; min-height: 1.4em; }
.price-card .per { color: var(--ink-3); font-size: .82rem; }
.price-card.best { border-color: rgba(255, 201, 60, .7); background: linear-gradient(180deg, rgba(255, 201, 60, .16), rgba(255, 255, 255, .04)); }
.price-card .badge { position: absolute; top: -13px; padding: 3px 12px; border-radius: 999px; background: var(--gold); color: #2a1a00; font-weight: 800; font-size: .8rem; }
.price-note { text-align: center; color: var(--ink-3); margin-top: 18px; }
.school-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 34px; border-radius: var(--r-lg); background: linear-gradient(120deg, rgba(52, 217, 143, .16), rgba(58, 167, 255, .12)); border: 1px solid rgba(52, 217, 143, .35); }
.school-card .band-title, .school-card .band-sub { text-align: start; margin-inline: 0; margin-bottom: 4px; }
#foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 70px; padding: 24px 0 10px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .92rem; }
#foot a { color: var(--ink-2); }

/* ================================================================ VIEWS */
.view { position: relative; z-index: 1; }
.view.narrow { max-width: 460px; margin: 0 auto; padding: 32px 16px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.view.narrow h2 { font-family: var(--display); margin: 0 0 14px; font-size: 1.8rem; text-align: center; }
.join-card form { display: flex; flex-direction: column; gap: 10px; }
.join-card label { font-weight: 800; color: var(--ink-2); font-size: .95rem; margin-top: 6px; }
.join-card input, .acct-card input, .paybox input {
  width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 14px;
  background: rgba(0, 0, 0, .25); border: 2px solid var(--line-2); color: var(--ink);
  font-size: 1.1rem; font-weight: 700; outline: none; transition: border-color .2s, background .2s;
}
.join-card input:focus, .acct-card input:focus, .paybox input:focus { border-color: var(--gold); background: rgba(0, 0, 0, .35); }
.code-input { text-align: center; font-family: var(--display); font-size: 2rem !important; letter-spacing: .35em; text-transform: uppercase; min-height: 70px !important; }
.join-mons { display: flex; justify-content: center; gap: 0; margin: -8px 0 8px; }
.join-mons .mon { width: 54px; margin-inline: -4px; }
.form-err { padding: 10px 14px; border-radius: 12px; background: rgba(255, 92, 108, .15); border: 1px solid rgba(255, 92, 108, .4); color: #ffc2c8; font-weight: 700; }
#scan-pane { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: #000; }
#scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.dev-code { direction: ltr; text-align: center; font-family: var(--display); font-size: 3rem; font-weight: 800; color: var(--gold); letter-spacing: .1em; margin: 14px 0; }
.dev-qr { display: grid; place-items: center; margin: 0 auto 10px; }
.dev-qr svg { width: 200px; height: 200px; background: #fff; border-radius: 16px; padding: 6px; }
.dev-status { text-align: center; color: var(--ink-2); }

/* HUD */
.hud { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; background: linear-gradient(180deg, rgba(12, 9, 34, .9), rgba(12, 9, 34, .55)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hud-brand { display: flex; align-items: center; gap: 10px; }
.hud-brand .logo-mark { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 10px; }
.code-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.code-chip .code-label { font-size: .8rem; color: var(--ink-3); font-weight: 700; }
.code-chip b { font-family: var(--display); font-size: 1.2rem; letter-spacing: .12em; color: var(--gold); }
.hud-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
#host-stage, #p-stage { padding: 18px; max-width: 1500px; margin: 0 auto; }
#p-stage { max-width: 640px; padding: 14px; }

/* my-team tint on phones */
body[data-team] .view.player { --tc: var(--myc); }
body[data-team] { background-image: radial-gradient(100vmax 70vmax at 50% -20%, color-mix(in srgb, var(--myc) 38%, transparent) 0%, transparent 60%), radial-gradient(90vmax 70vmax at -10% 110%, #11307a 0%, transparent 55%), linear-gradient(180deg, var(--bg1), var(--bg0) 70%); }

/* team banner (phone identity) */
.team-banner { --tc: var(--myc); display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; margin-bottom: 12px; border-radius: 20px; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 40%, transparent), color-mix(in srgb, var(--tc) 12%, transparent)); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.team-banner .mon { width: 54px; }
.team-banner .tb-name { font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.team-banner .tb-sub { font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.team-banner .tb-pos { margin-inline-start: auto; font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.team-banner .tb-pos small { font-size: .85rem; color: var(--ink-2); }

/* ================================================================ LOBBY */
.lobby { display: grid; gap: 18px; }
.lobby-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 18px; align-items: start; }
.join-panel { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jp-step { color: var(--ink-2); font-weight: 700; }
.jp-url { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--ink); direction: ltr; }
.code-giant { font-family: var(--display); font-weight: 800; direction: ltr; font-size: clamp(3.4rem, 8vw, 5.5rem); line-height: 1; letter-spacing: .14em; color: var(--gold); text-shadow: 0 5px 0 #8a5a00, 0 16px 40px rgba(255, 201, 60, .35); margin: 4px 0 10px; padding-inline-start: .14em; }
.qr { line-height: 0; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 20px; padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.qr-small svg { width: 150px; height: 150px; }
.hostplay { margin-top: 10px; color: var(--ink-2); }
.hostplay summary { cursor: pointer; font-weight: 700; }
.hostplay .qr { margin: 10px auto; display: grid; place-items: center; }
.lan-line { font-size: .82rem; color: var(--ink-3); direction: ltr; }

.teams-panel h3, .panel-title { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.panel-title .chip { font-family: var(--body); }
.team-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tcard { --tc: #888; position: relative; padding: 12px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 24%, transparent), rgba(255, 255, 255, .03)); border: 1.5px solid color-mix(in srgb, var(--tc) 45%, transparent); min-height: 150px; }
.tcard.empty { opacity: .45; border-style: dashed; }
.tcard-head { display: flex; align-items: center; gap: 8px; }
.tcard-head .mon { width: 58px; }
.tcard-head b { font-family: var(--display); font-size: 1.05rem; line-height: 1.15; }
.tcard-head small { display: block; color: var(--ink-2); font-weight: 700; }
.tcard ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-weight: 700; font-size: .88rem; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.pchip.ready::after { content: "✓"; color: var(--ok); font-weight: 900; }
.pchip.off { opacity: .45; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.waiting-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; color: var(--ink-3); font-weight: 700; }
.tc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tc-row .tc-val { font-family: var(--display); font-size: 1.2rem; min-width: 70px; text-align: center; }

/* team picker (phone) */
.teampick { text-align: center; }
.teampick h3 { font-family: var(--display); font-size: 1.4rem; margin: 0 0 12px; }
.pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pickT { --pc: #888; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 12px; border-radius: 20px; border: 2px solid color-mix(in srgb, var(--pc) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 32%, transparent), color-mix(in srgb, var(--pc) 8%, transparent)); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: .95rem; cursor: pointer; box-shadow: 0 5px 0 color-mix(in srgb, var(--pc) 45%, #000); transition: transform .1s; }
.pickT .mon { width: 70px; }
.pickT .cnt { font-family: var(--body); font-size: .78rem; color: var(--ink-2); }
.pickT:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--pc) 45%, #000); }
.pickT:disabled { opacity: .35; cursor: not-allowed; }

.paybox { display: grid; gap: 10px; }
.payrow { display: flex; gap: 8px; }
.payrow input { flex: 1; text-transform: uppercase; letter-spacing: .08em; direction: ltr; text-align: center; }
.bundle-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bundle { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 120px; }
.bundle b { color: var(--gold); font-size: 1.15rem; }
.bundle .bd, .bundle span { font-family: var(--body); font-size: .8rem; color: var(--ink-2); font-weight: 700; }

.lobby-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lobby-actions .btn { min-width: min(100%, 360px); }
.ready-meter { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 700; }
.ready-meter .bar { width: 160px; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ready-meter .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #9ff0c9); border-radius: 99px; transition: width .4s; }
.rules { color: var(--ink-2); font-size: .95rem; }
.rules summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.rules ul { margin: 10px 0 0; padding-inline-start: 1.2em; }
.rules li { margin: 4px 0; }

/* ================================================================ GAME */
.game { display: grid; gap: 14px; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.host .game-grid.no-q { grid-template-columns: 1fr; }
.scoreline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.scoreline .race { font-family: var(--display); font-weight: 800; font-size: 1.1rem; margin-inline-end: auto; }
.wins { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 22%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); font-weight: 800; }
.wins .mon { width: 26px; }
.wins .trophies { color: var(--gold); letter-spacing: -2px; }

/* the board */
.board { display: grid; gap: 10px; }
.lane { --tc: #888; --p: 0; position: relative; }
.lane-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; margin-bottom: 3px; padding-inline: 4px; }
.lane-title .nm { color: color-mix(in srgb, var(--tc) 70%, #fff); }
.lane-title .lane-pos { margin-inline-start: auto; font-family: var(--display); color: var(--ink-2); }
.lane-title .chip { padding: .1em .55em; font-size: .75rem; }
.track { position: relative; height: 54px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); display: grid; grid-template-columns: repeat(19, 1fr); align-items: center; padding: 0 6px; gap: 3px; }
.track .tile { height: 14px; border-radius: 5px; background: rgba(255, 255, 255, .07); transition: background .4s; }
.track .tile.filled { background: color-mix(in srgb, var(--tc) 65%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--tc) 40%, transparent); }
.track .tile.fin { height: 34px; background: repeating-conic-gradient(#fff 0 25%, #1b1640 0 50%) 50% / 10px 10px; border-radius: 6px; opacity: .9; }
.track .token { position: absolute; bottom: 4px; width: 52px; inset-inline-start: calc(6px + var(--p) * (100% - 64px)); transition: inset-inline-start .9s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.track .token .mon { width: 100%; }
.lane.moved .token .mon svg { animation: hop .9s ease-out; }
@keyframes hop { 0% { transform: none; } 35% { transform: translateY(-38%) rotate(-8deg); } 70% { transform: translateY(0) scale(1.1, .88); } 100% { transform: none; } }
.lane.lead .track { border-color: color-mix(in srgb, var(--gold) 70%, transparent); box-shadow: 0 0 0 2px rgba(255, 201, 60, .18), 0 0 24px rgba(255, 201, 60, .18); }
.lane.lead .lane-title .nm::after { content: " 👑"; }
.lane.mine .track { border-color: color-mix(in srgb, var(--tc) 80%, transparent); border-width: 2px; }
.lane.burned { opacity: .55; }
.lane.burned .lane-title .nm::after { content: " ✗"; color: var(--bad); }
.lane.won .track { background: color-mix(in srgb, var(--tc) 25%, rgba(0, 0, 0, .2)); }

/* question card */
.q-card { position: relative; padding: 22px 22px 20px; overflow: hidden; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.q-meta .timer-n { margin-inline-start: auto; }
.timer { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: -4px 0 14px; }
.timer i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--ok), var(--gold)); transition: width .25s linear; }
.timer.low i { background: linear-gradient(90deg, var(--bad), #ff9a3c); }
.timer-n { display: inline-grid; place-items: center; min-width: 54px; height: 54px; border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: 1.5rem; background: var(--surface-2); border: 3px solid var(--ok); }
.timer-n.low { border-color: var(--bad); color: #ffc2c8; animation: throb .5s ease-in-out infinite alternate; }
@keyframes throb { to { transform: scale(1.1); } }
.qtext { font-family: var(--display); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 2.2rem); line-height: 1.3; margin: 0 0 18px; animation: rise .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.player .qtext { font-size: 1.3rem; }

/* answer tiles */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt {
  --o: var(--o1); --od: var(--o1d);
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 74px; padding: 12px 16px; border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--o) 92%, #fff), var(--o));
  color: #fff; font-weight: 800; font-size: 1.12rem; line-height: 1.25; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow: 0 6px 0 var(--od), 0 12px 24px rgba(0, 0, 0, .25);
  transition: transform .08s, box-shadow .08s, opacity .3s, filter .3s;
  animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both;
}
.opt:nth-child(2) { --o: var(--o2); --od: var(--o2d); animation-delay: .05s; }
.opt:nth-child(3) { --o: var(--o3); --od: var(--o3d); color: #2a1a00; text-shadow: none; animation-delay: .1s; }
.opt:nth-child(4) { --o: var(--o4); --od: var(--o4d); color: #052a18; text-shadow: none; animation-delay: .15s; }
.opt-n { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(0, 0, 0, .2); font-family: var(--display); font-size: 1.2rem; }
.opt-n::before { content: "▲"; font-size: .95rem; }
.opt:nth-child(2) .opt-n::before { content: "◆"; }
.opt:nth-child(3) .opt-n::before { content: "●"; }
.opt:nth-child(4) .opt-n::before { content: "■"; }
.opt .opt-n { font-size: 0; }
.opt .opt-n::before { font-size: 1.05rem; }
.opt.live { cursor: pointer; }
.opt.live:hover { filter: brightness(1.08); }
.opt.live:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--od); }
.opt.gone { opacity: .28; filter: grayscale(.7); transform: scale(.97); }
.opt.picked { outline: 4px solid #fff; outline-offset: 3px; }
.opt.reveal { opacity: 1; filter: none; outline: 4px solid #fff; outline-offset: 3px; animation: win .6s ease-out; }
.opt.reveal::after { content: "✓"; position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ok-d); font-weight: 900; text-shadow: none; }
@keyframes win { 40% { transform: scale(1.05); } }
.player .opts { gap: 10px; }
.player .opt { min-height: 86px; font-size: 1.15rem; }
.player .opt:not(.live):not(.reveal) { filter: saturate(.55) brightness(.8); }

/* state banner */
.state-banner { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 14px 18px; border-radius: 18px; font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.3; background: var(--surface-2); border: 1px solid var(--line-2); animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.state-banner.ok { background: rgba(52, 217, 143, .16); border-color: rgba(52, 217, 143, .5); color: #c9f7e0; }
.state-banner.bad { background: rgba(255, 92, 108, .16); border-color: rgba(255, 92, 108, .5); color: #ffd0d5; }
.state-banner.steal { background: linear-gradient(90deg, rgba(255, 181, 71, .25), rgba(255, 92, 168, .2)); border-color: rgba(255, 181, 71, .6); color: #ffe5bd; animation: rise .4s both, glowb 1.2s ease-in-out infinite alternate; }
.state-banner.pick { background: rgba(124, 92, 255, .22); border-color: rgba(124, 92, 255, .6); }
.state-banner.dim { opacity: .75; }
@keyframes glowb { to { box-shadow: 0 0 30px rgba(255, 181, 71, .35); } }

/* attack picker */
.bigactions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bigaction { --ac: var(--violet); position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 12px; border-radius: 20px; border: 2px solid color-mix(in srgb, var(--ac) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--ac) 35%, transparent), color-mix(in srgb, var(--ac) 10%, transparent)); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.2; cursor: pointer; box-shadow: 0 5px 0 color-mix(in srgb, var(--ac) 45%, #000); text-align: center; }
.bigaction .ic { font-size: 1.9rem; line-height: 1; }
.bigaction:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--ac) 45%, #000); }
.bigaction:disabled { opacity: .35; cursor: not-allowed; }
.bigaction.adv { --ac: #34d98f; } .bigaction.hinder { --ac: #ff5c6c; } .bigaction.tile { --ac: #ffc93c; } .bigaction.freeze { --ac: #5fd0ff; }
.bigaction .cd { font-family: var(--body); font-size: .75rem; color: var(--ink-3); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.controls:empty { display: none; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; animation: rise .35s both; }
.feed li:first-child { color: var(--ink); background: var(--surface-2); }
.player .feed li:nth-child(n+3) { display: none; }
.end-ballot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 92, 108, .12); border: 1px solid rgba(255, 92, 108, .4); font-weight: 700; }
.end-ballot.voted em { color: var(--ink-2); font-style: normal; }
.lockline { display: flex; justify-content: center; }

/* waiting (phones during result / others' turn) */
.wait-card { text-align: center; padding: 26px 18px; }
.wait-card .mon { width: 110px; margin-bottom: 6px; }
.wait-card h3 { font-family: var(--display); font-size: 1.4rem; margin: 0 0 4px; }
.wait-card p { margin: 0; color: var(--ink-2); }

/* podium (race end / match end) */
.podium-card { position: relative; text-align: center; padding: 26px 20px 24px; overflow: hidden; }
.podium-card::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tc) 45%, transparent), transparent); opacity: .7; pointer-events: none; }
.podium-card > * { position: relative; }
.podium-card .crown { font-size: 2.6rem; line-height: 1; animation: cheer 1.2s ease-in-out infinite; display: block; width: max-content; margin: 0 auto -6px; }
.podium-card .winner-mon { display: block; }
.podium-card .winner-mon { width: 170px; margin: 0 auto; }
.podium-card h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; margin: 6px 0 4px; color: color-mix(in srgb, var(--tc) 60%, #fff); }
.podium-card .sub { color: var(--ink-2); font-weight: 700; margin: 0 0 16px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 12px 0 6px; }
.pod { --tc: #888; display: flex; flex-direction: column; align-items: center; width: 120px; }
.pod .mon { width: 76px; }
.pod .pod-step { width: 100%; padding: 8px 4px; border-radius: 14px 14px 6px 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 55%, transparent), color-mix(in srgb, var(--tc) 18%, transparent)); border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent); font-family: var(--display); font-weight: 800; color: #fff; }
.pod.p1 .pod-step { height: 110px; } .pod.p2 .pod-step { height: 80px; } .pod.p3 .pod-step { height: 58px; }
.pod .pod-step small { display: block; font-family: var(--body); font-size: .78rem; color: var(--ink-2); }
.next-in { color: var(--ink-3); font-weight: 700; margin-top: 12px; }

/* confetti */
.sib-confetti { position: fixed; top: -20px; z-index: 90; pointer-events: none; }
@keyframes sib-confetti { to { transform: translateY(110vh) rotate(720deg); } }

/* ================================================================ SHEETS + TOAST */
#toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(92vw, 520px); padding: 12px 20px; border-radius: 16px; background: #241b5e; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 700; text-align: center; animation: rise .3s both; }
#acct-sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 20, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.acct-card { width: min(560px, 100%); max-height: min(88vh, 900px); overflow: auto; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(180deg, #221a5c, #15103b); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 16px; animation: rise .35s cubic-bezier(.2, 1.3, .4, 1) both; }
.acct-head { display: flex; align-items: center; justify-content: space-between; }
.acct-head h3 { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.acct-head .btn { min-height: 40px; padding: 0 14px; }
.acct-bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.acct-bal > div { padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.acct-bal small { display: block; color: var(--ink-3); font-weight: 700; }
.acct-bal b { font-family: var(--display); font-size: 1.15rem; }
.acct-card h4 { margin: 0 0 8px; font-family: var(--display); font-size: 1.1rem; }
.acct-edit { display: grid; gap: 6px; font-weight: 700; color: var(--ink-2); }
.acct-edit .row, .buy-custom { display: flex; gap: 8px; align-items: center; }
.buy-custom input { flex: 1; }
.buy-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.acct-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.acct-row .ps { padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--surface-2); }
.acct-row .st-captured { color: #9ff0c9; } .acct-row .st-failed { color: #ffb3bb; } .acct-row .st-pending { color: #ffd79c; }
.acct-row small { color: var(--ink-3); }
.acct-danger { padding: 14px; border-radius: 16px; border: 1px solid rgba(255, 92, 108, .35); background: rgba(255, 92, 108, .07); }
.acct-danger p { margin: 0 0 8px; color: var(--ink-2); font-size: .92rem; }
.chk { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-weight: 700; }
.acct-card .btn.danger { --b: linear-gradient(180deg, #ff7f8c, var(--bad)); --bd: var(--bad-d); }
.unit { font-weight: 800; color: var(--ink-2); }
.prev { color: #9ff0c9; font-weight: 700; }

/* ================================================================ RESPONSIVE */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: 0; padding-top: 26px; gap: 34px; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-tag { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-stage { max-width: 560px; margin: 0 auto; width: 100%; }
  .attack-grid, .price-grid { grid-template-columns: repeat(2, 1fr); }
  .sample-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .lobby-grid, .game-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  #landing { padding: 0 16px 30px; }
  #topnav { margin: 0 -16px; padding: 10px 16px; gap: 8px; }
  .nav-logo b { display: none; }
  .pill-btn { min-height: 36px; padding: .3em .8em; font-size: .85rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .stat { min-width: 0; flex: 1 1 30%; padding: 8px 10px; }
  .stat b { font-size: 1.2rem; }
  .stage-screen { padding: 16px 12px 12px; border-radius: 22px; }
  .s-lane { height: 38px; } .s-lane .mon { width: 46px; top: -10px; inset-inline-start: calc(var(--p) * (100% - 46px)); }
  .stage-phones { display: none; }
  .steps, .attack-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .price-card { padding: 22px 8px 14px; } .price-card .kd { font-size: 2rem; }
  .school-card { flex-direction: column; text-align: center; padding: 24px 18px; }
  .school-card .band-title, .school-card .band-sub { text-align: center; }
  .band { padding-top: 48px; }
  .hud { padding: 8px 10px; }
  .hud-btn { min-height: 34px; padding: .25em .7em; font-size: .8rem; }
  .card { padding: 16px; border-radius: 22px; }
  .q-card { padding: 16px; }
  .opts { gap: 10px; }
  .opt { min-height: 66px; font-size: 1rem; padding: 10px 12px; }
  .opt-n { width: 32px; height: 32px; }
  .team-cols { grid-template-columns: 1fr 1fr; }
  .track { height: 44px; } .track .token { width: 42px; inset-inline-start: calc(6px + var(--p) * (100% - 54px)); } .track .tile { height: 10px; } .track .tile.fin { height: 26px; }
  .acct-bal, .buy-packs { grid-template-columns: 1fr 1fr; }
  .pod { width: 96px; } .pod .mon { width: 62px; }
}
@media (max-width: 380px) {
  .hud-right .hud-btn:not(.danger) { padding: .25em .55em; }
}
/* the big screen: give the board and the question room to breathe */
@media (min-width: 1500px) {
  .host .qtext { font-size: 2.5rem; }
  .host .opt { min-height: 92px; font-size: 1.35rem; }
  .host .track { height: 62px; } .host .track .token { width: 60px; inset-inline-start: calc(6px + var(--p) * (100% - 72px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- v50 fixes ---- */
body { background-image: none; background: var(--bg0); }
.sky { background: radial-gradient(120vmax 80vmax at 85% -10%, #2a1d78 0%, transparent 55%), radial-gradient(90vmax 70vmax at -10% 110%, #11307a 0%, transparent 55%), linear-gradient(180deg, var(--bg1), var(--bg0) 70%); }
body[data-team] { background-image: none; }
body[data-team] .sky { background: radial-gradient(100vmax 70vmax at 50% -20%, color-mix(in srgb, var(--myc) 38%, transparent) 0%, transparent 60%), radial-gradient(90vmax 70vmax at -10% 110%, #11307a 0%, transparent 55%), linear-gradient(180deg, var(--bg1), var(--bg0) 70%); }
.conn { font-size: 0; overflow: hidden; flex: none; }
.flow .chip { white-space: normal; text-align: center; }
.opt.reveal { padding-inline-end: 54px; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .player .opts { grid-template-columns: 1fr; }
  .player .opt { min-height: 64px; }
  .hud-right { flex-wrap: nowrap; gap: 4px; }
  .hud-btn { font-size: .72rem; padding: .2em .55em; min-height: 30px; }
  .hud .code-chip b { font-size: 1rem; }
  .sample .opts { grid-template-columns: 1fr; }
}
img.logo-mark { background: none; box-shadow: none; padding: 0; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.nav-logo img.logo-mark { width: 44px; height: 44px; }
