/* ============================================================================
   سبق لبق — "Maruko" skin
   Cream paper, thin brown outlines, flat pastel colours, hand-drawn corners.
   Same class names as the v50 skin (client.js is shared); team colours still
   arrive through --tc / --myc.
   ========================================================================== */

:root {
  --paper: #fff7e3;
  --paper-2: #fdeecb;
  --card: #fffdf7;
  --ink: #3b2b25;
  --ink-2: #6f5a4e;
  --ink-3: #a08b7d;
  --line: #3b2b25;
  --red: #f25c5c;   --red-d: #c63f41;
  --sky: #6cc5f0;   --sky-d: #3d97c8;
  --sun: #ffd24a;   --sun-d: #d9a514;
  --leaf: #86cf62;  --leaf-d: #4f9a35;
  --pink: #ff9fb8;  --pink-d: #e0708c;
  --lilac: #c3a8f5;
  --wood: #c98e5e;  --wood-d: #9a6238;
  /* old token names, kept so inline styles + client.js keep working */
  --gold: var(--sun); --gold-d: var(--sun-d);
  --violet: var(--sky); --violet-d: var(--sky-d);
  --ok: var(--leaf); --ok-d: var(--leaf-d);
  --bad: var(--red); --bad-d: var(--red-d);
  --warn: #ffb547;
  --o1: #ff8f8f; --o1d: var(--line);
  --o2: #84d0f5; --o2d: var(--line);
  --o3: #ffd75e; --o3d: var(--line);
  --o4: #a2dc7f; --o4d: var(--line);
  --surface: #fffdf7;
  --surface-2: #fff6df;
  --surface-3: #fdeecb;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --wob: 16px 22px 15px 24px / 22px 15px 24px 16px;
  --wob-lg: 24px 32px 22px 34px / 32px 22px 34px 24px;
  --pop: 3px 4px 0 rgba(59, 43, 37, .9);
  --shadow: 3px 4px 0 rgba(59, 43, 37, .9);
  --display: "Baloo Bhaijaan 2", "Tajawal", system-ui, sans-serif;
  --body: "Tajawal", "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tc: var(--sky);
  --myc: var(--sky);

  /* surfaces + tints (light "paper" values; the night theme redefines them below) */
  --surface: #ffffff; --tint-base: #ffffff; --soft-bg: #fff6df; --focus-bg: #fffbea; --on-pastel: #3b2b25;
  --note: #fff3b5; --note-blue: #dff2ff; --note-pink: #ffe0e8; --warn-bg: #fff0c2; --ok-bg: #e3f6d6; --bad-bg: #ffdede;
  --pick-bg: #ece2ff; --best-bg: #fff6cf; --hard-bg: #ffe0c6; --track: #f6e7c8; --track-band: rgba(255, 255, 255, .55);
  --paper-note: #fffef9; --nb-line: #d5e8f5; --nb-margin: #f7a3a3; --fin-a: #ffffff; --fin-b: #3b2b25;
  --nav-bg: rgba(255, 247, 227, .96); --overlay: rgba(59, 43, 37, .35); --pop-ink: rgba(59, 43, 37, .85);
  --line-soft: rgba(59, 43, 37, .35); --line-faint: rgba(59, 43, 37, .13); --ground: rgba(59, 43, 37, .14);
  --dot-r: rgba(242, 92, 92, .13); --dot-b: rgba(108, 197, 240, .16); --tape: rgba(255, 255, 255, .7);
  --sky-1: #d6efff; --sky-2: #eaf7ff; --sky-0: rgba(255, 247, 227, 0); --screen-1: #dff3ff; --screen-2: #f4fbff; --screen-3: #eaf7d9;
  --focus-glow: rgba(255, 210, 74, .7); --gloom: rgba(86, 70, 196, .85); --halo: transparent;
  --red-text: #c63f41; --green-text: #4f9a35; --sun-text: #b98a0c;
  color-scheme: light;
  --cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M20 52 Q3 52 7 39 Q4 26 19 26 Q21 11 38 13 Q47 1 63 7 Q79 -1 87 15 Q104 13 105 28 Q119 30 115 43 Q117 54 100 52 Z' fill='white' stroke='%233b2b25' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sunface: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60 6v15M60 99v15M6 60h15M99 60h15M22 22l11 11M87 87l11 11M98 22L87 33M22 98l11-11' stroke='%233b2b25' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='60' cy='60' r='30' fill='%23ffd24a' stroke='%233b2b25' stroke-width='3'/%3E%3Cellipse cx='49' cy='56' rx='3.2' ry='4.8' fill='%233b2b25'/%3E%3Cellipse cx='71' cy='56' rx='3.2' ry='4.8' fill='%233b2b25'/%3E%3Cellipse cx='42' cy='67' rx='5.5' ry='3.4' fill='%23f59aa2'/%3E%3Cellipse cx='78' cy='67' rx='5.5' ry='3.4' fill='%23f59aa2'/%3E%3Cpath d='M51 67 Q60 77 69 67' fill='none' stroke='%233b2b25' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --bunting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 30'%3E%3Cpath d='M0 3 Q75 15 150 3' fill='none' stroke='%233b2b25' stroke-width='1.6'/%3E%3Cg stroke='%233b2b25' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M5 4.5 L25 6.5 L14 25 Z' fill='%23f25c5c'/%3E%3Cpath d='M35 7.5 L55 8.8 L45 27 Z' fill='%23ffd24a'/%3E%3Cpath d='M65 9.2 L85 9.2 L75 28 Z' fill='%236cc5f0'/%3E%3Cpath d='M95 8.8 L115 7.5 L105 27 Z' fill='%2386cf62'/%3E%3Cpath d='M125 6.5 L145 4.5 L136 25 Z' fill='%23ff9fb8'/%3E%3C/g%3E%3C/svg%3E");
  --burst: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 3 L58 30 L84 13 L72 40 L97 46 L72 58 L88 85 L60 72 L52 97 L42 72 L15 87 L28 60 L3 52 L28 40 L12 14 L40 28 Z' fill='%23ffd24a' stroke='%233b2b25' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
  --burst-ice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 3 L58 30 L84 13 L72 40 L97 46 L72 58 L88 85 L60 72 L52 97 L42 72 L15 87 L28 60 L3 52 L28 40 L12 14 L40 28 Z' fill='%23c9ecff' stroke='%233b2b25' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { 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-color: var(--paper);
  background-image:
    radial-gradient(var(--dot-r) 1.7px, transparent 2px),
    radial-gradient(var(--dot-b) 1.7px, transparent 2px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--red-text); }
img { max-width: 100%; }
::selection { background: rgba(255, 210, 74, .55); }

/* ------------------------------------------------------------ the sky: clouds + smiling sun */
.sky { position: absolute; top: 0; left: 0; right: 0; height: 620px; pointer-events: none; z-index: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0, var(--sky-2) 130px, var(--sky-0) 320px); }
.sky .star { display: none; }
.sky .glow { position: absolute; border-radius: 0; filter: none; opacity: 1; background: var(--cloud) no-repeat center / contain; }
.sky .g1 { width: 190px; height: 95px; top: 64px; inset-inline-start: 4vw; animation: cloud 70s linear infinite alternate; }
.sky .g2 { width: 140px; height: 70px; top: 150px; inset-inline-start: 46vw; animation: cloud 90s linear infinite alternate-reverse; }
.sky .g3 { width: 120px; height: 120px; top: 70px; inset-inline-end: 2.5vw; background-image: var(--sunface); animation: sunbob 6s ease-in-out infinite; }
@keyframes cloud { to { transform: translateX(16vw); } }
@keyframes sunbob { 50% { transform: rotate(8deg) translateY(4px); } }

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

