/* ============================================================
   play.css v2, the /play/ arcade (demo)
   ------------------------------------------------------------
   Site chrome (navy masthead, research desk, footer) wraps a
   game screen. The screen is a sheet of ice: rink lines under
   everything, one focused board, trading cards for players, a
   scoreboard for the state of the game. Each game has its own
   accent (--ga). No italics, gold only on the receipt glyph,
   figures final on first paint, geometry-only motion.
   ============================================================ */
:root {
  --g-ice: #edf3fa;
  --g-ice-2: #e2eaf4;
  --g-line-blue: rgba(31,95,191,.12);
  --g-line-red: rgba(200,16,46,.09);
  --g-card: #ffffff;
  --g-card-2: #f5f8fc;
  --g-ink: #0d1f3c;
  --g-ink-2: #34496b;
  --g-muted: #677a96;
  --g-hair: rgba(13,31,60,.09);
  --g-line: rgba(13,31,60,.16);
  --g-track: #dfe7f1;
  --g-blue: #1f5fbf;
  --g-blue-soft: #e3ecfb;
  --g-right: #1d7a5c;
  --g-right-soft: #dcf1e8;
  --g-wrong: #b8442f;
  --g-wrong-soft: #f8e1db;
  --g-shadow: 0 1px 0 rgba(13,31,60,.05), 0 14px 32px -18px rgba(13,31,60,.35);
  --g-lift: 0 2px 0 rgba(13,31,60,.06), 0 22px 40px -20px rgba(13,31,60,.45);
  --g-sb: #0a1628;
  --g-sb-2: #13233e;
  --g-sb-line: rgba(157,184,221,.18);
  --g-sb-ink: #ffffff;
  --g-sb-dim: #8fa5c4;
  --g-lamp: #ff3b3b;
  --g-scrim: rgba(7,16,31,.58);
  --ga: #1f5fbf;
  --ga-ink: #ffffff;
  --ga-soft: #e3ecfb;
  --ga-hi: #8ab8f2;
  --g-serif: var(--hi-serif, 'Newsreader', Georgia, serif);
  --g-sans: 'Source Sans 3', 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --g-mono: var(--hi-mono, 'JetBrains Mono', 'Cascadia Mono', ui-monospace, monospace);
  --g-ease: var(--mo-ease, cubic-bezier(.22,.61,.36,1));
  --g-fast: var(--mo-fast, 120ms);
  --g-base: var(--mo-base, 240ms);
  --g-slow: var(--mo-slow, 400ms);
}
.g-sd { --ga: #1f5fbf; --ga-soft: #e3ecfb; --ga-hi: #8ab8f2; }
.g-t5 { --ga: #12765f; --ga-soft: #dcf1ea; --ga-hi: #6fdcbc; }
.g-gh { --ga: #c8323a; --ga-soft: #fbe3e3; --ga-hi: #ff8a8a; }
.g-dd { --ga: #5b45c6; --ga-soft: #ebe6fb; --ga-hi: #b3a6ff; }
.g-rd { --ga: #b85412; --ga-soft: #fbeadc; --ga-hi: #ffb27a; }
.g-cp { --ga: #0e7c86; --ga-soft: #dcf1f2; --ga-hi: #6fd6dc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-ice: #07111f; --g-ice-2: #0b182b;
    --g-line-blue: rgba(110,168,255,.10); --g-line-red: rgba(255,90,90,.08);
    --g-card: #10203a; --g-card-2: #0c1a31;
    --g-ink: #e8f0fb; --g-ink-2: #bccbe2; --g-muted: #8da2c0;
    --g-hair: rgba(157,184,221,.12); --g-line: rgba(157,184,221,.22); --g-track: #1b2d4b;
    --g-blue: #6ea8ff; --g-blue-soft: rgba(110,168,255,.14);
    --g-right: #5fd3a8; --g-right-soft: rgba(95,211,168,.14);
    --g-wrong: #f08b74; --g-wrong-soft: rgba(240,139,116,.14);
    --g-shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 34px -18px rgba(0,0,0,.8);
    --g-lift: 0 2px 0 rgba(0,0,0,.3), 0 24px 44px -20px rgba(0,0,0,.9);
    --g-sb: #050c18; --g-sb-2: #0d1a2f;
    --ga-ink: #07111f;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .g-sd { --ga: #6ea8ff; --ga-soft: rgba(110,168,255,.14); }
  :root:not([data-theme="light"]) .g-t5 { --ga: #4fd1b0; --ga-soft: rgba(79,209,176,.14); }
  :root:not([data-theme="light"]) .g-gh { --ga: #ff6b6b; --ga-soft: rgba(255,107,107,.14); }
  :root:not([data-theme="light"]) .g-dd { --ga: #a594ff; --ga-soft: rgba(165,148,255,.15); }
  :root:not([data-theme="light"]) .g-rd { --ga: #ff9d5c; --ga-soft: rgba(255,157,92,.14); }
  :root:not([data-theme="light"]) .g-cp { --ga: #4fc8d1; --ga-soft: rgba(79,200,209,.14); }
}
:root[data-theme="dark"] {
  --g-ice: #07111f; --g-ice-2: #0b182b;
  --g-line-blue: rgba(110,168,255,.10); --g-line-red: rgba(255,90,90,.08);
  --g-card: #10203a; --g-card-2: #0c1a31;
  --g-ink: #e8f0fb; --g-ink-2: #bccbe2; --g-muted: #8da2c0;
  --g-hair: rgba(157,184,221,.12); --g-line: rgba(157,184,221,.22); --g-track: #1b2d4b;
  --g-blue: #6ea8ff; --g-blue-soft: rgba(110,168,255,.14);
  --g-right: #5fd3a8; --g-right-soft: rgba(95,211,168,.14);
  --g-wrong: #f08b74; --g-wrong-soft: rgba(240,139,116,.14);
  --g-shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 34px -18px rgba(0,0,0,.8);
  --g-lift: 0 2px 0 rgba(0,0,0,.3), 0 24px 44px -20px rgba(0,0,0,.9);
  --g-sb: #050c18; --g-sb-2: #0d1a2f;
  --ga-ink: #07111f;
  color-scheme: dark;
}
:root[data-theme="dark"] .g-sd { --ga: #6ea8ff; --ga-soft: rgba(110,168,255,.14); }
:root[data-theme="dark"] .g-t5 { --ga: #4fd1b0; --ga-soft: rgba(79,209,176,.14); }
:root[data-theme="dark"] .g-gh { --ga: #ff6b6b; --ga-soft: rgba(255,107,107,.14); }
:root[data-theme="dark"] .g-dd { --ga: #a594ff; --ga-soft: rgba(165,148,255,.15); }
:root[data-theme="dark"] .g-rd { --ga: #ff9d5c; --ga-soft: rgba(255,157,92,.14); }
:root[data-theme="dark"] .g-cp { --ga: #4fc8d1; --ga-soft: rgba(79,200,209,.14); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--g-ice); }
body { margin: 0; background: var(--g-ice); color: var(--g-ink); font-family: var(--g-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
i, em { font-style: normal; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- site masthead (the /streaks/ dialect; hi-nav.js normalises it) */
.masthead { background: #0d1f3c; color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 3px solid #1f5fbf; }
.masthead .inner { max-width: 1220px; margin: 0 auto; display: flex; align-items: center; gap: 30px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); height: 58px; }
.wordmark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: #fff; }
.wordmark .hi { font-weight: 900; letter-spacing: .14em; font-size: .82rem; text-transform: uppercase; }
.wordmark .section { font-family: var(--g-serif); font-weight: 500; font-size: 1.02rem; color: #9db8dd; }
.mnav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.mnav a { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: #8fa5c4; padding: 20px 0; border-bottom: 3px solid transparent; margin-bottom: -3px; text-decoration: none; }
.mnav a:hover { color: #fff; }
.mnav a:focus-visible { outline: 2px solid #4d8fe8; outline-offset: -2px; color: #fff; }
.theme-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(157,184,221,.35); background: transparent; color: #c9d8ee; cursor: pointer; font-size: .9rem; display: grid; place-items: center; }
.theme-btn:hover { background: rgba(157,184,221,.15); }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (max-width: 1023.98px) { .mnav > a { display: none; } }
.rdesk { background: var(--hi-surface-1, #fffaf1); border-bottom: 1px solid var(--hi-line, #d7cbb7); }
.rdesk .inner { max-width: 1220px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 8px; min-height: 42px; flex-wrap: wrap; }
.rdesk .lbl { font-family: var(--g-mono); font-size: .55rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hi-muted, #6a7d99); white-space: nowrap; padding-right: 6px; }
.rdesk a { font-family: var(--g-mono); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hi-muted, #6a7d99); border: 1px solid var(--hi-line, #d7cbb7); border-radius: 999px; padding: 5px 12px; white-space: nowrap; text-decoration: none; }

/* ---------- the arena: ice with rink lines under everything */
.arena { position: relative; isolation: isolate; min-height: 70vh; padding-bottom: 40px; overflow: hidden; overflow: clip; }
.arena::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 230px, transparent 0 169px, var(--g-line-red) 170px 173px, transparent 174px),
    radial-gradient(circle at 50% 230px, var(--g-line-red) 0 7px, transparent 8px),
    linear-gradient(90deg, transparent calc(50% - 2px), var(--g-line-red) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(90deg, transparent 12%, var(--g-line-blue) 12% calc(12% + 10px), transparent calc(12% + 10px) calc(88% - 10px), var(--g-line-blue) calc(88% - 10px) 88%, transparent 88%),
    linear-gradient(180deg, var(--g-ice) 0%, var(--g-ice-2) 100%); }

/* ---------- game bar */
.gbar { position: relative; z-index: 5; border-bottom: 1px solid var(--g-hair); background: color-mix(in srgb, var(--g-ice) 82%, transparent); backdrop-filter: blur(6px); }
.gbar .in { max-width: 1100px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 12px; }
.gb-btn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--g-line); background: var(--g-card); color: var(--g-ink); display: grid; place-items: center; cursor: pointer; transition: border-color var(--g-fast) var(--g-ease), transform var(--g-fast) var(--g-ease); }
.gb-btn:hover { border-color: var(--ga); transform: translateY(-1px); }
.gb-btn:focus-visible { outline: 2px solid var(--ga); outline-offset: 2px; }
.gb-btn svg { width: 18px; height: 18px; }
.gb-title { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.gb-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--ga); color: var(--ga-ink); display: grid; place-items: center; }
.gb-icon svg { width: 20px; height: 20px; }
.gb-title .t { min-width: 0; display: grid; }
.gb-title b, .gb-title .gb-h { margin: 0; font-family: var(--g-serif); font-weight: 600; font-size: 1.18rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-title span.s { font-family: var(--g-mono); font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); white-space: nowrap; }
.gb-demo { flex: 0 0 auto; font-family: var(--g-mono); font-size: .54rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g-wrong); border: 1px dashed var(--g-wrong); border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
@media (max-width: 560px) { .gb-demo { display: none; } .gb-title b, .gb-title .gb-h { font-size: 1.02rem; } }

/* ---------- board */
.board { max-width: 760px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
.board.wide { max-width: 1000px; }
.panel { background: var(--g-card); border: 1px solid var(--g-hair); border-radius: 20px; box-shadow: var(--g-shadow); padding: 18px; min-width: 0; }
.panel.flat { box-shadow: none; }
.kicker { font-family: var(--g-mono); font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.kicker b { color: var(--ga); font-weight: 700; }
.ask { margin: 0; font-family: var(--g-serif); font-weight: 600; font-size: clamp(1.35rem, 3.4vw, 1.85rem); line-height: 1.22; letter-spacing: -.005em; text-wrap: balance; }
.ask b { color: var(--ga); font-weight: 600; }
.lead { margin: 0; color: var(--g-ink-2); font-size: 1rem; line-height: 1.55; }
.lead b { color: var(--g-ink); }

/* ---------- scoreboard: navy in both themes */
.sb { background: linear-gradient(180deg, var(--g-sb-2), var(--g-sb)); color: var(--g-sb-ink); border-radius: 16px; border: 1px solid var(--g-sb-line); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); box-shadow: var(--g-shadow); overflow: hidden; }
.sb > div { padding: 10px 12px; display: grid; gap: 2px; justify-items: center; text-align: center; border-left: 1px solid var(--g-sb-line); min-width: 0; }
.sb > div:first-child { border-left: 0; }
.sb .l { font-family: var(--g-mono); font-size: .54rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--g-sb-dim); white-space: nowrap; }
.sb .v { font-family: var(--g-mono); font-weight: 700; font-size: 1.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sb .v small { font-size: .7rem; color: var(--g-sb-dim); font-weight: 700; letter-spacing: .04em; margin-left: 2px; }
.sb .v.hi { color: var(--ga-hi); }
.sb .lamp { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #3a1a1f; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); vertical-align: middle; transition: background var(--g-fast) var(--g-ease), box-shadow var(--g-fast) var(--g-ease); }
.sb .lamp.on { background: var(--g-lamp); box-shadow: 0 0 0 4px rgba(255,59,59,.22), 0 0 18px 4px rgba(255,59,59,.55); }
.sb .pips { display: flex; gap: 4px; justify-content: center; padding-top: 6px; }
.sb .pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.16); }
.sb .pips i.y { background: #5fd3a8; } .sb .pips i.n { background: #f08b74; } .sb .pips i.now { background: var(--ga-hi); }

/* ---------- trading cards */
.pc { --tc: #1f5fbf; position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 16px; overflow: hidden; background: var(--g-card); border: 1px solid var(--g-hair); box-shadow: var(--g-shadow); min-width: 0; text-align: left; color: var(--g-ink); padding: 0; }
button.pc { cursor: pointer; transition: transform var(--g-base) var(--g-ease), box-shadow var(--g-base) var(--g-ease), border-color var(--g-fast) var(--g-ease); }
button.pc:hover:not([disabled]) { transform: translateY(-3px); box-shadow: var(--g-lift); border-color: var(--ga); }
button.pc:active:not([disabled]) { transform: translateY(-1px); }
button.pc:focus-visible { outline: 3px solid var(--ga); outline-offset: 3px; }
button.pc[disabled] { cursor: default; }
.pc-art { display: block; position: relative; height: 128px; overflow: hidden; background: linear-gradient(155deg, color-mix(in srgb, var(--tc) 86%, #fff) 0%, var(--tc) 48%, color-mix(in srgb, var(--tc) 62%, #000) 100%); }
.pc-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.18)); pointer-events: none; }
.pc-wm { position: absolute; right: -14%; top: -18%; width: 78%; height: auto; opacity: .2; pointer-events: none; }
.pc-head { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%); object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.pc-mono { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--g-serif); font-weight: 700; font-size: 2.6rem; color: rgba(255,255,255,.92); letter-spacing: .02em; }
.pc-mono.dk { color: rgba(13,31,60,.85); }
.pc-tag { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; font-family: var(--g-mono); font-size: .54rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(5,12,24,.55); border-radius: 999px; padding: 4px 8px; }
.pc-num { position: absolute; right: 10px; top: 10px; z-index: 2; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-family: var(--g-mono); font-size: .6rem; font-weight: 700; color: #fff; background: rgba(5,12,24,.5); }
.pc-body { padding: 10px 12px 12px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.pc-name { display: block; font-weight: 800; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: block; font-family: var(--g-mono); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-extra { margin-top: 8px; display: grid; gap: 6px; }
.pc.sm .pc-art { height: 92px; }
.pc.sm .pc-name { font-size: .9rem; }
.pc.lg .pc-art { height: 188px; }
.pc.lg .pc-name { font-family: var(--g-serif); font-weight: 600; font-size: 1.45rem; white-space: normal; text-wrap: balance; }
.pc.lg .pc-wm { width: 62%; right: -8%; }
.pc.right { border-color: var(--g-right); box-shadow: 0 0 0 2px var(--g-right), var(--g-shadow); }
.pc.wrong { border-color: var(--g-wrong); box-shadow: 0 0 0 2px var(--g-wrong), var(--g-shadow); }
.pc.dim { filter: saturate(.55); }
.pc.dim .pc-body { opacity: .78; }
.pc-mystery .pc-art { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ga) 70%, #0a1628) 0 10px, color-mix(in srgb, var(--ga) 58%, #0a1628) 10px 20px); }
.pc-mystery .pc-mono { font-size: 3.4rem; color: #fff; }

/* stamps: GOAL, SAVE, EXACT */
.stamp { position: absolute; z-index: 3; left: 50%; top: 46px; transform: translateX(-50%) rotate(-8deg); font-family: var(--g-sans); font-weight: 900; font-size: 1.3rem; letter-spacing: .14em; text-transform: uppercase; padding: 4px 14px; border-radius: 8px; border: 3px solid currentColor; background: rgba(255,255,255,.92); animation: g-stamp var(--g-base) var(--g-ease) both; white-space: nowrap; }
.stamp.goal { color: #d0262e; }
.stamp.save { color: #0d1f3c; }
.stamp.ok { color: #1d7a5c; }
.pc.lg .stamp { top: 70px; font-size: 1.6rem; }
@keyframes g-stamp { from { transform: translateX(-50%) rotate(-8deg) scale(1.6); } to { transform: translateX(-50%) rotate(-8deg) scale(1); } }

/* ---------- buttons */
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--ga); background: var(--ga); color: var(--ga-ink); font-family: var(--g-sans); font-weight: 800; font-size: 1rem; letter-spacing: .01em; cursor: pointer; text-decoration: none; transition: transform var(--g-fast) var(--g-ease), box-shadow var(--g-fast) var(--g-ease); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--ga) 80%, transparent); }
.gbtn:hover { transform: translateY(-1px); }
.gbtn:active { transform: translateY(1px); }
.gbtn:focus-visible { outline: 3px solid var(--ga); outline-offset: 3px; }
.gbtn.ghost { background: var(--g-card); color: var(--g-ink); border-color: var(--g-line); box-shadow: none; }
.gbtn.ghost:hover { border-color: var(--ga); }
.gbtn.small { min-height: 40px; padding: 0 14px; font-size: .86rem; border-radius: 11px; }
.gbtn.block { width: 100%; }
.gbtn[disabled] { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.gbtn .k { font-family: var(--g-mono); font-size: .6rem; font-weight: 700; opacity: .75; border: 1px solid currentColor; border-radius: 5px; padding: 1px 5px; }
.gbtn svg { width: 18px; height: 18px; }
.cost { font-family: var(--g-mono); font-size: .62rem; font-weight: 700; opacity: .8; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.split { justify-content: space-between; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--g-line); background: var(--g-card-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-family: var(--g-mono); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); cursor: pointer; min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--g-card); color: var(--g-ink); box-shadow: 0 1px 0 var(--g-line), 0 4px 10px -6px rgba(13,31,60,.3); }
.seg button:focus-visible { outline: 2px solid var(--ga); outline-offset: 1px; }
.seg button[disabled] { cursor: not-allowed; opacity: .6; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--g-mono); font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; border: 1px solid var(--g-line); color: var(--g-ink-2); background: var(--g-card); white-space: nowrap; }
.chip.right { color: var(--g-right); background: var(--g-right-soft); border-color: transparent; }
.chip.wrong { color: var(--g-wrong); background: var(--g-wrong-soft); border-color: transparent; }
.chip.acc { color: var(--ga); background: var(--ga-soft); border-color: transparent; }
.chip .logo { width: 14px; height: 14px; }

/* feedback line */
.say { min-height: 1.6em; font-size: 1rem; line-height: 1.5; color: var(--g-ink-2); }
.say b { color: var(--g-ink); }
.say .w { font-weight: 900; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; }
.say.right .w { color: var(--g-right); } .say.wrong .w { color: var(--g-wrong); }

/* ---------- portraits for lists (round) */
.mug { --s: 56px; --tint: #1f5fbf; position: relative; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.mug .mono { font-family: var(--g-sans); font-weight: 900; font-size: calc(var(--s) * .32); color: #fff; letter-spacing: .02em; }
.mug img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.mug.ask { background: var(--g-card-2); border: 2px dashed var(--g-line); }
.mug.ask .mono { color: var(--g-muted); font-family: var(--g-serif); font-size: calc(var(--s) * .5); font-weight: 600; }
.logo { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; vertical-align: middle; }
.tri { display: inline-grid; place-items: center; min-width: 30px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--tint, #1f5fbf); color: #fff; font-family: var(--g-mono); font-size: .54rem; font-weight: 700; letter-spacing: .06em; vertical-align: middle; }

/* ---------- player search */
.search { position: relative; }
.search input { width: 100%; min-height: 56px; border-radius: 14px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); padding: 0 16px 0 48px; font: 700 1.05rem var(--g-sans); transition: border-color var(--g-fast) var(--g-ease); }
.search input::placeholder { color: var(--g-muted); font-weight: 500; }
.search input:focus { outline: none; border-color: var(--ga); box-shadow: 0 0 0 4px var(--ga-soft); }
.search input[disabled] { opacity: .6; }
.search .ico { position: absolute; left: 17px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--g-muted); pointer-events: none; }
.search [role="listbox"] { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 16px; box-shadow: var(--g-lift); padding: 6px; margin: 0; list-style: none; max-height: 360px; overflow-y: auto; }
.search [role="option"] { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 11px; cursor: pointer; }
.search [role="option"][aria-selected="true"], .search [role="option"]:hover { background: var(--ga-soft); }
.search [role="option"] .nm { font-weight: 800; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search [role="option"] .sub { font-family: var(--g-mono); font-size: .58rem; letter-spacing: .06em; color: var(--g-muted); text-transform: uppercase; }
.search [role="option"] .tag { font-family: var(--g-mono); font-size: .58rem; font-weight: 700; color: var(--g-muted); }
.search [role="option"] .mug { --s: 38px; }
.search .empty { padding: 12px; color: var(--g-muted); font-size: .9rem; }
.search.pl-shake { animation: g-shake 260ms var(--g-ease) both; }

/* ---------- final screen */
.final { display: grid; gap: 16px; animation: g-rise var(--g-slow) var(--g-ease) both; }
.final .sb .v { font-size: 2.4rem; }
.final h2 { margin: 0; font-family: var(--g-serif); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15; text-wrap: balance; }
.final .facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.final .facts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--g-card-2); border: 1px solid var(--g-hair); }
.final .facts li .t { min-width: 0; }
.final .facts li .t b { display: block; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.final .facts li .t span { font-family: var(--g-mono); font-size: .58rem; letter-spacing: .05em; text-transform: uppercase; color: var(--g-muted); }
.final .facts li .mug { --s: 40px; }
.final .facts li .n { font-family: var(--g-mono); font-weight: 700; font-size: .8rem; text-align: right; }
.sharecard { border-radius: 16px; border: 1px dashed var(--g-line); background: var(--g-card-2); padding: 14px; display: grid; gap: 10px; }
.sharecard pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--g-mono); font-size: .8rem; line-height: 1.55; color: var(--g-ink); }
.nextup { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: var(--g-ink); background: var(--g-card); border: 1px solid var(--g-hair); box-shadow: var(--g-shadow); transition: transform var(--g-base) var(--g-ease), border-color var(--g-fast) var(--g-ease); }
.nextup:hover { transform: translateY(-2px); border-color: var(--nx, var(--ga)); }
.nextup .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--nx, var(--ga)); color: #fff; }
.nextup .ic svg { width: 22px; height: 22px; }
.nextup b { display: block; font-family: var(--g-serif); font-weight: 600; font-size: 1.12rem; }
.nextup span { font-size: .86rem; color: var(--g-ink-2); }
.nextup .go { font-family: var(--g-mono); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--nx, var(--ga)); white-space: nowrap; }
.metaline { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-family: var(--g-mono); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.metaline b { color: var(--g-ink); }

/* ---------- dialogs: help, stats, games */
dialog.gm { border: 0; padding: 0; background: transparent; max-width: min(460px, calc(100vw - 24px)); width: 100%; color: var(--g-ink); }
dialog.gm::backdrop { background: var(--g-scrim); backdrop-filter: blur(2px); }
dialog.gm[open] .gm-card { animation: g-rise var(--g-base) var(--g-ease) both; }
.gm-card { background: var(--g-card); border-radius: 22px; border: 1px solid var(--g-hair); box-shadow: var(--g-lift); overflow: hidden; }
.gm-hd { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0 18px; }
.gm-hd h2 { margin: 0; font-family: var(--g-serif); font-weight: 600; font-size: 1.4rem; margin-right: auto; }
.gm-x { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--g-line); background: var(--g-card-2); display: grid; place-items: center; cursor: pointer; color: var(--g-ink); }
.gm-x svg { width: 16px; height: 16px; }
.gm-bd { padding: 14px 18px 18px; display: grid; gap: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 1rem; line-height: 1.4; }
.steps li::before { counter-increment: st; content: counter(st); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ga-soft); color: var(--ga); font-family: var(--g-mono); font-weight: 700; font-size: .85rem; }
.steps li b { color: var(--g-ink); }
.gm-note { font-size: .82rem; color: var(--g-muted); line-height: 1.5; margin: 0; }
.stat4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat4 div { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--g-card-2); }
.stat4 b { display: block; font-family: var(--g-mono); font-weight: 700; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat4 span { font-family: var(--g-mono); font-size: .5rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g-muted); }
.dist { display: grid; gap: 5px; }
.dist div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; font-family: var(--g-mono); font-size: .62rem; font-weight: 700; color: var(--g-muted); }
.dist i { display: block; height: 22px; min-width: 26px; border-radius: 6px; background: var(--g-track); color: var(--g-ink); font-style: normal; font-family: var(--g-mono); font-size: .62rem; font-weight: 700; text-align: right; padding: 4px 8px; line-height: 14px; }
.dist i.on { background: var(--ga); color: var(--ga-ink); }
.glist { display: grid; gap: 8px; }
.glist a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--g-hair); background: var(--g-card-2); text-decoration: none; color: var(--g-ink); }
.glist a:hover { border-color: var(--nx); }
.glist a[aria-current="page"] { border-color: var(--nx); box-shadow: inset 0 0 0 1px var(--nx); }
.glist .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--nx); color: #fff; }
.glist .ic svg { width: 20px; height: 20px; }
.glist b { display: block; font-weight: 800; }
.glist span { font-size: .82rem; color: var(--g-ink-2); }
.glist .st { font-family: var(--g-mono); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); white-space: nowrap; }
.glist .st.dn { color: var(--g-right); }
@media (max-width: 560px) {
  dialog.gm { margin: auto auto 0; max-width: 100vw; }
  .gm-card { border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ---------- how it works (closed, at the bottom) */
.how { max-width: 760px; margin: 26px auto 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.how details { border-top: 1px solid var(--g-line); }
.how summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 900; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--g-ink-2); }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--g-line); font-family: var(--g-mono); font-size: .8rem; color: var(--ga); }
.how details[open] summary::before { content: "\2212"; }
.how .body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; padding: 4px 0 12px; }
.how h3 { margin: 0 0 4px; font-family: var(--g-serif); font-weight: 600; font-size: 1.05rem; }
.how p { margin: 0; color: var(--g-ink-2); font-size: .88rem; line-height: 1.6; }
.receipt { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: var(--g-mono); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.receipt .glyph { color: var(--hi-receipt, #b07f1e); font-size: .8rem; letter-spacing: 0; }
@media (max-width: 700px) { .how .body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); z-index: 90; background: #0d1f3c; color: #fff; border: 1px solid rgba(157,184,221,.26); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity var(--g-base) var(--g-ease), transform var(--g-base) var(--g-ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer (same slab as the rest of the site) */
.hi-foot { background: #0d1f3c; color: #dfe9f8; border-top: 3px solid #1f5fbf; font-family: var(--g-sans); position: relative; z-index: 1; }
.hi-foot a { color: #a8c2de; text-decoration: none; }
.hi-foot a:hover { color: #fff; }
.hi-foot-in { max-width: 1100px; margin: 0 auto; padding: 34px max(16px, env(safe-area-inset-right, 0px)) 22px max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(220px, 1.1fr) 2fr; gap: 2rem; border-bottom: 1px solid rgba(157,184,221,.26); }
.hi-foot-brand { display: flex; gap: .8rem; align-items: flex-start; }
.hi-foot-brand img { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 3px; }
.hi-foot-brand b { display: block; color: #fff; font-family: var(--g-serif); font-size: 1.3rem; font-weight: 600; margin-bottom: .4rem; }
.hi-foot-brand p { margin: 0; font-size: .78rem; line-height: 1.65; color: #a8c2de; max-width: 34ch; }
.hi-foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.hi-foot-cols h3 { margin: 0 0 .6rem; font-size: .56rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: #8ab8f2; }
.hi-foot-cols a { display: block; font-size: .7rem; font-weight: 700; padding: .22rem 0; }
.hi-foot-base { max-width: 1100px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 22px max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: .6rem; flex-wrap: wrap; font-family: var(--g-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: #a8c2de; }
@media (max-width: 900px) { .hi-foot-in { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .hi-foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- motion: geometry only, content visible on frame one */
@keyframes g-rise { from { transform: translateY(12px); } to { transform: none; } }
@keyframes g-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes g-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes g-flip { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes g-in-r { from { transform: translateX(26px); } to { transform: none; } }
.g-rise { animation: g-rise var(--g-slow) var(--g-ease) both; }
.g-pop { animation: g-pop var(--g-base) var(--g-ease) both; }
.g-shake { animation: g-shake 260ms var(--g-ease) both; }
.g-flip { animation: g-flip var(--g-slow) var(--g-ease) both; transform-origin: 50% 50%; }
.g-in-r { animation: g-in-r var(--g-base) var(--g-ease) both; }
.stagger > * { animation: g-rise var(--g-slow) var(--g-ease) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms; } .stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; } .stagger > *:nth-child(5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
