/* ==========================================================================
   Catch 4 - Stadium-broadcast plastic (shared world with Pokémon Guess Who)
   Radius rule: panels 20 / cards 14 / tiles 12 / inputs 10 / micro 6 / buttons pill / discs round
   Elevation ladder: ground -> panel (line + top highlight) -> card (solid offset + soft) -> floating
   Color roles: red = player one, gold = player two, blue = the rack, paper = live slots and primary
   actions, sky = controls and focus.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-wdth.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-wght.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink-950: #0a0f2c;
  --ink-900: #101a42;
  --ink-800: #182457;
  --ink-700: #23326f;
  --ink-600: #34478f;
  --line: rgba(190, 205, 255, 0.30);
  --line-strong: rgba(190, 205, 255, 0.42);
  --paper: #f5f7ff;
  --paper-2: #e3e8fb;
  --paper-3: #c9d2f2;
  --text: #f2f4ff;
  --text-2: #b9c3ea;
  --text-3: #8f9bd0;
  --ink-on-paper: #121a42;
  --ink-on-paper-2: #4a5690;

  --red: #ef3b4a;
  --red-deep: #b5202e;
  --red-soft: #ff8a94;
  --blue: #2f6bf5;
  --blue-deep: #1c46b4;
  --blue-soft: #8fb2ff;
  --gold: #ffcb05;
  --gold-deep: #cc9e00;
  --gold-soft: #ffe07a;
  --gold-ink: #3d2f00;
  --yes: #35d97c;
  --yes-deep: #178f4a;
  --no: #ff7a2f;
  --no-deep: #b84e12;
  --sky: var(--blue-soft);

  /* game identity bands on live slots */
  --za: #35d97c;
  --sv: #c59bff;
  --swsh: #5ed0e0;

  --r-panel: 20px;
  --r-card: 14px;
  --r-tile: 12px;
  --r-input: 10px;
  --r-micro: 6px;

  --font-display: 'Archivo', 'Arial Black', Impact, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --shadow-card: 0 5px 0 var(--paper-3), 0 12px 24px -8px rgba(4, 8, 40, 0.55);
  --shadow-panel: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 4px 0 #05081f;
  --shadow-float: 0 30px 70px -20px rgba(2, 5, 30, 0.8), 0 8px 0 rgba(4, 8, 40, 0.5);

  --p1: var(--red); --p1-deep: var(--red-deep); --p1-soft: var(--red-soft); --p1-ink: #fff5f6;
  --p2: var(--gold); --p2-deep: var(--gold-deep); --p2-soft: var(--gold-soft); --p2-ink: var(--gold-ink);

  --zoom-window: 0.26; /* must match WINDOW in data-build/crops.py */

  /* rack geometry: one square cell per slot. Overridden per view below. */
  --cols: 7; --rows: 6; --pitch: 84px; --rack-pad: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink-950);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(64, 90, 200, 0.35), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(47, 107, 245, 0.14), transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
::selection { background: var(--sky); color: var(--ink-950); }
[hidden] { display: none !important; }
a { color: var(--sky); }

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 850;
  font-stretch: 118%;
  letter-spacing: -0.01em;
  line-height: 0.95;
  text-transform: uppercase;
}
.display-tight { font-stretch: 100%; letter-spacing: -0.02em; }
.label {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 110%;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Boot ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; gap: 16px; text-align: center; color: var(--text-2); padding: 24px; }
.boot-mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: linear-gradient(90deg, var(--red) 50%, var(--gold) 50%); animation: boot-spin 1.1s var(--ease-in-out) infinite; }
@keyframes boot-spin { 0% { transform: rotate(0); } 50% { transform: rotate(180deg) scale(0.9); } 100% { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink-700);
  --btn-fg: var(--text);
  --btn-deep: var(--ink-950);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; text-decoration: none;
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 15px;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 4px 0 var(--btn-deep);
  transform: translateY(0);
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out), filter 160ms ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-deep); }
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.08); } }
.btn:disabled { --btn-bg: var(--ink-700); --btn-fg: var(--text-2); --btn-deep: var(--ink-950); cursor: not-allowed; filter: none; }
.btn-ghost:disabled { --btn-bg: transparent; opacity: 0.55; }
.btn-paper { --btn-bg: var(--paper); --btn-fg: var(--ink-on-paper); --btn-deep: var(--paper-3); }
.btn-red { --btn-bg: var(--red); --btn-fg: #fff5f6; --btn-deep: var(--red-deep); }
.btn-yellow { --btn-bg: var(--gold); --btn-fg: var(--gold-ink); --btn-deep: var(--gold-deep); }
.btn-yes { --btn-bg: var(--yes); --btn-fg: #06301a; --btn-deep: var(--yes-deep); }
.btn-no { --btn-bg: var(--no); --btn-fg: #2b1200; --btn-deep: var(--no-deep); }
.btn-ghost { --btn-bg: transparent; --btn-deep: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); }
.btn-ghost:active { box-shadow: inset 0 0 0 2px var(--line-strong); }
.btn-lg { min-height: 60px; padding: 0 30px; font-size: 19px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; box-shadow: 0 3px 0 var(--btn-deep); }
.btn-ghost.btn-sm, .btn-ghost.btn-sm:active { box-shadow: inset 0 0 0 2px var(--line-strong); }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0 4px; color: var(--text-3); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
.linkish:hover { color: var(--sky); }

/* ---------- Panels ---------- */
.panel {
  background: var(--ink-900);
  border: 2px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-panel);
}
.panel-pad { padding: 24px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 22px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field > .flabel { font-weight: 800; font-size: 14px; }
.field .help { font-size: 13px; color: var(--text-3); margin: 0; }
.input, select.input {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: var(--ink-950); border: 2px solid var(--line-strong); border-radius: var(--r-input);
  color: var(--text); font-weight: 700;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--sky); outline: none; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.switch { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: var(--ink-950); border: 2px solid var(--line); border-radius: var(--r-input); cursor: pointer; }
.switch:has(input:checked) { border-color: var(--sky); }
.switch .sw-text { display: grid; gap: 2px; }
.switch .sw-text b { font-size: 14px; }
.switch .sw-text span { font-size: 13px; color: var(--text-3); }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--ink-700); position: relative; flex: none; margin: 0; transition: background 160ms ease; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: transform 160ms var(--ease-out); }
.switch input:checked { background: var(--sky); }
.switch input:checked::after { transform: translateX(20px); background: var(--ink-950); }
.switch.sub { margin-left: 22px; }
.field.sub { margin-left: 22px; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.multi label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; background: var(--ink-950); border: 2px solid var(--line); border-radius: 999px; font-weight: 800; font-size: 13px; cursor: pointer; }
.multi label:has(input:checked) { border-color: var(--sky); color: var(--sky); }
.multi label:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.multi input { appearance: none; width: 0; height: 0; margin: 0; position: absolute; }
.settings-group { margin-bottom: 24px; }
.settings-group > .label { margin: 28px 0 12px; display: block; font-size: 20px; font-weight: 850; letter-spacing: 0; color: var(--text); font-stretch: 108%; }
.settings-group:first-child > .label { margin-top: 0; }
.settings-group.locked { opacity: 0.8; pointer-events: none; }
.poolcount { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-card); background: var(--ink-950); border: 2px solid var(--line); margin-bottom: 20px; }
.poolcount b { font-family: var(--font-display); font-weight: 850; font-stretch: 112%; font-size: 26px; line-height: 1; }
.poolcount span { font-size: 14px; color: var(--text-2); font-weight: 700; }
.poolcount.bad { border-color: var(--no); }
.poolcount.bad b { color: var(--no); }