/* ------------------------------------------------------------ buttons */
.btn {
  --b: var(--surface); --bd: var(--line); --bi: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.3em;
  border: 2.5px solid var(--line); border-radius: var(--wob);
  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);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease, background .2s;
}
.btn:hover { filter: brightness(1.04) saturate(1.05); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.5); }
.btn:focus-visible, .hud-btn:focus-visible, .pill-btn:focus-visible, .opt:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }
.btn-primary { --b: var(--sun); --bi: var(--on-pastel); }
.btn-violet { --b: var(--sky); --bi: var(--on-pastel); }
.btn-ok { --b: var(--leaf); --bi: var(--on-pastel); }
.btn-danger { --b: var(--red); --bi: #fff; }
.btn-ghost { --b: var(--surface); }
.btn-lg { min-height: 56px; font-size: 1.15rem; padding: .7em 1.6em; }
.btn-xl { min-height: 64px; font-size: 1.3rem; padding: .75em 1.8em; }
.btn-sm { min-height: 38px; font-size: .92rem; padding: .4em .9em; border-width: 2px; box-shadow: 0 3px 0 var(--bd); }
.btn-block { width: 100%; }
.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 7px 0 var(--bd); } }
.link { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline wavy; text-decoration-color: var(--pink); text-underline-offset: 4px; padding: .4em; }
.pill-btn, .hud-btn {
  display: inline-flex; align-items: center; gap: .35em;
  min-height: 38px; padding: .35em .95em; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 0 var(--line);
  transition: background .2s, transform .08s;
}
.pill-btn:hover, .hud-btn:hover { background: var(--surface-2); }
.pill-btn:active, .hud-btn:active { transform: translateY(2px); box-shadow: none; }
.hud-btn.danger { background: var(--bad-bg); color: var(--red-text); }

.card {
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: var(--wob-lg);
  padding: 22px;
  box-shadow: var(--pop);
}
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .22em .8em; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line);
  font-size: .85rem; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.chip b { color: var(--red-text); }
.chip.ok { background: var(--ok-bg); }
.chip.warn { background: var(--warn-bg); }
.chip.bad { background: var(--bad-bg); }
.chip.lvl-easy { background: var(--ok-bg); } .chip.lvl-mid { background: var(--warn-bg); } .chip.lvl-hard { background: var(--hard-bg); } .chip.lvl-extreme { background: var(--bad-bg); }

/* ------------------------------------------------------------ characters */
.mon { display: inline-block; width: 56px; aspect-ratio: .75; line-height: 0; }
.mon svg, .mon-svg { width: 100%; height: 100%; overflow: visible; }
.mon svg [fill="#d8d8d8"] { fill: var(--ground); }
.mon.idle svg { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 95%; }
.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(-4%) scale(.98, 1.02); } }
@keyframes cheer { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-12%) rotate(-6deg); } 75% { transform: translateY(-12%) 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: 10px 20px;
  background: var(--nav-bg);
  border-bottom: 2.5px solid var(--line);
  box-shadow: 0 0 0 100vmax var(--nav-bg), 0 2.5px 0 100vmax var(--line);
  clip-path: inset(0 -100vmax -3px);
}
.nav-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--red); font-family: var(--display); font-weight: 800; font-size: 1.55rem;
  filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff) drop-shadow(2px 2px 0 var(--line)); }
.logo-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; }
.nav-links { display: flex; gap: 22px; margin-inline-start: 18px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 800; }
.nav-links a:hover { color: var(--red); text-decoration: underline wavy var(--pink); text-underline-offset: 5px; }
.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); border: 2px 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(--red-text); }
#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: .3em .95em; border-radius: 999px; background: var(--sun); border: 2px solid var(--line); color: var(--on-pastel); 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: 5px 14px; border-radius: 10px 14px 9px 15px;
  background: var(--sun); border: 2px solid var(--line); box-shadow: 2px 3px 0 var(--line);
  color: var(--on-pastel); font-weight: 800; font-size: .92rem; transform: rotate(-2deg);
}
.wordmark { margin: 14px 0 6px; font-family: var(--display); font-weight: 800; line-height: 1; font-size: clamp(4.6rem, 12vw, 8.6rem); letter-spacing: 0; }
.wordmark span {
  display: inline-block; color: var(--red);
  filter: drop-shadow(4px 0 0 #fff) drop-shadow(-4px 0 0 #fff) drop-shadow(0 4px 0 #fff) drop-shadow(0 -4px 0 #fff)
          drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 2px 0 var(--line)) drop-shadow(0 -2px 0 var(--line))
          drop-shadow(4px 6px 0 var(--pop-ink));
  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: 10px 0 26px; font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-hint { color: var(--ink-3); margin: 16px 0 22px; font-weight: 700; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { display: flex; flex-direction: column; padding: 10px 16px; border-radius: var(--wob); background: var(--surface); border: 2px solid var(--line); box-shadow: 2px 3px 0 var(--line); min-width: 110px; }
.stat:nth-child(1) { background: var(--warn-bg); transform: rotate(-1.5deg); }
.stat:nth-child(2) { background: var(--note-blue); transform: rotate(1deg); }
.stat:nth-child(3) { background: var(--note-pink); transform: rotate(-.5deg); }
.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-2); font-weight: 700; }

/* hero stage: a 1970s wooden TV with rabbit-ear antenna, a tiny race inside */
.hero-stage { position: relative; padding: 46px 0 50px; min-height: 433px; }   /* the race lanes arrive with the script: hold their room so the page below does not jump */
html[data-pre-lang="en"] [data-ssr] { visibility: hidden; }   /* saved English choice: the Arabic text in the HTML keeps its space but stays unseen until the script writes English */
.stage-screen {
  position: relative; border-radius: 26px; padding: 20px 20px 16px;
  background: linear-gradient(180deg, var(--screen-1) 0%, var(--screen-2) 45%, var(--screen-3) 100%);
  border: 14px solid var(--wood);
  outline: 2.5px solid var(--line);
  box-shadow: inset 0 0 0 2.5px var(--line), 6px 8px 0 var(--pop-ink);
  animation: rise .9s .1s cubic-bezier(.2, 1.2, .4, 1) both;
}
.stage-screen::before {   /* rabbit ears */
  content: ""; position: absolute; left: 50%; top: -58px; width: 120px; height: 46px; transform: translateX(-50%);
  background:
    linear-gradient(var(--line), var(--line)) 50% 100% / 26px 10px no-repeat,
    linear-gradient(62deg, transparent 47%, var(--line) 47% 53%, transparent 53%) 0 0 / 50% 100% no-repeat,
    linear-gradient(-62deg, transparent 47%, var(--line) 47% 53%, transparent 53%) 100% 0 / 50% 100% no-repeat;
}
.stage-screen::after {    /* little legs */
  content: ""; position: absolute; bottom: -44px; left: 50%; width: 62%; height: 26px; transform: translateX(-50%);
  background:
    linear-gradient(var(--wood-d), var(--wood-d)) 8% 0 / 12px 100% no-repeat,
    linear-gradient(var(--wood-d), var(--wood-d)) 92% 0 / 12px 100% no-repeat;
}
.stage-q { font-family: var(--display); font-weight: 800; font-size: 1.12rem; text-align: center; margin-bottom: 18px; min-height: 2.6em; display: grid; place-items: center; color: var(--ink); }
.stage-track { display: grid; gap: 16px; }
.s-lane { --p: 0; position: relative; height: 40px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); overflow: visible;
  background-image: repeating-linear-gradient(90deg, transparent 0 20px, var(--line-faint) 20px 22px); }
.s-lane::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: calc(var(--p) * 100%); border-radius: 10px; background: color-mix(in srgb, var(--tc) 55%, var(--tint-base)); transition: width 1.1s cubic-bezier(.3, 1.3, .5, 1); }
.s-lane .mon { position: absolute; bottom: 4px; width: 38px; inset-inline-start: calc(var(--p) * (100% - 38px)); 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: -22px; bottom: 0; display: flex; gap: 10px; }
.s-phone { width: 72px; height: 124px; border-radius: 16px; padding: 10px 7px; background: var(--surface); border: 2.5px solid var(--line); box-shadow: 3px 4px 0 var(--line); 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; border: 1.5px solid var(--line); }
.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; } 78% { transform: scale(.85); } }
@keyframes float { 50% { translate: 0 -10px; } }

/* bands */
.band { padding: 70px 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.2; margin: 0 auto 10px; text-align: center; width: max-content; max-width: 100%;
  padding-bottom: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8'%3E%3Cpath d='M1 5 Q8 1 15 5 T30 5 T45 5 T59 5' fill='none' stroke='%23f25c5c' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 100% / 60px 8px; }
.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: 24px; margin-top: 34px; }
.step { position: relative; padding: 30px 22px 24px; border-radius: 4px 4px 18px 4px; background: var(--note); border: 2px solid var(--line); box-shadow: 3px 4px 0 var(--pop-ink); transform: rotate(-1.5deg); }
.step:nth-child(2) { background: var(--note-blue); transform: rotate(1.2deg); }
.step:nth-child(3) { background: var(--note-pink); transform: rotate(-.6deg); }
.step::before { content: ""; position: absolute; top: -12px; left: 50%; width: 86px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: var(--tape); border: 1.5px dashed var(--line-soft); }
.step-n { position: absolute; top: -16px; inset-inline-start: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.25rem; background: var(--red); color: #fff; border: 2.5px solid var(--line); }
.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); }

/* meet the family: characters + their silly weapons */
.cast-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.cast-card { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 4px 14px; align-items: center; padding: 16px 18px 16px 12px; border-radius: var(--wob-lg);
  background: color-mix(in srgb, var(--tc) 22%, var(--tint-base)); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.cast-card:nth-child(odd) { transform: rotate(-.8deg); } .cast-card:nth-child(even) { transform: rotate(.8deg); }
.cast-art { position: relative; grid-row: span 4; display: grid; place-items: end center; height: 150px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); }
.cast-art .mon { width: 100px; }
.cast-wpn { position: absolute; top: -14px; inset-inline-end: -18px; width: 52px; height: 52px; animation: wiggle 2.4s ease-in-out infinite; }
.cast-wpn svg { width: 100%; height: 100%; }
@keyframes wiggle { 50% { transform: rotate(-14deg) translateY(-3px); } }
.cast-card h3 { font-family: var(--display); font-size: 1.45rem; margin: 0; line-height: 1.1; }
.cast-role { font-weight: 800; color: color-mix(in srgb, var(--tc) 40%, var(--ink)); font-size: .9rem; }   /* 4.7:1 or better on every team's card */
.cast-card p { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.45; }
.cast-w { justify-self: start; background: var(--surface); }

.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; white-space: normal; text-align: center; }
.flow .arr { color: var(--ink-2); font-weight: 800; }
.attack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.attack-card { --ac: var(--sky); padding: 20px; border-radius: var(--wob-lg); background: var(--surface); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.attack-card .ac-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: color-mix(in srgb, var(--ac) 45%, var(--tint-base)); border: 2px solid var(--line); 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: var(--leaf); } .k-hinder { --ac: var(--red); } .k-tile { --ac: var(--sun); } .k-freeze { --ac: var(--sky); }

/* sample questions on notebook paper */
.sample-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.sample { padding: 18px 20px 18px 46px; border-radius: 6px 6px 20px 6px; border: 2px solid var(--line); box-shadow: 3px 4px 0 var(--pop-ink);
  background-color: var(--paper-note);
  background-image: linear-gradient(90deg, transparent 32px, var(--nb-margin) 32px, var(--nb-margin) 34px, transparent 34px), repeating-linear-gradient(180deg, transparent 0 27px, var(--nb-line) 27px 28px); }
[dir="rtl"] .sample { padding: 18px 46px 18px 20px; background-image: linear-gradient(270deg, transparent 32px, var(--nb-margin) 32px, var(--nb-margin) 34px, transparent 34px), repeating-linear-gradient(180deg, transparent 0 27px, var(--nb-line) 27px 28px); }
.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.4; }
.sample .opts { grid-template-columns: 1fr 1fr; gap: 8px; }
.sample .opt { min-height: 46px; font-size: .95rem; padding: 8px 10px; gap: 8px; box-shadow: 0 3px 0 var(--line); }
.sample .opt-n { width: 28px; height: 28px; }
.sample .opt.reveal { padding-inline-end: 38px; }
.sample .opt.reveal::after { width: 26px; height: 26px; inset-inline-end: 8px; font-size: .85rem; }
.cats-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }

/* prices as little shop tags */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.price-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px 20px; border-radius: 14px 14px 22px 22px; background: var(--surface); border: 2.5px solid var(--line); box-shadow: var(--pop); cursor: pointer; color: var(--ink); font: inherit; transition: transform .15s; }
.price-card::before { content: ""; position: absolute; top: 10px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); }
.price-card:hover { transform: translateY(-4px) rotate(-1deg); }
.price-card .kd { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--red); }
.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: color-mix(in srgb, var(--green-text) 62%, var(--ink)); font-weight: 800; font-size: .9rem; min-height: 1.4em; }
.price-card .per { color: var(--ink-2); font-size: .82rem; }
.price-card.best { background: var(--best-bg); }
.price-card .badge { position: absolute; top: -15px; inset-inline-end: 12px; padding: 3px 12px; border-radius: 999px; background: var(--red); color: #fff; border: 2px solid var(--line); font-weight: 800; font-size: .8rem; transform: rotate(-3deg); }
.price-note { text-align: center; color: var(--ink-3); margin-top: 18px; }
/* the school band is a chalkboard */
.school-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 34px; border-radius: 18px; background: #2f5d47; border: 10px solid var(--wood); outline: 2.5px solid var(--line); box-shadow: 6px 8px 0 var(--pop-ink); color: #f4f1e6; }
.school-card .band-title, .school-card .band-sub { text-align: start; margin-inline: 0; margin-bottom: 4px; color: #f4f1e6; width: auto; background: none; }
.school-card .band-sub { color: #d9e8dc; }
#foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 70px; padding: 24px 0 10px; border-top: 2.5px dashed var(--line-soft); color: var(--ink-2); 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: var(--surface); border: 2.5px solid var(--line); color: var(--ink);
  font-size: 1.1rem; font-weight: 700; outline: none; transition: box-shadow .2s, background .2s;
}
.join-card input:focus, .acct-card input:focus, .paybox input:focus { background: var(--focus-bg); box-shadow: 0 0 0 4px var(--focus-glow); }
.code-input { text-align: center; font-family: var(--display); font-size: 2rem !important; letter-spacing: .35em; text-transform: uppercase; min-height: 70px !important;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--line-faint) calc(25% - 1px) 25%) !important; }
.join-mons { display: flex; justify-content: center; gap: 0; margin: -8px 0 10px; }
.join-mons .mon { width: 50px; margin-inline: -2px; }
.form-err { padding: 10px 14px; border-radius: 12px; background: var(--bad-bg); border: 2px solid var(--line); color: var(--red-text); font-weight: 800; }
#scan-pane { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: #000; border: 2.5px solid var(--line); }
#scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border: 3px dashed var(--sun); 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(--red); 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; border: 2.5px solid var(--line); }
.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: 8px 18px; background: var(--nav-bg); border-bottom: 2.5px solid var(--line); }
.hud-brand { display: flex; align-items: center; gap: 10px; }
.hud-brand .logo-mark { width: 34px; height: 34px; }
.code-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 2px 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.code-chip .code-label { font-size: .8rem; color: var(--ink-2); font-weight: 800; }
.code-chip b { font-family: var(--display); font-size: 1.25rem; letter-spacing: .12em; color: var(--red); }
.hud-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.conn { width: 12px; height: 12px; border-radius: 50%; background: var(--leaf); border: 2px solid var(--line); font-size: 0; overflow: hidden; flex: none; }
.conn.off { background: var(--red); }
#host-stage, #p-stage { padding: 18px; max-width: 1500px; margin: 0 auto; }
#p-stage { max-width: 640px; padding: 14px; }