/* ==========================================================================
   LOBBY
   ========================================================================== */
.lobby { max-width: 1240px; margin: 0 auto; padding: 32px 20px 60px; container-type: inline-size; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 8px 10px; border-radius: 999px; background: var(--ink-900); border: 2px solid var(--line); }
.topbar-room { font-weight: 800; color: var(--text-2); font-size: 14px; }
.topbar-room b { color: var(--paper); letter-spacing: 0.08em; }
.topbar-links { margin-left: auto; display: flex; gap: 6px; }
.player .topbar { margin-bottom: 0; }
.lobby-hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; margin-bottom: 28px; }
.lockup { display: grid; gap: 6px; }
.lockup .kicker { color: var(--text-2); font-family: var(--font-display); font-weight: 800; font-stretch: 110%; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.lockup h1 { margin: 0; font-size: clamp(44px, 13cqi, 104px); }
.lockup h1 .r { color: var(--red); }
.lockup h1 .y { color: var(--gold); }
.lockup p { margin: 8px 0 0; max-width: 58ch; color: var(--text-2); font-size: 17px; }
.mini-rack { --pitch: 30px; width: calc(var(--pitch) * 7 + 20px); padding: 10px; border-radius: 16px 16px 8px 8px; background: var(--blue); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28), 0 8px 0 var(--blue-deep), 0 26px 40px -18px rgba(2, 5, 30, 0.8); display: grid; grid-template-columns: repeat(7, var(--pitch)); position: relative; margin-bottom: 20px; }
.mini-rack::after { content: ''; position: absolute; left: -12px; right: -12px; bottom: -20px; height: 14px; border-radius: 6px; background: var(--blue-deep); box-shadow: 0 5px 0 #122f80; }
.mini-rack i { width: var(--pitch); height: var(--pitch); display: grid; place-items: center; }
.mini-rack i::before { content: ''; width: 78%; height: 78%; border-radius: 50%; background: var(--ink-950); box-shadow: inset 0 3px 0 rgba(4, 8, 40, 0.6); }
.mini-rack i.r::before { background: var(--red); box-shadow: inset 0 -3px 0 var(--red-deep); }
.mini-rack i.y::before { background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-deep); }
.mini-rack i.l::before { background: var(--paper); box-shadow: inset 0 -3px 0 var(--paper-3); }

.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lobby-grid > .sticky { position: sticky; top: 16px; }
.room-code { font-family: var(--font-display); font-weight: 850; font-stretch: 118%; font-size: 64px; letter-spacing: 0.08em; line-height: 1; color: var(--paper); }
.room-code .btn { vertical-align: middle; margin-left: 10px; letter-spacing: 0.02em; }
.link-cards { display: grid; gap: 12px; }
.link-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-card); background: var(--ink-950); border: 2px solid var(--line); }
.link-card .swatch { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 19px; }
.link-card.p1 .swatch { background: var(--red); color: var(--p1-ink); box-shadow: inset 0 -4px 0 var(--red-deep); }
.link-card.p2 .swatch { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 -4px 0 var(--gold-deep); }
.link-card.spec .swatch { background: var(--blue-deep); color: var(--text); box-shadow: inset 0 -4px 0 #122f80; font-size: 15px; }
.link-card b { display: block; font-size: 15px; }
.link-card span { display: block; font-size: 13px; color: var(--text-3); }
.link-card .actions { display: flex; gap: 6px; }
.qr-row { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 12px; margin-top: 12px; }
.qr { background: var(--paper); border-radius: 12px; padding: 8px; display: grid; place-items: center; gap: 4px; }
.qr img { width: 100%; image-rendering: pixelated; }
.qr small { color: var(--ink-on-paper-2); font-weight: 800; font-size: 12px; text-align: center; line-height: 1.2; }
.qr-row.masked .qr { background: var(--ink-950); border: 2px dashed var(--line); min-height: 120px; }
.qr-row.masked .qr img { display: none; }
.qr-row.masked .qr small { color: var(--text-3); }
.presence { display: grid; gap: 8px; margin-top: 16px; }
.presence-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-card); background: var(--ink-950); border: 2px solid var(--line); }
.presence-row .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ink-600); flex: none; }
.presence-row.p1.joined .dot { background: var(--red); }
.presence-row.p2.joined .dot { background: var(--gold); }
.presence-row.ready .dot { box-shadow: 0 0 0 4px var(--paper); }
.presence-row b { flex: 1; }
.footer { margin-top: 40px; padding-top: 16px; border-top: 2px solid var(--line); color: var(--text-3); font-size: 13px; max-width: 86ch; }
.rules-card { display: grid; gap: 8px; font-size: 15px; color: var(--text-2); margin: 0; padding-left: 22px; max-width: 78ch; }
.rules-card li { margin-bottom: 4px; }
.rules-card b { color: var(--text); }
.hint { font-size: 14px; font-weight: 800; color: var(--text-2); }
.hint.warn { color: var(--no); }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.needs li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-weight: 700; font-size: 14px; color: var(--text); }
.needs .badge { margin-top: 1px; }
.needs-rules { margin: 0; font-size: 14px; }