/* my team tints my phone */
body[data-team] .view.player { --tc: var(--myc); }
body[data-team] { background-color: color-mix(in srgb, var(--myc) 12%, var(--paper)); }
body[data-team] .sky { background: linear-gradient(180deg, color-mix(in srgb, var(--myc) 34%, var(--tint-base)) 0, transparent 300px); }

/* team banner (phone identity) */
.team-banner { --tc: var(--myc); display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 10px; margin-bottom: 12px; border-radius: var(--wob-lg); background: color-mix(in srgb, var(--tc) 30%, var(--tint-base)); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.team-banner .mon { width: 48px; }
.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: 800; }
.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: 800; }
.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(--red); margin: 6px 0 12px; padding-inline-start: .14em;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 2px 0 var(--line)) drop-shadow(0 -2px 0 var(--line)) drop-shadow(3px 5px 0 var(--pop-ink)); }
.qr { line-height: 0; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 20px; padding: 8px; border: 2.5px solid var(--line); box-shadow: var(--pop); }
.qr-small svg { width: 150px; height: 150px; }
.hostplay { margin-top: 10px; color: var(--ink-2); }
.hostplay summary { cursor: pointer; font-weight: 800; }
.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: 14px; }
.tcard { --tc: #888; position: relative; padding: 12px; border-radius: var(--wob-lg); background: color-mix(in srgb, var(--tc) 24%, var(--tint-base)); border: 2.5px solid var(--line); box-shadow: var(--pop); min-height: 150px; }
.tcard.empty { opacity: .55; border-style: dashed; box-shadow: none; }
.tcard-head { display: flex; align-items: center; gap: 8px; }
.tcard-head .mon { width: 50px; }
.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: 800; }
.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: 2px 10px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-weight: 800; font-size: .88rem; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.pchip.ready::after { content: "✓"; color: var(--green-text); 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-2); font-weight: 800; }
.tc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 2px dashed var(--line-soft); }
.tc-row .tc-val { font-family: var(--display); font-size: 1.2rem; min-width: 70px; text-align: center; }
.cast-nm { display: block; font-family: var(--body); font-size: .78rem; font-weight: 800; color: var(--ink-2); }

/* 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: 0; padding: 8px 6px 10px; border-radius: var(--wob); border: 2.5px solid var(--line); background: color-mix(in srgb, var(--pc) 28%, var(--tint-base)); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: .95rem; line-height: 1.2; cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .1s; }
.pickT .mon { width: 58px; }
.pickT .cnt { font-family: var(--body); font-size: .76rem; color: var(--ink-2); }
.pickT:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.pickT:disabled { opacity: .4; 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(--red); 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: 800; }
.ready-meter .bar { width: 160px; height: 14px; border-radius: 99px; background: var(--surface); border: 2px solid var(--line); overflow: hidden; }
.ready-meter .bar i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--leaf) 0 8px, #9fdc7f 8px 16px); 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: 14px; }
.scoreline .race { font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin-inline-end: auto; }
.wins { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 4px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 30%, var(--tint-base)); border: 2px solid var(--line); font-weight: 800; }
.wins .mon { width: 22px; }
.wins .trophies { letter-spacing: -2px; }

/* the board: a school sports-day track */
.board-panel { background-color: var(--card); }
.board { display: grid; gap: 14px; }
.lane { --tc: #888; --p: 0; position: relative; }
.lane-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; margin-bottom: 4px; padding-inline: 4px; }
.lane-title .nm { padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 35%, var(--tint-base)); border: 2px solid var(--line); }
.lane-title .lane-pos { margin-inline-start: auto; font-family: var(--display); color: var(--ink-2); }
.lane-title .chip { padding: .05em .55em; font-size: .75rem; }
.track { position: relative; height: 62px; border-radius: 14px; background: var(--track); border: 2.5px solid var(--line); display: grid; grid-template-columns: repeat(19, 1fr); align-items: end; padding: 0 6px 8px; gap: 3px;
  background-image: linear-gradient(180deg, transparent 0 calc(100% - 22px), var(--track-band) calc(100% - 22px)); }
.track .tile { height: 12px; border-radius: 4px; background: var(--surface); border: 1.5px dashed var(--line-soft); transition: background .4s; }
.track .tile.filled { background: var(--tc); border: 1.5px solid var(--line); }
.track .tile.fin { height: 30px; border: 1.5px solid var(--line); background: repeating-conic-gradient(var(--fin-a) 0 25%, var(--fin-b) 0 50%) 50% / 10px 10px; border-radius: 4px; }
.track .token { position: absolute; bottom: 3px; width: 42px; inset-inline-start: calc(6px + var(--p) * (100% - 54px)); transition: inset-inline-start .9s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; }
.track .token .mon { width: 100%; }
.lane.moved .token .mon svg { animation: hop .9s ease-out; }
@keyframes hop { 0% { transform: none; } 35% { transform: translateY(-34%) rotate(-8deg); } 70% { transform: translateY(0) scale(1.1, .88); } 100% { transform: none; } }
.lane.lead .track { box-shadow: 0 0 0 4px var(--sun); }
.lane.lead .lane-title .nm::after { content: " 👑"; }
.lane.mine .track { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 70%, var(--tint-base)); }
.lane.mine.lead .track { box-shadow: 0 0 0 4px var(--sun), 0 0 0 8px color-mix(in srgb, var(--tc) 60%, var(--tint-base)); }
.lane.burned { opacity: .6; }
.lane.burned .lane-title .nm::after { content: " ✗"; color: var(--red-d); }
.lane.won .track { background-color: color-mix(in srgb, var(--tc) 30%, var(--tint-base)); }

/* question card = a page of a school notebook */
.q-card { position: relative; padding: 22px 22px 20px 52px; overflow: hidden;
  background-color: var(--paper-note);
  background-image: linear-gradient(90deg, transparent 34px, var(--nb-margin) 34px, var(--nb-margin) 36px, transparent 36px), repeating-linear-gradient(180deg, transparent 0 31px, var(--nb-line) 31px 32px); }
[dir="rtl"] .q-card { padding: 22px 52px 20px 22px; background-image: linear-gradient(270deg, transparent 34px, var(--nb-margin) 34px, var(--nb-margin) 36px, transparent 36px), repeating-linear-gradient(180deg, transparent 0 31px, var(--nb-line) 31px 32px); }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.q-meta .timer-n { margin-inline-start: auto; }
/* the timer is a pencil being used up */
.timer { position: relative; height: 16px; border-radius: 4px; background: transparent; margin: -2px 14px 18px 0; }
[dir="rtl"] .timer { margin: -2px 0 18px 14px; }
.timer i { position: relative; display: block; height: 100%; width: 100%; border: 2px solid var(--line); border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, #ff9fb8 0 14px, #c9c9c9 14px 20px, transparent 20px), repeating-linear-gradient(180deg, #ffd24a 0 4px, #f5bd22 4px 8px);
  transition: width .25s linear; }
.timer i::after { content: ""; position: absolute; top: -2px; right: -14px; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 14px solid #f1c48f; filter: drop-shadow(1.5px 0 0 var(--line)); }
[dir="rtl"] .timer i { margin-inline-start: 0; border-radius: 0 3px 3px 0; background: linear-gradient(270deg, #ff9fb8 0 14px, #c9c9c9 14px 20px, transparent 20px), repeating-linear-gradient(180deg, #ffd24a 0 4px, #f5bd22 4px 8px); }
[dir="rtl"] .timer i::after { right: auto; left: -14px; border-left: 0; border-right: 14px solid #f1c48f; filter: drop-shadow(-1.5px 0 0 var(--line)); }
.timer.low i { background: linear-gradient(90deg, #ff9fb8 0 14px, #c9c9c9 14px 20px, transparent 20px), repeating-linear-gradient(180deg, #ff8f8f 0 4px, #f26b6b 4px 8px); }
[dir="rtl"] .timer.low i { background: linear-gradient(270deg, #ff9fb8 0 14px, #c9c9c9 14px 20px, transparent 20px), repeating-linear-gradient(180deg, #ff8f8f 0 4px, #f26b6b 4px 8px); }
.timer-n { display: inline-grid; place-items: center; min-width: 52px; height: 52px; border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: 1.5rem; background: var(--surface); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.timer-n.low { background: var(--bad-bg); color: var(--red-text); animation: throb .5s ease-in-out infinite alternate; }
@keyframes throb { to { transform: scale(1.1) rotate(-4deg); } }
.qtext { font-family: var(--display); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 2.2rem); line-height: 1.45; 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(--line);
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 74px; padding: 12px 16px; border-radius: var(--wob);
  background: var(--o); border: 2.5px solid var(--line);
  color: var(--on-pastel); font-weight: 800; font-size: 1.12rem; line-height: 1.3;
  box-shadow: 0 5px 0 var(--line);
  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); animation-delay: .05s; }
.opt:nth-child(3) { --o: var(--o3); animation-delay: .1s; }
.opt:nth-child(4) { --o: var(--o4); animation-delay: .15s; }
.opt-n { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 2px solid var(--line); font-family: var(--display); font-size: 0; }
.opt-n::before { content: "▲"; font-size: 1rem; color: var(--red-d); }
.opt:nth-child(2) .opt-n::before { content: "◆"; color: var(--sky-d); }
.opt:nth-child(3) .opt-n::before { content: "●"; color: var(--sun-d); }
.opt:nth-child(4) .opt-n::before { content: "■"; color: var(--leaf-d); }
.opt.live { cursor: pointer; }
.opt.live:hover { filter: brightness(1.05); }
.opt.live:active { transform: translateY(5px); box-shadow: 0 0 0 var(--line); }
.opt.gone { opacity: .35; filter: grayscale(.8); transform: scale(.97); }
.opt.picked { box-shadow: 0 5px 0 var(--line), 0 0 0 5px var(--surface), 0 0 0 7.5px var(--line); }
.opt.reveal { opacity: 1; filter: none; box-shadow: 0 5px 0 var(--line), 0 0 0 5px var(--surface), 0 0 0 7.5px var(--leaf-d); animation: win .6s ease-out; padding-inline-end: 54px; }
.opt.reveal::after { content: "✓"; position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%) rotate(-8deg); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); border: 2px solid var(--line); color: #fff; font-weight: 900; }
@keyframes win { 40% { transform: scale(1.05) rotate(-1deg); } }
.player .opts { gap: 12px; }
.player .opt { min-height: 86px; font-size: 1.15rem; }
.player .opt:not(.live):not(.reveal) { filter: saturate(.5); opacity: .8; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* state banner = speech bubble */
.state-banner { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; text-align: center; padding: 14px 18px; border-radius: 26px; font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.35; background: var(--surface); border: 2.5px solid var(--line); box-shadow: var(--pop); animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; margin-bottom: 8px; }
.state-banner::after { content: ""; position: absolute; bottom: -13px; inset-inline-start: 46px; width: 20px; height: 20px; background: inherit; border-inline-end: 2.5px solid var(--line); border-bottom: 2.5px solid var(--line); transform: skewX(-25deg) rotate(45deg); border-radius: 0 0 4px 0; }
[dir="rtl"] .state-banner::after { transform: skewX(25deg) rotate(-45deg); border-radius: 0 0 0 4px; }
.state-banner.ok { background: var(--ok-bg); }
.state-banner.bad { background: var(--bad-bg); }
.state-banner.steal { background: var(--note); animation: rise .4s both, nudge 1.2s ease-in-out infinite; }
.state-banner.pick { background: var(--pick-bg); }
.state-banner.dim { opacity: .75; }
@keyframes nudge { 50% { transform: rotate(-1deg) scale(1.01); } }
.wpn-ico { display: inline-block; width: 1.8em; height: 1.8em; vertical-align: middle; animation: wiggle 1.2s ease-in-out infinite; }
.wpn-ico svg { width: 100%; height: 100%; }
.say { color: var(--red-text); }

/* attack picker */
.wpn-ready { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 14px; margin-bottom: 10px; border-radius: 6px 6px 18px 6px; background: var(--note); border: 2px solid var(--line); box-shadow: 2px 3px 0 var(--line); font-family: var(--display); font-weight: 800; font-size: 1.1rem; transform: rotate(-1deg); }
.wpn-ready svg { width: 46px; height: 46px; flex: none; animation: wiggle 1s ease-in-out infinite; }
.bigactions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bigaction { --ac: var(--sky); position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 12px; border-radius: var(--wob); border: 2.5px solid var(--line); background: color-mix(in srgb, var(--ac) 40%, var(--tint-base)); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.2; cursor: pointer; box-shadow: 0 5px 0 var(--line); text-align: center; }
.bigaction .ic { font-size: 1.9rem; line-height: 1; }
.bigaction:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.bigaction:disabled { opacity: .45; cursor: not-allowed; }
.bigaction.adv { --ac: var(--leaf); } .bigaction.hinder { --ac: var(--red); } .bigaction.tile { --ac: var(--sun); } .bigaction.freeze { --ac: var(--sky); }
.bigaction .cd { font-family: var(--body); font-size: .75rem; color: var(--ink-2); }

.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: 8px; }
.feed li { padding: 8px 14px; border-radius: 4px 4px 14px 4px; background: var(--surface); border: 2px solid var(--line); color: var(--ink-2); font-size: .92rem; font-weight: 600; animation: rise .35s both; }
.feed li:first-child { color: var(--ink); background: var(--note); box-shadow: 2px 3px 0 var(--line); }
.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: var(--bad-bg); border: 2.5px solid var(--line); font-weight: 800; }
.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: 96px; 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: school sports day, bunting and all */
.podium-card { position: relative; text-align: center; padding: 44px 20px 24px; overflow: hidden; background: color-mix(in srgb, var(--tc) 14%, var(--card)); }
.podium-card::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 34px; background: var(--bunting) repeat-x 0 0 / 150px 30px; 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; width: 150px; 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: var(--ink); }
.podium-card .sub { color: var(--ink-2); font-weight: 800; 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: 64px; }
.pod .pod-step { width: 100%; padding: 8px 4px; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--tc) 45%, var(--tint-base)); border: 2.5px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--ink); }
.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-2); font-weight: 800; margin-top: 12px; }

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