/* ==========================================================================
   SCOREBUG
   ========================================================================== */
.scorebug {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch;
  border-radius: var(--r-panel); overflow: hidden;
  background: var(--ink-900); border: 2px solid var(--line); box-shadow: var(--shadow-panel);
}
.scorebug .side { display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-width: 0; position: relative; }
.scorebug .side.p1 { background: var(--red-deep); color: var(--p1-ink); }
.scorebug .side.p2 { background: var(--gold); color: var(--gold-ink); flex-direction: row-reverse; text-align: right; }
.scorebug .who { display: grid; gap: 3px; min-width: 0; }
.scorebug .who .name { font-family: var(--font-display); font-weight: 850; font-stretch: 112%; font-size: 24px; text-transform: uppercase; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scorebug .who .sub { font-size: 14px; font-weight: 800; opacity: 0.9; white-space: nowrap; }
.scorebug .score { font-family: var(--font-display); font-weight: 900; font-stretch: 120%; font-size: 40px; line-height: 1; margin-left: auto; white-space: nowrap; }
.scorebug .score small { font-size: 0.5em; font-stretch: 100%; opacity: 0.85; margin-left: 0.08em; }
/* match point: the line under the name becomes the loudest thing on that side */
.scorebug .side.threat .sub { font-family: var(--font-display); font-weight: 900; font-stretch: 110%; text-transform: uppercase; opacity: 1; font-size: 18px; animation: threat 700ms ease-in-out infinite alternate; }
.scorebug .side.p2 .score { margin-left: 0; margin-right: auto; }
.scorebug .center { display: grid; place-items: center; align-content: center; gap: 4px; padding: 10px 22px; background: var(--ink-950); border-left: 2px solid var(--line); border-right: 2px solid var(--line); min-width: 200px; text-align: center; }
.scorebug .center .round { font-family: var(--font-display); font-weight: 850; font-stretch: 118%; font-size: 18px; text-transform: uppercase; color: var(--paper); }
.scorebug .center .state { font-size: 14px; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.scorebug .clock { font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.scorebug .clock.hot { color: var(--no); }
.scorebug .conn { font-size: 12px; font-weight: 800; color: var(--no); }
.scorebug .conn:empty { display: none; }
/* ==========================================================================
   THE RACK
   Back layer: one square cell per slot (the buttons). Face layer: the blue plate with holes punched
   by a repeating mask, so a falling disc shows through every hole it passes.
   ========================================================================== */
.rack-wrap { display: grid; gap: 0; justify-items: center; }
.chutes { display: grid; grid-template-columns: repeat(var(--cols), var(--pitch)); padding: 0 var(--rack-pad); margin-bottom: 6px; }
.chute { height: 30px; display: grid; place-items: center; border: 0; background: none; padding: 0; font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--text-3); }
.chute .cn { display: grid; place-items: center; min-width: 26px; height: 24px; border-radius: 999px; transition: background 160ms ease, color 160ms ease; }
.chute .ct { display: none; }
.chute.sel .cn { background: var(--paper); color: var(--ink-on-paper); }
.chute.full { opacity: 0.4; cursor: default; }
.rack {
  position: relative; padding: var(--rack-pad); padding-bottom: calc(var(--rack-pad) + 4px);
  border-radius: var(--r-panel) var(--r-panel) var(--r-tile) var(--r-tile);
  background: var(--blue);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28), 0 12px 0 var(--blue-deep), 0 36px 50px -22px rgba(2, 5, 30, 0.8);
  margin-bottom: 44px;
}
.rack::after { content: ''; position: absolute; left: -20px; right: -20px; bottom: -32px; height: 22px; border-radius: var(--r-micro); background: var(--blue-deep); box-shadow: 0 7px 0 #122f80; }
.rack-well { position: relative; width: calc(var(--pitch) * var(--cols)); height: calc(var(--pitch) * var(--rows)); overflow: hidden; background: var(--blue); }
.rack-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), var(--pitch)); grid-template-rows: repeat(var(--rows), var(--pitch)); }
.rack-face { position: absolute; inset: 0; pointer-events: none; background: var(--blue);
  -webkit-mask: radial-gradient(circle closest-side at 50% 50%, transparent 0 84%, #000 86%) 0 0 / var(--pitch) var(--pitch);
  mask: radial-gradient(circle closest-side at 50% 50%, transparent 0 84%, #000 86%) 0 0 / var(--pitch) var(--pitch);
}
.rack-rim { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle closest-side at 50% 48%, transparent 0 82%, rgba(4, 8, 40, 0.5) 84% 90%, rgba(255, 255, 255, 0.18) 92% 95%, transparent 97%) 0 0 / var(--pitch) var(--pitch);
}
.hole { position: relative; width: var(--pitch); height: var(--pitch); border: 0; padding: 0; background: transparent; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; cursor: default; }
.hole::before { content: ''; position: absolute; inset: 5%; border-radius: 50%; background: var(--ink-950); }
.hole:focus-visible { outline: none; }
.hole:focus-visible .slot, .hole:focus-visible .disc { box-shadow: inset 0 0 0 5px var(--sky); }
.hole.live { cursor: pointer; }
.hole .slot, .hole .disc { width: 94%; height: 94%; border-radius: 50%; display: grid; place-items: center; position: relative; overflow: hidden; }

/* live slot: a paper token carrying the clue type and the game it is locked to */
.slot { background: var(--paper); color: var(--ink-on-paper); align-content: center; gap: 0; box-shadow: inset 0 -5px 0 var(--paper-3); transition: transform 160ms var(--ease-out); }
.slot .tag { font-family: var(--font-display); font-weight: 900; font-stretch: 88%; font-size: max(12px, calc(var(--pitch) * 0.21)); letter-spacing: 0; line-height: 1; margin-top: -10%; }
.slot .game { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; display: grid; place-items: start center; padding-top: 4%; font-family: var(--font-display); font-weight: 900; font-size: max(12px, calc(var(--pitch) * 0.16)); line-height: 1; color: var(--ink-on-paper); }
.slot .game.za { background: var(--za); } .slot .game.sv { background: var(--sv); } .slot .game.swsh { background: var(--swsh); }
.slot .pips { position: absolute; top: 13%; display: flex; gap: 6%; width: 34%; justify-content: center; }
.slot .pips i { width: 26%; aspect-ratio: 1; border-radius: 50%; background: var(--paper-3); }
.slot .pips.t1 i:nth-child(-n+1), .slot .pips.t2 i:nth-child(-n+2), .slot .pips.t3 i { background: var(--ink-on-paper); }
@media (hover: hover) and (pointer: fine) { .hole.live:hover .slot { transform: scale(1.04); } }
.hole.live:active .slot { transform: scale(0.96); }
.hole.sel .slot { box-shadow: inset 0 0 0 calc(var(--pitch) * 0.07) var(--ink-on-paper), inset 0 -5px 0 var(--paper-3); }
.hole.known .slot .tag { color: var(--ink-on-paper); }
.hole.frozen .slot { background: var(--ink-700); color: var(--no); box-shadow: inset 0 -5px 0 var(--ink-950); }
.hole.frozen .slot .game, .hole.frozen .slot .pips { display: none; }
.hole.frozen .slot .tag { margin-top: 0; font-size: max(12px, calc(var(--pitch) * 0.22)); font-variant-numeric: tabular-nums; }
.hole.frozen.sel .slot { box-shadow: inset 0 0 0 calc(var(--pitch) * 0.07) var(--no); }
/* match point: this slot would finish a line. A dark keyline keeps the ring readable on paper. */
.hole.threat-p1 .slot::after, .hole.threat-p2 .slot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 calc(var(--pitch) * 0.035) var(--ink-on-paper), inset 0 0 0 calc(var(--pitch) * 0.13) var(--tc); animation: threat 700ms ease-in-out infinite alternate; pointer-events: none; }
.hole.threat-p1 .slot::after { --tc: var(--red); }
.hole.threat-p2 .slot::after { --tc: var(--gold); }
.hole.threat-p1.threat-p2 .slot::after { box-shadow: inset 0 0 0 calc(var(--pitch) * 0.035) var(--ink-on-paper), inset 0 0 0 calc(var(--pitch) * 0.09) var(--red), inset 0 0 0 calc(var(--pitch) * 0.15) var(--gold); }
.hole.threat-p1 .slot .pips, .hole.threat-p2 .slot .pips { display: none; }
@keyframes threat { from { opacity: 0.75; } to { opacity: 1; } }
/* broadcast only: who is looking at this slot, and who is locked out of it */
.hole .aim { position: absolute; top: 4%; width: 26%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink-950); z-index: 2; }
.hole .aim.p1 { left: 6%; background: var(--red); }
.hole .aim.p2 { right: 6%; background: var(--gold); }
.hole .lockb { position: absolute; bottom: 2%; z-index: 2; padding: 2px 7px; border-radius: 999px; border: 3px solid var(--ink-950); font-family: var(--font-display); font-weight: 900; font-size: calc(var(--pitch) * 0.15); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hole .lockb.p1 { left: 0; background: var(--red-deep); color: var(--p1-ink); }
.hole .lockb.p2 { right: 0; background: var(--gold); color: var(--gold-ink); }

/* claimed disc */
.disc { background: var(--dc); box-shadow: inset 0 calc(var(--pitch) * -0.07) 0 var(--dd), inset 0 calc(var(--pitch) * 0.04) 0 rgba(255, 255, 255, 0.32); will-change: transform; }
.disc.p1 { --dc: var(--red); --dd: var(--red-deep); }
.disc.p2 { --dc: var(--gold); --dd: var(--gold-deep); }
.disc img { width: 80%; height: 80%; object-fit: contain; margin-top: -4%;
  /* a paper keyline all the way round, so red art reads on a red disc and yellow art on a yellow one */
  --k: max(1px, calc(var(--pitch) * 0.018));
  filter: drop-shadow(var(--k) 0 0 var(--paper)) drop-shadow(calc(var(--k) * -1) 0 0 var(--paper)) drop-shadow(0 var(--k) 0 var(--paper)) drop-shadow(0 calc(var(--k) * -1) 0 var(--paper)); }
.disc.shiny img { width: 66%; height: 66%; margin-top: -16%; }
.disc.shiny::after { content: 'SHINY'; position: absolute; bottom: 8%; font-family: var(--font-display); font-weight: 900; font-size: max(12px, calc(var(--pitch) * 0.14)); letter-spacing: 0.04em; color: var(--ink-on-paper); background: var(--paper); padding: 1px 7px; border-radius: 999px; }
.rack.over .disc { filter: brightness(0.62); }
.rack.over .hole.win .disc { filter: none; animation: win-pulse 700ms ease-in-out infinite alternate; }
.rack.over .hole.win .disc::before { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 calc(var(--pitch) * 0.08) var(--paper); }
@keyframes win-pulse { from { transform: scale(0.94); } to { transform: scale(1.03); } }
/* after the game every unclaimed slot shows what it was hiding */
.reveal { width: 94%; height: 94%; border-radius: 50%; background: var(--ink-600); display: grid; place-items: center; position: relative; }
.reveal img { width: 80%; height: 80%; object-fit: contain; }

/* ==========================================================================
   CLUE CARD (player panel and broadcast hunt card share this)
   ========================================================================== */
.clue { display: grid; gap: 12px; }
.clue-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-family: var(--font-display); font-weight: 850; font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1; white-space: nowrap; background: var(--ink-700); color: var(--text); }
.badge.za { background: var(--za); color: #06301a; } .badge.sv { background: var(--sv); color: #2a1150; } .badge.swsh { background: var(--swsh); color: #062f36; }
.badge.rate { gap: 5px; }
.badge.rate i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-950); }
.badge.rate i.on { background: var(--paper); }
.clue-main { border-radius: var(--r-card); background: var(--paper); color: var(--ink-on-paper); box-shadow: var(--shadow-card); padding: 16px; display: grid; gap: 10px; }
.clue-main .kind { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-on-paper-2); }
.zoom { width: 100%; max-width: 220px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--r-tile); background-color: var(--paper-2); background-repeat: no-repeat; }
.sil { width: 100%; max-width: 240px; aspect-ratio: 1; margin: 0 auto; object-fit: contain; filter: brightness(0); opacity: 0.86; }
.dex { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; text-wrap: pretty; }
.dex .redact { background: var(--ink-on-paper); color: var(--paper); border-radius: var(--r-micro); padding: 0 8px; font-weight: 800; white-space: nowrap; }
.dex-src { font-size: 13px; font-weight: 800; color: var(--ink-on-paper-2); }
.stats { display: grid; grid-template-columns: auto 1fr auto; gap: 7px 10px; align-items: center; font-weight: 800; font-size: 14px; }
.stats .bar { height: 14px; border-radius: var(--r-micro); background: var(--ink-on-paper); min-width: 3px; }
.stats .v { font-family: var(--font-display); font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.stats .total { grid-column: 1 / -1; display: flex; justify-content: space-between; padding-top: 8px; margin-top: 2px; border-top: 2px solid var(--paper-3); font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 14px; }
.notes { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 16px; font-weight: 700; }
.notes dt { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-on-paper-2); align-self: center; }
.notes dd { margin: 0; font-weight: 800; }
.abil { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.abil li { font-family: var(--font-display); font-weight: 850; font-stretch: 108%; font-size: 22px; text-transform: uppercase; line-height: 1.05; }
.abil li small { display: block; font-family: var(--font-body); font-weight: 800; font-size: 12px; letter-spacing: 0.04em; color: var(--ink-on-paper-2); }
.cry { display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.types { display: flex; gap: 6px; flex-wrap: wrap; }
.type { display: inline-block; padding: 4px 11px; border-radius: 999px; font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-on-paper); background: var(--tc, var(--paper-3)); }
.type[data-t="ghost"], .type[data-t="dark"], .type[data-t="dragon"], .type[data-t="fighting"], .type[data-t="poison"] { color: var(--text); }
.hints { display: grid; gap: 8px; }
.hint-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-input); background: var(--ink-950); border: 2px solid var(--line); font-weight: 800; }
.hint-row .hk { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.hint-row .sil-s { width: 72px; height: 72px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9; }
.hint-row .letters { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: 0.16em; word-spacing: 0.3em; }
.hint-next { font-size: 13px; font-weight: 800; color: var(--text-3); padding: 2px 4px; }
.hint-next b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   PLAYER VIEW
   ========================================================================== */
.player { max-width: 1320px; margin: 0 auto; padding: 16px 16px 60px; display: grid; gap: 16px; }
.play { display: grid; grid-template-columns: auto minmax(320px, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "cols side" "rack side" "feed side"; gap: 0 24px; align-items: start; }
.play > #chuteshost { grid-area: cols; justify-self: center; }
.play > #rackhost { grid-area: rack; }
.play > .feedpanel { margin-top: 20px; }
.play > .side { grid-area: side; }
.play > .feedpanel { grid-area: feed; align-self: start; }
/* the rack fits the window both ways: never wider than the column, never taller than the screen */
.play { --pitch: clamp(44px, min(calc((100vw - 32px - 28px - 24px - 360px) / var(--cols)), calc((100dvh - 330px) / var(--rows))), 92px); }
.side { display: grid; gap: 16px; min-width: 0; }
.slotpanel { padding: 18px; display: grid; gap: 14px; }
.slotpanel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.slotpanel-head h2 { margin: 0; font-size: 20px; }
.catch { display: grid; gap: 10px; padding-top: 14px; border-top: 2px solid var(--line); }
.catch label { font-weight: 800; font-size: 15px; }
.results { display: grid; gap: 6px; }
.result { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--r-input); border: 2px solid var(--line); background: var(--ink-950); text-align: left; font-weight: 800; transition: transform 120ms var(--ease-out), border-color 120ms ease; }
.result img { width: 44px; height: 44px; object-fit: contain; }
.result:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .result:hover { border-color: var(--sky); } }
.result.sel { border-color: var(--paper); background: var(--paper); color: var(--ink-on-paper); }
.results-empty { font-size: 14px; font-weight: 700; color: var(--text-3); padding: 4px 2px; }
.lockout { display: grid; gap: 4px; padding: 14px; border-radius: var(--r-card); background: var(--ink-800); border: 2px solid var(--no); text-align: center; }
.lockout b { font-family: var(--font-display); font-weight: 900; font-stretch: 112%; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--no); }
.lockout span { font-weight: 800; font-size: 14px; color: var(--text-2); }
.knownbox { margin-bottom: 8px; display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-card); background: var(--paper); color: var(--ink-on-paper); box-shadow: var(--shadow-card); }
.knownbox img { width: 88px; height: 88px; object-fit: contain; }
.knownbox .big { font-family: var(--font-display); font-weight: 850; font-stretch: 112%; font-size: 24px; text-transform: uppercase; line-height: 1; }
.knownbox p { margin: 4px 0 0; font-weight: 700; color: var(--ink-on-paper-2); font-size: 14px; }
.extras { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-row { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-card); background: var(--ink-800); border: 2px solid var(--line-strong); }
.confirm-row p { margin: 0; font-weight: 700; font-size: 14px; color: var(--text-2); }
.confirm-row .row { display: flex; gap: 8px; flex-wrap: wrap; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 16px; border-radius: var(--r-input); font-family: var(--font-display); font-weight: 850; font-stretch: 108%; font-size: 16px; text-transform: uppercase; background: var(--ink-900); border: 2px solid var(--line); text-align: center; }
.status-line.go { color: var(--paper); border-color: var(--paper); }
.status-line.danger { background: var(--no); color: #2b1200; border-color: transparent; }
.bounty { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-card); background: var(--paper); color: var(--ink-on-paper); box-shadow: var(--shadow-card); }
.bounty img { width: 72px; height: 72px; object-fit: contain; }
.bounty .bk { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-on-paper-2); }
.bounty .bn { font-family: var(--font-display); font-weight: 850; font-stretch: 110%; font-size: 20px; text-transform: uppercase; line-height: 1.05; }
.bounty .btn { --btn-bg: var(--ink-on-paper); --btn-fg: var(--paper); --btn-deep: #05081f; }

/* Catch feed */
.feed { display: grid; gap: 0; align-content: start; }
.feed-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 2px solid var(--line); }
.feed-item:first-child { border-top: 0; padding-top: 2px; }
.feed-item .fi { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-700); font-family: var(--font-display); font-weight: 900; font-size: 12px; color: var(--text); overflow: hidden; }
.feed-item .fi.p1 { background: var(--red); color: var(--p1-ink); } .feed-item .fi.p2 { background: var(--gold); color: var(--gold-ink); }
.feed-item .fi.p1.txt, .ticker .fi.p1.txt { background: var(--red-deep); }
.feed-item .fi img { width: 86%; height: 86%; object-fit: contain; }
.feed-item .by { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.feed-item .by.p1 { color: var(--red-soft); } .feed-item .by.p2 { color: var(--gold-soft); }
.feed-item .q { font-weight: 800; font-size: 15px; }
.feed-item .where { font-family: var(--font-display); font-weight: 900; font-size: 12px; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.feed-empty { color: var(--text-3); font-weight: 700; padding: 18px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r-card); }

/* Game-over card (players) */
.gameover { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(6, 9, 34, 0.92); animation: fade-in 300ms ease 1700ms both; }
.gameover.still, .gameover.still .card { animation: none; }
.gameover .row.col { flex-direction: column; }
.gameover .card { width: min(680px, 100%); padding: 26px; border-radius: var(--r-panel); background: var(--ink-900); border: 2px solid var(--line-strong); box-shadow: var(--shadow-float); display: grid; gap: 16px; text-align: center; animation: pop-in 420ms var(--ease-out) 1700ms both; }
.gameover h2 { margin: 0; font-size: clamp(32px, 4.6vw, 54px); text-wrap: balance; }
.gameover h2.p1 { color: var(--red-soft); }
.gameover h2.p2 { color: var(--gold); }
.gameover .why { color: var(--text-2); font-weight: 800; font-size: 16px; }
.gameover .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ==========================================================================
   SPECTATOR (broadcast, 1920x1080 stage scaled to fit)
   ========================================================================== */
.spec-root { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; background: var(--ink-950); }
.stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 1920px; height: 1080px; transform-origin: center; display: grid; grid-template-rows: auto 1fr; gap: 20px; padding: 24px 32px 28px; }
.stage .scorebug .side { padding: 14px 20px; }
.stage .scorebug .side.p1 { background: var(--red); }
.stage .scorebug .who .name { font-size: 36px; }
.stage .scorebug .who .sub { font-size: 21px; }
.stage .scorebug .score { font-size: 60px; }
.stage .scorebug .center { min-width: 300px; }
.stage .scorebug .center .round { font-size: 22px; }
.stage .scorebug .center .state { font-size: 24px; color: var(--text); }
.stage .scorebug .side.threat .sub { font-size: 32px; }
.stage .scorebug .clock { font-size: 40px; }
.stage-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; min-height: 0; align-items: start; }
.stage-center { display: grid; justify-items: center; gap: 0; }
.stage { --pitch: 112px; --rack-pad: 18px; }
.stage .rack { margin-bottom: 46px; }
.stage .chutes { display: none; }
.stage .rack-rim { background-size: var(--pitch) var(--pitch); }
.ticker { width: 100%; min-height: 76px; display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 10px 20px; border-radius: var(--r-panel); background: var(--ink-900); border: 2px solid var(--line); box-shadow: var(--shadow-panel); }
.ticker .fi { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--ink-700); font-family: var(--font-display); font-weight: 900; font-size: 14px; }
.ticker .fi.p1 { background: var(--red); color: var(--p1-ink); } .ticker .fi.p2 { background: var(--gold); color: var(--gold-ink); }
.ticker .fi img { width: 86%; height: 86%; object-fit: contain; }
.ticker .tt { font-family: var(--font-display); font-weight: 850; font-stretch: 108%; font-size: 26px; text-transform: uppercase; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .tt .p1 { color: var(--red-soft); } .ticker .tt .p2 { color: var(--gold); }
.ticker .ts { font-weight: 800; font-size: 22px; color: var(--text-2); white-space: nowrap; }
.hunt { --tray: var(--ink-700); --tray-deep: var(--ink-950); --tray-ink: var(--text); border-radius: var(--r-panel); padding: 16px; background: var(--tray); color: var(--tray-ink); box-shadow: 0 10px 0 var(--tray-deep), 0 30px 50px -20px rgba(2, 5, 30, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.22); display: grid; gap: 14px; align-content: start; min-width: 0; }
.hunt.p1 { --tray: var(--red); --tray-deep: var(--red-deep); --tray-ink: var(--p1-ink); }
.hunt.p2 { --tray: var(--gold); --tray-deep: var(--gold-deep); --tray-ink: var(--gold-ink); }
.hunt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hunt-head .hname { font-family: var(--font-display); font-weight: 850; font-stretch: 114%; font-size: 28px; text-transform: uppercase; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hunt-head .hstat { font-family: var(--font-display); font-weight: 900; font-size: 18px; text-transform: uppercase; background: rgba(4, 8, 40, 0.3); color: var(--text); padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.hunt.p2 .hunt-head .hstat { background: rgba(61, 47, 0, 0.82); }
.hunt.p2 .hunt-idle { background: rgba(61, 47, 0, 0.14); }
.hunt.won .hunt-idle { font-size: 72px; font-stretch: 118%; padding: 48px 18px 54px; background: var(--paper); color: var(--ink-on-paper); box-shadow: 0 6px 0 var(--tray-deep); }
.hunt-now { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.1; }
.hunt .clue-main { padding: 18px; box-shadow: 0 6px 0 var(--tray-deep), 0 12px 24px -8px rgba(4, 8, 40, 0.55); }
.hunt .clue-main .kind { font-size: 17px; }
.hunt .badge { font-size: 17px; padding: 7px 14px; }
.hunt .badge.rate i { width: 11px; height: 11px; }
.hunt .dex { font-size: 26px; line-height: 1.32; }
.hunt .dex-src { font-size: 18px; }
.hunt .zoom { max-width: 280px; }
.hunt .sil { max-width: 300px; }
/* once hints are out the first clue steps back, so the whole card stays inside the 1080 frame */
.hunt:has(.hint-row) .zoom, .hunt:has(.hint-row) .sil { max-width: 180px; }
.hunt:has(.hint-row) .dex { font-size: 22px; }
.hunt .hint-row .sil-s { width: 60px; height: 60px; }
.hunt .hint-row .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hunt .stats { font-size: 21px; gap: 9px 12px; }
.hunt .stats .bar { height: 20px; }
.hunt .stats .total { font-size: 21px; }
.hunt .notes { font-size: 23px; gap: 10px 18px; }
.hunt .notes dt { font-size: 18px; }
.hunt .abil li { font-size: 32px; }
.hunt .abil li small { font-size: 17px; }
.hunt .type { font-size: 17px; padding: 6px 14px; }
.hunt .hints { gap: 8px; }
.hunt .hint-row { grid-template-columns: 150px 1fr; background: rgba(4, 8, 40, 0.84); border: 0; color: var(--text); font-size: 20px; padding: 11px 16px; }
.hunt .hint-row .hk { font-size: 18px; color: var(--text-2); }
.hunt .hint-row .letters { font-size: 26px; }
.hunt .hint-next { font-size: 20px; color: inherit; }
.hunt .hint-next b { color: inherit; }
.hunt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hunt-chips .chip { font-family: var(--font-display); font-weight: 900; font-size: 18px; text-transform: uppercase; background: rgba(4, 8, 40, 0.84); color: var(--text); padding: 7px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hunt-idle { padding: 30px 18px; border-radius: var(--r-card); background: rgba(4, 8, 40, 0.2); font-family: var(--font-display); font-weight: 850; font-size: 24px; text-transform: uppercase; text-align: center; line-height: 1.15; }
.hunt .answer { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 8px 14px; border-radius: var(--r-card); background: rgba(4, 8, 40, 0.84); color: var(--text); font-family: var(--font-display); font-weight: 850; font-size: 24px; text-transform: uppercase; }
.hunt .answer img { width: 64px; height: 64px; object-fit: contain; }
.spec-help { position: fixed; right: 14px; bottom: 12px; font-size: 12px; color: var(--text-3); font-weight: 800; opacity: 0; z-index: 5; transition: opacity 200ms ease; }
.spec-help.show, .spec-help:focus-within { opacity: 1; }
.spec-root.clear, body.clear { background: transparent; background-image: none; }
.spec-help kbd { font-family: var(--font-display); background: var(--ink-800); padding: 2px 6px; border-radius: 6px; margin-right: 2px; }
.spec-help a { color: var(--text-2); margin-left: 8px; }
.stage-wait { grid-column: 1 / -1; display: grid; place-items: center; align-content: center; gap: 18px; text-align: center; height: 100%; }
.stage-wait h2 { margin: 0; font-size: 84px; }
.stage-wait p { margin: 0; font-size: 30px; font-weight: 800; color: var(--text-2); }

/* Stamps, banners, toasts (authored moments) */
.stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1.25); pointer-events: none; z-index: 45; font-family: var(--font-display); font-weight: 900; font-stretch: 122%; font-size: 130px; line-height: 1; text-transform: uppercase; padding: 10px 50px 18px; border-radius: 20px; border: 10px solid currentColor; opacity: 0; filter: blur(10px); animation: stamp 1500ms var(--ease-out) forwards; box-shadow: var(--shadow-float); white-space: nowrap; }
.stamp.p1 { color: var(--p1-ink); background: var(--red); border-color: var(--red-deep); }
.stamp.p2 { color: var(--gold-ink); background: var(--gold); border-color: #7a5d00; }
.stamp.wrong { color: #2b1200; background: var(--no); border-color: #7a2f06; }
.stamp.right { color: #06301a; background: var(--yes); border-color: #0d5c2f; }
.stamp.neutral { color: var(--text); background: var(--ink-700); border-color: var(--ink-950); }
.stamp.small { font-size: 64px; border-width: 7px; padding: 8px 30px 13px; position: fixed; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3) rotate(-6deg); filter: blur(10px); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); filter: blur(0); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.96) rotate(-3deg); }
}
.layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.layer-toast { display: grid; align-content: end; justify-items: center; gap: 8px; padding: 0 16px 24px; z-index: 60; }
.toast { pointer-events: auto; max-width: 560px; padding: 12px 18px; border-radius: var(--r-card); background: var(--paper); color: var(--ink-on-paper); font-weight: 800; box-shadow: var(--shadow-float); animation: toast-in 240ms var(--ease-out); }
.toast.err { background: var(--no); color: #2b1200; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.banner { position: absolute; left: 0; right: 0; top: 40%; transform: translateY(-50%); display: grid; justify-items: center; }
.banner .band { max-width: 100vw; white-space: nowrap; overflow: hidden; padding: 16px 5vw 22px; font-family: var(--font-display); font-weight: 900; font-stretch: 122%; font-size: min(clamp(28px, 5.2vw, 104px), calc(88vw / (var(--len, 12) * 0.86))); line-height: 1; text-transform: uppercase; color: var(--text); text-shadow: 0 0.06em 0 rgba(4, 8, 40, 0.4); clip-path: inset(0 100% 0 0); animation: band 1400ms var(--ease-in-out) forwards; box-shadow: var(--shadow-float); }
.banner .band.p1 { background: var(--red); }
.banner .band.p2 { background: var(--gold); color: var(--gold-ink); text-shadow: none; }
.banner .band.paper { background: var(--paper); color: var(--ink-on-paper); text-shadow: none; }
.banner .band.blue { background: var(--blue); }
.banner .band.long { animation-duration: 3200ms; animation-name: band-long; }
@keyframes band-long {
  0% { clip-path: inset(0 100% 0 0); }
  12% { clip-path: inset(0 0 0 0); }
  90% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 100%); }
}
@keyframes band {
  0% { clip-path: inset(0 100% 0 0); }
  25% { clip-path: inset(0 0 0 0); }
  78% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 100%); }
}
.confetti-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 55; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-hero { grid-template-columns: 1fr; }
  .mini-rack { display: none; }
  .play { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "cols" "rack" "side" "feed"; justify-items: center; gap: 0; }
  .play > .side { margin-top: 16px; }
  /* The column strip becomes a switcher pinned to the top: each column shows its clue type, its game colour,
     a lockout timer and the match-point ring, so the rack can scroll away without losing the board. */
  .play > #chuteshost { position: sticky; top: 0; z-index: 20; }
  .chutes { margin: 0 0 8px; padding: 6px var(--rack-pad); width: calc(var(--pitch) * var(--cols) + var(--rack-pad) * 2); background: var(--ink-950); border-radius: 0 0 var(--r-tile) var(--r-tile); box-shadow: 0 6px 0 rgba(4, 8, 40, 0.5); }
  .chute { height: 46px; grid-template-rows: auto auto; align-content: center; gap: 2px; border-radius: var(--r-input); border-bottom: 4px solid transparent; color: var(--text-2); }
  .chute .cn { min-width: 0; height: auto; font-size: 13px; background: none !important; color: inherit !important; }
  .chute .ct { display: block; font-size: 12px; font-stretch: 80%; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
  .chute[data-g="za"] { border-bottom-color: var(--za); } .chute[data-g="sv"] { border-bottom-color: var(--sv); } .chute[data-g="swsh"] { border-bottom-color: var(--swsh); }
  .chute.sel { background: var(--paper); color: var(--ink-on-paper-2); }
  .chute.sel .ct { color: var(--ink-on-paper); }
  .chute.frozen .ct { color: var(--no); }
  .chute.threat { box-shadow: inset 0 0 0 3px var(--no); }
  .status-line.danger { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: var(--shadow-float); }
  .player:has(.status-line.danger) { padding-bottom: 120px; }
  .play > .feedpanel { width: 100%; max-width: 640px; }
  .lobby-grid > .sticky { position: static; }
  .play { --pitch: clamp(40px, min(calc((100vw - 32px - 28px) / var(--cols)), calc((100dvh - 150px) / var(--rows))), 84px); }
  .side { width: 100%; max-width: 640px; }
}
@media (max-width: 720px) {
  .player { padding: 10px 10px 60px; gap: 12px; }
  .play { --rack-pad: 8px; --pitch: clamp(38px, min(calc((100vw - 20px - 16px) / var(--cols)), calc((100dvh - 130px) / var(--rows))), 84px); }
  .player.in-play .topbar { display: none; }
  .play .rack { border-radius: 18px 18px 10px 10px; margin-bottom: 34px; }
  .play .rack::after { left: -6px; right: -6px; bottom: -24px; height: 16px; }
  .slot .pips { display: none; }
  .slot .tag { font-size: max(12px, calc(var(--pitch) * 0.25)); font-stretch: 76%; margin-top: -24%; }
  .slot .game { font-size: 12px; height: 40%; padding-top: 3%; }
  .scorebug { grid-template-columns: 1fr 1fr; }
  .scorebug .center { order: 3; grid-column: 1 / -1; border: 0; border-top: 2px solid var(--line); min-width: 0; padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; }
  .scorebug .center .round { font-size: 14px; }
  .scorebug .center .state { white-space: normal; font-size: 13px; }
  .scorebug .clock { font-size: 20px; }
  .scorebug .side.p2 { order: 2; }
  .scorebug .who .name { font-size: 16px; font-stretch: 96%; }
  .scorebug .who .sub { font-size: 12px; }
  .scorebug .who .you { display: none; }
  .scorebug .score { font-size: 28px; }
  .scorebug .side { padding: 10px 12px; gap: 10px; }
  .scorebug .side.threat .sub { font-family: var(--font-body); font-weight: 800; font-size: 12px; text-transform: none; font-stretch: normal; }
  .topbar { gap: 8px; padding: 6px 8px; }
  .topbar-room { font-size: 13px; }
  .qr-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-code { font-size: 44px; }
  .hint-row { grid-template-columns: 92px 1fr; }
  .link-card { grid-template-columns: auto 1fr; }
  .link-card .actions { grid-column: 1 / -1; }
  .topbar-links .btn { padding: 0 10px; }
  .panel-pad { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .banner .band { animation: band-reduced 1200ms ease forwards; }
  @keyframes band-reduced { 0% { opacity: 0; clip-path: none; } 15% { opacity: 1; clip-path: none; } 85% { opacity: 1; clip-path: none; } 100% { opacity: 0; clip-path: none; } }
  .stamp { animation: stamp-reduced 1400ms ease forwards; }
  @keyframes stamp-reduced { 0% { opacity: 0; transform: translate(-50%, -50%); filter: none; } 15% { opacity: 1; transform: translate(-50%, -50%); filter: none; } 80% { opacity: 1; transform: translate(-50%, -50%); filter: none; } 100% { opacity: 0; transform: translate(-50%, -50%); filter: none; } }
  .boot-mark, .rack.over .hole.win .disc, .hole.threat-p1 .slot::after, .hole.threat-p2 .slot::after, .scorebug .side.threat .sub { animation: none; }
  .banner .band.long { animation: band-reduced 3000ms ease forwards; }
  .slot, .btn, .result { transition: none; }
}

/* Type colors (official-ish palette, tinted) */
.type[data-t="normal"] { --tc: #9a9a7a; } .type[data-t="fire"] { --tc: #ee7f2f; } .type[data-t="water"] { --tc: #6fa2f0; }
.type[data-t="grass"] { --tc: #67b83f; } .type[data-t="electric"] { --tc: #f4ea6a; } .type[data-t="ice"] { --tc: #5ec3d4; }
.type[data-t="fighting"] { --tc: #c03a2b; } .type[data-t="poison"] { --tc: #9b46b7; } .type[data-t="ground"] { --tc: #c9a548; }
.type[data-t="flying"] { --tc: #8a9be8; } .type[data-t="psychic"] { --tc: #f57aa5; } .type[data-t="bug"] { --tc: #97a51b; }
.type[data-t="rock"] { --tc: #b6a04a; } .type[data-t="ghost"] { --tc: #6a4f9b; } .type[data-t="dragon"] { --tc: #5b4bd6; }
.type[data-t="dark"] { --tc: #5a4b41; } .type[data-t="steel"] { --tc: #8a95b4; } .type[data-t="fairy"] { --tc: #e58fc2; }