/* ================================================================ WEAPONS: thrown after a steal */
.wpn-fly { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; will-change: transform; filter: drop-shadow(2px 3px 0 var(--line-soft)); }
.wpn-fly svg { width: 100%; height: 100%; display: block; }
.wpn-boom { position: fixed; z-index: 96; pointer-events: none; width: 120px; height: 120px; margin: -60px 0 0 -60px; display: grid; place-items: center; background: var(--burst) center / contain no-repeat; animation: boom 1.1s cubic-bezier(.2, 1.6, .4, 1) both; }
.wpn-boom b { font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--red-d); transform: rotate(-10deg); white-space: nowrap; }
.wpn-boom.k-freeze { background-image: var(--burst-ice); }
.wpn-boom.k-freeze b { color: var(--sky-d); }
.wpn-boom.k-advance b, .wpn-boom.k-tile b { color: var(--leaf-d); }
@keyframes boom { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 25% { transform: scale(1.1) rotate(4deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(.9) rotate(0); opacity: 0; } }
.token.throw .mon svg { animation: throw .55s ease-out; transform-origin: 50% 95%; }
@keyframes throw { 30% { transform: rotate(-12deg) translateY(-6%); } 60% { transform: rotate(10deg) scale(1.06); } }
/* the dazed look: shake + the vertical "gloom lines" across the face */
.token.dazed .mon svg { animation: daze .5s ease-in-out 3; transform-origin: 50% 95%; }
@keyframes daze { 25% { transform: translateX(-5%) rotate(-5deg); } 75% { transform: translateX(5%) rotate(5deg); } }
.token.dazed::after { content: ""; position: absolute; left: 31%; right: 31%; top: 16%; height: 22%; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--gloom) 0 2px, transparent 2px 5px);
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); animation: gloomIn .35s ease-out both; }
.token.dazed::before { content: "💫"; position: absolute; left: 50%; top: -14%; z-index: 3; font-size: 18px; line-height: 1; transform: translateX(-50%); animation: orbit 1s linear infinite; }
@keyframes gloomIn { from { transform: scaleY(0); transform-origin: top; } }
@keyframes orbit { 50% { transform: translateX(-50%) rotate(20deg) scale(1.1); } }
.token.iced .mon { background: rgba(170, 225, 255, .55); border: 2px solid var(--sky-d); border-radius: 10px; }

/* ================================================================ 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: 22px; background: var(--surface); color: var(--ink); border: 2.5px solid var(--line); box-shadow: var(--pop); font-weight: 800; text-align: center; animation: rise .3s both; }
#acct-sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.acct-card { width: min(560px, 100%); max-height: min(88vh, 900px); overflow: auto; padding: 22px; border-radius: var(--wob-lg); background: var(--card); border: 2.5px solid var(--line); box-shadow: var(--pop); 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(--soft-bg); border: 2px solid var(--line); }
.acct-bal small { display: block; color: var(--ink-2); font-weight: 800; }
.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: 800; 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: 2px dashed var(--line-soft); font-size: .92rem; }
.acct-row .ps { padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--surface); border: 1.5px solid var(--line); }
.acct-row .st-captured { color: var(--green-text); } .acct-row .st-failed { color: var(--red-text); } .acct-row .st-pending { color: var(--sun-text); }
.acct-row small { color: var(--ink-3); }
.acct-danger { padding: 14px; border-radius: 16px; border: 2px dashed var(--red); background: var(--bad-bg); }
.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: var(--red); --bi: #fff; }
.unit { font-weight: 800; color: var(--ink-2); }
.prev { color: var(--green-text); font-weight: 800; }

/* ================================================================ RESPONSIVE */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: 0; padding-top: 26px; gap: 30px; }
  .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); }
  .cast-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: 8px 16px; gap: 8px; }
  .nav-logo b { display: none; }
  .pill-btn { min-height: 36px; padding: .3em .8em; font-size: .85rem; }
  .sky .g1 { width: 130px; height: 65px; top: 70px; }
  .sky .g2 { display: none; }
  .sky .g3 { width: 76px; height: 76px; top: 64px; }
  .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; }
  .hero-stage { padding-top: 54px; min-height: 399px; }
  .stage-screen { padding: 14px 10px 12px; border-width: 10px; border-radius: 20px; }
  .s-lane { height: 34px; } .s-lane .mon { width: 32px; inset-inline-start: calc(var(--p) * (100% - 32px)); }
  .stage-phones { display: none; }
  .steps, .attack-grid, .cast-grid { grid-template-columns: 1fr; }
  .cast-card { grid-template-columns: 96px 1fr; }
  .cast-art { height: 128px; } .cast-art .mon { width: 86px; }
  .price-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .price-card { padding: 26px 8px 14px; } .price-card .kd { font-size: 2rem; }
  .school-card { flex-direction: column; text-align: center; padding: 22px 16px; }
  .school-card .band-title, .school-card .band-sub { text-align: center; }
  .band { padding-top: 52px; }
  .hud { padding: 6px 10px; }
  .hud-btn { min-height: 30px; padding: .2em .55em; font-size: .72rem; }
  .hud-right { flex-wrap: nowrap; gap: 4px; }
  .hud .code-chip b { font-size: 1rem; }
  .card { padding: 16px; }
  .q-card { padding: 16px 16px 16px 44px; }
  [dir="rtl"] .q-card { padding: 16px 44px 16px 16px; }
  .opts { gap: 10px; }
  .opt { min-height: 66px; font-size: 1rem; padding: 10px 12px; }
  .opt-n { width: 32px; height: 32px; }
  .player .opts { grid-template-columns: 1fr; }
  .player .opt { min-height: 64px; }
  .sample .opts { grid-template-columns: 1fr; }
  .team-cols { grid-template-columns: 1fr 1fr; }
  .track { height: 54px; } .track .token { width: 34px; inset-inline-start: calc(6px + var(--p) * (100% - 46px)); } .track .tile { height: 10px; } .track .tile.fin { height: 24px; }
  .acct-bal, .buy-packs { grid-template-columns: 1fr 1fr; }
  .pod { width: 96px; } .pod .mon { width: 54px; }
}
@media (max-width: 380px) {
  .hud-right .hud-btn:not(.danger) { padding: .2em .45em; }
}
/* 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: 72px; } .host .track .token { width: 50px; inset-inline-start: calc(6px + var(--p) * (100% - 62px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
img.logo-mark { background: none; box-shadow: none; padding: 0; object-fit: contain; }
.nav-logo img.logo-mark { width: 46px; height: 46px; }

/* team names: rename button on the phone banner + the naming sheet */
.tb-rename { margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 2px 0 var(--line); font-family: var(--display); font-weight: 700; font-size: .85rem; cursor: pointer; }
.tb-rename:active { transform: translateY(2px); box-shadow: none; }
#tn-sheet { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.tn-card { width: min(420px, 100%); display: grid; gap: 12px; padding: 20px; border-radius: var(--wob-lg); background: color-mix(in srgb, var(--tc) 18%, var(--card)); border: 2.5px solid var(--line); box-shadow: var(--pop); animation: rise .35s cubic-bezier(.2, 1.3, .4, 1) both; }
.tn-head { display: flex; align-items: center; gap: 10px; }
.tn-head .mon { width: 50px; }
.tn-head h3 { margin: 0; font-family: var(--display); font-size: 1.45rem; }
.tn-card input { width: 100%; min-height: 54px; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 2.5px solid var(--line); color: var(--ink); font-family: var(--display); font-size: 1.25rem; font-weight: 700; outline: none; }
.tn-card input:focus { box-shadow: 0 0 0 4px var(--focus-glow); }
.tn-card p { margin: 0; font-size: .9rem; }
.tn-row { display: flex; gap: 10px; }
.tn-row .btn { flex: 1; }

/* ================================================================ NIGHT (dark mode)
   A Maruko night: navy paper with star dots, cream ink, a sleepy crescent moon.
   Answer tiles, the pencil and the primary buttons stay pastel; characters and
   weapons get a thin cream sticker outline so dark hair and abayas still read. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171a30; --paper-2: #1f2241; --card: #22264a; --surface: #2c3159; --tint-base: #272b50;
  --soft-bg: #2b2f57; --focus-bg: #333863; --ink: #f6ecd8; --ink-2: #d3c6ae; --ink-3: #a59bb3; --line: #07080f; --on-pastel: #2b2221;
  --note: #4b4427; --note-blue: #243f5d; --note-pink: #4e2b41; --warn-bg: #4a3f20; --ok-bg: #22452f; --bad-bg: #54262f;
  --pick-bg: #3a2f5f; --best-bg: #4a4222; --hard-bg: #4e3424; --track: #39345a; --track-band: rgba(255, 255, 255, .05);
  --paper-note: #20244a; --nb-line: rgba(140, 170, 235, .2); --nb-margin: rgba(242, 110, 110, .55); --fin-a: #f6ecd8; --fin-b: #07080f;
  --nav-bg: rgba(23, 26, 48, .96); --overlay: rgba(0, 0, 0, .55); --pop-ink: rgba(0, 0, 0, .6);
  --line-soft: rgba(246, 236, 216, .26); --line-faint: rgba(246, 236, 216, .09); --ground: rgba(0, 0, 0, .35);
  --dot-r: rgba(255, 214, 120, .14); --dot-b: rgba(170, 195, 255, .12); --tape: rgba(255, 255, 255, .14);
  --sky-1: #0c1030; --sky-2: #141a40; --sky-0: rgba(23, 26, 48, 0); --screen-1: #1b2150; --screen-2: #232859; --screen-3: #1f3a3a;
  --focus-glow: rgba(255, 210, 74, .45); --gloom: rgba(165, 150, 255, .95); --halo: rgba(246, 236, 216, .95);
  --red-text: #ff8f8f; --green-text: #a7e08a; --sun-text: #ffd24a;
  --o1: #f28888; --o2: #7cc6ec; --o3: #f4ce5a; --o4: #97d477;
  --pop: 3px 4px 0 rgba(0, 0, 0, .6); --shadow: 3px 4px 0 rgba(0, 0, 0, .6);
  --cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M20 52 Q3 52 7 39 Q4 26 19 26 Q21 11 38 13 Q47 1 63 7 Q79 -1 87 15 Q104 13 105 28 Q119 30 115 43 Q117 54 100 52 Z' fill='%23262b52' stroke='%238f88bb' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sunface: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='%23ffe08a' stroke='%2307080f' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M14 22 l3 7 7 3 -7 3 -3 7 -3 -7 -7 -3 7 -3 Z'/%3E%3Cpath d='M100 86 l2.4 5.6 5.6 2.4 -5.6 2.4 -2.4 5.6 -2.4 -5.6 -5.6 -2.4 5.6 -2.4 Z'/%3E%3C/g%3E%3Cpath d='M74 14 A46 46 0 1 0 104 82 A38 38 0 0 1 74 14 Z' fill='%23ffe08a' stroke='%2307080f' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M38 60 Q44 64 50 60 M58 70 Q64 74 70 70' fill='none' stroke='%2307080f' stroke-width='3' stroke-linecap='round'/%3E%3Cellipse cx='40' cy='72' rx='6' ry='3.6' fill='%23f59aa2'/%3E%3Cpath d='M50 84 Q56 88 62 84' fill='none' stroke='%2307080f' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.mon svg .sil { display: none; }
[data-theme="dark"] .mon svg .sil { display: inline; }
[data-theme="dark"] .mon svg .sil * { fill: var(--halo); stroke: var(--halo); }
[data-theme="dark"] .wpn-fly, [data-theme="dark"] .wpn-ico svg, [data-theme="dark"] .cast-wpn svg, [data-theme="dark"] .wpn-ready svg, [data-theme="dark"] .tn-head .mon {
  filter: drop-shadow(1.3px 0 0 var(--halo)) drop-shadow(-1.3px 0 0 var(--halo)) drop-shadow(0 1.3px 0 var(--halo)) drop-shadow(0 -1.3px 0 var(--halo)); }
[data-theme="dark"] .sky .g3 { animation: none; }
[data-theme="dark"] .sky::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff7d6 50%, transparent 60%), radial-gradient(1.2px 1.2px at 34% 9%, #fff7d6 50%, transparent 60%), radial-gradient(1.6px 1.6px at 58% 24%, #fff7d6 50%, transparent 60%), radial-gradient(1.2px 1.2px at 77% 12%, #fff7d6 50%, transparent 60%), radial-gradient(1.4px 1.4px at 88% 30%, #fff7d6 50%, transparent 60%), radial-gradient(1px 1px at 22% 36%, #fff7d6 50%, transparent 60%), radial-gradient(1px 1px at 66% 40%, #fff7d6 50%, transparent 60%);
  opacity: .8; }
[data-theme="dark"] .wordmark span { filter: drop-shadow(4px 0 0 #fff7e3) drop-shadow(-4px 0 0 #fff7e3) drop-shadow(0 4px 0 #fff7e3) drop-shadow(0 -4px 0 #fff7e3)
          drop-shadow(2px 0 0 #07080f) drop-shadow(-2px 0 0 #07080f) drop-shadow(0 2px 0 #07080f) drop-shadow(0 -2px 0 #07080f) drop-shadow(4px 6px 0 rgba(0, 0, 0, .7)); }
[data-theme="dark"] .stage-screen { background: linear-gradient(180deg, var(--screen-1) 0%, var(--screen-2) 45%, var(--screen-3) 100%); }

/* the sun/moon switch */
.theme-btn { min-width: 38px; justify-content: center; padding-inline: .6em; font-size: 1rem; }

/* ---------- genres (Seen Jeem-style picker), did-you-know, streaks, match recap ---------- */
.genre-pick h3 { margin-bottom: 4px; }
.genre-pick > .muted { margin: 0 0 10px; }
.gp-group { margin: 10px 0 4px; }
.gp-group h4 { margin: 0 0 6px; font-size: .92rem; color: var(--ink-2); }
.gp-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gp-chip { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: start;
  padding: 7px 10px; border-radius: 14px; border: 2.5px solid var(--line); min-width: 0;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer;
  box-shadow: 0 3px 0 var(--line); transition: transform .12s, background .12s; }
.gp-chip .em { grid-row: 1 / 3; font-size: 1.35rem; line-height: 1; }
.gp-chip span:not(.em) { line-height: 1.25; overflow-wrap: anywhere; }
.gp-chip small { font-weight: 700; font-size: .72rem; color: var(--ink-3); line-height: 1.1; }
.gp-chip.on { background: var(--sun); color: var(--on-pastel, var(--ink)); transform: translateY(-1px); }
.gp-chip.on small { color: var(--on-pastel, var(--ink-2)); }
.gp-chip:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.gp-chip:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.gp-chip:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.genre-pick.locked .gp-chips { filter: saturate(.6); }
.team-genres { margin-top: 12px; }
.team-genres h4 { margin: 0 0 6px; font-size: .92rem; }
.team-genres ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.team-genres li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-inline-start: 10px; border-inline-start: 5px solid var(--tc, var(--line)); }
.gchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--soft-bg); font-weight: 800; font-size: .8rem; color: var(--ink); }
.gchip.off { opacity: .55; }
.dyk { margin-top: 12px; padding: 10px 14px; border-radius: 14px; border: 2.5px dashed var(--line); background: var(--soft-bg);
  display: grid; gap: 4px; font-weight: 700; line-height: 1.55; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.dyk b { color: var(--red-text); }
.chip.fire { background: #ffd0a8; color: #7a2e0e; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.learned summary { cursor: pointer; font-weight: 900; font-size: 1.1rem; }
.learned summary small { font-weight: 700; color: var(--ink-2); margin-inline-start: 6px; }
.learned ol { margin: 10px 0 0; padding-inline-start: 22px; display: grid; gap: 12px; }
.learned li p { margin: 2px 0; }
.learned .lq { font-weight: 800; }
.learned .la { color: var(--green-text); font-weight: 900; }
.learned .lx { color: var(--ink-2); font-weight: 600; }
:root[data-theme="dark"] .chip.fire { background: #5a2a14; color: #ffd7b8; }

/* ---------- phones: less crowded (menu bar, folds, simpler cards, lighter game screen) ---------- */
.hud-menu { display: none; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "▾"; flex: none; font-size: 1.1rem; color: var(--ink-2); transition: transform .2s; }
.fold[open] > summary::after { transform: rotate(180deg); }
.fold-t { font-family: var(--display); font-size: 1.05rem; white-space: nowrap; }
.fold-sum { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-inline-start: auto; min-width: 0; }
.fold-sum .muted { font-size: .85rem; font-weight: 600; }
.fold[open] .fold-sum { display: none; }
.fold > :not(summary) { margin-top: 10px; }
.card.fold { padding: 12px 16px; }
.tb-edit { margin-top: 4px; }
.tb-edit > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.tb-edit > summary::-webkit-details-marker { display: none; }
.tb-edit > summary::after { content: "▾"; transition: transform .2s; }
.tb-edit[open] > summary::after { transform: rotate(180deg); }
.tn-inline { display: flex; gap: 8px; margin-top: 8px; }
.tn-inline input { flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 6px 12px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--surface); color: var(--ink); }
.mode-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.seg { font: inherit; font-weight: 800; font-size: .85rem; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.seg.on { background: var(--sun); color: var(--on-pastel); }
.pickT.is-taken { opacity: .45; }
.pickT .pk-name { font-family: var(--display); font-weight: 800; font-size: .98rem; line-height: 1.15; text-align: center; }
.team-banner.compact { padding: 4px 12px 4px 8px; margin-bottom: 8px; }
.team-banner.compact .mon { width: 36px; }
.team-banner.compact .tb-name { font-size: 1.05rem; }
.team-banner.compact .tb-sub { display: none; }

@media (max-width: 640px) {
  .hud { position: sticky; flex-wrap: nowrap; }
  .hud-menu { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; font: 900 1.4rem/1 var(--display); color: var(--ink);
    border: 2.5px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 0 var(--line); cursor: pointer; margin-inline-start: auto; }
  .hud .hud-right { display: none; position: absolute; top: calc(100% + 6px); inset-inline-end: 10px; z-index: 30; flex-direction: column; align-items: stretch; gap: 8px;
    min-width: 190px; padding: 12px; background: var(--card); border: 2.5px solid var(--line); border-radius: 18px; box-shadow: 4px 6px 0 var(--line); }
  .hud.menu-open .hud-right { display: flex; }
  .hud-right .hud-btn, .hud-right .hud-btn:not(.danger) { min-height: 42px; font-size: .95rem; padding: .3em 1em; justify-content: center; }
  .hud-right .conn { align-self: center; }
  .hud-brand { gap: 8px; }
  /* in game the phone shows: who I am → the state → the question → my race. The TV carries the feed. */
  .player .state-banner { padding: 8px 14px; font-size: .98rem; }
  .player .state-banner::after { display: none; }
  .player .game { gap: 10px; }
  .player .board-panel .scoreline { font-size: .85rem; }
  .player .lane-title .chip { display: none; }
  .player .lobby { display: grid; gap: 12px; }
  .player .lobby > .card, .player .lobby-grid > .card { margin: 0; }
  .player .teampick .pickgrid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .player .pickT { padding: 6px 4px 8px; }
  .player .pickT .mon { width: 50px; }
  .player .rules { padding: 12px 16px; }
  .player .team-cols { grid-template-columns: 1fr; }
}

/* solo lobby: one slim row per player */
.solo-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.solo-list li { display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 6px 12px 6px 8px; border-radius: 16px;
  background: color-mix(in srgb, var(--tc) 22%, var(--surface)); border: 2.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.solo-list li.off { opacity: .5; }
.solo-list .sl-mon { grid-row: 1 / 3; width: 44px; height: 52px; display: grid; place-items: center; }
.solo-list .sl-mon .mon { width: 40px; }
.solo-list .sl-q { font: 900 1.4rem var(--display); color: var(--ink-2); }
.solo-list b { font-family: var(--display); font-size: 1.05rem; line-height: 1.1; }
.solo-list small { color: var(--ink-2); font-weight: 700; font-size: .8rem; grid-column: 2; }
.solo-list .sl-ok { grid-row: 1 / 3; grid-column: 3; font: 900 1.3rem var(--display); color: var(--green-text); }
.team-banner.compact::after, .team-banner.compact::before { display: none; }

/* photo questions */
.q-img { margin: 12px 0 4px; display: grid; gap: 4px; justify-items: center; }
.q-img img { display: block; width: 100%; max-height: 38vh; object-fit: contain; border-radius: 16px; border: 2.5px solid var(--line); background: var(--soft-bg); }
.q-img figcaption { font-size: .78rem; direction: ltr; color: var(--ink-3); text-align: center; overflow-wrap: anywhere; }
@media (max-height: 760px) { .q-img img { max-height: 30vh; } }

/* guess-the-brand: blurry logo that reveals itself over the question timer (2026-11-15) */
.q-img.brandq img{animation:brandReveal 14s linear forwards}
@keyframes brandReveal{0%{filter:blur(30px) saturate(1.3)}55%{filter:blur(14px) saturate(1.2)}80%{filter:blur(5px)}100%{filter:blur(0)}}
