/* After Dark (Oct 2026). Loaded last; supersedes the plum/neon layer without touching mechanics.
   Rules of the look: a near-black purple ground, one lime for action and HUD, colour otherwise
   only from players. Flat fills and tone steps, no glows or gradients. Bricolage Grotesque for
   display and numbers, Figtree for reading. Every animation has a reduced-motion fallback. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/BricolageGrotesque-Variable.woff") format("woff"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/Figtree-Variable.woff") format("woff"); font-weight: 300 900; font-display: swap; }
/* Older rules name Outfit; point that name at Figtree so every legacy rule picks up the new face. */
@font-face { font-family: "Outfit"; src: url("../fonts/Figtree-Variable.woff") format("woff"); font-weight: 300 900; font-display: swap; }

:root {
  --ad-night: #120A1F; --ad-night-2: #1D1230; --ad-night-3: #2A1B43; --ad-night-4: #3A2759;
  --ad-ink: #F7F2FF; --ad-muted: #C3B3DA; --ad-spent: #8F7FA8;
  --ad-lime: #D8FF36; --ad-lime-ink: #120A1F; --ad-gold: #FFC83D;
  --ad-font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --ad-font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ad-ease: cubic-bezier(.16, 1, .3, 1);
  --ad-radius: 14px;
  --ad-row-step: 40px;
  /* Legacy tokens from ux-uplift.css */
  --ux-ink: var(--ad-ink); --ux-secondary: var(--ad-muted); --ux-subtle: var(--ad-muted); --ux-panel: var(--ad-night-2);
  --ux-border: transparent; --ux-focus: var(--ad-lime); --ux-gold: var(--ad-gold); --ux-success: var(--ad-lime); --ux-pink: var(--ad-muted);
  --ux-ease: var(--ad-ease); --ux-ease-impact: var(--ad-ease);
  color-scheme: dark;
  font-family: var(--ad-font-ui);
}
@media (max-width: 700px) { :root { --ad-row-step: 36px; } }

/* Purple ground from master: deep plum with a soft glow behind the stage. */
html { background: #140b28 !important; }
body { background: #140b28 radial-gradient(at 50% 35%, #30124b66, #0000 67%) fixed !important; color: var(--ad-ink); }
#root { background: transparent !important; color: var(--ad-ink); }
body { font-family: var(--ad-font-ui) !important; }
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--ad-lime); color: var(--ad-lime-ink); }
* { scrollbar-color: var(--ad-night-4) transparent; }
:where(button, input, select, textarea, a, [tabindex]):focus-visible { outline: 3px solid var(--ad-lime) !important; outline-offset: 3px !important; }
/* No glows: depth comes from tone steps. */
.game-shell *, .shared-stage * { text-shadow: none !important; }
.game-shell, .main-stage, .shared-stage { background: transparent !important; }

/* Display type */
h1, h2, .stage-title, .brand, .home-title, .lobby-heading h1, .question-heading h1, .shared-question h1, .shared-reveal h1, .shared-end h1, .shared-map-panel h1,
.final-screen h1, .intermission h1, .reward-screen h1, .battle-intro h1, .battle-ready h1, .battle-outcome h1 {
  font-family: var(--ad-font-display) !important; font-weight: 800 !important; letter-spacing: -0.03em !important;
}
.brand { letter-spacing: -0.02em !important; }
.player-score, .player-score span, .shared-score b, .room-code, .timer span, .score-total-stack, .rank-number, .intro-count {
  font-family: var(--ad-font-display) !important; font-variant-numeric: tabular-nums;
}

/* Labels: sentence case, untracked, quiet. (No tracked capitals anywhere.) */
.eyebrow, .shared-kicker, .land-panel-kicker, .land-player-label, .lobby-field-label, .live-results-heading, .battle-track-heading, .map-credit, .shared-header span {
  text-transform: lowercase !important; letter-spacing: 0 !important; font-weight: 600 !important; color: var(--ad-muted) !important; font-family: var(--ad-font-ui) !important;
}
.eyebrow, .shared-kicker, .live-results-heading { display: block; font-size: 15px !important; }
.eyebrow::first-letter, .shared-kicker::first-letter, .land-panel-kicker::first-letter, .land-player-label::first-letter, .lobby-field-label::first-letter, .live-results-heading::first-letter, .battle-track-heading::first-letter, .map-credit::first-letter, .shared-header span::first-letter { text-transform: uppercase; }

/* Shell */
.topbar { border-bottom: 0 !important; background: transparent !important; }
.player-strip { background: var(--ad-night-2) !important; backdrop-filter: none !important; border-top: 0 !important; }
.player-card { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
/* Your own card needs no outline: your piece already bounces when it's your move, the active card
   has an underline in your colour, and the name carries "(you)". */
.player-card.is-you { box-shadow: none !important; }
.player-strip .player-card.is-you::before { content: none !important; display: none !important; }
.player-strip .player-card.strip-card.active { background: transparent !important; }
.player-card.active { background: var(--ad-night-3) !important; }
.connection-note { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; }

/* Buttons: one lime primary per screen, everything else a tone step. */
.primary, button.primary, .start-game:has(> p) {
  background: var(--ad-lime) !important; color: var(--ad-lime-ink) !important; border: 0 !important; border-radius: var(--ad-radius) !important;
  box-shadow: none !important; font-family: var(--ad-font-display) !important; font-weight: 800 !important; letter-spacing: -0.01em !important;
  transition: transform 90ms var(--ad-ease), filter 120ms ease !important;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); }
.primary:active:not(:disabled) { transform: scale(.97); }
.primary:disabled { background: var(--ad-night-3) !important; color: var(--ad-spent) !important; }
.secondary, .quiet-button, .icon-button, .lobby-leave-button, .danger-button {
  background: var(--ad-night-3) !important; color: var(--ad-ink) !important; border: 0 !important; border-radius: 12px !important; box-shadow: none !important;
}
.secondary:hover:not(:disabled), .quiet-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--ad-night-4) !important; }
.icon-button { color: var(--ad-muted) !important; }
.question-feedback-buttons > button, .question-upvote-button, .question-report-button { background: var(--ad-night-3) !important; border: 0 !important; }

/* Surfaces */
.game-dialog, .settings-content, .help-content, .profile-card, .lobby-self-config, .lobby-advanced, .lobby-map-preview, .question-duration-controls,
.bot-settings-disclosure, .land-panel, .land-sidecar, .queue-sidecar, .intermission-sidecar, .battle-ready-sidecar, .live-answer-results, .selection-note,
.selected-attack-card, .attack-status-card, .waiting-panel, .final-breakdown, .score-award-board {
  background: var(--ad-night-2) !important; border-color: transparent !important; box-shadow: none !important;
}
.live-answer-row, .question-kind-option, .identity-choice, .bot-seat-config, .lobby-player, .queue-row, .final-row, .geo-result-row, .battle-highlight-pair .land-player-identity {
  background: var(--ad-night-3) !important; border-color: transparent !important; box-shadow: none !important;
}
.empty-seat { background: transparent !important; box-shadow: inset 0 0 0 2px var(--ad-night-3) !important; border-color: transparent !important; }
.room-code { background: var(--ad-lime) !important; color: var(--ad-lime-ink) !important; border: 0 !important; font-weight: 800 !important; }
input, select, textarea, .code-input { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; border-color: transparent !important; }

/* Timer ring */
.timer svg circle:first-child, .timer-track { stroke: var(--ad-night-3) !important; }
.timer svg circle + circle, .timer-fill { stroke: var(--ad-lime) !important; }
.timer span { color: var(--ad-lime) !important; }

/* Answers: neutral until you pick; then they light up in your own colour. */
.answer-option {
  --me: var(--ad-lime);
  background: var(--ad-night-3) !important; color: var(--ad-ink) !important; border: 0 !important; border-radius: 16px !important;
  box-shadow: none !important; transform: none; transition: background 180ms var(--ad-ease), transform 70ms ease-out, opacity 160ms ease !important;
}
.answer-option:hover:not(:disabled) { background: var(--ad-night-4) !important; }
.answer-option:active:not(:disabled) { transform: scale(.98) !important; }
.answer-option .option-key { background: var(--ad-night) !important; color: var(--ad-muted) !important; border-radius: 9px !important; font-family: var(--ad-font-display) !important; font-weight: 800 !important; }
.answer-option.chosen, .answer-option[aria-pressed="true"] { background: var(--me) !important; color: var(--ad-night) !important; }
.answer-option.chosen .option-key { background: var(--ad-night) !important; color: var(--me) !important; }
.answer-option.muted-option { opacity: .5 !important; }
.answer-lock { color: var(--ad-night) !important; }
.order-tile, .word-cell, .number-form input { background: var(--ad-night-3) !important; border-color: transparent !important; color: var(--ad-ink) !important; }
.word-cell.revealed { background: var(--ad-lime) !important; color: var(--ad-lime-ink) !important; }
.five-progress span { background: var(--ad-night-3) !important; } .five-progress span.done { background: var(--ad-muted) !important; } .five-progress span.current { background: var(--ad-lime) !important; }

/* Pieces of players who have answered, under the question (phones and TV). */
/* The row owns its height from the start: pieces landing never push the question around mid-answer. */
.ad-answered { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; height: 46px; margin: 4px 0 6px; overflow: visible; }
.shared-question .ad-answered { height: 64px; margin: 6px 0 14px; justify-content: center; }
.ad-answered .ad-answered-piece { animation: ad-quick-in 300ms cubic-bezier(.2,.9,.3,1.2) both; }

/* Tile map: flat owner colour separated by gaps of ground; lime marks what you can pick. */
.candy-board .tile { stroke: var(--ad-night) !important; stroke-width: 6px !important; stroke-dasharray: none !important; }
.candy-board .tile[fill="#3b2b52"] { fill: var(--ad-night-3) !important; }
.candy-board .tile.eligible, .candy-board .tile.eligible-view { stroke: var(--ad-lime) !important; stroke-width: 4px !important; stroke-dasharray: 10 8 !important; }
.candy-board .tile.selected-tile, .candy-board .tile.attack-target-tile { stroke: var(--ad-lime) !important; stroke-width: 7px !important; stroke-dasharray: none !important; }
.candy-board > rect:first-child { fill: transparent !important; stroke: transparent !important; }

/* Shared screen (TV): dark panels, neutral options, lime HUD. */
.shared-stage { color: var(--ad-ink) !important; }
.shared-main-content, .shared-sidebar { background: var(--ad-night-2) !important; border: 0 !important; box-shadow: none !important; color: var(--ad-ink) !important; }
.shared-header, .shared-header strong { color: var(--ad-ink) !important; }
.shared-header span { color: var(--ad-muted) !important; }
.shared-question h1, .shared-reveal h1, .shared-end h1, .shared-map-panel h1 { color: var(--ad-ink) !important; }
.shared-option { background: var(--ad-night-3) !important; border: 0 !important; color: var(--ad-ink) !important; border-radius: 16px !important; box-shadow: none !important; }
.shared-option b { background: var(--ad-night) !important; color: var(--ad-muted) !important; font-family: var(--ad-font-display) !important; }
.shared-timer { background: var(--ad-night-3) !important; }
.shared-timer-fill { background: var(--ad-lime) !important; }
.shared-timer strong { color: var(--ad-ink) !important; mix-blend-mode: normal !important; }
.shared-score { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; }
.shared-rank { color: var(--ad-muted) !important; }
.shared-progress-track { background: var(--ad-night-3) !important; } .shared-progress-track span { background: var(--ad-lime) !important; }
.shared-five-segments i { background: var(--ad-night-3) !important; } .shared-five-segments i.done { background: var(--ad-lime) !important; }
.shared-result { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; }
.shared-join { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; border: 0 !important; }
.shared-join strong { background: var(--ad-lime); color: var(--ad-lime-ink) !important; border-radius: 10px; padding: 2px 10px; font-family: var(--ad-font-display); }
.shared-hint { color: var(--ad-muted) !important; }
.shared-end-buttons .secondary { background: var(--ad-night-3) !important; color: var(--ad-ink) !important; border: 0 !important; }
.shared-lobby-mode { background: var(--ad-night-2) !important; border-color: transparent !important; }

/* ---------------------------------------------------------------------------
   Reveal sequence: times, picks, truth, verdict.
   ------------------------------------------------------------------------- */
.ad-reveal { width: min(100%, 1100px); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; padding: 8px 0 4px; }
.ad-reveal-question { margin: 0 !important; font-size: clamp(24px, 3.4vw, 54px) !important; line-height: 1.02 !important; letter-spacing: -0.035em !important; color: var(--ad-ink) !important; text-align: left !important; }
.ad-note { margin: 0; color: var(--ad-muted); font-size: 15px; }

/* Beat 1: the answer-times table (rows glide to --pos). */
.ad-times { position: relative; height: calc(var(--rows) * var(--ad-row-step)); flex: 0 0 auto; }
.ad-time-row {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--ad-row-step) - 6px);
  display: grid; align-items: center; gap: 12px;
  padding: 0 12px; border-radius: 10px; background: var(--ad-night-2);
  transform: translateY(calc(var(--pos) * var(--ad-row-step))); opacity: 0;
  transition: transform 600ms var(--ad-ease), opacity 300ms ease, background 300ms ease;
}
.ad-time-row.is-in { opacity: 1; animation: ad-row-in 300ms var(--ad-ease) backwards; }
.ad-time-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ad-time-who b { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-time-track { height: 10px; border-radius: 5px; background: var(--ad-night); overflow: hidden; }
.ad-time-track i { display: block; height: 100%; border-radius: 5px; background: var(--player); transform-origin: left center; transform: scaleX(0); }
.ad-time-row.is-in .ad-time-track i { animation: ad-bar 520ms var(--ad-ease) 80ms both; }
.ad-time-value { font-family: var(--ad-font-display); font-weight: 800; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.ad-time-detail { font-size: 14px; font-weight: 600; color: var(--ad-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-time-mark { display: inline-flex; justify-content: center; }
.ad-time-points { font-family: var(--ad-font-display); font-weight: 800; font-size: 16px; color: var(--ad-gold); text-align: right; font-variant-numeric: tabular-nums; }
.ad-time-row.is-right .ad-time-mark { color: var(--ad-lime); }
.ad-time-row.is-wrong .ad-time-mark { color: var(--ad-spent); }
.ad-time-row.is-judged .ad-time-mark, .ad-time-row.is-judged .ad-time-points, .ad-time-row.is-judged .ad-time-detail { animation: ad-fade-in 220ms ease both; }
.ad-time-row.is-wrong { opacity: .45; }
.ad-time-row.is-wrong .ad-time-track i { background: var(--ad-spent); transition: background 300ms ease; }
.ad-hints { display: inline-flex; align-items: center; gap: 3px; }
.ad-hints i { width: 9px; height: 12px; border-radius: 2px; background: var(--ad-lime); }
.ad-hints small { margin-left: 4px; font-size: 13px; color: var(--ad-muted); white-space: nowrap; }
.ad-slots { display: inline-flex; gap: 4px; }
.ad-slots i { width: 20px; height: 20px; border-radius: 6px; background: var(--ad-night); display: inline-grid; place-items: center; }
.ad-slots i.is-ok { background: var(--ad-lime); color: var(--ad-lime-ink); animation: ad-quick-in 240ms var(--ad-ease) both; }
.ad-slots i.is-bad { background: var(--ad-night-4); color: var(--ad-spent); animation: ad-quick-in 240ms var(--ad-ease) both; }

/* Beats 2-4: answer cards, pieces popping in underneath, the flash. */
.ad-cards { display: grid; gap: 12px 18px; }
.ad-cards.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-cards.is-list { grid-template-columns: minmax(0, 1fr); }
.ad-card-wrap { display: flex; flex-direction: column; min-width: 0; }
.ad-card-wrap.is-hidden { display: none; }
.ad-card { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-radius: 16px; background: var(--ad-night-3); color: var(--ad-ink); transition: opacity 300ms ease; }
.ad-key { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--ad-night); color: var(--ad-muted); font-family: var(--ad-font-display); font-weight: 800; font-size: 20px; }
.ad-card-label { font-weight: 700; font-size: clamp(17px, 1.8vw, 26px); min-width: 0; }
.ad-card-tick { margin-left: auto; display: inline-flex; color: var(--ad-night); }
.ad-card.is-flash { animation: ad-flash 1150ms linear both; }
.ad-card.is-truth { background: var(--ad-ink); color: var(--ad-night); }
.ad-card.is-dim { opacity: .42; }
.ad-card-pieces { display: flex; align-items: flex-end; gap: 8px; padding-left: 12px; height: 0; overflow: visible; transition: height 420ms var(--ad-ease); }
.rows-open .ad-card-pieces { height: 52px; }
.ad-piece { position: relative; display: inline-block; flex: 0 0 auto; opacity: 0; transform: scale(0); }
.ad-piece > svg { position: relative; display: block; }
.ad-piece.is-in { opacity: 1; transform: none; animation: ad-quick-in 240ms cubic-bezier(.2,.9,.3,1.25) both; }
.ad-piece.is-first.is-in { animation: ad-pop-in 560ms var(--ad-ease) both; }
.ad-diamond { position: absolute; inset: 2px; border-radius: 30%; background: var(--player); opacity: 0; transform: rotate(45deg) scale(0); }
.ad-piece.is-first.is-in .ad-diamond { animation: ad-diamond 560ms var(--ad-ease) both; }
/* Order strips and word entries */
.ad-order-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-order-tile { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--ad-night); color: var(--ad-ink); font-size: clamp(15px, 1.5vw, 20px); }
.ad-card.is-truth .ad-order-tile { background: var(--ad-night-3); color: var(--ad-ink); }
.ad-order-tile.is-ok i { color: var(--ad-lime); display: inline-flex; } .ad-order-tile.is-bad i { color: var(--ad-spent); display: inline-flex; }
.ad-order-tile.is-bad { opacity: .7; }
.ad-word { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ad-letter { width: 1.5em; height: 1.75em; display: inline-grid; place-items: center; border-radius: 6px; background: var(--ad-night); color: var(--ad-ink); font-family: var(--ad-font-display); font-weight: 800; }
.ad-card.is-truth .ad-letter { background: var(--ad-night-3); color: var(--ad-ink); }
.ad-word.is-flipping .ad-letter { animation: ad-letter 360ms var(--ad-ease) both; animation-delay: calc(var(--i) * 70ms); }

/* Number line */
.ad-number-line { position: relative; height: calc(64px + var(--lanes) * 46px); margin: 6px 16px 0; }
.ad-line-axis { position: absolute; left: 0; right: 0; bottom: 18px; height: 4px; border-radius: 2px; background: var(--ad-night-4); }
.ad-line-guess { position: absolute; bottom: calc(26px + var(--lane) * 46px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; }
.ad-line-guess.is-in { opacity: 1; }
/* The answer bar runs behind the pieces so faces and values stay readable. */
.ad-line-guess { z-index: 1; } .ad-line-truth { z-index: 0; } .ad-line-truth b { z-index: 2; }
.ad-line-value { font-family: var(--ad-font-display); font-weight: 800; font-size: 13px; color: var(--ad-muted); }
.ad-line-truth { position: absolute; bottom: 8px; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; opacity: 0; }
.ad-line-truth i { width: 5px; height: calc(40px + var(--lanes) * 46px); border-radius: 3px; background: var(--ad-lime); }
.ad-line-truth b { position: absolute; top: calc(100% + 4px); font-family: var(--ad-font-display); font-weight: 800; font-size: 30px; line-height: 1.1; color: #fff; white-space: nowrap; background: var(--ad-night-2); padding: 0 8px; border-radius: 8px; }
.ad-number-line { margin-bottom: 44px !important; }
.shared-main-content .ad-line-truth b { font-size: 44px; }
.ad-line-truth.is-near-start b { left: -8px; } .ad-line-truth.is-near-end b { right: -8px; }
.shared-main-content .ad-number-line { margin-bottom: 60px !important; }
.ad-line-truth.is-flash { opacity: 1; animation: ad-blink 1100ms linear both; }
.ad-line-truth.is-truth { opacity: 1; }

/* Geography */
.ad-geo-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.ad-geo-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.geo-guess-marker.is-waiting { opacity: 0; }
.geo-guess-marker.is-in { animation: ad-quick-in 260ms cubic-bezier(.2,.9,.3,1.25) both; transform-box: fill-box; transform-origin: center !important; }
.geo-guess-marker.is-first.is-in { animation: ad-pop-in 560ms var(--ad-ease) both; }
/* The answer pin: neon lime with a fixed glow, dropped onto the true spot while a ripple spreads on the ground.
   The glow does not animate: an animated drop-shadow inside the map SVG repaints the whole map every frame. */
.geo-answer-marker { transform-box: fill-box; transform-origin: 50% 100%; animation: geo-pin-drop 560ms cubic-bezier(.3, 1.5, .5, 1) both; filter: drop-shadow(0 0 5px rgba(216, 255, 54, .7)); }
/* The ripple keeps a 2 px line at any map zoom (non-scaling stroke), which the compositor cannot do, so it repaints the map:
   three rings, then it stops. */
.geo-answer-ripple { fill: none; stroke: #D8FF36; stroke-width: 2px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: geo-pin-ripple 1.8s 560ms ease-out 3 both; }
@keyframes geo-pin-drop { 0% { opacity: 0; translate: 0 -60%; scale: .9 1.1; } 60% { opacity: 1; translate: 0 0; scale: 1.12 .86; } 80% { scale: .96 1.04; } 100% { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes geo-pin-ripple { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(2.2); } }
.geo-score-ring { stroke: var(--ad-lime); stroke-width: 2; opacity: 0; animation: ad-ring 700ms var(--ad-ease) both; animation-delay: calc(var(--ring) * 110ms); }
.geo-reveal-line line { stroke-opacity: .85; }

/* Quick five */
.ad-rapid-question { display: flex; flex-direction: column; gap: 12px; animation: ad-fade-in 220ms ease both; }
.ad-rapid-count { margin: 0; color: var(--ad-muted); font-size: 15px; font-weight: 600; }
/* Quick 5: step back to a question already shown. Always laid out, so nothing below moves when it unlocks. */
.ad-rapid-picker { display: flex; justify-content: center; gap: 6px; margin: 2px 0 -2px; }
.ad-rapid-picker button { min-width: 44px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ad-night-4); background: transparent; color: var(--ad-ink); font: 700 14px var(--ad-font-ui); cursor: pointer; transition: background 160ms var(--ad-ease), color 160ms var(--ad-ease), border-color 160ms var(--ad-ease); }
.ad-rapid-picker button.is-live { border-color: var(--ad-lime); }
.ad-rapid-picker button.is-on { background: var(--ad-lime); border-color: var(--ad-lime); color: var(--ad-lime-ink); }
.ad-rapid-picker button:disabled { opacity: .35; cursor: default; }
.ad-rapid-picker button:focus-visible { outline: 2px solid var(--ad-gold); outline-offset: 2px; }
.ad-rapid-yours { margin: 0; min-height: 1.4em; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 15px; font-weight: 700; color: var(--ad-muted); }
.ad-rapid-yours.is-ok { color: var(--ad-lime); } .ad-rapid-yours.is-bad { color: var(--ad-spent); }
/* Quick 5: the question shows alone first; the options keep their place, hidden, until the picks come in. */
.ad-kind-rapid .ad-cards:not(.rows-open) .ad-card-wrap { visibility: hidden; opacity: 0; }
.ad-kind-rapid .ad-cards.rows-open .ad-card-wrap { animation: ad-fade-in 260ms ease both; }
.ad-kind-rapid .ad-cards .ad-card-pieces { height: 52px; }
.ad-cards.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-finish { margin-top: 6px; }

/* Shared screen sizing */
.shared-main-content:has(.ad-reveal) { padding: 18px 24px !important; place-items: start stretch !important; align-content: start !important; text-align: left !important; }
.shared-main-content > .review-with-votes { max-width: none; }
.shared-main-content .ad-reveal { gap: 12px; padding: 0; }
.shared-main-content { --ad-row-step: 34px; }
.shared-main-content .ad-reveal-question { font-size: clamp(24px, 2.8vw, 46px) !important; }
.shared-main-content .ad-card { min-height: 52px; padding: 6px 12px; }
.shared-main-content .ad-key { width: 34px; height: 34px; font-size: 17px; }
.shared-main-content .rows-open .ad-card-pieces { height: 46px; }
.shared-main-content .ad-time-who b, .shared-main-content .ad-time-value { font-size: 15px; }
.shared-main-content .ad-finish { display: none; }

@keyframes ad-row-in { from { opacity: 0; translate: -24px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes ad-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ad-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ad-quick-in { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ad-pop-in { 0%, 35% { transform: scale(0) rotate(-35deg); opacity: 0; } 70% { transform: scale(1.22) rotate(8deg); opacity: 1; } 85% { transform: scale(.94) rotate(-3deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes ad-diamond { 0% { transform: rotate(45deg) scale(0); opacity: 1; } 45% { transform: rotate(45deg) scale(1.15); opacity: 1; } 100% { transform: rotate(45deg) scale(1.75); opacity: 0; } }
/* Flashes blink once and hold: at most two bright peaks a second, never a strobe on the shared TV. */
@keyframes ad-flash { 0% { background: var(--ad-night-3); color: var(--ad-ink); } 18%, 66%, 100% { background: var(--ad-ink); color: var(--ad-night); } 42% { background: var(--ad-night-3); color: var(--ad-ink); } }
@keyframes ad-blink { 0% { opacity: 0; } 18%, 66%, 100% { opacity: 1; } 42% { opacity: .15; } }
@keyframes ad-letter { from { transform: rotateX(90deg); background: var(--ad-lime); color: var(--ad-lime-ink); } to { transform: rotateX(0); } }
@keyframes ad-ring { from { opacity: 0; transform: scale(.4); } to { opacity: .55; transform: scale(1); } }
.geo-score-ring { transform-box: fill-box; transform-origin: center; }

@media (max-width: 860px) {
  .ad-geo-layout { grid-template-columns: minmax(0, 1fr); }
  .ad-cards.is-grid { grid-template-columns: minmax(0, 1fr); }
  .ad-cards.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-time-who b { font-size: 15px; }
  .ad-slots i { width: 16px; height: 16px; }
  .ad-card { min-height: 52px; }
  .rows-open .ad-card-pieces { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-reveal *, .ad-answered *, .geo-guess-marker, .geo-score-ring, .geo-answer-marker { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .geo-answer-marker, .geo-answer-ripple { animation: none !important; } .geo-answer-ripple { display: none; }
}

/* Keep strips and words on one line inside their cards. */
.ad-card-label { flex: 1 1 auto; min-width: 0; }
.ad-order-strip, .ad-word { flex-wrap: nowrap; }
.ad-order-tile { padding: 5px 8px; white-space: nowrap; font-size: clamp(13px, 1.25vw, 18px); }
.ad-word { font-size: clamp(13px, 1.3vw, 19px); gap: 3px; }

/* Times table columns by name, so every question type lines up at every width. */
.ad-time-row { grid-template-areas: "who track extra value detail mark points"; grid-template-columns: minmax(110px, 190px) minmax(40px, 1fr) auto minmax(76px, max-content) minmax(0, 110px) 24px 44px; }
.ad-time-who { grid-area: who; } .ad-time-track { grid-area: track; } .ad-hints, .ad-slots { grid-area: extra; }
.ad-time-value { grid-area: value; } .ad-time-detail { grid-area: detail; } .ad-time-mark { grid-area: mark; } .ad-time-points { grid-area: points; }
.ad-kind-geo .ad-time-row { grid-template-columns: minmax(90px, 1fr) 0 0 minmax(66px, max-content) 78px 22px 40px; }
.ad-kind-geo .ad-time-track { display: none; }
@media (max-width: 860px) {
  .ad-time-row { grid-template-areas: "who extra value detail mark points"; grid-template-columns: minmax(0, 1fr) auto minmax(58px, max-content) var(--detail-w, 0px) 20px 34px; gap: 8px; padding: 0 8px; }
  .ad-time-track { display: none; }
  .ad-kind-number .ad-time-row, .ad-kind-geo .ad-time-row, .ad-kind-order .ad-time-row { --detail-w: 74px; }
  .ad-kind-rapid .ad-time-row { --detail-w: 34px; }
  .ad-hints small { display: none; }
  .ad-time-value, .ad-time-who b { font-size: 15px; }
  .ad-time-detail { font-size: 13px; }
}

/* Room code chip: everything inside sits on lime. */
.room-code, .room-code * { color: var(--ad-lime-ink) !important; }
.room-code small, .room-code span:first-child { opacity: .75; }

/* TV question: fit a 720p screen. */
.shared-question h1 { font-size: clamp(28px, 3.6vw, 64px) !important; line-height: 1.04 !important; margin-bottom: 14px !important; }
.shared-question .shared-kicker { margin-bottom: .6rem !important; }
.shared-options { margin: 12px 0 !important; }
.shared-option { min-height: clamp(60px, 8vh, 110px) !important; padding: clamp(10px, 1.4vw, 22px) !important; font-size: clamp(18px, 1.8vw, 30px) !important; }
.shared-timer { height: 14px !important; margin-top: 18px !important; }
.shared-timer strong { position: static !important; display: block; margin-top: 18px; font-family: var(--ad-font-display); color: var(--ad-lime) !important; }
.shared-main-content:has(.shared-question) { place-items: start stretch !important; }

/* Format icons: no fixed four-colour answer palette anywhere. */
.four-icon i, .format-icon i { background: var(--ad-night-4) !important; color: var(--ad-ink) !important; }
.four-icon i:first-child { background: var(--ad-lime) !important; color: var(--ad-lime-ink) !important; }

/* ===================== Land topics ===================== */
/* Chips: what an attack will ask about. */
.topic-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--ad-night-2); color: var(--ad-ink); font-size: 15px; line-height: 1.2; }
.topic-chip b { font-weight: 800; }
.topic-chip.target-topic { background: var(--ad-night); align-self: flex-start; }
.question-top .question-topic, .geo-question-copy .question-topic { margin-right: auto; }

/* The naming screen */
.topic-screen .topic-sidecar { gap: 14px; }
.topic-options { display: flex; flex-direction: column; gap: 10px; }
.topic-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px; box-sizing: border-box; border-radius: 16px; border: 2px solid transparent; background: var(--ad-night-3); color: var(--ad-ink); text-align: left; font: inherit; transition: background-color .18s var(--ad-ease), opacity .25s var(--ad-ease); }
button.topic-option { cursor: pointer; }
button.topic-option:not(:disabled):hover { background: var(--ad-night-4); }
.topic-option.is-surprise { background: var(--ad-night-2); border-style: dashed; border-color: var(--ad-night-4); }
.topic-option-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topic-option-copy b { font-family: var(--ad-font-display); font-weight: 800; font-size: 22px; line-height: 1.05; letter-spacing: -.01em; }
.topic-option-copy small { font-size: 14px; opacity: .85; }
.topic-option-bonus { margin-left: auto; font-family: var(--ad-font-display); font-weight: 800; font-size: 18px; color: var(--ad-lime); }
/* Pick: the chosen card fills with the picker's colour; the rest step back. */
.topic-option.is-chosen { background: var(--me, var(--ad-lime)); border-color: var(--me, var(--ad-lime)); color: var(--ad-night); opacity: 1; }
.topic-option.is-chosen .topic-option-bonus { color: var(--ad-night); }
.topic-option.is-dimmed { opacity: .4; }
/* Flash: once, when the room sees the pick. */
.topic-screen.is-named .topic-option.is-chosen { animation: ad-topic-flash 900ms ease-in-out both; }
@keyframes ad-topic-flash { 0%, 36%, 100% { opacity: 1; } 18%, 54% { opacity: .55; } }

/* Map labels: badge at rest, pill with a name for the TV or the land in focus. */
.topic-layer .topic-label, .topic-layer .topic-badge, .topic-layer .topic-naming { transform-box: fill-box; transform-origin: center; }
.topic-layer .topic-naming { animation: ad-topic-hold 1.4s ease-in-out infinite; }
@keyframes ad-topic-hold { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* Stamp: out of a rounded diamond, like the first piece in a reveal. */
.topic-layer .is-stamped { animation: ad-topic-stamp 560ms var(--ad-ease) both; }
.topic-layer .topic-burst { transform-box: fill-box; transform-origin: center; animation: ad-diamond 560ms var(--ad-ease) both; }
@keyframes ad-topic-stamp { 0% { transform: scale(0) rotate(-35deg); opacity: 0; } 60% { transform: scale(1.22) rotate(8deg); opacity: 1; } 80% { transform: scale(.95) rotate(-3deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }

/* The key */
.topic-key { display: flex; flex-direction: column; gap: 8px; }
.topic-key-heading { font-size: 14px; font-weight: 700; color: var(--ad-muted); margin-top: 4px; }
.topic-key-heading.is-attack { color: var(--ad-lime); margin-top: 0; }
.topic-key-attack { display: flex; flex-direction: column; gap: 6px; }
.topic-key-target { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--ad-night-3); color: var(--ad-ink); font: inherit; text-align: left; cursor: pointer; }
.topic-key-target b { width: 112px; flex: none; font-weight: 700; }
.topic-key-target .topic-key-land { flex: 1; min-width: 0; color: var(--ad-muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-key-target.is-selected { background: var(--ad-night-4); box-shadow: inset 0 0 0 2px var(--ad-lime); }
.topic-key-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.topic-key-row { display: flex; align-items: center; gap: 8px; min-height: 28px; min-width: 0; font-size: 15px; font-weight: 600; }
.topic-key-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-key-owners { display: flex; gap: 3px; margin-left: auto; flex: none; }
.topic-key-row.is-new { color: var(--ad-lime); animation: ad-row-in 320ms var(--ad-ease) both; }
.topic-key-row.is-gone { opacity: .35; text-decoration: line-through; }

/* Phones: the key button and sheet */
.topic-key-button { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; }
.topic-sheet-scrim { position: fixed; inset: 0; z-index: 9000; background: rgba(18, 10, 31, .6); }
.topic-sheet { position: fixed; z-index: 9001; left: 0; right: 0; bottom: 0; max-height: min(78vh, 640px); overflow-y: auto; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); box-sizing: border-box; border-radius: 24px 24px 0 0; background: var(--ad-night-2); color: var(--ad-ink); display: flex; flex-direction: column; gap: 12px; animation: ad-sheet-in 260ms var(--ad-ease) both; }
.topic-sheet header { display: flex; align-items: center; gap: 10px; }
.topic-sheet h2 { margin: 0; font-family: var(--ad-font-display); font-weight: 800; font-size: 24px; }
.topic-sheet header span { font-size: 14px; color: var(--ad-muted); }
.topic-sheet-close { margin-left: auto; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--ad-night-3); color: var(--ad-ink); display: grid; place-items: center; cursor: pointer; }
@keyframes ad-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 900px) { .topic-sheet { left: 50%; right: auto; width: 480px; translate: -50% 0; } }

/* TV: the sidebar key and the naming moment */
.shared-topic-key { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 20px; background: var(--ad-night-2); }
.shared-topic-key .topic-key-row { font-size: 16px; }
.topic-screen.is-tv .topic-option { min-height: 68px; }
.topic-screen.is-tv .topic-option-copy b { font-size: 21px; }

@media (prefers-reduced-motion: reduce) {
  .topic-layer .is-stamped, .topic-layer .topic-burst, .topic-layer .topic-naming, .topic-screen.is-named .topic-option.is-chosen, .topic-key-row.is-new, .topic-sheet { animation: none !important; }
  .topic-layer .topic-burst { display: none; }
}

/* Naming: TV panel */
.topic-tv { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; text-align: center; }
.topic-tv .topic-tv-grid { width: 100%; text-align: left; }
.topic-tv h1 { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--ad-font-display); font-weight: 800; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.03em; color: var(--ad-ink); }
.topic-tv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: center; margin-top: 10px; }
.topic-tv .shared-map-board { height: min(48vh, 470px); margin: 0; }
.topic-tv-side { display: flex; flex-direction: column; gap: 12px; }
.topic-tv-note { margin: 0; color: var(--ad-muted); font-size: 16px; line-height: 1.4; }
.topic-tv .topic-option { min-height: 66px; }
.topic-tv .topic-option-copy b { font-size: 21px; }
.topic-tv.is-named .topic-option.is-chosen { animation: ad-topic-flash 900ms ease-in-out both; }

/* Naming: phones put the choices first; the map is context */
@media (max-width: 700px) {
  .topic-screen .land-layout { display: flex !important; flex-direction: column; gap: 12px; }
  .topic-screen .topic-sidecar { order: -1; width: 100% !important; max-width: none !important; }
  .topic-screen .land-map-slot { height: 190px !important; min-height: 0 !important; width: 100% !important; }
  .topic-screen .land-map-slot svg { height: 100% !important; width: 100% !important; }
  .topic-screen .land-header { margin-bottom: 4px; }
  .topic-option { min-height: 62px; padding: 9px 12px; gap: 12px; }
  .topic-option-copy b { font-size: 20px; }
}
.topic-note { margin: 0; color: var(--ad-muted); font-size: 15px; line-height: 1.45; }
.shared-topic-chip { align-self: center; font-size: 18px; padding: 8px 18px 8px 12px; }

/* Buttons: labels stay inside. Wrap instead of spilling, keep breathing room, never wider than the row. */
.primary, .secondary, .quiet-button, .start-game:has(> p), .danger-button, .lobby-leave-button, .topic-key-button {
  white-space: normal !important; overflow-wrap: anywhere; text-wrap: balance; text-align: center;
  line-height: 1.15 !important; min-width: 0; max-width: 100%; height: auto !important; min-height: 44px;
  padding: 10px 18px !important; box-sizing: border-box;
}
.primary > *, .secondary > *, .quiet-button > * { min-width: 0; }
.primary svg, .secondary svg, .quiet-button svg { flex: 0 0 auto; }
/* Lobby seat admin: small, but readable and padded. */
.lobby-player-admin .quiet-button { min-height: 30px !important; height: auto !important; padding: 4px 10px !important; font-size: 12px !important; }
/* Rows of buttons wrap rather than squeeze. */
.shared-end-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
/* Topic cards: long names wrap, the bonus keeps its place. */
.topic-option { padding: 12px 16px; }
.topic-option-copy b { overflow-wrap: anywhere; }
.topic-option-bonus { flex: none; padding-left: 8px; }

/* ===========================================================================
   Gallery feedback pass (Oct 2026). One rule per idea, applied everywhere it fits:
   - One timer, one place: a bare ring at top centre on intro, question, waiting and reveal.
   - One title per moment; status is shown, not written (tick, three dots).
   - The battle pair faces off across the swords, bows out for the question, returns for the reveal.
   - Motion: anticipation going out, overshoot coming in, one punch for the truth.
   ========================================================================= */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Screens grow from their centre, not upwards. */
@keyframes screenIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* The timer ring: same size and place on every question moment. */
.stage-timer { display: flex !important; justify-content: center; align-items: center; width: 100%; margin: 0 !important; padding: 0 !important; background: none !important; grid-column: 1 / -1; order: -10; }
.stage-timer .timer, .question-top .timer, .sequence-timer .timer { width: 64px !important; height: 64px !important; flex: 0 0 64px !important; }
.stage-timer .timer span, .question-top .timer span, .sequence-timer .timer span { font-size: 28px !important; }
.sequence-timer > span { display: none !important; }
.stage-timer.has-caption { flex-direction: column; gap: 4px; }
.stage-timer-caption { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--ad-muted); }
.land-screen > .stage-timer { margin-bottom: 4px !important; }
/* Land screens are a header row over a flexible map row; the timer adds a row on top. */
.land-screen:has(> .stage-timer) { grid-template-rows: auto auto minmax(0, 1fr) !important; }
.battle-swords-verb { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.battle-pair .battle-swords-verb small { font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--ad-muted) !important; animation: ad-fade-in 300ms ease 520ms both; }
.review-with-votes > .stage-timer { margin-bottom: 6px !important; }
.shared-main-content .reveal-finish.stage-timer { display: none !important; }

/* Intro: timer, icon, one title, then the battle pair with room to breathe. */
.intro-screen { gap: 14px !important; }
.intro-screen > .subtitle, .intro-screen > .eyebrow, .intro-count { display: none !important; }
.intro-screen > .stage-timer { margin-bottom: 10px !important; }
.intro-screen > .battle-pair { margin-top: 36px !important; }

/* Battle pair: [name piece] swords [piece name], hugging the swords, all on one centre line. */
.battle-pair { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important; align-items: center !important; column-gap: 14px !important; width: 100%; max-width: 560px; margin-inline: auto; padding: 0 !important; background: none !important; border: 0 !important; }
.battle-pair .battle-side.land-player-identity, .land-info-panel .battle-pair .battle-side.land-player-identity { display: flex !important; align-items: center !important; gap: 10px !important; width: auto !important; min-width: 0; padding: 0 !important; background: none !important; border: 0 !important; outline: 0 !important; box-shadow: none !important; }
.land-info-panel .battle-pair .land-player-copy { flex: 0 1 auto !important; width: auto !important; }
.battle-pair .battle-side.is-attacker { flex-direction: row-reverse !important; justify-self: end; justify-content: flex-start !important; text-align: right !important; }
.battle-pair .battle-side.is-defender { flex-direction: row !important; justify-self: start; justify-content: flex-start !important; text-align: left !important; }
.battle-pair .land-player-copy { display: flex !important; flex-direction: column; min-width: 0; text-align: inherit !important; }
.battle-pair .is-attacker .land-player-copy { align-items: flex-end; }
.battle-pair .land-player-label { display: none !important; }
.battle-pair .land-player-name { font-family: var(--ad-font-display) !important; font-weight: 800 !important; font-size: 18px !important; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.battle-pair .land-player-name .you-label { display: block; font-family: var(--ad-font-ui); font-weight: 600; font-size: 13px; color: var(--ad-muted); }
.battle-pair .land-player-avatar { width: 60px !important; height: 60px !important; overflow: visible; }
.battle-crossed-swords { width: 36px; height: 36px; flex: none; overflow: visible; }
.battle-crossed-swords .battle-sword-blade { fill: var(--ad-ink); }
.battle-crossed-swords .battle-sword-hilt { fill: none; stroke: var(--ad-lime); stroke-width: 4.5; stroke-linecap: round; }
.land-sidecar .battle-pair { column-gap: 10px !important; }
.land-sidecar .battle-pair .land-player-avatar { width: 52px !important; height: 52px !important; }
.land-sidecar .battle-pair .land-player-name { font-size: 16px !important; }

/* In: both pieces rush to the swords, overshoot (the clash), settle; the swords snap in on impact. */
.battle-pair .is-attacker .land-player-avatar { animation: bp-in-left 560ms cubic-bezier(.2, .9, .3, 1.25) both, bp-bob 2.6s 900ms ease-in-out infinite alternate !important; }
.battle-pair .is-defender .land-player-avatar { animation: bp-in-right 560ms cubic-bezier(.2, .9, .3, 1.25) 60ms both, bp-bob 2.6s 1150ms ease-in-out infinite alternate !important; }
.battle-pair .land-player-copy { animation: ad-fade-in 300ms ease 220ms both; }
.battle-pair .battle-crossed-swords { animation: bp-swords-in 420ms cubic-bezier(.2, .9, .3, 1.4) 300ms both; }
/* The entrance moves with translate/rotate/scale and the endless bob with transform: two transform animations on one
   element both drop to the main thread, and an SVG root can only composite transform. */
@keyframes bp-in-left { 0% { translate: -70px 0; rotate: -14deg; scale: .6; opacity: 0; } 60% { translate: 8px 0; rotate: 6deg; scale: 1.08; opacity: 1; } 100% { translate: none; rotate: none; scale: none; opacity: 1; } }
@keyframes bp-in-right { 0% { translate: 70px 0; rotate: 14deg; scale: .6; opacity: 0; } 60% { translate: -8px 0; rotate: -6deg; scale: 1.08; opacity: 1; } 100% { translate: none; rotate: none; scale: none; opacity: 1; } }
@keyframes bp-swords-in { 0% { transform: scale(0) rotate(-120deg); opacity: 0; } 65% { transform: scale(1.3) rotate(12deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes bp-bob { from { transform: none; } to { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .battle-pair .is-attacker .land-player-avatar, .battle-pair .is-defender .land-player-avatar, .battle-pair .land-player-copy, .battle-pair .battle-crossed-swords { animation: none !important; } }

/* Out: a short wind-up towards the centre, then off their own sides; the row folds away. */
.battle-pair.is-leaving { overflow: hidden; animation: bp-fold 380ms var(--ad-ease) 720ms both; }
.battle-pair.is-leaving .land-player-avatar, .battle-pair.is-leaving .land-player-copy { animation: none !important; }
.battle-pair.is-leaving .is-attacker { animation: bp-out-left 520ms cubic-bezier(.6, -0.3, .7, .05) 300ms both; }
.battle-pair.is-leaving .is-defender { animation: bp-out-right 520ms cubic-bezier(.6, -0.3, .7, .05) 340ms both; }
.battle-pair.is-leaving .battle-crossed-swords { animation: bp-swords-out 320ms ease-in 300ms both; }
@keyframes bp-out-left { to { transform: translateX(-75vw); opacity: 0; } }
@keyframes bp-out-right { to { transform: translateX(75vw); opacity: 0; } }
@keyframes bp-swords-out { to { transform: scale(0) rotate(90deg); opacity: 0; } }
@keyframes bp-fold { from { max-height: 120px; } to { max-height: 0; margin-block: 0; } }

/* Outcome: the winner jumps and stays up front; the loser deflates. */
.battle-pair.has-outcome .battle-winner .land-player-avatar { animation: bp-win 720ms cubic-bezier(.2, .9, .3, 1.3) both !important; }
.battle-pair.has-outcome .battle-winner .land-player-name { color: var(--ad-lime) !important; }
.battle-pair.has-outcome .battle-loser { opacity: .5; filter: grayscale(.5); transition: opacity 400ms ease, filter 400ms ease; }
.battle-pair.has-outcome .battle-loser .land-player-avatar { animation: bp-lose 600ms var(--ad-ease) both !important; }
@keyframes bp-win { 0% { transform: none; } 30% { transform: translateY(-14px) scale(1.18); } 60% { transform: translateY(0) scale(.94, 1.06); } 100% { transform: scale(1.08); } }
@keyframes bp-lose { 0% { transform: none; } 40% { transform: translateY(4px) scale(1.05, .9) rotate(-4deg); } 100% { transform: scale(.9); } }

/* Player strip: 10px between entries; piece | name over score, both in the name's type. */
.player-strip { column-gap: 10px !important; }
/* The gap separates entries now; no divider lines (outranks the legacy :nth-child dividers). */
.player-strip .player-card.strip-card:nth-child(n):nth-child(n) { border-left: 0 !important; }
.player-strip .player-card.strip-card .player-card-copy { display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: flex-start !important; gap: 1px !important; height: auto !important; min-height: 0 !important; position: relative !important; }
.player-strip .strip-card .player-name-row { display: flex !important; align-items: center !important; gap: 5px !important; width: 100%; min-width: 0; }
.player-strip .strip-card .player-name { min-width: 0; }
.player-strip .strip-card .player-score-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; width: 100%; }
.player-strip .strip-card .score-total-stack { position: relative; height: auto !important; flex: none; font-family: var(--ad-font-ui) !important; }
.player-strip .strip-card .player-card-copy .player-score { width: auto !important; min-width: 0 !important; max-width: none !important; overflow: visible !important; display: inline-flex !important; align-items: baseline; gap: 3px; font-family: var(--ad-font-ui) !important; font-size: 12px !important; font-weight: 750 !important; line-height: 1.2 !important; color: var(--ad-ink) !important; font-variant-numeric: tabular-nums; }
.player-strip .strip-card .player-card-copy .player-score small { display: inline !important; font-size: 12px !important; font-weight: 600 !important; color: var(--ad-muted) !important; }
/* Points gained sit beside both the name and the score, centred on the pair. They take no layout space, so
   nothing on the card moves when they arrive; the mute icon and the bot note step aside while they show. */
.player-strip .strip-card .score-total-stack { display: inline-flex !important; align-items: baseline; gap: 6px; }
.player-strip .strip-card .player-card-copy > .player-score-delta-slot {
  position: absolute !important; top: 50% !important; right: 0 !important; left: auto !important; bottom: auto !important; translate: 0 -50%; transform: none !important;
  width: auto !important; height: auto !important; min-height: 0 !important; display: flex !important; align-items: center !important; pointer-events: none;
}
/* Long names give way to the points rather than running under them. */
.player-strip .strip-card.is-awarding .player-name-row { max-width: calc(100% - 34px); }
.player-strip .strip-card .player-card-copy > .player-score-delta-slot:empty { display: none !important; }
.player-strip .strip-card .player-score-delta { position: static !important; height: auto !important; min-height: 0 !important; max-width: none !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; overflow: visible !important; animation: ad-stamp 360ms cubic-bezier(.2, .9, .3, 1.4) both !important; }
.player-strip .strip-card .player-score-delta b { font-family: var(--ad-font-display, var(--ad-font-ui)) !important; font-size: 24px !important; font-weight: 800 !important; line-height: 1 !important; letter-spacing: -.5px; color: var(--ad-lime) !important; -webkit-text-stroke: 0 !important; font-variant-numeric: tabular-nums; }
.player-strip .strip-card .player-score-delta small { display: none !important; }
.player-strip .strip-card.is-awarding .player-meta { visibility: hidden !important; }
.player-strip .strip-card .player-name-row { min-height: 18px; }
.player-strip .strip-card.is-awarding .player-name-row .player-mute-button { visibility: hidden !important; position: absolute !important; }
@media (max-width: 520px) { .player-strip .strip-card .player-score-delta b { font-size: 19px !important; } }
.player-strip .strip-card .player-meta { display: block !important; flex: 1 1 auto; min-width: 0; height: auto !important; line-height: 1.2 !important; margin: 0 !important; font-size: 11px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-strip .strip-card .player-meta::before { content: none; }
@media (max-width: 520px) { .player-strip .strip-card .player-bot { display: none; } }
/* Large viewports: the piece sits above the name and points. The card is a grid whose layered
   !important column template cannot be beaten, so both children span every column and stack instead. */
@media (min-width: 1100px) {
  /* The stacked card is taller than the side-by-side one: let it take its height so the strip never scrolls. */
  .player-strip .player-card.strip-card { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; row-gap: 4px; text-align: center; padding-top: 4px; padding-bottom: 4px; }
  .player-strip:has(> .player-card.strip-card) { overflow-y: visible !important; height: auto !important; max-height: none !important; }
  .player-strip .player-card.strip-card > .player-score-anchor { grid-column: 1 / -1 !important; grid-row: 1 !important; justify-self: center; }
  .player-strip .player-card.strip-card > .player-card-copy { grid-column: 1 / -1 !important; grid-row: 2 !important; align-items: center !important; justify-self: center !important; width: max-content !important; max-width: 100%; }
  /* Centred cards: the points hang just right of the name and score instead of at the card edge. */
  .player-strip .strip-card .player-card-copy > .player-score-delta-slot { right: auto !important; left: calc(100% + 8px) !important; }
  .player-strip .strip-card.is-awarding .player-name-row { max-width: none; }
  .player-strip .strip-card.is-awarding .player-name-row .player-mute-button { position: static !important; }
  .player-strip .strip-card .player-name-row { justify-content: center; width: auto; }
  .player-strip .strip-card .player-score-row { justify-content: center; width: auto; }
  .player-strip .strip-card .player-meta { flex: 0 1 auto; }
}
.player-status { display: inline-flex; align-items: center; flex: none; height: 14px; align-self: center; }
.answered-tick { color: var(--ad-lime); flex: none; animation: ad-quick-in 260ms cubic-bezier(.2, .9, .3, 1.3) both; }

/* Still answering: three dots taking turns. */
.answering-dots { display: inline-flex; align-items: center; gap: 3px; height: 14px; color: var(--ad-ink); }
.answering-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; animation: ad-dot 1.2s ease-in-out infinite; }
.answering-dots i:nth-child(2) { animation-delay: .2s; } .answering-dots i:nth-child(3) { animation-delay: .4s; }
/* The results table is laid out hidden to reserve its space: its dots would tick on the main thread unseen. */
.answer-slot-table.is-reserved .answering-dots i { animation: none; }
@keyframes ad-dot { 0%, 70%, 100% { opacity: .4; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }

/* Mute: just the glyph, in the names' colour. Muted shows the crossed speaker, quieter. */
.player-mute-button, .player-mute-button.is-muted, .player-mute-button:hover, .lobby-player > .player-mute-button.is-muted {
  background: transparent !important; border: 0 !important; box-shadow: none !important; outline-offset: 2px; color: var(--ad-ink) !important; padding: 0 !important;
}
.player-mute-button.is-muted { opacity: .55; }
.player-card .player-mute-button { flex: 0 0 18px !important; width: 18px !important; height: 18px !important; margin-left: auto; }

/* Live answers: a line per player drawn the moment they lock in; no side highlights. */
.live-answer-row, .live-answer-row.is-done { display: grid !important; grid-template-columns: 28px minmax(0, 92px) minmax(0, 1fr) 62px !important; gap: 10px !important; align-items: center; min-height: 40px; padding: 4px 10px !important; border: 0 !important; border-radius: 10px !important; background: var(--ad-night-3) !important; box-shadow: none !important; }
.live-answer-row::before, .live-answer-row::after { content: none !important; display: none !important; }
.live-answer-row.is-waiting .live-answer-name { color: var(--ad-muted); }
.live-answer-track { height: 10px; border-radius: 5px; background: var(--ad-night); overflow: hidden; }
.live-answer-track i { display: block; height: 100%; border-radius: 5px; background: var(--player); transform-origin: left center; animation: ad-bar 520ms var(--ad-ease) both; }
.live-answer-time { display: inline-flex; justify-content: flex-end; min-width: 0 !important; font-family: var(--ad-font-display); font-weight: 800; color: var(--ad-ink) !important; }
.live-reveal { display: flex; flex-direction: column; gap: 12px; }

/* Votes: one or the other, drawn in the question's ink. */
.question-feedback-buttons > button, .question-feedback-buttons > button.active, .question-feedback-buttons > button:disabled {
  color: var(--ad-ink) !important; background: var(--ad-night-3) !important; border: 0 !important; box-shadow: none !important; font-size: 0 !important; display: inline-grid !important; place-items: center;
  transition: opacity 200ms ease, transform 120ms ease !important;
}
.question-feedback-buttons > button:disabled { cursor: default; }
.question-feedback-buttons > button.active { opacity: 1 !important; }
.question-feedback-buttons > button.active .vote-glyph path:last-child { fill: currentColor; }
.question-feedback-buttons > button.active .vote-glyph { animation: ad-quick-in 300ms cubic-bezier(.2, .9, .3, 1.4) both; }
.question-feedback-buttons > button.is-other { opacity: .45 !important; }
.question-feedback-buttons > button:not(:disabled):active { transform: scale(.92); }

/* Number line: an axis end label steps aside when the answer's label lands on it. */

/* Quick five: one compact rating row, so the standings keep the stage. */
.rapid-review-votes { display: flex !important; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px !important; margin: 4px 0 0 !important; }
.rapid-votes-label { font-size: 13px; font-weight: 700; color: var(--ad-muted); }
.rapid-vote-row { display: inline-flex !important; align-items: center; gap: 4px !important; padding: 0 !important; background: none !important; }
.rapid-vote-row > span { font-size: 12px; font-weight: 800; color: var(--ad-muted); }
.rapid-vote-row .question-feedback-buttons { gap: 2px !important; margin: 0 !important; }
.rapid-vote-row .question-feedback-buttons > button { min-width: 0 !important; width: 32px !important; height: 32px !important; min-height: 32px !important; padding: 0 !important; border-radius: 9px !important; }
.rapid-vote-row .vote-glyph { width: 16px; height: 16px; }
/* Reveals end above the sticky player strip, so the last row and the votes stay reachable. */
@media (max-width: 860px) { .review-with-votes { padding-bottom: 104px !important; } }

/* Answers fill with your colour the moment you tap, even with a sticky touch hover. */
@media (hover: none) { .answer-option:hover:not(:disabled) { background: var(--ad-night-3) !important; } }
.answer-option.chosen, .answer-option.chosen:hover, .answer-option.chosen:hover:not(:disabled), .answer-option[aria-pressed="true"]:hover { background: var(--me) !important; color: var(--ad-night) !important; transition: transform 70ms ease-out, opacity 160ms ease !important; }

/* Tile map: pinch to zoom (useMapZoom). Outlines are non-scaling, so they keep their width at any zoom;
   on phones they are thinner, because the whole map is small. */
.candy-board .map-pinch-hint { fill: var(--ad-muted); font-family: var(--ad-font-ui); font-weight: 700; pointer-events: none; user-select: none; }
@media (pointer: fine) { .candy-board .map-pinch-hint { display: none; } }
.shared-stage .candy-board .map-pinch-hint { display: none; }
.candy-board .map-zoom-reset { cursor: pointer; }
.candy-board .map-zoom-reset circle { fill: var(--ad-night-2); stroke: var(--ad-night-4); stroke-width: 1.5; }
.candy-board .map-zoom-reset path { stroke: var(--ad-ink); }
.candy-board .map-zoom-reset:focus-visible { outline: none; } .candy-board .map-zoom-reset:focus-visible circle { stroke: var(--ad-lime); stroke-width: 3; }
@media (max-width: 700px) {
  .candy-board .tile { stroke-width: 3px !important; }
  .candy-board .tile.eligible, .candy-board .tile.eligible-view { stroke-width: 2.5px !important; stroke-dasharray: 6 5 !important; }
  .candy-board .tile.selected-tile, .candy-board .tile.attack-target-tile { stroke-width: 4px !important; }
}

/* Word entry: notes sit on their own line under the buttons, never pushing them. Stuck for a while?
   The reveal button gives up to three small shakes, 5 s apart, instead of a written hint; they stop once
   a hint is used or a guess is tried (hints cost points, so the nudge stays light). */
.word-entry-actions { display: flex !important; flex-wrap: wrap !important; justify-content: center; align-items: center; }
.word-entry-actions .word-hint-status, .word-entry-actions .word-space-hint { flex: 0 0 100% !important; order: 10; text-align: center; margin: 2px 0 0 !important; font-size: 14px; color: var(--ad-muted); }
.word-hint-button.is-nudging:not(:disabled) { animation: ad-nudge 5s ease-in-out 3; }
@keyframes ad-nudge { 0%, 10%, 100% { transform: none; } 2% { transform: translateX(-3px) rotate(-2deg); } 4% { transform: translateX(3px) rotate(2deg); } 6% { transform: translateX(-2px) rotate(-1deg); } 8% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .word-hint-button.is-nudging:not(:disabled) { animation: none; box-shadow: inset 0 0 0 2px var(--ad-lime) !important; } }

/* Order: the end labels are readable. */
.order-area .order-end-label { font-size: 13px !important; letter-spacing: .08em !important; font-weight: 800 !important; line-height: 1.4; }

/* Reveal impact: pieces drop and squash, the truth punches, verdicts stamp. */
.ad-piece.is-in { animation: ad-drop 420ms cubic-bezier(.3, .7, .4, 1) both; }
.ad-piece.is-first.is-in { animation: ad-pop-in 560ms var(--ad-ease) both; }
@keyframes ad-drop { 0% { transform: translateY(-30px) scale(.5); opacity: 0; } 55% { transform: translateY(0) scale(1.18, .82); opacity: 1; } 78% { transform: scale(.94, 1.06); } 100% { transform: none; opacity: 1; } }
.ad-card { position: relative; transition: opacity 400ms ease, transform 400ms var(--ad-ease); }
.ad-card.is-flash { animation: ad-flash 1150ms linear both, ad-punch 520ms cubic-bezier(.2, .9, .3, 1.4) both; }
.ad-card.is-flash::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 3px solid var(--ad-lime); pointer-events: none; animation: ad-burst 700ms var(--ad-ease) both; }
.ad-card.is-dim { transform: scale(.98); }
@keyframes ad-punch { 0% { transform: scale(1); } 30% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes ad-burst { from { opacity: 1; transform: scale(.97); } to { opacity: 0; transform: scale(1.12); } }
.ad-time-row.is-judged .ad-time-mark { animation: ad-stamp 360ms cubic-bezier(.2, .9, .3, 1.4) both; }
.ad-time-row.is-judged .ad-time-points { animation: ad-stamp 360ms cubic-bezier(.2, .9, .3, 1.4) 90ms both; }
.ad-order-tile i { animation: ad-stamp 300ms cubic-bezier(.2, .9, .3, 1.4) both; }
.ad-order-tile:nth-child(2) i { animation-delay: 90ms; } .ad-order-tile:nth-child(3) i { animation-delay: 180ms; }
@keyframes ad-stamp { 0% { transform: scale(1.9); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: none; opacity: 1; } }
.ad-line-truth.is-flash i { transform-origin: bottom; animation: ad-grow-up 420ms cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes ad-grow-up { from { transform: scaleY(0); } to { transform: none; } }
.ad-reveal-question.is-answer { color: var(--ad-lime) !important; animation: ad-answer-in 480ms cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes ad-answer-in { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }

@media (max-width: 860px) {
  /* Order strips wrap on phones instead of running off the card. */
  .ad-order-strip { flex-wrap: wrap !important; }
  .ad-order-tile { white-space: normal !important; }
  /* Geography table: six columns on phones, like every other kind. */
  .ad-kind-geo .ad-time-row { grid-template-columns: minmax(0, 1fr) 0 minmax(58px, max-content) 74px 20px 34px !important; }
}

/* Maps get the height on phones; the view widens or deepens to fill it (see quizClampGeoView). */
.geo-map, .geo-map > svg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.geo-map > svg { touch-action: none !important; }
@media (max-width: 700px) {
  .geo-question .geo-map > svg { aspect-ratio: auto !important; height: clamp(300px, 52dvh, 560px) !important; min-height: 0 !important; }
  /* Reveal: as tall as the screen allows while the closest-first table stays above the player strip. */
  .ad-geo-map .geo-map > svg { aspect-ratio: auto !important; height: clamp(240px, calc(100dvh - 450px), 540px) !important; min-height: 0 !important; }
  .ad-reveal:has(> .battle-pair) .ad-geo-map .geo-map > svg { height: clamp(220px, calc(100dvh - 580px), 500px) !important; }
  /* Question: timer and title above the map, the lock button under it. */
  .geo-question .geo-question-copy { display: contents !important; }
  .geo-question .geo-layout { display: flex !important; flex-direction: column; gap: 12px !important; }
  .geo-question .geo-layout > .geo-map { order: 0; }
  .geo-question .geo-question-copy > * { order: -1; }
  .geo-question .geo-question-copy > .primary, .geo-question .geo-question-copy > .live-answer-results { order: 1; width: 100%; }
  .geo-question .geo-question-copy > .stage-title { margin: 0 !important; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .battle-pair *, .battle-pair, .answering-dots i, .answered-tick, .live-answer-track i, .question-feedback-buttons *, .ad-reveal-question.is-answer { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .answering-dots i { opacity: .7; }
}

/* Settings: a switch whose thumb fills its track. A touch-target min-height used to stretch the track to 44px tall around a 16px thumb;
   the track is now 52×30 with a 24px thumb, and an invisible halo keeps the 44px tap area. */
[data-slot="switch"] { position: relative; width: 52px !important; min-width: 52px !important; height: 30px !important; min-height: 30px !important; padding: 2px !important; }
[data-slot="switch"]::before { content: ""; position: absolute; inset: -7px -4px; }
[data-slot="switch-thumb"] { width: 24px !important; height: 24px !important; box-shadow: 0 1px 3px #0006; }
[data-slot="switch"][data-state="checked"] > [data-slot="switch-thumb"] { translate: 22px 0 !important; }
[data-slot="switch"][data-state="unchecked"] > [data-slot="switch-thumb"] { translate: 0 0 !important; }

/* Question timers: the seconds match the label's size everywhere. In Settings: two per row, labels in full (phone and desktop). */
.duration-grid input { font-size: inherit !important; font-weight: 750; }
.question-duration-controls.compact .duration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 14px !important; }
.question-duration-controls.compact .duration-grid label { grid-template-columns: minmax(0, 1fr) 56px !important; gap: 8px !important; font-size: 14px !important; }
.question-duration-controls.compact .duration-grid label > span { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.15; }
.question-duration-controls.compact .duration-grid input { width: 56px !important; height: 40px !important; min-height: 40px !important; }
.question-duration-controls.compact .duration-grid small { display: none !important; }

/* Lobby: Randomise sits on the Colour label's row. */
.lobby-identity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lobby-identity-head .randomise-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px !important; padding: 5px 12px !important; border-radius: 999px !important; font-size: 13px !important; font-weight: 800; }
.lobby-identity-head .randomise-button span { font-size: 15px; line-height: 1; }

/* Lobby, guest: "Waiting for host…" reads like the invite chip (dark on lime) at Leave lobby's size, both centred in buttons that hug their labels. */
.lobby-bottom { align-items: stretch !important; }
.lobby-bottom .lobby-leave-button, .lobby-bottom .start-game:has(> p) { min-height: 44px !important; padding: 8px 16px !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 14px !important; line-height: 1.2 !important; }
/* Host: the wrapper is only a slot; the Start game button inside fills it (one button, not a button in a button). */
.lobby-bottom .start-game:has(> .primary) { display: flex !important; padding: 0 !important; background: none !important; }
.lobby-bottom .start-game > .primary { flex: 1 1 auto; width: 100% !important; min-height: 44px !important; justify-content: center !important; }
.lobby-bottom .start-game > p { margin: 0 !important; color: #120a1f !important; font-size: 14px !important; line-height: 1.2 !important; font-weight: 800 !important; text-align: center; }

/* Lobby map preview: the map as big as the card allows, 20px clear on each side. */
.lobby-map-preview { padding: 12px 20px !important; }
.lobby-map-preview-board { position: relative; flex: 1 1 auto; min-height: 96px !important; max-height: none !important; }
.lobby-map-preview-board .candy-board { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; min-height: 0 !important; }
/* Mini maps (lobby preview) draw thin seams so the tiles read as one map at small sizes. */
.lobby-map-preview-board .candy-board .tile { stroke-width: 2px !important; }
/* Phones: the lobby's spare height goes to the map preview instead of empty bands above and below. */
@media (max-width: 700px) {
  .lobby.screen-enter { display: flex !important; flex-direction: column; }
  .lobby.screen-enter > .lobby-config-grid { flex: 1 1 auto; grid-template-rows: auto minmax(0, 1fr); }
}
/* Wider screens with height to spare: the map preview moves under the bots, tiles and map controls and takes the spare height,
   instead of a thin strip beside them; it only ever grows into spare height. Shorter windows keep the side-by-side layout. */
@media (min-width: 701px) and (min-height: 1150px) {
  .lobby.screen-enter { display: flex !important; flex-direction: column; }
  /* The lobby fills the stage (it otherwise sizes to its content), so there is spare height for the preview to take. */
  .main-stage > .lobby.screen-enter:has(> .lobby-config-grid) { flex: 1 1 auto !important; }
  .lobby.screen-enter > .lobby-config-grid { flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(0, 1fr); }
  .lobby-config-grid > .lobby-map-preview { min-height: 0; }
  /* Same floor as side by side, so stacking never makes the lobby taller than the window (fit-stage would shrink it all). */
  .lobby-config-grid .lobby-map-preview-board { min-height: 96px !important; }
}

/* Tap-to-answer questions (multiple choice, Quick 5): timer, question, votes and answers sit together as one centred block.
   The question gets a three-line slot and each answer a two-line slot, so nothing moves from one question to the next. */
.question-screen:has(> .answer-options) { justify-content: center !important; }
.question-screen:has(> .answer-options) > .question-heading h1 { min-height: 3lh; display: flex; align-items: center; justify-content: center; margin: 0 !important; }
.question-screen:has(> .answer-options) > .answer-options { margin-block: 14px 0 !important; }
.question-screen:has(> .answer-options) .answer-option { min-height: 64px; }

/* Emote menu: floats over everything from a portal (the player strip scrolls and would clip it); your piece opens it too. */
.emoji-menu.is-floating { position: fixed !important; z-index: 200 !important; top: var(--menu-top, auto) !important; right: auto !important; left: var(--menu-left) !important; bottom: var(--menu-bottom) !important; max-width: calc(100vw - 16px); flex-wrap: wrap; }
.player-score-anchor.emoji-piece-button { cursor: pointer; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
.player-score-anchor.emoji-piece-button:focus-visible { outline: 2px solid var(--ad-lime, #d8ff36); outline-offset: 2px; }

/* Lobby colour and shape rows: › and ‹ step through the row, over a fade so the cut-off choice reads as "more this way". */
.scroll-choice-wrap { position: relative; min-width: 0; }
.scroll-choice-wrap > .identity-choice-row { cursor: grab; }
.scroll-choice-wrap > .identity-choice-row.is-dragging { cursor: grabbing; scroll-snap-type: none !important; user-select: none; }
.scroll-choice-wrap > .identity-choice-row.is-dragging * { pointer-events: none; }
.scroll-choice-wrap::before, .scroll-choice-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; width: 56px; pointer-events: none; opacity: 0; transition: opacity .2s ease; z-index: 1; }
.scroll-choice-wrap::before { left: 0; background: linear-gradient(90deg, var(--ad-night-2, #1d1230) 35%, transparent); }
.scroll-choice-wrap::after { right: 0; background: linear-gradient(270deg, var(--ad-night-2, #1d1230) 35%, transparent); }
.scroll-choice-wrap.can-back::before, .scroll-choice-wrap.can-forward::after { opacity: 1; }
.scroll-choice-step { position: absolute; top: 50%; z-index: 2; width: 34px; height: 34px; margin-top: -17px; display: grid; place-items: center; padding: 0 0 3px; border: 1px solid #ffffff26; border-radius: 999px; background: #2a1b43; color: #f7f2ff; font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px #0007; animation: scroll-step-in .18s ease-out both; }
.scroll-choice-step.back { left: 2px; }
.scroll-choice-step.forward { right: 2px; }
.scroll-choice-step:hover, .scroll-choice-step:focus-visible { background: #3a2760; outline: none; }
.scroll-choice-step::before { content: ""; position: absolute; inset: -6px; }
@keyframes scroll-step-in { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }

/* Final screen confetti: a dense, slow shower that sways as it falls the full height of the screen. */
.final-confetti { position: fixed !important; inset: 0 !important; z-index: 5; overflow: hidden; }
.final-confetti { perspective: 600px; }
/* Paper falls at a near-steady speed (it reaches terminal velocity almost at once), flutters side to side and tumbles in 3D, so each
   piece flashes its face as it turns. Every piece loops; the screen-side delays keep the shower even (final-screen.js). */
.final-confetti i { top: -24px !important; animation: final-confetti-fall var(--dur, 7s) linear var(--delay) infinite !important; }
/* Every piece is restyled on each main-thread frame (the timers tick ten times a second), so a narrow screen shows half of them:
   60 pieces across a phone is as dense as 120 across a desktop. */
@media (max-width: 760px) { .final-confetti i:nth-child(n+61) { display: none; } }
@keyframes final-confetti-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate3d(1, .35, 0, 0deg) rotate(0deg); }
  4% { opacity: 1; }
  20% { transform: translate(var(--drift), 20vh) rotate3d(1, .35, 0, calc(var(--flip) * 180deg)) rotate(120deg); }
  40% { transform: translate(calc(var(--drift) * -.6), 41vh) rotate3d(1, .35, 0, calc(var(--flip) * 360deg)) rotate(230deg); }
  60% { transform: translate(calc(var(--drift) * .9), 62vh) rotate3d(1, .35, 0, calc(var(--flip) * 540deg)) rotate(350deg); }
  80% { transform: translate(calc(var(--drift) * -.4), 82vh) rotate3d(1, .35, 0, calc(var(--flip) * 720deg)) rotate(460deg); }
  96% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--drift) * .3), calc(100vh + 30px)) rotate3d(1, .35, 0, calc(var(--flip) * 900deg)) rotate(570deg); }
}

/* Final standings: each row fills with a bar in the player's colour, as long as their score against the winner's.
   Bars grow in from 1st downwards; the winner wears a crown and glows. */
.final-row { position: relative; isolation: isolate; border-color: #ffffff14 !important; background: #ffffff06 !important; }
/* The row card, score bar, winner row and crown colours are set in the "Final standings and highlight reel" block at the end of this file. */
.final-row .rank-number { min-width: 1.1em; font-weight: 900; }
.final-screen .final-ranking { grid-template-columns: minmax(0, 1fr) !important; justify-content: stretch !important; }
.final-row.first .rank-number { color: #d8ff36; }
.final-row > strong { position: relative; }
.final-piece { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; }
.final-crown { position: absolute; top: -13px; left: 50%; width: 22px; height: 15px; margin-left: -11px; fill: #ffd84a; stroke: #120a1f; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 0 5px #ffd84a99); animation: final-crown-drop 600ms cubic-bezier(.3, 1.6, .5, 1) 1.1s both; }
@keyframes final-crown-drop { from { opacity: 0; transform: translateY(-10px) rotate(-14deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .final-crown, .final-row.first { animation: none !important; transition: none !important; } }

/* Final screen highlight reel: one clip at a time, story-style progress, each kind of moment with its own entrance. */
.highlight-reel { position: relative; display: grid; gap: 10px; width: 100%; padding: 12px 14px 14px; border: 1px solid #ffffff1c; border-radius: 18px; background: radial-gradient(120% 90% at 50% 0%, #3a2463, #1d1230 70%); color: var(--ad-ink, #f7f2ff); text-align: left; cursor: pointer; overflow: hidden; box-shadow: 0 10px 30px #0006; }
.hl-progress { display: flex; gap: 4px; }
.hl-progress i { flex: 1; height: 3px; border-radius: 3px; background: #ffffff26; overflow: hidden; position: relative; }
.hl-progress i::after { content: ""; position: absolute; inset: 0; background: #d8ff36; transform-origin: left; transform: scaleX(0); }
.hl-progress i.done::after { transform: scaleX(1); }
.hl-progress i.now::after { animation: hl-progress var(--highlight-clip-ms, 4200ms) linear both; }
.highlight-reel.hl-hook .hl-progress i.now::after { animation: none; transform: scaleX(1); }
@keyframes hl-progress { to { transform: scaleX(1); } }
.hl-clip { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; animation: hl-clip-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes hl-clip-in { from { opacity: 0; transform: translateX(28px) scale(.96); } to { opacity: 1; transform: none; } }
.hl-stage { position: relative; display: flex; align-items: center; justify-content: center; min-width: 96px; height: 84px; }
.hl-stage.is-pair { min-width: 150px; gap: 2px; }
.hl-piece { position: relative; display: grid; place-items: center; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--player) 55%, transparent)); }
.hl-glyph { font-size: 24px; line-height: 1; z-index: 2; animation: hl-glyph-hit .5s .55s cubic-bezier(.3, 1.8, .5, 1) both; }
.hl-icon { position: absolute; right: 2px; bottom: 2px; font-size: 26px; line-height: 1; animation: hl-glyph-hit .5s .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.hl-rays { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; background: repeating-conic-gradient(color-mix(in srgb, var(--player) 50%, transparent) 0 12deg, transparent 12deg 30deg); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: hl-rays 6s linear infinite, hl-fade-in .4s both; }
.is-solo .hl-piece { animation: hl-pop .55s cubic-bezier(.3, 1.7, .5, 1) both; }
.is-pair .hl-piece.lead { animation: hl-lunge .7s cubic-bezier(.2, .9, .3, 1) both; }
.is-pair .hl-piece.other { animation: hl-recoil .7s .45s ease-out both; }
.hl-copy { display: grid; gap: 3px; min-width: 0; }
.hl-kicker { color: #d8ff36; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.hl-title { font-size: 19px; font-weight: 900; line-height: 1.12; letter-spacing: -.01em; }
.hl-detail { color: #c9b8dd; font-size: 13px; line-height: 1.3; }
.hl-hint { position: absolute; right: 12px; bottom: 6px; color: #ffffff59; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
/* Per-kind moments. */
.hl-knockout .is-pair .hl-piece.other { animation: hl-knocked .9s .45s cubic-bezier(.4, 0, .6, 1) both; }
.hl-betrayal .is-pair .hl-piece.lead { animation: hl-turn .9s cubic-bezier(.2, .9, .3, 1) both; }
.hl-dethroned .hl-glyph { animation: hl-crown-pass .9s .3s cubic-bezier(.3, 1.4, .5, 1) both; }
.hl-photo .hl-glyph { animation: hl-flash .6s .4s ease-out both; }
.hl-streak .hl-icon { animation: hl-glyph-hit .5s .35s cubic-bezier(.3, 1.8, .5, 1) both, hl-flicker .5s .9s ease-in-out infinite alternate; }
.hl-lightning .is-solo .hl-piece { animation: hl-zip .45s cubic-bezier(.1, .9, .2, 1) both; }
.hl-hook { background: radial-gradient(120% 90% at 50% 0%, #4a5a12, #1d1230 72%); border-color: #d8ff3666; }
.hl-hook .hl-title { color: #d8ff36; }
@keyframes hl-pop { from { opacity: 0; transform: scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes hl-glyph-hit { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: none; } }
@keyframes hl-rays { to { rotate: 360deg; } }
@keyframes hl-fade-in { from { opacity: 0; } }
@keyframes hl-lunge { 0% { opacity: 0; transform: translateX(-36px); } 55% { opacity: 1; transform: translateX(14px) scale(1.08); } 100% { transform: none; } }
@keyframes hl-recoil { 0% { transform: none; } 30% { transform: translateX(10px) rotate(10deg); } 100% { transform: none; } }
@keyframes hl-knocked { 0% { transform: none; opacity: 1; } 100% { transform: translate(46px, -14px) rotate(220deg) scale(.6); opacity: .25; } }
@keyframes hl-turn { 0% { opacity: 0; transform: translateX(-30px) scaleX(-1); } 45% { opacity: 1; transform: translateX(-6px) scaleX(-1); } 60% { transform: scaleX(1); } 80% { transform: translateX(12px) scale(1.08); } 100% { transform: none; } }
@keyframes hl-crown-pass { 0% { opacity: 0; transform: translate(40px, -10px); } 50% { opacity: 1; transform: translate(10px, -30px) rotate(-20deg); } 100% { transform: translate(-36px, -30px) rotate(-12deg); } }
@keyframes hl-flash { 0% { opacity: 0; filter: brightness(4); transform: scale(1.8); } 100% { opacity: 1; filter: none; transform: none; } }
@keyframes hl-flicker { from { scale: 1; rotate: -4deg; } to { scale: 1.15; rotate: 4deg; } }
@keyframes hl-zip { 0% { opacity: 0; transform: translateX(-60px) skewX(-20deg); } 70% { opacity: 1; transform: translateX(6px) skewX(8deg); } 100% { transform: none; } }
@media (max-width: 420px) { .hl-stage.is-pair { min-width: 124px; } .hl-title { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .highlight-reel *, .highlight-reel *::after { animation: none !important; } .hl-progress i.now::after { transform: scaleX(.5); } }
/* TV: the reel sits under the winner line, sized for the room. */
.shared-end .highlight-reel { max-width: 720px; margin: 8px auto 14px; padding: 16px 20px 20px; }
.shared-end .hl-title { font-size: 30px; }
.shared-end .hl-detail { font-size: 18px; }
.shared-end .hl-kicker { font-size: 14px; }
.shared-end .hl-stage { transform: scale(1.25); margin: 0 18px; }

/* TV: the whole stage fits the screen. The leaderboard gives up height first; the room code always stays in view. */
.shared-stage { min-height: 0 !important; }
.shared-layout { height: 100% !important; min-height: 0 !important; }
.shared-columns { flex: 1 1 auto; min-height: 0 !important; }
.shared-sidebar { min-height: 0 !important; overflow: hidden; }
.shared-sidebar > .shared-score-list { flex: 0 1 auto; min-height: 0; overflow: hidden; }
@media (max-height: 820px) {
  .shared-sidebar { gap: 10px !important; }
  .shared-sidebar > .shared-progress { padding-block: 4px !important; }
  .shared-sidebar .shared-score-list { gap: 6px !important; grid-auto-rows: auto !important; grid-template-rows: none !important; }
  .shared-sidebar .shared-score { min-height: 0 !important; height: auto !important; padding-block: 5px !important; }
  .shared-sidebar .shared-score .avatar { width: 28px !important; height: 28px !important; }
}

/* On-screen keys for number and word answers: big, flat, thumb-sized, in the game's night palette. */
.onscreen-keys { display: grid; gap: 6px; width: 100%; max-width: 520px; margin: 4px auto 0; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.onscreen-key-row { display: flex; justify-content: center; gap: 6px; }
.onscreen-key { flex: 1 1 0; min-width: 0; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid #ffffff14; border-radius: 10px; background: var(--ad-night-3, #2a1b43); color: var(--ad-ink, #f7f2ff); font: 800 19px/1 var(--ad-font-display, inherit); cursor: pointer; box-shadow: 0 2px 0 #0000004d; transition: transform .08s ease, background .12s ease; -webkit-tap-highlight-color: transparent; }
.onscreen-key:active { transform: translateY(2px); box-shadow: none; background: #3a2760; }
.onscreen-key:disabled { opacity: .4; cursor: default; }
.onscreen-key.is-backspace { background: #ffffff10; font-size: 20px; }
.keys-digits .onscreen-key { height: 52px; font-size: 24px; }
.number-form #integer-answer { font-size: 30px !important; font-weight: 900; letter-spacing: .04em; text-align: center; caret-color: #d8ff36; }
.keys-digits .onscreen-key.is-zero { flex-grow: 2.08; }
.keys-letters .onscreen-key { max-width: 44px; font-size: 17px; }
.keys-letters .onscreen-key.is-backspace { max-width: 66px; flex-grow: 1.5; }
@media (max-width: 400px) { .onscreen-keys, .onscreen-key-row { gap: 4px; } .keys-letters .onscreen-key { height: 42px; font-size: 15px; border-radius: 8px; } .keys-digits .onscreen-key { height: 46px; } }

/* Year questions: a timeline. Big year readout with ±1, a tape under a lime needle for exact years, and an overview bar to jump eras. */
.year-timeline { display: grid; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; }
.year-readout { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px; }
.year-value { text-align: center; font: 900 36px/1.1 var(--ad-font-display, inherit); letter-spacing: .02em; color: #fff; font-variant-numeric: tabular-nums; }
.year-timeline:not(.is-touched) .year-value { font-size: 17px; color: #bba7ce; font-weight: 800; }
.year-nudge { height: 44px; border: 1px solid #ffffff1c; border-radius: 12px; background: var(--ad-night-3, #2a1b43); color: #f7f2ff; font-weight: 900; font-size: 16px; cursor: pointer; }
.year-nudge:active { transform: translateY(1px); background: #3a2760; }
.year-tape { position: relative; height: 74px; overflow: hidden; border-radius: 14px; border: 1px solid #ffffff14; background: linear-gradient(180deg, #2a1b43, #1d1230); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.year-tape:active { cursor: grabbing; }
.year-tape:focus-visible { outline: 2px solid #d8ff36; outline-offset: 2px; }
.year-tick { position: absolute; top: 0; width: 2px; height: 14px; margin-left: -1px; border-radius: 0 0 2px 2px; background: #ffffff40; }
.year-tick.mid { height: 22px; background: #ffffff66; }
.year-tick.major { height: 30px; background: #ffffffaa; }
.year-tick b { position: absolute; top: 36px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #d9cbe8; font-size: 13px; font-weight: 800; }
.year-needle { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: #d8ff36; box-shadow: 0 0 12px #d8ff36aa; pointer-events: none; }
.year-needle::before { content: ""; position: absolute; top: -1px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: #d8ff36; }
.year-overview { position: relative; height: 40px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.year-overview-track { position: absolute; left: 0; right: 0; top: 8px; height: 8px; border-radius: 8px; background: #fff; }
.year-era { position: absolute; top: 22px; transform: translateX(-50%); color: #d9cbe8; font-size: 10px; font-weight: 800; white-space: nowrap; }
.year-era.is-start { transform: none; }
.year-overview-thumb { position: absolute; top: 2px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #d8ff36; border: 3px solid #120a1f; box-shadow: 0 0 10px #d8ff3699; transition: left .08s linear; }
.year-timeline:not(.is-touched) .year-overview-thumb { animation: year-thumb-hint 1.4s ease-in-out infinite alternate; }
@keyframes year-thumb-hint { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
/* After locking in, the question stays above the answer lines, with its votes. */
.live-reveal .answered-question-heading { width: 100%; max-width: 760px; margin: 4px auto 14px; text-align: center; }
.live-reveal .answered-question-heading h1 { font-size: clamp(20px, 5.4vw, 30px); line-height: 1.2; margin: 0 0 10px; }
/* TV leaderboard: a thin score bar under each row, styled like the answer-time bars. */
.shared-score { flex-wrap: wrap; row-gap: 6px !important; }
.shared-score > .shared-score-track { flex: 0 0 100%; height: 6px; }
.shared-score > .shared-score-track i { transition: width .7s var(--ad-ease, ease); }

/* Topbar: logo left, icons (and the TV room code) right. If they do not fit on one line, the logo breaks onto two lines
   (phones); on the TV the room code and icons wrap below the logo instead, still on the right. The logo is never cut. */
.game-shell > .topbar { height: auto !important; }
.game-shell > .topbar > .brand { flex: 0 1 auto; min-width: 0; white-space: normal !important; line-height: 1.02; text-wrap: balance; overflow: visible !important; text-overflow: clip !important; }
.game-shell > .topbar > .top-actions { margin-left: auto; flex-shrink: 0; }
.top-actions > button { white-space: nowrap; }
.game-shell > .topbar:has(.topbar-room) { flex-wrap: wrap; row-gap: 8px; }
.game-shell > .topbar:has(.topbar-room) > .brand { white-space: nowrap !important; }
.topbar-room { display: flex; align-items: center; gap: 12px; margin-right: 8px; color: var(--ad-muted); font-size: 15px; font-weight: 700; white-space: nowrap; }
.topbar-room strong { background: var(--ad-lime); color: var(--ad-lime-ink); border-radius: 12px; padding: 4px 16px; font-family: var(--ad-font-display); font-size: clamp(24px, 3.6vh, 38px); letter-spacing: .14em; line-height: 1.1; }

/* Lobby look: Randomise heads the rows it changes (colour, shape, accessory), with our own die icon. */
.lobby-self-config { grid-template-columns: minmax(0, 1fr) !important; }
.lobby-identity-controls > .randomise-button { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 7px; min-height: 34px !important; padding: 5px 14px 5px 10px !important; border-radius: 999px !important; font-size: 13px !important; font-weight: 800; }
.die-glyph { flex: none; }
.accessory-choice.is-none:not(.selected) .avatar { opacity: .55; }

/* Your name on your own seat edits in place: tap it, type, Enter. */
.lobby-seat-name { display: block; min-width: 0; }
.lobby-name-button { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; cursor: text; border-bottom: 1.5px dashed #ffffff47; font: inherit; color: inherit; }
.lobby-name-button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-name-button .pencil-glyph { flex: none; opacity: .7; }
.lobby-name-button:focus-visible { outline: 2px solid var(--ad-lime); outline-offset: 2px; border-radius: 4px; }
.lobby .lobby-name-inline input { width: 100%; min-width: 0; height: 30px !important; min-height: 0 !important; padding: 3px 8px !important; border: 1.5px solid var(--ad-lime) !important; border-radius: 8px !important; background: #160c23 !important; color: #fff !important; font: inherit; font-size: 14px !important; font-weight: 800; box-shadow: 0 0 0 3px #d8ff3626 !important; }
.lobby-seat-name .form-error { display: block; font-size: 11px; color: #ff8398; white-space: normal; }

/* The room code reads "CODE: XXXXXX" everywhere, phones included. */
.room-code .room-code-label { display: inline !important; font-size: 11px !important; letter-spacing: .08em !important; font-weight: 900; opacity: .8; }

/* Phone lobby: joined seats hug their content like open seats; host buttons sit on one short row under the name. */
@media (max-width: 600px) {
  .lobby-players { align-items: start !important; }
  .lobby .lobby-player .lobby-player-admin { grid-column: 2 / -1 !important; margin-right: -28px !important; gap: 4px !important; flex-wrap: nowrap !important; }
  .lobby .lobby-player .lobby-player-admin .quiet-button { min-height: 24px !important; height: 24px !important; padding: 2px 7px !important; font-size: 11px !important; }
}

/* Small TV screens: the code alone, no "CODE:" label. */
@media (max-width: 1100px), (max-height: 560px) {
  .topbar-room > span { display: none; }
}

/* Lobby look: Customise unfolds the colour, shape and accessory rows (and folds them again); Randomise sits beside it. */
.lobby-identity-controls { display: block !important; }
.lobby-look-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lobby-look-head .quiet-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px !important; padding: 5px 14px 5px 8px !important; border-radius: 999px !important; font-size: 13px !important; font-weight: 800; }
.lobby-look-head .randomise-button { padding-left: 10px !important; }
.customise-button .avatar { flex: none; }
.customise-chevron { width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .18s ease; }
.lobby-identity-controls.is-open .customise-chevron { transform: translateY(1px) rotate(-135deg); }
.lobby-look-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; margin-top: 10px; animation: look-rows-in .2s ease both; }
@media (max-width: 600px) { .lobby-look-rows { grid-template-columns: minmax(0, 1fr); gap: 4px; } .lobby-look-rows > small { margin-top: 4px; } }
@keyframes look-rows-in { from { opacity: 0; transform: translateY(-4px); } }
/* The win-animation pick rows fold behind Preview Animations; the button spans the look grid's two columns. */
.preview-animations-button { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 7px; min-height: 36px !important; padding: 5px 14px 5px 12px !important; border-radius: 999px !important; font-size: 13px !important; font-weight: 800; }
.preview-animations-button .customise-chevron { transform: translateY(-2px) rotate(45deg); }
.preview-animations-button[aria-expanded="true"] .customise-chevron { transform: translateY(1px) rotate(-135deg); }
.lobby-fx-rows { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; animation: look-rows-in .2s ease both; }
@media (max-width: 600px) { .lobby-fx-rows { grid-template-columns: minmax(0, 1fr); gap: 4px; } .lobby-fx-rows > small { margin-top: 4px; } }
/* Host switches for what plays after battles, styled like the question-timer fieldset beside them. */
.win-fx-toggles { padding: 8px 10px; border: 1px solid #ffffff10; border-radius: 11px; background: #ffffff025; }
.win-fx-toggles legend { color: #bda9cc; letter-spacing: .06em; font-size: 10px; }
.win-fx-toggles label { display: inline-flex; align-items: center; gap: 7px; margin: 4px 14px 0 0; font-size: 12px; color: #e8def1; }
.win-fx-toggles input { accent-color: var(--mc-pink); width: 15px; height: 15px; }
.win-fx-toggles-hint { margin: 6px 0 0; font-size: 10px; color: #bda9cc; }
@media (prefers-reduced-motion: reduce) { .lobby-look-rows, .lobby-fx-rows { animation: none; } .customise-chevron { transition: none; } }

/* Maps: each board fills its own column (never under the side panel), centred, as big as the column allows;
   lands are split by a thin outline rather than a thick gap. Applies to every map screen, phone and TV. */
.land-map-slot, .map-wrap, .queue-map, .battle-intro-map, .intermission-board, .final-map { width: 100% !important; min-width: 0 !important; justify-self: center !important; }
.candy-board .tile { stroke-width: 2.5px !important; }
.candy-board .tile.eligible, .candy-board .tile.eligible-view { stroke-width: 3px !important; stroke-dasharray: 7 6 !important; }
.candy-board .tile.selected-tile, .candy-board .tile.attack-target-tile { stroke-width: 4.5px !important; }
.lobby-map-preview-board .candy-board .tile { stroke-width: 1.5px !important; }
/* Faces on the map get a thin dark outline so they never melt into a land of the same colour. */
.candy-board .avatar-body > * { stroke: #1a0d2b; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* Start countdown in the lobby: a big lime number that ticks down while looks are locked in. */
.loadout-countdown { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 16px; background: var(--ad-night-3, #2a1b43); box-shadow: 0 0 0 2px var(--ad-lime), 0 10px 30px #0008; }
.loadout-count { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--ad-lime); color: var(--ad-lime-ink); font: 900 26px/1 var(--ad-font-display, inherit); animation: loadout-tick .5s cubic-bezier(.2,1.6,.4,1) both; }
.loadout-countdown > span { display: grid; gap: 2px; }
.loadout-countdown strong { font-size: 17px; }
.loadout-countdown small { color: var(--ad-muted, #bba7ce); font-size: 13px; }
@keyframes loadout-tick { from { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .loadout-count { animation: none; } }

/* Tile captured: the losing defender hops, then drops through the ground (the avatar's baseline clips it) and is gone.
   The svg box stays put as the ground line; only its shapes move. */
.battle-pair.has-outcome .is-defender.battle-loser { opacity: 1; filter: none; }
.battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar { animation: none !important; overflow: visible; clip-path: inset(-120% -60% 0 -60%); }
.battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar > g { animation: bp-fall-through 1150ms cubic-bezier(.45, 0, .55, 1) 250ms both; }
.battle-pair.has-outcome .is-defender.battle-loser .land-player-name { animation: bp-name-fade 500ms ease 1100ms both; }
@keyframes bp-fall-through {
  0% { transform: none; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  28% { transform: translateY(-16px) scale(.96, 1.06); animation-timing-function: cubic-bezier(.6, 0, .9, .4); }
  42% { transform: translateY(0) scale(1.08, .9); }
  52% { transform: translateY(6px) scale(.98, 1.02); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  100% { transform: translateY(80px); }
}
@keyframes bp-name-fade { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar > g { animation: bp-name-fade 400ms ease both; }
}

/* A topic with no description file: its name sits in the vertical middle of the button. */
.topic-option.no-description .topic-option-copy { align-self: center; justify-content: center; }

/* Lobby tabs: My Character (your look, large) and Lobby (seats, map, settings). Same corner language as the code chip, but quiet:
   lime stays for the code chip and the main button, so the picked tab is a raised tone, not a third lime block. */
.lobby.screen-enter { margin: 0 auto auto; }
.lobby-tabs { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: min(100%, 440px); margin: 10px 0 4px; padding: 4px; border-radius: var(--ad-radius); background: var(--ad-night-2); box-shadow: inset 0 0 0 1px #ffffff0d; flex: none; }
.lobby-tab { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 4px 12px; border-radius: 10px; cursor: pointer; font: 800 14px var(--ad-font-ui); color: var(--ad-muted); transition: background-color .18s ease, color .18s ease; }
.lobby-tab:hover { color: var(--ad-ink); }
.lobby-tab.selected { color: var(--ad-ink); }
/* One lime pill slides under whichever tab is picked. */
.lobby-tabs::before { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 10px; background: var(--ad-night-4); box-shadow: 0 2px 0 #00000040, inset 0 1px 0 #ffffff14; transition: transform .32s cubic-bezier(.3, 1.3, .5, 1); }
.lobby-on-lobby .lobby-tabs::before { transform: translateX(calc(100% + 4px)); }
.lobby-tab:focus-visible { outline: 2px solid var(--ad-lime); outline-offset: 2px; }
.lobby-tab .avatar { flex: none; }
.lobby-tab-count { order: 1; padding: 1px 7px; border-radius: 999px; background: #ffffff14; font-size: 12px; font-variant-numeric: tabular-nums; }
.lobby-tab.selected .lobby-tab-count { background: #ffffff1f; }
.lobby-character { display: grid; align-content: start; gap: 12px; min-height: 0; overflow-y: auto; animation: look-rows-in .2s ease both; }
.lobby.has-tabs.lobby-on-character { flex: 1 1 auto; }
.lobby-on-character > .lobby-character { flex: 1 1 auto; }
.lobby-character-stage { position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 12px 12px; border-radius: 18px; background: var(--ad-night-2); overflow: hidden; }
.lobby-character-glow { position: absolute; left: 50%; top: 18px; width: 190px; height: 150px; margin-left: -95px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--player) 34%, transparent), transparent); pointer-events: none; }
.lobby-character-stage > .avatar { position: relative; transform-origin: 50% 100%; animation: character-pop .38s cubic-bezier(.2, 1.5, .4, 1) both, character-idle 5.2s ease-in-out .5s infinite; }
.lobby-character-stage .lobby-seat-name { position: relative; font: 800 20px var(--ad-font-display); text-align: center; }
.lobby-character .lobby-self-config { padding: 12px !important; }
@keyframes character-pop { from { transform: scale(.7); } }
/* Idle: a short burst of motion, then a long still break (each cycle is roughly a third motion, two thirds rest).
   The default is a stretch-up and squash-landing from the feet, so the character has weight rather than floating. */
@keyframes character-idle { 0%, 42%, 100% { transform: none; } 10% { transform: translateY(-5px) scale(.98, 1.02); } 22% { transform: scale(1.025, .975); } 32% { transform: translateY(-2px); } }
/* Accessories, on this stage only (in-game avatars stay still): a new one drops on and settles with a squash; face items pop. Then a
   few have their own small motion: the halo trails the body's bob, antenna tips wobble, the crown glints, bee wings buzz as it rises. */
.lobby-character-stage .avatar-accessory { transform-box: fill-box; transform-origin: 50% 100%; animation: accessory-equip .46s cubic-bezier(.3, 1.4, .5, 1) backwards; }
.lobby-character-stage :is(.accessory-mustache, .accessory-monocle, .accessory-glasses, .accessory-goggles, .accessory-eyepatch, .accessory-mask, .accessory-bubblegum, .accessory-cutlery, .accessory-spoon, .accessory-nerdglasses, .accessory-lollipop) { transform-origin: 50% 50%; animation-name: accessory-pop; }
.lobby-character-stage .accessory-halo ellipse { animation: halo-trail 2.6s ease-in-out .62s infinite; }
.lobby-character-stage .accessory-antennae circle { transform-box: fill-box; animation: antenna-wobble 1.3s ease-in-out .5s infinite alternate; }
.lobby-character-stage .accessory-antennae circle:last-of-type { animation-delay: 1.15s; }
.lobby-character-stage .crown-glint { transform-box: fill-box; transform-origin: 50% 50%; animation: crown-glint 2.8s ease-in-out .8s infinite both; }
.lobby-character-stage .bee-wing { transform-box: fill-box; transform-origin: 50% 100%; animation: bee-buzz 2.6s linear .4s infinite; }
.lobby-character-stage .propeller-blades { transform-box: fill-box; transform-origin: 50% 50%; animation: propeller-spin 4.8s ease-in-out .5s infinite; }
@keyframes accessory-equip { 0% { opacity: 0; transform: translateY(-12px) scale(1.15); } 55% { opacity: 1; transform: translateY(1px) scale(1.08, .9); } 80% { transform: translateY(-.5px) scale(.97, 1.03); } }
@keyframes accessory-pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } }
@keyframes halo-trail { 45% { transform: translateY(1.6px); } }
@keyframes antenna-wobble { from { transform: translateX(-1px); } to { transform: translate(1.2px, .4px); } }
@keyframes crown-glint { 0%, 68%, 100% { opacity: 0; transform: scale(.2); } 80% { opacity: 1; transform: scale(1.25) rotate(45deg); } 90% { opacity: .8; transform: scale(.9) rotate(90deg); } }
@keyframes bee-buzz { 0%, 30%, 100% { transform: none; } 5%, 15%, 25% { transform: scaleX(.55); } 10%, 20% { transform: none; } }
@keyframes propeller-spin { 0%, 40%, 100% { transform: none; } 6%, 18%, 30% { transform: scaleX(.15); } 12%, 24%, 36% { transform: scaleX(1); } }
/* Per-character idles, on this stage only. The avatar carries `shape-<n> acc-<id>` classes; an accessory picks the idle,
   and with nothing equipped the body shape does. Every set keeps the burst-then-break rhythm of character-idle above:
   the override swaps only the second animation's name (and sometimes pace), so character-pop and the .5s delay stay. */
.lobby-character-stage > .avatar:is(.acc-none.shape-0, .acc-none.shape-3, .acc-none.shape-17) { animation-name: character-pop, idle-wiggle; animation-duration: .38s, 6s; } /* pointy shapes tilt */
.lobby-character-stage > .avatar:is(.acc-none.shape-11, .acc-none.shape-19) { animation-name: character-pop, idle-wiggle; } /* star + burst twinkle */
.lobby-character-stage > .avatar:is(.acc-none.shape-8) { animation-name: character-pop, idle-pulse; animation-duration: .38s, 5s; } /* heartbeat */
.lobby-character-stage > .avatar:is(.acc-none.shape-9, .acc-none.shape-16) { animation-name: character-pop, idle-pulse; animation-duration: .38s, 6.2s; } /* shield braces, crown puffs up */
.lobby-character-stage > .avatar:is(.acc-none.shape-12) { animation-name: character-pop, idle-drift; animation-duration: .38s, 7s; } /* cloud drifts */
.lobby-character-stage > .avatar:is(.acc-none.shape-14, .acc-none.shape-27) { animation-name: character-pop, idle-float; animation-duration: .38s, 5.6s; } /* ghost hovers, squid swims */
.lobby-character-stage > .avatar:is(.acc-none.shape-24) { animation-name: character-pop, idle-float; animation-duration: .38s, 4.2s; } /* bee hovers while the wings buzz */
.lobby-character-stage > .avatar:is(.acc-none.shape-15, .acc-none.shape-22, .acc-none.shape-25, .acc-none.shape-26) { animation-name: character-pop, idle-hop; animation-duration: .38s, 4.6s; } /* cat pounces; mushroom, bunny and frog hop */
.lobby-character-stage > .avatar:is(.acc-none.shape-10, .acc-none.shape-21, .acc-none.shape-28) { animation-name: character-pop, idle-rock; animation-duration: .38s, 6.2s; } /* flower and sprout sway, bear waddles */
.lobby-character-stage > .avatar:is(.acc-none.shape-13, .acc-none.shape-18) { animation-name: character-pop, idle-squash; animation-duration: .38s, 5.4s; } /* bean + drop jiggle like jelly */
.lobby-character-stage > .avatar.acc-none.shape-23 { transform-origin: 50% 12%; animation-name: character-pop, idle-wiggle; animation-duration: .38s, 5.4s; } /* bell swings from its hanger */
.lobby-character-stage > .avatar.acc-headphones { animation-name: character-pop, idle-groove; animation-duration: .38s, 4.8s; } /* nodding to the beat */
.lobby-character-stage > .avatar:is(.acc-shades, .acc-goggles) { animation-name: character-pop, idle-groove; animation-duration: .38s, 6.6s; } /* slower, cooler nod */
.lobby-character-stage > .avatar:is(.acc-halo, .acc-wizard, .acc-antennae) { animation-name: character-pop, idle-float; animation-duration: .38s, 5.6s; } /* otherworldly ones levitate */
.lobby-character-stage > .avatar:is(.acc-cowboy, .acc-flower) { animation-name: character-pop, idle-rock; animation-duration: .38s, 5.8s; } /* swagger / sway */
.lobby-character-stage > .avatar:is(.acc-horns, .acc-eyepatch) { animation-name: character-pop, idle-wiggle; animation-duration: .38s, 5s; } /* mischievous shimmy */
.lobby-character-stage > .avatar:is(.acc-partyhat, .acc-propeller) { animation-name: character-pop, idle-hop; animation-duration: .38s, 4.4s; } /* party bounce */
.lobby-character-stage > .avatar.acc-beanie { animation-name: character-pop, idle-hop; } /* boing under the pompom */
.lobby-character-stage > .avatar:is(.acc-tophat, .acc-monocle, .acc-glasses, .acc-beret) { animation-name: character-pop, idle-lean; animation-duration: .38s, 6.4s; } /* a curious lean-in */
.lobby-character-stage > .avatar.acc-bow { animation-name: character-pop, idle-squash; animation-duration: .38s, 5.4s; } /* a little curtsy */
.lobby-character-stage > .avatar:is(.acc-crown, .acc-laurel) { animation-name: character-pop, idle-pulse; animation-duration: .38s, 6.4s; } /* royal chest-puff */
.lobby-character-stage > .avatar:is(.acc-none.shape-29) { animation-name: character-pop, idle-lean; animation-duration: .38s, 6s; } /* owl tilts its head */
.lobby-character-stage > .avatar:is(.acc-none.shape-30) { animation-name: character-pop, idle-hop; animation-duration: .38s, 5s; } /* toast pops up */
.lobby-character-stage > .avatar:is(.acc-none.shape-31, .acc-none.shape-34) { animation-name: character-pop, idle-float; animation-duration: .38s, 5s; } /* axolotl swims, bat flits */
.lobby-character-stage > .avatar:is(.acc-none.shape-32) { animation-name: character-pop, idle-rock; animation-duration: .38s, 6.6s; } /* cactus sways in its pot */
.lobby-character-stage > .avatar:is(.acc-none.shape-33) { animation-name: character-pop, idle-squash; animation-duration: .38s, 5.4s; } /* onigiri squishes */
.lobby-character-stage > .avatar:is(.acc-none.shape-36, .acc-none.shape-38) { animation-name: character-pop, idle-wiggle; animation-duration: .38s, 5.6s; } /* donut and ice cream wobble */
.lobby-character-stage > .avatar:is(.acc-none.shape-37, .acc-none.shape-41) { animation-name: character-pop, idle-squash; animation-duration: .38s, 5.2s; } /* cupcake and burger squish */
.lobby-character-stage > .avatar:is(.acc-none.shape-39) { animation-name: character-pop, idle-hop; animation-duration: .38s, 4.8s; } /* strawberry bounces */
.lobby-character-stage > .avatar:is(.acc-none.shape-40) { animation-name: character-pop, idle-lean; animation-duration: .38s, 6s; } /* pizza tips its slice */
.lobby-character-stage > .avatar:is(.acc-none.shape-42, .acc-none.shape-46) { animation-name: character-pop, idle-pulse; animation-duration: .38s, 5.2s; } /* T-rex and ankylosaurus puff up */
.lobby-character-stage > .avatar:is(.acc-none.shape-43, .acc-none.shape-44, .acc-none.shape-45) { animation-name: character-pop, idle-wiggle; animation-duration: .38s, 5.8s; } /* frill, plates and crest shake */
.lobby-character-stage > .avatar:is(.acc-none.shape-47, .acc-none.shape-48, .acc-none.shape-49) { animation-name: character-pop, idle-rock; animation-duration: .38s, 6.2s; } /* drinks slosh */
.lobby-character-stage > .avatar:is(.acc-none.shape-35) { animation-name: character-pop, idle-rock; animation-duration: .38s, 6.4s; } /* mug sways, coffee and all */
/* The mug's steam curls up and fades on the character stage; the cinematics (3D build, cast roll call, first claim) leave it out. */
.lobby-character-stage .mug-steam path { transform-box: fill-box; transform-origin: 50% 100%; animation: steam-rise 2.8s ease-in-out infinite; }
.lobby-character-stage .mug-steam path:nth-child(2) { animation-delay: .9s; }
.lobby-character-stage .mug-steam path:nth-child(3) { animation-delay: 1.8s; }
@keyframes steam-rise { 0% { opacity: 0; transform: translateY(2.5px) scaleY(.7); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(-2.5px) scaleY(1.1); } }
:is(.cast-intro, .first-claim-fx, .win-fx, .clash3d) .mug-steam { display: none; } /* the teacup's steam too */
.lobby-character-stage > .avatar:is(.acc-gradcap, .acc-viking, .acc-mask) { animation-name: character-pop, idle-pulse; animation-duration: .38s, 6.2s; } /* proud chest-puff */
.lobby-character-stage > .avatar:is(.acc-idea) { animation-name: character-pop, idle-hop; animation-duration: .38s, 4.8s; } /* eureka! */
.lobby-character-stage > .avatar:is(.acc-chick, .acc-pirate) { animation-name: character-pop, idle-rock; animation-duration: .38s, 6s; } /* rocking the nest / the deck */
.lobby-character-stage > .avatar:is(.acc-chef) { animation-name: character-pop, idle-squash; animation-duration: .38s, 5.6s; } /* a chef's flourish */
.lobby-character-stage > .avatar:is(.acc-bubblegum) { animation-name: character-pop, idle-groove; animation-duration: .38s, 6.4s; } /* chewing, unbothered */
@keyframes idle-hop { 0%, 40%, 100% { transform: none; } 6% { transform: scale(1.04, .94); } 14% { transform: translateY(-6px) scale(.97, 1.04); } 24% { transform: translateY(0) scale(1.05, .95); } 32% { transform: translateY(-2.5px); } }
@keyframes idle-float { 0%, 56%, 100% { transform: none; } 18% { transform: translateY(-4.5px); } 38% { transform: translateY(-3px) rotate(1.5deg); } }
@keyframes idle-rock { 0%, 44%, 100% { transform: none; } 10% { transform: rotate(3deg); } 22% { transform: rotate(-3deg); } 34% { transform: rotate(1.5deg); } }
@keyframes idle-wiggle { 0%, 30%, 100% { transform: none; } 6% { transform: rotate(-4deg) scale(1.02); } 13% { transform: rotate(4deg); } 20% { transform: rotate(-2.5deg); } 26% { transform: rotate(1.2deg); } }
@keyframes idle-pulse { 0%, 36%, 100% { transform: none; } 8% { transform: scale(1.06); } 16% { transform: scale(1); } 24% { transform: scale(1.08); } }
@keyframes idle-groove { 0%, 48%, 100% { transform: none; } 8% { transform: translateY(-3px) rotate(-2deg); } 16% { transform: translateY(1px); } 24% { transform: translateY(-3px) rotate(2deg); } 32% { transform: translateY(1px); } 40% { transform: translateY(-2px); } }
@keyframes idle-squash { 0%, 38%, 100% { transform: none; } 9% { transform: scale(1.06, .92); } 20% { transform: scale(.96, 1.05); } 30% { transform: scale(1.02, .98); } }
@keyframes idle-lean { 0%, 50%, 100% { transform: none; } 12%, 34% { transform: rotate(4deg) translateY(-1px); } }
@keyframes idle-drift { 0%, 56%, 100% { transform: none; } 16% { transform: translate(4px, -1.5px); } 40% { transform: translate(-3px, -1px); } }
/* Accessory accents that ride on top of the body idle (the equip/pop entrance stays first in each list). */
.lobby-character-stage .accessory-mustache { animation: accessory-pop .46s cubic-bezier(.3, 1.4, .5, 1) backwards, acc-wiggle 5s ease-in-out 1.1s infinite; }
.lobby-character-stage .accessory-bow { animation: accessory-equip .46s cubic-bezier(.3, 1.4, .5, 1) backwards, bow-perk 5.4s ease-in-out .5s infinite; }
.lobby-character-stage .accessory-beanie circle { transform-box: fill-box; transform-origin: 50% 100%; animation: pompom-boing 5.2s ease-in-out .5s infinite; }
.lobby-character-stage .accessory-wizard path[fill="#ffe066"] { transform-box: fill-box; transform-origin: 50% 50%; animation: star-twinkle 5.6s ease-in-out 1.2s infinite; }
@keyframes acc-wiggle { 0%, 28%, 100% { transform: none; } 7% { transform: rotate(-5deg); } 15% { transform: rotate(5deg); } 22% { transform: rotate(-2deg); } }
@keyframes bow-perk { 0%, 36%, 100% { transform: none; } 10% { transform: scale(1.12) rotate(6deg); } 22% { transform: scale(.96); } }
@keyframes pompom-boing { 0%, 40%, 100% { transform: none; } 16% { transform: translateY(-2.5px) scale(1.15); } 26% { transform: translateY(.5px) scale(.9, 1.05); } }
.lobby-character-stage .idea-glow { transform-box: fill-box; transform-origin: 50% 50%; animation: idea-glow 3.2s ease-in-out .6s infinite; }
.lobby-character-stage .idea-rays { animation: idea-rays 3.2s ease-in-out .6s infinite; }
.lobby-character-stage .accessory-chick { animation: accessory-equip .46s cubic-bezier(.3, 1.4, .5, 1) backwards, chick-bob 4.4s ease-in-out .7s infinite; }
.lobby-character-stage .gum-bubble { transform-box: fill-box; transform-origin: 50% 25%; animation: gum-blow 5s ease-in-out .9s infinite; }
.lobby-character-stage .gradcap-tassel { transform-box: fill-box; transform-origin: 0% 0%; animation: tassel-swing 4.6s ease-in-out .6s infinite; }
/* Buddies bob and settle on their perch; the candle flickers, the gears turn and the question mark bobs. */
.lobby-character-stage .buddy { transform-box: fill-box; transform-origin: 50% 100%; animation: buddy-bob 4.2s ease-in-out .7s infinite; }
.lobby-character-stage .accessory-parrot .buddy { transform-origin: 30% 100%; animation-name: parrot-tilt; }
.lobby-character-stage .candle-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: candle-flicker .9s ease-in-out infinite alternate; }
.lobby-character-stage .thinkcap-gear { transform-box: fill-box; transform-origin: 50% 50%; animation: gear-turn 4s linear infinite; }
.lobby-character-stage .thinkcap-gear.is-small { animation-direction: reverse; animation-duration: 2.9s; }
.lobby-character-stage .question-mark { transform-box: fill-box; transform-origin: 50% 100%; animation: question-bob 2.6s ease-in-out .5s infinite; }
@keyframes buddy-bob { 0%, 46%, 100% { transform: none; } 12% { transform: translateY(-1.6px) scale(1.04, .97); } 22% { transform: scale(.97, 1.03); } 32% { transform: translateY(-.6px); } }
@keyframes parrot-tilt { 0%, 50%, 100% { transform: none; } 14% { transform: rotate(-9deg); } 26% { transform: rotate(4deg); } 38% { transform: rotate(-2deg); } }
@keyframes candle-flicker { from { transform: scale(.9, 1) skewX(-4deg); } to { transform: scale(1.08, 1.12) skewX(4deg); } }
@keyframes gear-turn { to { transform: rotate(360deg); } }
@keyframes question-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-1.4px) rotate(4deg); } }
@keyframes idea-glow { 0%, 100% { opacity: .5; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes idea-rays { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes chick-bob { 0%, 44%, 100% { transform: none; } 10% { transform: translateY(-2px) rotate(-4deg); } 20% { transform: rotate(5deg); } 30% { transform: translateY(-1px) rotate(-2deg); } }
@keyframes gum-blow { 0%, 100% { transform: scale(.55); } 40% { transform: scale(1.12); } 46% { transform: scale(1.18); } 50% { transform: scale(.45); } 70% { transform: scale(.6); } }
@keyframes tassel-swing { 0%, 46%, 100% { transform: none; } 12% { transform: rotate(4deg); } 26% { transform: rotate(-3deg); } 38% { transform: rotate(1.5deg); } }
@keyframes star-twinkle { 0%, 50%, 100% { transform: none; } 12% { transform: scale(1.3) rotate(18deg); } 24% { transform: scale(.9); } }
/* Opaque eyewear goes up on the forehead while an emote shows, so the eyes stay readable. */
.accessory-shades, .accessory-cateye, .accessory-eyepatch { transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.expression-active :is(.accessory-shades, .accessory-cateye, .accessory-eyepatch) { transform: translateY(-11px); }
@media (max-width: 600px) { .lobby-tab { min-height: 38px; font-size: 13px; } .lobby-character { gap: 8px; } .lobby-character-stage { padding: 12px 10px 10px; } }
/* Phones: the tabbed lobby never squashes its sections to fit the screen (that flattened the character stage to its
   padding and pushed Leave/Start off the bottom). The lobby scrolls instead, the Leave/Start bar stays pinned at the
   bottom, the character stage keeps its full height, and the map preview keeps a 16:10 board. */
@media (max-width: 600px) {
  .lobby.has-tabs { display: flex !important; flex-direction: column; overflow-x: hidden !important; overflow-y: auto !important; overscroll-behavior: contain; scrollbar-width: none; }
  .lobby.has-tabs > * { flex-shrink: 0 !important; }
  .lobby.has-tabs > .lobby-character { display: flex; flex-direction: column; flex: 0 0 auto !important; overflow: visible; }
  .lobby-character > * { flex: none; }
  .lobby.has-tabs > .lobby-config-grid { flex: 0 0 auto !important; grid-template-rows: none !important; }
  .lobby.has-tabs .lobby-map-preview-board { height: auto !important; min-height: 0 !important; max-height: none !important; aspect-ratio: 16 / 10; }
  .lobby.has-tabs > .lobby-bottom { position: sticky; bottom: 0; z-index: 3; margin-top: auto !important; padding-bottom: 2px; background: linear-gradient(#140b2800, #140b28 10px); }
}
@media (prefers-reduced-motion: reduce) { .lobby-character, .lobby-character-stage > .avatar, .lobby-character-stage .avatar-accessory, .lobby-character-stage .avatar-accessory *, .lobby-character-stage .bee-wing, .lobby-character-stage .mug-steam path { animation: none; } .lobby-tab, .lobby-tabs::before, .accessory-shades, .accessory-cateye, .accessory-eyepatch { transition: none; } }

/* ---------- One map frame for every map screen ----------
   Queue, claim, attack, topic pick, battle ready, battle result, reward, intermission and final all share the
   same frame: a countdown slot (kept even when there is no countdown), a title band of fixed height, then a map
   box of fixed size. Whatever the title says or the side panel holds, the map never moves between screens.
   Scoped to the player's stage; the TV keeps its own layout. */
.main-stage .land-screen { --frame-timer-h: 82px; --frame-header-h: 108px; --frame-gap: 12px; }
.main-stage .land-screen > .stage-timer {
  height: var(--frame-timer-h) !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
  box-sizing: border-box; flex-direction: column !important; justify-content: flex-start !important; align-items: center !important;
}
.main-stage .land-screen > .land-header {
  box-sizing: border-box; height: var(--frame-header-h) !important; min-height: 0 !important; max-height: none !important;
  margin: 0 auto var(--frame-gap) !important; overflow: visible; align-content: end !important;
}
.main-stage .land-screen > .land-layout { align-items: start !important; margin-top: 0 !important; }
.main-stage .land-screen .land-layout > .land-map-slot { align-self: start !important; }

@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  /* The frame fills the whole stage instead of being centred in it: a centred frame moves whenever its content
     grows or shrinks. The bottom is always kept clear for the Ready bar, shown or not, so the side panel under
     the map has the same height on every map screen and never runs beneath the bar. */
  .main-stage:has(> .land-screen) { justify-content: flex-start !important; align-items: stretch !important; }
  .main-stage .land-screen {
    --frame-timer-h: 66px; --frame-header-h: 74px; --frame-gap: 6px; --frame-side-h: clamp(118px, 20dvh, 168px); --frame-ready-h: 54px;
    flex: 1 1 auto !important; height: 100% !important; max-height: 100% !important; min-height: 0 !important; box-sizing: border-box;
    padding-bottom: var(--frame-ready-h) !important; align-content: start !important; row-gap: 0 !important;
    grid-template-rows: var(--frame-timer-h) var(--frame-header-h) minmax(0, 1fr) !important;
  }
  .main-stage .land-screen > .land-header { margin: 0 !important; padding-bottom: var(--frame-gap); }
  .main-stage .land-screen > .land-layout {
    display: grid !important; grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) var(--frame-side-h) !important; gap: 6px !important; height: 100% !important; min-height: 0;
    align-content: stretch !important; overflow: hidden;
  }
  .main-stage .land-screen .land-layout > .land-map-slot {
    grid-row: 1 !important; grid-column: 1 !important; order: 0 !important;
    height: 100% !important; max-height: 100% !important; min-height: 0 !important; width: 100% !important;
  }
  .main-stage .land-screen .land-layout > .land-sidecar {
    grid-row: 2 !important; grid-column: 1 !important; order: 0 !important; align-self: stretch !important;
    height: 100% !important; max-height: 100% !important; min-height: 0 !important; box-sizing: border-box;
    justify-content: flex-start !important; overflow-y: auto; overscroll-behavior: contain;
  }
  /* The pick list marks your row already; "(you)" would push it past the fixed panel height. */
  .main-stage .queue-list .you-label { display: none !important; }
  /* Topic choices sit under the map like every other side panel, compact enough to fit. */
  .main-stage .topic-screen .topic-sidecar { gap: 6px !important; }
  .main-stage .topic-screen .topic-options { gap: 6px; }
  .main-stage .topic-screen .topic-option { min-height: 48px; padding: 6px 12px; }
  .main-stage .topic-screen .topic-option-copy b { font-size: 17px; }
  .main-stage .topic-screen .topic-option-copy small { font-size: 12px; }
  .main-stage .topic-screen .topic-note { margin: 0; font-size: 12px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 932px) and (max-height: 700px) {
  .main-stage .land-screen { --frame-timer-h: 52px; --frame-header-h: 52px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 932px) and (orientation: landscape) and (max-height: 500px) {
  .main-stage .land-screen > .land-layout { grid-template-columns: minmax(0, 1.65fr) minmax(210px, .72fr) !important; grid-template-rows: minmax(0, 1fr) !important; }
  .main-stage .land-screen .land-layout > .land-map-slot { grid-row: 1 !important; height: 100% !important; max-height: 100% !important; }
  .main-stage .land-screen .land-layout > .land-sidecar { grid-row: 1 !important; grid-column: 2 !important; }
}

/* ---------- Question, answered, reveal: one screen that only grows ----------
   Anchored to the top (a centred block re-centres, and so moves, whenever anything is added). The timer always keeps
   a caption line, the reveal reuses the question's own timer and heading, and the answer table opens where the
   answered pieces were and stays there while the reveal fills it in. New things push what's below them, never above. */
.main-stage .question-screen, .main-stage .question-screen:has(> .answer-options) { margin: 0 auto !important; justify-content: flex-start !important; padding-top: clamp(4px, 2vh, 24px); }
.question-clock { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.question-clock .stage-timer-caption { display: block; min-height: 1.25em; line-height: 1.25; }
.main-stage .question-screen.is-reveal { display: flex; flex-direction: column; width: 100%; max-width: 1120px; gap: 0 !important; padding-bottom: 8px; }
.main-stage .question-screen.is-reveal > .question-top { margin: 0; }
.main-stage .question-screen.is-reveal.ad-kind-mc > .question-heading h1 { min-height: 3lh; display: flex; align-items: center; justify-content: center; margin: 0 !important; }
.main-stage .question-screen.is-reveal > .ad-results ~ * { margin-top: 18px; }
.main-stage .question-screen.is-reveal .ad-reveal-question { display: none; }
.ad-results { width: 100%; max-width: 760px; margin: 4px auto 12px; text-align: left; }
.ad-results-label { display: block; height: 18px; margin: 0 0 4px 2px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ad-muted); }
.ad-results .ad-time-track i { transition: width 700ms var(--ad-ease); }
/* Opening: the table grows out of the answered-pieces row, gently pushing your locked answer down. */
.question-screen:not(.is-reveal) > .ad-results, .geo-question:not(.is-reveal) .ad-results { overflow: hidden; animation: ad-results-open 700ms var(--ad-ease) both; }
@keyframes ad-results-open { from { max-height: 56px; opacity: .35; } to { max-height: 640px; opacity: 1; } }
/* Carried into the reveal: the rows are already on screen, so nothing re-enters. */
.ad-times.is-carried .ad-time-row.is-in { animation: none !important; }
.ad-times.is-carried .ad-time-track i { animation: none !important; transform: none !important; }
/* Geo: the question stays; the answer lands in a line reserved under it from the start. */
.ad-geo-answer { margin: 0; min-height: 1.3em; font-family: var(--ad-font-display); font-weight: 800; font-size: clamp(18px, 2.2vw, 26px); line-height: 1.3; color: var(--ad-lime); opacity: 0; text-align: center; }
.ad-geo-answer.is-in { opacity: 1; animation: ad-answer-in 480ms cubic-bezier(.2, .9, .3, 1.3) both; }
.geo-question.is-reveal .geo-question-copy > .stage-title { margin-bottom: 0 !important; }
@media (max-width: 700px) {
  .geo-question .geo-question-copy > .ad-results, .geo-question .geo-question-copy > .battle-pair { order: 1; width: 100%; }
}
@media (max-width: 860px) {
  .main-stage .question-screen:has(> .ad-results), .main-stage .question-screen.is-reveal, .main-stage .geo-question.is-reveal { height: auto !important; max-height: none !important; padding-bottom: 104px; }
}
@media (prefers-reduced-motion: reduce) { .ad-results, .ad-geo-answer.is-in { animation: none !important; } }

/* ---------- Collapsible attack order ----------
   The ATTACKS track folds sideways into a small tab: the rounds-left count and the current attacker.
   Only its width changes, never its height, so nothing under it moves. */
.battle-track-toggle {
  pointer-events: auto; flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid #ffffff1f; border-radius: 8px; background: var(--ad-night-3, #2a1a40); color: var(--ad-ink, #f3ecfa); cursor: pointer;
}
.battle-track-toggle:hover { border-color: #ffffff40; }
.battle-track-toggle:focus-visible { outline: 2px solid var(--ad-lime, #d8ff36); outline-offset: 2px; }
.battle-track-toggle svg { transition: transform .22s ease; }
.battle-round-track .battle-track-toggle { position: absolute; top: 9px; left: -15px; z-index: 3; }
.battle-round-track { transition: width .24s cubic-bezier(.2, .8, .25, 1); }
.battle-round-track.is-collapsed { width: 64px !important; padding: 44px 6px 8px !important; bottom: auto !important; }
.battle-round-track.is-collapsed .battle-track-toggle { top: 9px; left: 50%; translate: -50% 0; }
/* The rail folds into the right edge: the chevron points the way it will move. */
.battle-round-track .battle-track-toggle svg { transform: rotate(180deg); }
.battle-round-track.is-collapsed .battle-track-toggle svg { transform: none; }
.battle-round-track.is-collapsed .battle-track-heading { display: grid !important; justify-items: center; padding-inline: 0 !important; }
.battle-round-track.is-collapsed .battle-track-heading strong { display: none; }
.battle-round-track.is-collapsed .battle-track-round:not(.is-current) { display: none !important; }
.battle-round-track.is-collapsed .battle-track-round { grid-template-columns: 1fr !important; justify-items: center; transform: none !important; }
.battle-round-track.is-collapsed .battle-track-node,
.battle-round-track.is-collapsed .battle-track-name,
.battle-round-track.is-collapsed .battle-track-line { display: none !important; }
body:has(.battle-round-track.is-collapsed) .ready-skip { right: 88px; }

@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  /* Phones: the strip under the top bar folds towards the left edge. */
  .battle-round-track {
    right: auto !important; width: calc(100vw - var(--phone-inline) - var(--phone-inline-end)) !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }
  .battle-round-track .battle-track-toggle { position: static; order: 2; width: 30px; height: 30px; }
  .battle-round-track .battle-track-heading { order: 0; }
  .battle-round-track .battle-track-list { order: 1; }
  .battle-round-track .battle-track-toggle svg { transform: none; }
  .battle-round-track.is-collapsed .battle-track-toggle svg { transform: rotate(180deg); }
  .battle-round-track.is-collapsed { width: 168px !important; padding: 4px 5px !important; }
  .battle-round-track.is-collapsed .battle-track-toggle { translate: none; }
  .battle-round-track.is-collapsed .battle-track-heading { justify-items: start; }
  .battle-round-track.is-collapsed .battle-track-heading strong { display: block; }
  .battle-round-track.is-collapsed .battle-track-round { grid-template-columns: 24px auto !important; justify-items: start; }
  .battle-round-track.is-collapsed .battle-track-name { display: block !important; max-width: 56px; }
  body:has(.battle-round-track.is-collapsed) .ready-skip { right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .battle-round-track, .battle-track-toggle svg { transition: none; } }

/* Final standings: revealed last place first, one player every 0.85 s, so the winner lands last. Each row's bar, and the
   winner's crown, follow their own row in. (Delays are real seconds: the motion pace only slows the movement itself.) */
.final-screen .final-row { animation: final-row-reveal 700ms cubic-bezier(.16, 1, .3, 1) both !important; animation-delay: calc(var(--reveal, 0) * .85s) !important; }
.final-screen .final-row.first .final-crown { animation-delay: calc(var(--reveal, 0) * .85s + 500ms) !important; }
@keyframes final-row-reveal { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .final-screen .final-row { animation: final-row-reveal 1ms both !important; animation-delay: calc(var(--reveal, 0) * .85s) !important; } }

/* Question screens that grow (answered, reveal) still fill the stage from the top, so the stage never re-centres them. */
@media (max-width: 860px) {
  .main-stage .question-screen:has(> .ad-results), .main-stage .question-screen.is-reveal, .main-stage .geo-question.is-reveal { min-height: 100% !important; }
}
/* The geo reveal keeps the stage height, exactly like the answered geo screen, so the map is the same size in both. */
@media (max-width: 860px) { .main-stage .geo-question.is-reveal { height: 100% !important; max-height: 100% !important; min-height: 0 !important; padding-bottom: 0; } }

/* ---------- Order reveal: the right order flashes in, item by item ----------
   Every row is there from the first frame showing only its place number, so the list never changes size. */
.ad-order-truth { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ad-order-step {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 14px; box-sizing: border-box;
  border-radius: 14px; background: var(--ad-night-3); color: var(--ad-ink); position: relative;
}
.ad-order-num {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ad-night); color: var(--ad-muted); font-family: var(--ad-font-display); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ad-order-text { min-width: 0; font-size: clamp(16px, 1.6vw, 22px); font-weight: 750; line-height: 1.2; visibility: hidden; }
/* One soft flash per row (was a 3x full-inversion strobe, too aggressive with several rows in a row). */
@keyframes ad-order-flash { 0% { background: var(--ad-night-3); color: var(--ad-ink); } 35%, 100% { background: var(--ad-ink); color: var(--ad-night); } }
@keyframes ad-order-settle { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.ad-order-step.is-in { animation: ad-order-flash 520ms ease-out both, ad-order-settle 420ms ease-out both; }
.ad-order-step.is-in::after { content: ""; position: absolute; inset: -4px; border-radius: 18px; border: 3px solid var(--ad-lime); pointer-events: none; animation: ad-burst 700ms var(--ad-ease) both; }
.ad-order-step.is-in .ad-order-text { visibility: visible; }
.ad-order-step.is-in .ad-order-num { background: var(--ad-lime); color: var(--ad-lime-ink, #13091f); animation: ad-stamp 360ms cubic-bezier(.2, .9, .3, 1.4) both; }
.ad-order-note { min-height: 1.3em; }
@media (max-width: 700px) {
  .ad-order-truth { gap: 6px; }
  .ad-order-step { min-height: 42px; padding: 6px 10px; gap: 10px; }
  .ad-order-num { width: 28px; height: 28px; font-size: 15px; }
  .ad-order-text { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ad-order-step.is-in, .ad-order-step.is-in .ad-order-num { animation: none; background: var(--ad-ink); color: var(--ad-night); }
  .ad-order-step.is-in .ad-order-num { background: var(--ad-lime); color: var(--ad-lime-ink, #13091f); }
  .ad-order-step.is-in::after { content: none; }
}

/* Map screens follow each other with the map in the same place, so the map never blinks: only the words around it
   (title and side panel) fade in. The screen-wide fade made the map dip and come back on every phase change. */
.main-stage .land-screen.screen-enter { animation: none !important; }
.main-stage .land-screen.screen-enter > .land-header, .main-stage .land-screen.screen-enter .land-sidecar { animation: land-copy-in 520ms ease both; }
@keyframes land-copy-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .main-stage .land-screen.screen-enter > .land-header, .main-stage .land-screen.screen-enter .land-sidecar { animation: none; } }

/* ---------- Reveal fits the phone ----------
   Votes ride in the timer row's corner (out of the flow, so the clock and title never move). On phones the
   multiple-choice answers sit two by two and each player's piece lands inside the card it chose, instead of
   in a row of its own under every card. */
.question-top:has(> .question-top-votes) { position: relative; }
.question-top > .question-top-votes { position: absolute; top: 0; right: 0; z-index: 2; }
.question-top > .question-top-votes .question-feedback-buttons { margin: 0 !important; }
@media (max-width: 700px) {
  .question-top > .question-top-votes .question-feedback-buttons { gap: 4px !important; }
  .question-top > .question-top-votes .question-feedback-buttons > button { width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; padding: 0 !important; }
  .ad-kind-mc .ad-cards.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .ad-kind-mc .ad-card-wrap { position: relative; }
  .ad-kind-mc .ad-card { min-height: 92px; align-items: flex-start; gap: 8px; padding: 8px 10px 36px; box-sizing: border-box; height: 100%; }
  .ad-kind-mc .ad-key { width: 28px; height: 28px; font-size: 15px; border-radius: 7px; }
  .ad-kind-mc .ad-card-label { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
  .ad-kind-mc .ad-card-tick { position: absolute; top: 8px; right: 8px; margin: 0; }
  .ad-kind-mc .ad-card-tick svg { width: 20px; height: 20px; }
  .ad-kind-mc .ad-card:has(.ad-card-tick) .ad-card-label { padding-right: 20px; }
  .ad-kind-mc .ad-card-pieces, .ad-kind-mc .rows-open .ad-card-pieces {
    position: absolute; left: 10px; right: 10px; bottom: 7px; height: 24px !important; padding: 0; gap: 4px; align-items: center; flex-wrap: nowrap; overflow: visible; z-index: 1;
  }
  .ad-kind-mc .ad-card-pieces .ad-piece { width: 24px !important; height: 24px !important; }
  .ad-kind-mc .ad-card-pieces .ad-piece svg { width: 24px !important; height: 24px !important; }
}
/* The battle topic chip rides in the timer row's left corner on every question and reveal screen, as the votes
   do on the right, instead of taking a line of its own above the timer. */
.main-stage .question-top:has(> .question-topic) { position: relative; }
.main-stage .question-top > .question-topic { position: absolute !important; top: 0; left: 0; margin: 0 !important; z-index: 2; }
@media (max-width: 700px) { .ad-kind-mc .ad-card { min-height: 80px; } }
@media (max-width: 700px) {
  /* Phone pins are small, so stacked lanes need less room. */
  .main-stage .ad-number-line { height: calc(52px + var(--lanes) * 36px); }
}

/* Quick 5 reveal: every answer's pieces row owns its height from the first frame, and the question keeps a fixed
   title slot, so the like/dislike row below never shifts as questions change or pieces land. */
.ad-kind-rapid .ad-card-pieces, .ad-kind-rapid .rows-open .ad-card-pieces { height: 52px !important; transition: none !important; }
.ad-kind-rapid .ad-rapid-question .ad-reveal-question { min-height: 2lh; display: flex; align-items: center; }
@media (max-width: 700px) {
  .ad-kind-rapid .ad-card-pieces, .ad-kind-rapid .rows-open .ad-card-pieces { height: 46px !important; }
  .ad-kind-rapid .ad-rapid-question .ad-reveal-question { min-height: 3lh; }
}

/* Large viewports: pieces in the player strip at three times their size (28 px to 84 px), above name and points;
   the card grows with them, so the strip still never scrolls. */
@media (min-width: 1100px) {
  .player-strip .player-card.strip-card .player-emote-anchor > .avatar { width: 84px !important; height: 84px !important; flex-basis: 84px !important; }
  .player-strip .player-card.strip-card .player-score-anchor { width: auto !important; height: auto !important; min-height: 84px; }
}

/* Number reveal: your guess's label flies in from your locked answer (NumberHandoff) and stays a touch brighter. */
.ad-handoff { display: inline-block; transform-origin: center; will-change: transform; }
.ad-line-guess.is-yours .ad-line-value { color: var(--ad-ink); }

/* Attack order heading: "Attacks" over the count on one left edge, in the game's normal label type; the open
   panel's toggle sits inside its top-right corner instead of hanging over the label. */
.battle-round-track .battle-track-heading strong { letter-spacing: .02em !important; text-transform: none !important; font-size: 12px !important; line-height: 1.2; }
.battle-round-track .battle-track-heading span { line-height: 1.2; }
.battle-round-track:not(.is-collapsed) .battle-track-toggle { left: auto !important; right: 10px !important; top: 10px !important; }
.battle-round-track:not(.is-collapsed) .battle-track-heading { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 2px !important; min-height: 30px; padding: 0 44px 8px 4px !important; }
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .battle-round-track:not(.is-collapsed) .battle-track-toggle { position: static !important; }
  .battle-round-track { column-gap: 10px !important; }
  .battle-round-track .battle-track-heading, .battle-round-track:not(.is-collapsed) .battle-track-heading { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 2px !important; min-height: 0; padding: 0 4px 0 6px !important; border-bottom: 0 !important; }
}

/* The current player's underline runs under their whole name (not a fixed bar by the piece), in every strip layout. */
.player-strip .player-card.active::after { content: none !important; display: none !important; }
.player-strip .player-card.active .player-name-text { text-decoration-line: underline; text-decoration-color: var(--player); text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
/* The name clips overflow (for its ellipsis): room below it, cancelled by a negative margin, keeps the underline visible. */
.player-strip .player-card.active .player-name, .player-strip .player-card.active .player-name-text { padding-bottom: 7px !important; margin-bottom: -7px !important; }

/* Reveals spell the answer out: on the answer table's label line (multiple choice, word, number) and on each Quick 5
   question's counter line, both lines that were already there, so nothing moves when it appears. */
.ad-results-label { display: flex !important; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.ad-results-label > span { flex: none; }
.ad-results-answer, .ad-rapid-answer { color: var(--ad-lime); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; animation: ad-fade-in 400ms ease both; }
.ad-results-answer { font-size: 13px; }

/* Score awards in the strip name their reason: "+25" over "Correct", left aligned, beside the score. The two lines are
   pulled into the score row's own height, so an award never makes the strip taller. */
.player-strip .strip-card .player-score-delta { display: inline-flex !important; flex-direction: column !important; align-items: flex-start !important; text-align: left !important; gap: 1px !important; line-height: 1 !important; margin-block: -6px !important; }
.player-strip .strip-card .player-score-delta b { line-height: 1 !important; }
.player-strip .strip-card .player-score-delta small, .player-card .player-score-delta small { display: block !important; position: static !important; font-size: 10px !important; font-weight: 700 !important; line-height: 1 !important; color: var(--ad-lime) !important; opacity: .9; max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none !important; letter-spacing: 0 !important; }

/* Tile captured: the losing defender no longer sinks through the ground. They stay standing and deflate, the same
   loss pose as any other battle loser, and remain fully visible on the board. */
.battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar { clip-path: none !important; }
.battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar > g { animation: bp-lose 700ms cubic-bezier(.3, .7, .3, 1) 250ms both !important; transform-origin: 50% 100%; transform-box: fill-box; }
@media (prefers-reduced-motion: reduce) { .battle-pair.has-outcome .is-defender.battle-loser .land-player-avatar > g { animation: none !important; } }
/* The badge keeps its size; its top lines up with the score and the reason hangs down into the strip padding, so it
   never covers the name above and never changes the card height. */
.player-strip .player-card.strip-card .player-score-delta { margin-top: -3px !important; margin-bottom: -18px !important; align-self: flex-start !important; }

/* Phones: more room for the points in the player strip. The mute icon moves up beside the piece so the name and
   points get the card's full width; points are larger; 7-8 players use four columns instead of five. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .player-strip { column-gap: 6px !important; row-gap: 10px !important; padding: 8px 4px 10px !important; }
  .player-strip.player-count-7, .player-strip.player-count-8 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .player-strip .strip-card .player-name-row .player-mute-button,
  .player-strip .strip-card.is-awarding .player-name-row .player-mute-button { position: absolute !important; top: 0; right: 0; margin: 0 !important; }
  .player-strip .strip-card .player-name-row { gap: 0 !important; padding-right: 18px; box-sizing: border-box; }
  /* 7-10 players stack the piece above the name: the icon sits beside the piece and the name gets the full width. */
  :is(.player-count-7, .player-count-8, .player-count-9, .player-count-10).player-strip .strip-card .player-name-row .player-mute-button { top: -26px; }
  :is(.player-count-7, .player-count-8, .player-count-9, .player-count-10).player-strip .strip-card .player-name-row { padding-right: 0; }
  .player-strip .strip-card .player-name-text { font-size: 13px !important; }
  .player-strip .strip-card .player-card-copy .player-score { font-size: 16px !important; font-weight: 800 !important; line-height: 1.15 !important; }
  .player-strip .strip-card .player-card-copy .player-score small { font-size: 12px !important; }
}

/* Emote pop-ups float above the player's piece at 1.5 times its size, whatever size the strip draws the piece. */
.player-strip .player-emote-anchor > .player-emote-pop,
.player-strip .player-score-anchor > .player-emote-pop { width: clamp(104px, 220%, 200px); aspect-ratio: 1; display: block; }
/* A big pop must stay on screen: the end cards lean it inwards. */
.player-strip .player-card:first-child .player-emote-pop { --pop-x: -14%; transform-origin: 14% 100%; }
.player-strip .player-card:last-child .player-emote-pop { --pop-x: -86%; transform-origin: 86% 100%; }
.player-strip .player-emote-anchor > .player-emote-pop > .avatar,
.player-strip .player-score-anchor > .player-emote-pop > .avatar { width: 100% !important; height: 100% !important; flex-basis: auto !important; max-width: none !important; max-height: none !important; }

/* Answer reveal: each player's piece sits above the answer they picked, in a row that keeps its height from the
   start so nothing moves when the pieces land. */
.ad-card-pieces.is-above, .rows-open .ad-card-pieces.is-above { position: static !important; height: 40px !important; padding: 0 4px 6px !important; align-items: flex-end; flex-wrap: nowrap; transition: none !important; }
.ad-kind-rapid .ad-card-pieces.is-above, .ad-kind-rapid .rows-open .ad-card-pieces.is-above { height: 46px !important; }
@media (max-width: 700px) {
  .ad-kind-mc .ad-card-pieces.is-above, .ad-kind-mc .rows-open .ad-card-pieces.is-above { height: 30px !important; padding: 0 2px 4px !important; }
  .ad-kind-mc .ad-card-wrap > .ad-card { padding-bottom: 10px !important; }
  .ad-kind-rapid .ad-card-pieces.is-above, .ad-kind-rapid .rows-open .ad-card-pieces.is-above { height: 40px !important; }
}
@media (max-width: 700px) {
  /* The pieces moved out of the answer cards, so the cards no longer need the extra height that held them. */
  .ad-kind-mc .ad-card-wrap > .ad-card { min-height: 58px !important; }
}

/* Player strip points: up to three times the old 12px, as large as each card's width allows. */
/* Sized from the whole card, not the name block: where the name block shrinks to fit its text (wide screens put
   it under the piece at max-content), measuring the block itself collapsed it to zero and the names vanished. */
.player-strip .player-card.strip-card { container-type: inline-size; }
.player-strip .player-card.strip-card .player-card-copy { width: 100%; }
.player-strip .strip-card .player-card-copy .player-score { font-size: clamp(16px, 22cqi, 36px) !important; line-height: 1 !important; font-weight: 800 !important; }
.player-strip .strip-card .player-card-copy .player-score small { font-size: clamp(11px, 7cqi, 15px) !important; }

/* Word reveal: the typed answers stay hidden (keeping their space) until the right answer is revealed. */
.ad-cards.hide-until-open:not(.rows-open) .ad-card-wrap { visibility: hidden; }
.ad-cards.hide-until-open.rows-open .ad-card-wrap { animation: ad-fade-in 260ms ease both; }

/* The player strip must not clip emote pop-ups that float above a player's piece. */
.game-shell .player-strip.player-strip { overflow: visible !important; }

/* Ready button: 50% bigger than before (40px tall, 15px text). Map screens keep its taller bar clear. */
.ready-skip .ready-skip-button { min-height: 60px; padding: 12px 27px; gap: 9px; font-size: 22px; }
.ready-skip .ready-skip-button svg { width: 25px; height: 25px; }
.ready-skip .ready-skip-count { font-size: 18px; gap: 6px; }
.ready-skip .ready-skip-count i { width: 13px; height: 13px; }
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .main-stage .land-screen { --frame-ready-h: 76px; }
}

/* Multiple choice and Quick 5 reveals reuse the question screen's answer buttons (same grid, size, letters).
   Only the reveal states are added here: the right answer blinks then stays lit, the rest dim, and each
   player's piece perches on the top edge of the answer they picked, taking no room of its own. */
.ad-options { width: 100%; box-sizing: border-box; }
.ad-options .ad-option-wrap { position: relative; display: flex; min-width: 0; }
.ad-options .ad-option-wrap > .answer-option { flex: 1 1 auto; width: 100%; min-width: 0; cursor: default; }
.ad-options .answer-option:disabled { opacity: 1; }
.ad-options .answer-option.is-truth { background: var(--ad-ink) !important; color: var(--ad-night) !important; }
.ad-options .answer-option.is-truth .option-key { background: var(--ad-night) !important; color: var(--ad-ink) !important; }
.ad-options .answer-option.is-dim { opacity: .42 !important; }
.ad-options .answer-option.is-flash { position: relative; }
.ad-options .answer-option.is-flash::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 3px solid var(--ad-lime); pointer-events: none; animation: ad-burst 700ms var(--ad-ease) both; }
.ad-options .ad-option-tick { margin-left: auto; display: inline-flex; flex: 0 0 auto; color: var(--ad-night); }
.ad-options .ad-option-pieces { position: absolute; left: 12px; right: 8px; top: 0; transform: translateY(-58%); display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; pointer-events: none; z-index: 2; }
.ad-options .ad-option-pieces .ad-piece { filter: drop-shadow(0 2px 3px #0008); }
.ad-kind-rapid .ad-options:not(.rows-open) .ad-option-wrap { visibility: hidden; }
.ad-kind-rapid .ad-options.rows-open .ad-option-wrap { animation: ad-fade-in 260ms ease both; }
@media (max-width: 700px) {
  .ad-options .ad-option-pieces .ad-piece, .ad-options .ad-option-pieces .ad-piece svg { width: 24px !important; height: 24px !important; }
  .ad-options .ad-option-tick svg { width: 20px; height: 20px; }
}

/* Emotion picker: three across, two rows, each emotion three times your piece's size (sized in emojiMenuPosition). */
.emoji-menu.expression-menu.is-floating { display: grid !important; grid-template-columns: repeat(3, var(--emote-size, 64px)); gap: var(--emote-gap, 6px) !important; padding: var(--emote-pad, 8px) !important; max-width: none; border-radius: 18px; }
.emoji-menu.expression-menu.is-floating button { width: var(--emote-size, 64px) !important; height: var(--emote-size, 64px) !important; padding: 6% !important; border-radius: 14px; }
.emoji-menu.expression-menu.is-floating button .avatar, .emoji-menu.expression-menu.is-floating button > svg { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; }

/* Design critique R1 (score strip): on phones a three-column card is too narrow for score + "pts" + award + reason, so
   the award collided with "pts", its reason ran into the next row and the name was squeezed to "Ra…". While an award
   shows, the unit steps aside and "+25" sits at the card's right edge on the score row; the reason is dropped on
   phones (the reveal table already says why). The name keeps its full width. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .player-strip .strip-card.is-awarding .player-card-copy .player-score small { visibility: hidden !important; }
  .player-strip .strip-card.is-awarding .player-name-row { max-width: none !important; }
  .player-strip .strip-card .player-card-copy > .player-score-delta-slot { top: auto !important; bottom: 0 !important; translate: none !important; right: 0 !important; left: auto !important; }
  .player-strip .player-card.strip-card .player-score-delta { margin: 0 !important; }
  .player-strip .strip-card .player-score-delta small { display: none !important; }
}
/* Labels that carry player names keep their case: "Magenta is attacking Raspberry", never "raspberry". */
.eyebrow.keep-case, .shared-kicker.keep-case { text-transform: none !important; }
/* The folded attack strip on phones clipped names to "Mager"; give the current attacker's name room and a readable size. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .battle-round-track.is-collapsed { width: 200px !important; }
  .battle-round-track.is-collapsed .battle-track-name { max-width: 92px !important; font-size: 12px !important; }
}
/* Geo reveal on phones keeps the stage height, so the answer table ran under the floating Ready pill and hid the last
   rows. Reserve the pill's height at the bottom; the map gives up the space (it can be zoomed). */
@media (max-width: 860px) {
  body:has(.ready-skip) .main-stage .geo-question.is-reveal { box-sizing: border-box !important; padding-bottom: 84px !important; }
}
.geo-reveal-top { position: relative; width: 100%; }
/* Geo battle reveals carry the duel row under the table: let that stage scroll (the duel row scrolls into view above
   the Ready pill when the outcome lands) instead of pinning it to the screen height, where it sat under the pill. */
@media (max-width: 860px) {
  .main-stage .geo-question.is-reveal:has(.battle-pair) { height: auto !important; max-height: none !important; min-height: 100% !important; padding-bottom: 104px !important; }
  .main-stage .geo-question.is-reveal:has(.battle-pair) .geo-map { height: 240px !important; flex: none !important; }
}
/* Duel names never break mid-word ("Raspberr / y"): a generic overflow-wrap:anywhere rule beat the nowrap. On phones they
   step down a size so a long name keeps its last letters. */
.battle-pair .land-player-name { white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important; }
@media (max-width: 520px) { .battle-pair .land-player-name { font-size: 16px !important; } }
/* Final standings on phones: the ranking panel was capped at 168px and scrolled, hiding the viewer's own row when they
   finished 4th or lower ("4th! Rematch time." with no "You" in sight). The panel takes its full height; the map gives way. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .main-stage .final-screen .land-layout.final-layout { grid-template-rows: minmax(96px, 1fr) auto !important; }
  .main-stage .final-screen .land-sidecar.final-ranking { height: auto !important; max-height: none !important; overflow: visible !important; }
  .main-stage .final-screen .land-map-slot.final-map { min-height: 0 !important; height: 100% !important; }
}
/* The end-of-game actions are the next step for everyone (Fitts): on phones they share the full row, Rematch first and wider. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .final-screen .button-row { display: grid !important; grid-template-columns: 3fr 2fr; gap: 8px !important; width: 100%; }
  .final-screen .button-row > button { width: 100% !important; min-height: 48px; justify-content: center; }
}
/* Highlight reel: its last line was clipped by the panel's fixed row heights and "Tap ›" sat on top of the text.
   Rows size to content and the hint gets its own strip under the copy. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .main-stage .final-screen .land-sidecar.final-ranking { grid-template-rows: none !important; grid-auto-rows: auto !important; }
}
.final-screen .highlight-reel { padding-bottom: 22px; min-height: max-content; }
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .final-screen .highlight-reel { gap: 6px; padding: 10px 12px 20px; }
  .final-screen .hl-stage { height: 64px; min-width: 72px; }
  .final-screen .hl-stage.is-pair { min-width: 112px; }
  .final-screen .hl-detail { font-size: 12px; }
  .final-screen .hl-hint { bottom: 4px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .final-screen .hl-detail { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* TV map screens at 720p: kicker, heading, hint and a 52vh map ran 67px past the bottom edge, cutting off "Pick on your
   phone." The map takes what is left of the panel instead of a fixed share of the viewport. */
.shared-map-panel .shared-map-board { height: clamp(200px, calc(100dvh - 400px), 570px); }
/* TV answer tables are read from the sofa: 12-15px names, times and labels were too small at 720p. They scale with the
   screen width, and the row step grows to match. */
.shared-main-content { --ad-row-step: clamp(34px, 3.1vw, 54px); }
.shared-main-content .ad-time-who b, .shared-main-content .ad-time-value { font-size: clamp(15px, 1.45vw, 26px) !important; }
.shared-main-content .ad-time-row small, .shared-main-content .ad-time-detail { font-size: clamp(13px, 1.2vw, 22px) !important; }
.shared-main-content .ad-results-label { font-size: clamp(12px, 1.1vw, 20px) !important; }
.shared-main-content .ad-results-answer { font-size: clamp(13px, 1.2vw, 22px) !important; }
/* Lobby: Start game is the primary action but an old phone rule set it at 11px, smaller than Leave lobby (Von Restorff).
   It now reads at least as large as the secondary action. */
.lobby-bottom .start-game > .primary { font-size: 17px !important; font-weight: 800 !important; min-height: 48px !important; }
.lobby-bottom .start-game > p { font-size: 15px !important; }
/* A guest's "Waiting for the host to start" is status, not an action: it no longer wears the lime primary-button look. */
.lobby-bottom .start-game:has(> p) { background: #ffffff10 !important; border: 1px dashed #ffffff2e !important; box-shadow: none !important; }
.lobby-bottom .start-game > p { color: var(--ad-muted) !important; font-weight: 700 !important; }
/* Quick 5 reveal on phones: five answer slots squeezed names to "Ho…". Slots step down a size so a name reads whole. */
@media (max-width: 860px) {
  .ad-kind-rapid .ad-slots { gap: 3px !important; }
  .ad-kind-rapid .ad-slots > * { width: 14px !important; height: 14px !important; min-width: 0 !important; }
  .ad-kind-rapid .ad-time-row { gap: 6px; }
}
/* Design critique R2: on answered battle questions the live answers table was squeezed by the column flex, clipping the
   fourth player to a sliver (a false floor). The table keeps its full height; rows were already laid out for it. */
.question-screen > .ad-results, .geo-question-copy > .ad-results { flex-shrink: 0 !important; }
/* Design critique R2: phone-style map screens shown on the TV (pick order) used a fixed 470px layout and ran past 720p,
   cutting off the last picker. Inside the TV panel the layout takes what is left of the screen. */
.shared-main-content .land-screen .land-layout { height: clamp(260px, calc(100dvh - 400px), 470px) !important; min-height: 0 !important; }
.shared-main-content .land-screen .land-sidecar { max-height: 100%; overflow: hidden; gap: 4px !important; }
.shared-main-content .queue-screen .land-header { padding-bottom: 4px !important; }
.shared-main-content .queue-screen .land-sidecar .avatar { width: 28px !important; height: 28px !important; }
.shared-main-content .queue-screen .land-sidecar { padding-block: 4px !important; }
.shared-main-content .queue-screen .land-sidecar > .land-panel-notice { display: none !important; }

/* ---------- Emote side rail (all screens: phone, desktop, TV) ----------
   Fixed to the right edge, vertically centred, above content but never taking clicks. */
.emoji-feed { position: fixed; right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; max-height: 70dvh; overflow: hidden; }
.emoji-feed-item { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; background: #140b22d1; background: color-mix(in srgb, var(--ad-night, #140b22) 82%, transparent); border: 2px solid var(--player, #fff); box-shadow: 0 8px 22px #0007; color: var(--ad-ink, #f7f2ff); animation: emoji-feed-in 260ms cubic-bezier(.2, .9, .3, 1.3) both, emoji-feed-out 500ms ease-in var(--feed-ms, 6000ms) both; }
.emoji-feed-item .avatar { flex: none; }
.emoji-feed-name { font-weight: 800; font-size: 14px; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes emoji-feed-in { from { opacity: 0; transform: translateX(40px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes emoji-feed-out { to { opacity: 0; transform: translateX(24px); } }
/* Phones: a slim column of pieces only, so it covers as little of the answer area as possible. */
@media (max-width: 700px) {
  .emoji-feed { right: max(4px, env(safe-area-inset-right)); top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); transform: none; gap: 5px; max-height: 40dvh; }
  .emoji-feed-item { padding: 3px; gap: 0; }
  .emoji-feed-name { display: none; }
}
/* TV: bigger, readable from the sofa. */
/* Emote faces read at a glance: 56px on desktop, 48px on phones, 84px on a TV. */
.emoji-feed-item .avatar { width: 56px !important; height: 56px !important; }
.emoji-feed-name { font-size: 16px; }
@media (max-width: 700px) { .emoji-feed-item .avatar { width: 48px !important; height: 48px !important; } }
@media (min-width: 1600px) { .emoji-feed-item { padding: 8px 20px 8px 8px; } .emoji-feed-item .avatar { width: 84px !important; height: 84px !important; } .emoji-feed-name { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .emoji-feed-item { animation: none; } }

/* "Use this device as the TV" / "Play on this device": a quiet link-style switch, not a full-width card. */
.lobby-tv-switch { justify-self: start; align-self: flex-start; width: auto !important; min-height: 36px !important; padding: 6px 12px !important; font-size: 14px !important; background: transparent !important; border: 1px dashed #ffffff33 !important; }
.join-as-tv { width: 100%; }

/* Phones: the floating Ready pill sits over the bottom of the stage; keep that strip free so it never covers content
   (the stage fitter then scales the screen into the space that is left). */
@media (max-width: 700px) {
  .game-shell:has(.ready-skip) > .main-stage { padding-bottom: 72px !important; }
}

/* Phone geo question: only the question and the map. The map takes every pixel left between the title and the
   Lock button, and never more (no stage scroll); thumbs and the empty answer line are left for the reveal. */
@media (max-width: 700px) {
  .main-stage > .geo-question:not(.is-reveal) { display: flex !important; flex-direction: column !important; height: 100% !important; max-height: 100% !important; min-height: 0 !important; padding-bottom: 0 !important; }
  .geo-question:not(.is-reveal) .geo-layout { flex: 1 1 0 !important; min-height: 0 !important; height: auto !important; gap: 6px !important; }
  .geo-question:not(.is-reveal) .geo-layout > .geo-map { flex: 1 1 0 !important; min-height: 140px !important; height: auto !important; display: flex !important; flex-direction: column !important; }
  .geo-question:not(.is-reveal) .geo-map > svg { flex: 1 1 0 !important; height: auto !important; min-height: 0 !important; }
  .geo-question:not(.is-reveal) .question-feedback-buttons,
  .geo-question:not(.is-reveal) .ad-geo-answer:empty,
  .geo-question:not(.is-reveal) .stage-timer-caption { display: none !important; }
  .geo-question:not(.is-reveal) .stage-timer, .geo-question:not(.is-reveal) .question-clock { min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
  .geo-question:not(.is-reveal) { --countdown-size: 46px; }
  .geo-question:not(.is-reveal) .geo-question-copy > .stage-title { font-size: clamp(19px, 5.4vw, 24px) !important; line-height: 1.15 !important; }
}
@media (max-width: 700px) {
  /* Battles wrap the question in .battle-question-stage: same fill rules one level down. */
  .main-stage > .battle-question-stage:has(> .geo-question:not(.is-reveal)) { display: flex !important; flex-direction: column !important; height: 100% !important; max-height: 100% !important; min-height: 0 !important; }
  .battle-question-stage > .geo-question:not(.is-reveal) { display: flex !important; flex-direction: column !important; flex: 1 1 0 !important; height: auto !important; max-height: 100% !important; min-height: 0 !important; padding-bottom: 0 !important; margin: 0 !important; }
}

/* TV lobby: the join QR code stacked above the room code, the same width as the code chip. */
.room-join { display: flex; flex-direction: column; align-items: stretch; gap: 10px; flex-shrink: 0; }
.room-join-qr { display: block; width: clamp(120px, 20vh, 220px); height: auto; aspect-ratio: 1; align-self: center; border-radius: 12px; background: #fff; box-shadow: 0 0 0 3px var(--ad-lime); image-rendering: pixelated; }

/* Word guesser: one row of letter cells with the hint button beside them. Each cell's width comes from the word length and
   the row width, so the row never wraps or runs off screen, and nothing changes size when letters are typed or revealed:
   the keyboard and the rest of the screen stay exactly where they are. */
.word-entry-area { --word-gap: 6px; --hint-w: 92px; --hint-gap: 10px; --cell-max: 48px; }
.word-row { container-type: inline-size; width: 100%; display: flex !important; align-items: center; justify-content: center; gap: var(--hint-gap); }
.word-row.is-locked { --hint-w: 0px; --hint-gap: 0px; }
.word-row .word-cells { flex: 0 1 auto !important; min-width: 0 !important; max-width: none !important; display: flex !important; flex-wrap: nowrap !important; gap: var(--word-gap) !important; margin: 0 !important; }
.word-row .word-cell {
  --cell-w: min(var(--cell-max), calc((100cqw - var(--hint-w) - var(--hint-gap) - (var(--word-n) - 1) * var(--word-gap)) / var(--word-n)));
  box-sizing: border-box !important; flex: 0 0 auto !important; width: var(--cell-w) !important; min-width: 0 !important;
  padding: 0 !important; border-width: 2px !important; border-style: solid !important;
  font-size: min(28px, calc(var(--cell-w) * .6)) !important; transform: none !important; transition: border-color .14s ease, background .14s ease !important;
}
.word-row .word-hint-button {
  flex: 0 0 var(--hint-w) !important; width: var(--hint-w) !important; min-width: 0 !important; height: 44px !important; min-height: 44px !important;
  padding: 0 8px !important; display: inline-flex !important; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; transform: none;
}
.word-row .word-hint-button svg { flex: 0 0 auto; }
/* The status line is always there (empty until a wrong guess), so the first "Not quite" never pushes the screen. */
.word-entry-actions .word-hint-status { display: block !important; position: static !important; min-height: 0 !important; height: 18px; line-height: 18px !important; margin: 4px 0 0 !important; font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .word-entry-area { --word-gap: 4px; --hint-w: 70px; --hint-gap: 6px; --cell-max: 36px; }
  .word-row .word-hint-button { height: 38px !important; min-height: 38px !important; padding: 0 6px !important; font-size: 14px !important; }
  .word-entry-actions .word-hint-status { height: 14px; line-height: 14px !important; font-size: 11px !important; margin-top: 2px !important; }
}
/* Hover and press lifts are off here: a sticky :hover after a tap moved the hint button by a few pixels. */
.word-row .word-hint-button:not(.is-nudging), .word-row .word-hint-button:not(.is-nudging):hover, .word-row .word-hint-button:not(.is-nudging):active, .word-row .word-hint-button:not(.is-nudging):focus-visible,
.word-entry-actions .primary, .word-entry-actions .primary:hover, .word-entry-actions .primary:active { transform: none !important; translate: none !important; }
/* Lock button on top, the status line under it across the full width, so a long "Not quite" never runs off screen. */
.word-entry-actions { display: flex !important; flex-direction: column !important; flex-wrap: nowrap !important; align-items: center !important; width: 100% !important; gap: 0 !important; }
.word-entry-actions .word-hint-status { width: 100% !important; max-width: 100% !important; flex: 0 0 auto !important; text-align: center !important; left: auto !important; right: auto !important; top: auto !important; transform: none !important; }
/* The answered tray keeps its height while empty: as a shrinkable flex item it collapsed to 0, then the first answer
   grew it and the whole question screen re-zoomed and moved. */
.ad-answered { flex-shrink: 0 !important; min-height: 46px; }
.shared-question .ad-answered { min-height: 64px; }

/* Landscape phones (short and wide): typed-answer questions go side by side, question on the left and the cells, keys and
   Lock on the right. Stacked, they needed ~400px of height and overflowed even at the smallest zoom. */
@media (orientation: landscape) and (max-height: 500px) {
  .question-screen:has(> .word-entry-area, > .number-entry) {
    display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: auto auto 1fr;
    column-gap: 28px; row-gap: 4px; align-items: center; align-content: center; height: auto !important;
  }
  .question-screen:has(> .word-entry-area, > .number-entry) > .question-top { grid-column: 1; grid-row: 1; position: static !important; left: auto !important; right: auto !important; top: auto !important; justify-content: center !important; width: auto !important; }
  .question-screen:has(> .word-entry-area, > .number-entry) > .question-heading { grid-column: 1; grid-row: 2; margin: 0 !important; }
  .question-screen:has(> .word-entry-area, > .number-entry) > .ad-answered { grid-column: 1; grid-row: 3; align-self: start; justify-content: center; }
  .question-screen:has(> .word-entry-area, > .number-entry) > .word-entry-area,
  .question-screen:has(> .word-entry-area, > .number-entry) > .number-entry { grid-column: 2; grid-row: 1 / span 3; margin: 0 !important; align-self: center; }
}

/* Host pause: a calm full-screen card over every screen (phones and TV) until the host resumes. */
.paused-overlay { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 16px; background: #120a1fd9; }
.paused-card { display: grid; justify-items: center; gap: 12px; max-width: 420px; padding: 28px 32px; border-radius: 22px; background: var(--ad-night-2, #1d1230); box-shadow: 0 0 0 2px var(--ad-lime), 0 20px 60px #000a; text-align: center; }
.paused-card strong { font: 900 clamp(34px, 6vw, 64px)/1 var(--ad-font-display, inherit); color: var(--ad-lime); letter-spacing: -.02em; }
.paused-card p { margin: 0; color: var(--ad-muted); font-size: clamp(15px, 2vw, 20px); }
.settings-paused-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ad-lime, #c6ff3d) 14%, transparent); color: var(--ad-lime, #c6ff3d); font-weight: 700; text-align: center; }

/* Answer times never wrap ("10.76 s" stays on one line, big TV type included): the value column is as wide as the
   widest value, which every cell carries invisibly so all rows share one width. */
.ad-time-value { display: grid; justify-items: end; white-space: nowrap; }
.ad-time-value > * { grid-area: 1 / 1; }
.ad-time-value > .ad-time-sizer { visibility: hidden; height: 0; overflow: hidden; }

/* TV leaderboard: the reason for each score lands on the row ("+25 Correct"), as on the players' strip. One line, so the
   row never grows; the name gives way. */
.shared-score > .shared-score-delta { display: inline-flex; align-items: baseline; gap: .35em; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; color: var(--ad-gold); animation: ad-stamp 360ms cubic-bezier(.2, .9, .3, 1.4) both; }
.shared-score > .shared-score-delta b { font-family: var(--ad-font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.shared-score > .shared-score-delta small { font-size: .78em; font-weight: 700; color: var(--ad-ink); opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.shared-score.is-awarding { box-shadow: inset 0 0 0 2px var(--player); }
.shared-score.score-jumping .avatar { animation: shared-score-hop 520ms cubic-bezier(.3, .7, .3, 1) both; }
@keyframes shared-score-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-10px) scale(1.08); } }

/* TV emote pop: bursts out to the left of the player's leaderboard row, grows from the row's side. */
.tv-emote-pop { position: fixed; z-index: 70; pointer-events: none; display: block; filter: drop-shadow(0 8px 18px #000a); transform-origin: 100% 50%; animation: tv-emote-pop 3.5s cubic-bezier(.18, .9, .26, 1) both; }
.tv-emote-pop > .avatar { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; }
@keyframes tv-emote-pop { 0% { opacity: 0; transform: translateX(24px) scale(.4); } 12%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(-10px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .tv-emote-pop { animation: none; } }

/* ---------- Lite rendering for slow TVs (logic/perf.js sets .perf-lite) ----------
   Samsung/LG TV browsers repaint on a weak CPU: every filter, mask, full-screen gradient and looping decoration costs
   a whole frame there. Same game, same timings; just no decoration that has to be repainted each frame. */
.perf-lite *, .perf-lite *::before, .perf-lite *::after { filter: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; animation-iteration-count: 1 !important; }
/* Loops that mean something keep looping. */
.perf-lite .spin, .perf-lite .answering-dots i, .perf-lite .waiting-dots i { animation-iteration-count: infinite !important; }
/* The first-claim art is one inline SVG, which repaints whole for every moving part: fewer moving parts. */
.perf-lite .first-claim-halo, .perf-lite .claim-orbit, .perf-lite .claim-seed, .perf-lite .claim-sparks, .perf-lite .claim-ripple, .perf-lite .claim-ground-shadow { display: none !important; }
.perf-lite .first-claim-scrim { background: #1b1029 !important; }
.perf-lite .hl-rays, .perf-lite .geo-answer-ripple { display: none !important; }
/* The tile flash is a brightness filter, which lite turns off: do not tick an animation nobody can see. */
.perf-lite .tile-pop { animation: none !important; }
/* Final confetti: a third of the pieces, one pass, then the screen is still. */
.perf-lite .final-confetti i { animation-iteration-count: 1 !important; }
.perf-lite .final-confetti i:nth-child(n+41) { display: none !important; }
.perf-lite .shared-stage, .perf-lite .game-shell { background-image: none !important; }

/* ---------- Lobby: players panel at the top, bots picker, map dice, topic picker ---------- */
.lobby-players-panel { display: grid; gap: 8px; width: 100%; }
.lobby-players-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border: 1px solid #ffffff12; border-radius: 14px; background: var(--ad-night-2); color: var(--ad-ink); text-align: left; cursor: pointer; font: inherit; }
.lobby-players-head b { font-size: 15px; font-weight: 800; }
.lobby-players-head small { flex: 1 1 auto; min-width: 0; color: var(--ad-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-players-faces { display: inline-flex; align-items: center; }
.lobby-players-faces .avatar + .avatar { margin-left: -6px; }
.lobby-players-panel.is-open .lobby-players-faces { display: none; }
.lobby-players-panel.is-open .lobby-players-head .customise-chevron,
.lobby-topics.is-open .lobby-topics-head .customise-chevron { transform: translateY(1px) rotate(-135deg); }
.lobby-players-head:focus-visible, .lobby-topics-head:focus-visible { outline: 2px solid var(--ad-lime); outline-offset: 2px; }

.map-choice-row { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.map-choice-row > :first-child { flex: 1 1 auto; min-width: 0; }
.lobby .lobby-options .map-roll-button { flex: 0 0 auto; display: grid; place-items: center; width: 40px; min-width: 40px; padding: 0 !important; }
.map-roll-button .die-glyph { width: 18px; height: 18px; }
.map-roll-button:not(:disabled):active .die-glyph { transform: rotate(90deg); transition: transform .15s var(--ad-ease, ease); }

.lobby-topics { width: 100%; border: 1px solid #ffffff12; border-radius: 14px; background: #ffffff05; }
.lobby-topics-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 14px; background: transparent; color: #f5edf9; text-align: left; cursor: pointer; font: inherit; }
.lobby-topics-head b { font-size: 12px; font-weight: 800; }
.lobby-topics-head small { flex: 1 1 auto; color: var(--ad-muted); font-size: 12px; }
.lobby-topics-body { display: grid; gap: 10px; padding: 0 12px 12px; }
.topic-search { position: relative; }
.topic-search input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--mc-cyan, #5ce1e6) 32%, transparent); border-radius: 10px; background: var(--ad-night); color: var(--ad-ink); font: inherit; font-size: 14px; }
.topic-search input::placeholder { color: var(--ad-muted); }
.topic-search input:focus { outline: 2px solid var(--ad-lime); outline-offset: 1px; }
.topic-search-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 232px; margin: 0; padding: 4px; overflow: auto; list-style: none; border: 1px solid #ffffff1a; border-radius: 12px; background: var(--ad-night-3); box-shadow: 0 12px 28px #00000080; }
.topic-search-list li { padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.topic-search-list li.is-active { background: var(--ad-night-4); color: var(--ad-lime); }
.topic-search-empty { margin: 6px 2px 0; color: var(--ad-muted); font-size: 13px; }
.topic-bubbles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.topic-bubble { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 3px 12px; border-radius: 999px; background: var(--ad-night-2); color: var(--ad-ink); font-size: 13px; font-weight: 700; }
.topic-bubble:has(.topic-bubble-remove) { padding-right: 3px; }
.topic-bubble-remove { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ad-muted); font-size: 17px; line-height: 1; cursor: pointer; }
.topic-bubble-remove:hover:not(:disabled), .topic-bubble-remove:focus-visible { background: #ffffff1a; color: var(--ad-ink); }
.topic-bubble-remove:disabled { opacity: .35; cursor: default; }
@media (max-width: 700px) {
  .lobby-players-head { min-height: 40px; padding: 6px 12px; }
  .topic-bubble { min-height: 28px; font-size: 12px; }
}
@media (min-width: 701px) {
  .map-choice-row { align-items: center; }
  .lobby .lobby-options .map-roll-button { width: 32px; min-width: 32px; height: 32px !important; min-height: 32px !important; margin: -4px 0; border-radius: 10px !important; }
}
@media (max-width: 700px) {
  .lobby .lobby-options { grid-template-columns: minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.5fr) !important; }
}

/* Bots: a − count + stepper instead of a dropdown. */
.bot-stepper-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bot-stepper { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.lobby .lobby-options .bot-step { display: grid; place-items: center; flex: 0 0 auto; width: 32px; min-width: 32px; height: 32px !important; min-height: 32px !important; padding: 0 !important; border: 1px solid color-mix(in srgb, var(--mc-cyan, #5ce1e6) 32%, transparent); border-radius: 10px !important; background: var(--ad-night-2); color: var(--ad-ink); font: inherit; font-size: 18px !important; font-weight: 800; line-height: 1; cursor: pointer; }
.lobby .lobby-options .bot-step:hover:not(:disabled) { background: var(--ad-night-4); }
.lobby .lobby-options .bot-step:disabled { opacity: .35; cursor: default; }
.bot-count { min-width: 4.2em; text-align: center; color: var(--ad-ink); font-size: 15px; font-weight: 700; white-space: nowrap; }
@media (max-width: 700px) {
  .bot-stepper { gap: 2px; }
  .lobby .lobby-options .bot-step { width: 28px; min-width: 28px; height: 32px !important; min-height: 32px !important; font-size: 16px !important; }
  .bot-count { min-width: 0; flex: 1 1 auto; font-size: 11px; }
}
@media (min-width: 701px) {
  .bot-stepper { min-height: 0; }
  .lobby .lobby-options .bot-step { width: 28px; min-width: 28px; height: 28px !important; min-height: 28px !important; margin: -3px 0; }
}
@media (max-width: 700px) { .bot-stepper-field { gap: 2px; } .bot-stepper { min-height: 36px; } }

/* Keyboard play: key hints on answers and buttons (A·E, Submit (Enter), Hint (Space), Ready (R)) and the order list's cursor.
   Touch-only devices have no keyboard, so they never see the hints. */
.key-hint { opacity: .72; font-size: .82em; font-weight: 700; margin-left: .2em; white-space: nowrap; }
.answer-option .option-key { position: relative; overflow: visible !important; }
.answer-option .option-shortcut { position: absolute; right: -7px; bottom: -7px; margin: 0; opacity: 1; padding: 2px 4px; border-radius: 5px; background: #F7F2FF; color: #1a0d2b;
  font: 800 10px/1 "Figtree", sans-serif; letter-spacing: 0; box-shadow: 0 1px 0 #0007; }
.order-item.is-cursor { outline: 2px dashed #D8FF36aa; outline-offset: 3px; }
.order-item.is-grabbed { outline: 2px solid #D8FF36; outline-offset: 3px; transform: scale(1.02); box-shadow: 0 10px 24px #0008; z-index: 2; }
.order-key-help { margin: 2px 0 0; text-align: center; font-size: 12px; color: #C3B3DA; }
@media (hover: none) and (pointer: coarse) { .key-hint { display: none !important; } .order-item.is-cursor:not(.is-grabbed) { outline: none; } }

/* Celebration emote: the confetti keeps falling. Each piece drops through the face's box on its own loop (staggered so the shower
   never empties), swaying and tumbling, fading in at the top and out at the bottom. The still CONFETTI burst hides once it runs. */
.confetti-burst { display: none; }
.confetti-fall { transform-box: fill-box; transform-origin: 50% 50%; animation: confetti-fall var(--dur, 3s) linear var(--delay, 0s) infinite; }
@keyframes confetti-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  8% { opacity: 1; }
  25% { transform: translate(calc(var(--sway) * 2.4px), 17px) rotate(calc(var(--sway) * 90deg)); }
  50% { transform: translate(calc(var(--sway) * -1.6px), 34px) rotate(calc(var(--sway) * 180deg)); }
  75% { transform: translate(calc(var(--sway) * 2px), 51px) rotate(calc(var(--sway) * 270deg)); }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--sway) * -1px), 66px) rotate(calc(var(--sway) * 360deg)); }
}
/* Still pictures (reduced motion, perf-lite) keep the old burst. */
@media (prefers-reduced-motion: reduce) { .confetti-rain { display: none; } .confetti-burst { display: inline; } }
.perf-lite .confetti-rain { display: none; } .perf-lite .confetti-burst { display: inline; }

@media (prefers-reduced-motion: reduce) { .final-confetti { display: none; } }

/* The answer slot under the question: the answer table is laid out from the first frame (unseen) so its height never changes;
   the answered pieces sit over it until you lock in. */
.answer-slot { display: grid; width: 100%; }
.answer-slot > * { grid-area: 1 / 1; min-width: 0; }
.answer-slot-table.is-reserved { visibility: hidden; }
.answer-slot-pieces { align-self: center; justify-self: center; }

/* Button letters from js/logic/hotkeys.js: "Rematch (R)". Shown only where there is a keyboard. */
button[data-hotkey]::after { content: " (" attr(data-hotkey) ")"; opacity: .72; font-size: .82em; font-weight: 700; margin-left: .25em; white-space: nowrap; }
@media (hover: none) and (pointer: coarse) { button[data-hotkey]::after { content: none; } }

/* Preview animations: Surprise me sits above the three rows and rolls all of them at once. */
.lobby-fx-rows > .fx-surprise-button { grid-column: 1 / -1; justify-self: start; width: auto !important; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px; }

/* Big rooms (up to 16 players). Lists that grow with the room keep the screen readable instead of shrinking it all:
   the answer table splits into two columns on wider screens and tightens on phones, the lobby seats turn compact,
   and the final standings flow into two columns. */
@media (min-width: 701px) {
  .ad-times.is-split { height: calc(var(--half) * var(--ad-row-step)); }
  .ad-times.is-split .ad-time-row { right: auto; width: calc(50% - 6px); left: calc(var(--col) * (50% + 6px)); transform: translateY(calc(var(--prow) * var(--ad-row-step))); }
  .ad-times.is-split .ad-time-row { grid-template-columns: minmax(80px, 1fr) minmax(24px, .8fr) auto minmax(58px, max-content) minmax(0, 70px) 20px 36px; gap: 8px; }
  .ad-times.is-split .ad-time-who b, .ad-times.is-split .ad-time-value { font-size: 15px; }
}
@media (max-width: 700px) {
  .ad-times.is-split { --ad-row-step: 28px; }
  .ad-times.is-split .ad-time-who .avatar { width: 20px !important; height: 20px !important; }
  .ad-times.is-split .ad-time-who b, .ad-times.is-split .ad-time-value { font-size: 13px; }
}
.lobby-players:has(> :nth-child(11)) { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 6px !important; }
.lobby-players:has(> :nth-child(11)) > .lobby-player { min-height: 0 !important; padding: 6px 4px !important; }
.lobby-players:has(> :nth-child(11)) > .lobby-player .avatar, .lobby-players:has(> :nth-child(11)) .empty-avatar { width: 40px !important; height: 40px !important; }
@media (max-width: 900px) { .lobby-players:has(> :nth-child(11)) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (max-width: 700px) { .lobby-players:has(> :nth-child(11)) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) { gap: 3px !important; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row { min-height: 0 !important; padding-block: 2px !important; font-size: .86em; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .avatar { width: 22px !important; height: 22px !important; }
/* A big room's standings reveal faster, so the whole order is in within about six seconds. */
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row { animation-delay: calc(var(--reveal, 0) * .38s) !important; }

/* Big-room final: a dashed gap marks the skip between the top 5 and your own row; the toggle sits above Score breakdown. */
.final-screen .final-row.after-gap { margin-top: 10px; }
.final-screen .final-row.after-gap::before { content: ""; position: absolute; left: 12px; right: 12px; top: -7px; border-top: 2px dashed #ffffff24; }
.final-screen .final-show-all { justify-self: center; }

/* Phones hold about four standings rows under the highlight card: a big room shows the top 3 and your own row there. */
@media (max-width: 700px) { .final-screen .final-row.beyond-phone { display: none !important; } }

/* The character box is a fixed size: avatar row (132px) + one name row tall enough for the name editor (40px).
   A new look, a long name or editing the name never changes its height, so nothing below it moves. */
.lobby-character-stage { grid-template-rows: 132px 40px; align-items: center; height: calc(18px + 132px + 6px + 40px + 12px); box-sizing: border-box; contain: layout; }
.lobby-character-stage > .avatar { width: 132px; height: 132px; }
.lobby-character-stage > :last-child { max-width: 100%; min-width: 0; }
.lobby-character-stage .lobby-seat-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .lobby-character-stage { height: calc(12px + 132px + 6px + 40px + 10px); } }
/* Settings: bots' answer rate and speed, for every bot at once. */
.bot-settings { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid #ffffff1f; border-radius: 16px; min-width: 0; }
.bot-settings legend { padding: 0 6px; font-weight: 800; }
.bot-settings-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; }
.bot-settings-head output { color: var(--ad-lime, #D8FF36); font-variant-numeric: tabular-nums; }
.bot-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bot-preset { display: grid; gap: 2px; justify-items: center; min-height: 48px; padding: 8px 6px; border: 2px solid #ffffff26; border-radius: 12px; background: #ffffff0d; color: inherit; font: inherit; cursor: pointer; }
.bot-preset small { opacity: .7; font-size: 12px; }
.bot-preset.is-active { border-color: var(--ad-lime, #D8FF36); background: color-mix(in srgb, var(--ad-lime, #D8FF36) 16%, transparent); }
.bot-preset:focus-visible { outline: 3px solid var(--ad-lime, #D8FF36); outline-offset: 2px; }
.bot-rate-slider { width: 100%; height: 32px; accent-color: var(--ad-lime, #D8FF36); cursor: pointer; }

/* ==== Input access: controller focus, letter-shortcut switch, map hints (js/logic/gamepad.js, js/logic/hotkeys.js) ==== */
/* Focus moved by a controller or by the tile map's arrow keys: the same lime ring as :focus-visible. */
[data-pad-focus] { outline: 3px solid #D8FF36 !important; outline-offset: 3px !important; }
/* A map tile follows its own outline instead of a box. */
.candy-board path.tile.tile.tile[data-pad-focus], .candy-board path.tile.tile.tile:focus-visible { outline: none !important; stroke: #D8FF36 !important; stroke-width: 7px !important; stroke-dasharray: none !important; filter: brightness(1.25) drop-shadow(0 0 5px #D8FF36) !important; }
/* Letter shortcuts switched off in Settings: the fixed keys' hints go too (E R D F on answers, R on Ready). */
html.hotkeys-off:not([data-pad]) .answer-option .option-shortcut, html.hotkeys-off:not([data-pad]) .ready-skip-button .key-hint { display: none !important; }
/* A controller is connected: the hints name its buttons (X Y LB RB answer A B C D, Y is Ready). */
html[data-pad] .answer-option .option-shortcut { display: inline-block !important; font-size: 0 !important; }
html[data-pad] .answer-option .option-shortcut::after { font-size: 10px; }
html[data-pad] .answer-option:nth-of-type(1) .option-shortcut::after { content: "X"; }
html[data-pad] .answer-option:nth-of-type(2) .option-shortcut::after { content: "Y"; }
html[data-pad] .answer-option:nth-of-type(3) .option-shortcut::after { content: "LB"; }
html[data-pad] .answer-option:nth-of-type(4) .option-shortcut::after { content: "RB"; }
html[data-pad] .ready-skip-button .key-hint { font-size: 0 !important; }
html[data-pad] .ready-skip-button .key-hint::after { content: " (Y)"; font-size: .82rem; }
/* Mouse devices show no zoom hint under the tile map (Ctrl + scroll still zooms); the TV view shows no hint either. */
@media (hover: hover) and (pointer: fine) { .candy-board .map-pinch-hint { display: inline; } }
.shared-stage .candy-board .map-pinch-hint, .shared-stage .geo-map .map-credit { display: none !important; }
/* The home screen map is decoration, so it carries no zoom hint. */
.home-art .candy-board .map-pinch-hint { display: none !important; }

/* ---------- Final standings and highlight reel in the After Dark look (Nov 2026) ----------
   Both used gradients, glows and 1px borders that no other screen has. They now follow the shared patterns:
   a row is a flat --ad-night-3 card (like .shared-score), its score bar is the reveal's time track (.ad-time-track:
   --ad-night groove, flat player-colour fill, ad-bar 520ms), and the reel is a flat card with an eyebrow-style kicker
   and --ad-night / --ad-lime progress segments (like .shared-five-segments). Data and order are unchanged. */
.final-screen .final-ranking > .final-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center;
  column-gap: 12px !important; row-gap: 5px !important; min-height: max-content !important; padding: 8px 14px !important;
  border: 0 !important; border-radius: var(--ad-radius) !important; background: var(--ad-night-3) !important; box-shadow: none !important; font-size: 15px !important;
}
.final-screen .final-ranking > .final-row.first { background: var(--ad-night-4) !important; }
.final-screen .final-row > .rank-number { grid-area: 1 / 1 / 3 / 2; min-width: 1.1em; font-family: var(--ad-font-display); font-size: 20px !important; font-weight: 800; line-height: 1; text-align: center; color: var(--ad-muted); }
.final-screen .final-row.first > .rank-number { color: var(--ad-lime); }
.final-screen .final-row > .final-piece { grid-area: 1 / 2 / 3 / 3; }
.final-screen .final-row > .final-piece .avatar { width: 40px !important; height: 40px !important; }
.final-screen .final-row > .land-player-copy { grid-area: 1 / 3 / 2 / 4; align-self: end; min-width: 0; }
.final-screen .final-row .land-player-name { display: flex !important; align-items: baseline; gap: 5px; min-width: 0; font-family: var(--ad-font-ui); font-size: 17px !important; font-weight: 700; line-height: 1.25; text-decoration: none !important; }
.final-screen .final-row .final-name-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#root .final-screen .final-row .you-label { flex: none; font-size: 12px !important; font-weight: 600; color: var(--ad-muted); white-space: nowrap; }
#root .final-screen .final-row > strong { grid-area: 1 / 4 / 2 / 5; align-self: end; margin: 0; font-family: var(--ad-font-display); font-size: 24px !important; font-weight: 800; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
#root .final-screen .final-row > strong > small { padding-left: 4px; font-family: var(--ad-font-ui); font-size: 12px !important; font-weight: 600; letter-spacing: 0; color: var(--ad-muted); }
/* The score bar: a groove under the name and score, filled to the player's share of the top score. */
.final-screen .final-row > .final-bar {
  grid-area: 2 / 3 / 3 / 5; align-self: start; position: relative; inset: auto; z-index: auto; display: block; width: auto; height: 8px; overflow: hidden;
  border-radius: 5px; background: var(--ad-night); box-shadow: none; transform: none; animation: none !important;
}
.final-screen .final-row > .final-bar::before {
  content: ""; display: block; width: calc(var(--share, .06) * 100%); height: 100%; border-radius: 5px; background: var(--player); transform-origin: left center;
  animation: ad-bar 520ms var(--ad-ease) calc(var(--reveal, 0) * .85s + 250ms) both;
}
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-bar::before { animation-delay: calc(var(--reveal, 0) * .38s + 250ms); }
.final-screen .final-row.first .final-crown { top: -9px; width: 18px; height: 12px; margin-left: -9px; fill: var(--ad-gold); stroke: var(--ad-night); filter: none; }
.final-screen .final-row.after-gap::before { border-top-color: var(--ad-night-4); }
/* Rooms of 10 or more (the "Show all" toggle is there): slimmer rows, so the top 5, your row and both buttons fit the panel. */
.final-screen .final-ranking:has(> .final-show-all) > .final-row { padding-block: 5px !important; row-gap: 4px !important; }
.final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-piece .avatar { width: 30px !important; height: 30px !important; }
.final-screen .final-ranking:has(> .final-show-all) > .final-row .land-player-name { font-size: 15px !important; }
#root .final-screen .final-ranking:has(> .final-show-all) > .final-row > strong { font-size: 20px !important; }
.final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-bar { height: 6px; }
/* "Show all" is on (9 or more rows): the list takes the highlight card's place and the rows go down one more size. */
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .highlight-reel { display: none; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row { padding-block: 4px !important; row-gap: 3px !important; column-gap: 8px !important; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-piece .avatar { width: 24px !important; height: 24px !important; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .rank-number { font-size: 15px !important; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .land-player-name { font-size: 14px !important; }
#root .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > strong { font-size: 16px !important; }
#root .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > strong > small { display: none; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-bar { height: 4px; }
.final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .final-crown { top: -7px; width: 14px; height: 9px; margin-left: -7px; }
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .final-screen .final-ranking > .final-row { column-gap: 9px !important; row-gap: 4px !important; padding: 6px 10px !important; border-radius: 12px !important; }
  .final-screen .final-row > .final-piece .avatar { width: 30px !important; height: 30px !important; }
  .final-screen .final-row > .rank-number { font-size: 17px !important; }
  .final-screen .final-row .land-player-name { font-size: 15px !important; }
  #root .final-screen .final-row > strong { font-size: 19px !important; }
  .final-screen .final-row > .final-bar { height: 6px; }
  .final-screen .final-row.first .final-crown { top: -8px; width: 16px; height: 11px; margin-left: -8px; }
  /* "Show all" on a phone: two columns of slim rows, read left to right, so a full room of 14 fits above the buttons.
     A screen too short for that scrolls the list inside the panel. */
  .main-stage .final-screen .land-sidecar.final-ranking:has(> .final-row:nth-child(10)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; column-gap: 4px !important; overflow-y: auto !important; overscroll-behavior: contain; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > :not(.final-row) { grid-column: 1 / -1; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row { padding: 4px 7px !important; column-gap: 6px !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-piece .avatar { width: 22px !important; height: 22px !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .land-player-name { font-size: 13px !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .you-label { display: none; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row.is-you .final-name-text { color: var(--ad-lime); }
}
@media (prefers-reduced-motion: reduce) { .final-screen .final-row > .final-bar::before { animation: none !important; } }

/* Highlight reel: a flat card, no gradient, border, shadow or avatar glow. */
.highlight-reel, .highlight-reel.hl-hook { border: 0; border-radius: var(--ad-radius); background: var(--ad-night-3); box-shadow: none; font-family: var(--ad-font-ui); }
.highlight-reel .hl-progress { gap: 5px; }
.highlight-reel .hl-progress i { height: 6px; border-radius: 3px; background: var(--ad-night); }
.highlight-reel .hl-progress i::after { border-radius: 3px; background: var(--ad-lime); }
.highlight-reel .hl-piece { filter: none; }
.highlight-reel .hl-rays { background: repeating-conic-gradient(color-mix(in srgb, var(--player) 34%, transparent) 0 12deg, transparent 12deg 30deg); mask: none; }
.highlight-reel .hl-kicker { color: var(--ad-muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.highlight-reel .hl-title { font-family: var(--ad-font-display); font-weight: 800; letter-spacing: 0; }
.highlight-reel.hl-hook .hl-title { color: var(--ad-lime); }
.highlight-reel .hl-detail { color: var(--ad-muted); }
.highlight-reel .hl-hint { color: var(--ad-muted); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.highlight-reel .hl-clip { animation: hl-clip-in 420ms var(--ad-ease) both; }
/* In the final screen's panel: smaller pieces leave the copy room, and the card keeps one height from clip to clip so the rows under it stay put. */
.final-screen .hl-clip { gap: 12px; min-height: 92px; }
.final-screen .hl-title { font-size: 17px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.final-screen .hl-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  .final-screen .hl-stage.is-pair { min-width: 96px; }
  .final-screen .hl-stage.is-pair .hl-piece .avatar { width: 42px !important; height: 42px !important; }
  .final-screen .hl-stage.is-solo .hl-piece .avatar { width: 54px !important; height: 54px !important; }
  /* Top 3 and your own row in a big room (the rule above this block, restated after the row's display). */
  .final-screen .final-ranking > .final-row.beyond-phone { display: none !important; }
}
/* Phones: rows keep their content height (the panel's grid used to squeeze them over the card when space ran out);
   a panel that is still too tall scrolls inside itself. */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) and (orientation: portrait) {
  .main-stage .final-screen .land-sidecar.final-ranking { grid-template-rows: none !important; grid-auto-rows: max-content !important; align-content: start; overflow-y: auto !important; overscroll-behavior: contain; scrollbar-width: none; }
  /* A big room on a phone: card, top 3, your row, "Show all" and Score breakdown share the panel, so the rows are slim. */
  .main-stage .final-screen .land-sidecar.final-ranking:has(> .final-show-all) { gap: 3px !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row { padding-block: 3px !important; row-gap: 3px !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-piece .avatar { width: 26px !important; height: 26px !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-bar { height: 5px; }
}
/* Short phones (under 700px high): a one-line card and slimmer rows, so four rows and Score breakdown fit under the map.
   A big room drops the card there to make room for "Show all". */
@media (hover: none) and (pointer: coarse) and (max-width: 932px) and (orientation: portrait) and (max-height: 700px) {
  .main-stage .final-screen .land-sidecar.final-ranking { gap: 3px !important; }
  .final-screen .highlight-reel { gap: 5px; padding: 6px 10px; }
  .final-screen .hl-clip { min-height: 38px; gap: 10px; }
  .final-screen .hl-stage { height: 36px; min-width: 44px; }
  .final-screen .hl-stage.is-pair { min-width: 70px; }
  .final-screen .hl-stage.is-pair .hl-piece .avatar { width: 30px !important; height: 30px !important; }
  .final-screen .hl-stage.is-solo .hl-piece .avatar { width: 34px !important; height: 34px !important; }
  .final-screen .hl-rays { width: 44px; height: 44px; }
  .final-screen .hl-glyph, .final-screen .hl-icon { font-size: 15px; }
  .final-screen .hl-title { font-size: 15px; -webkit-line-clamp: 1; }
  .final-screen .hl-detail, .final-screen .hl-hint { display: none; }
  .final-screen .final-ranking:has(> .final-show-all) > .highlight-reel { display: none; }
  .final-screen .final-ranking > .final-row, .final-screen .final-ranking:has(> .final-show-all) > .final-row { padding-block: 2px !important; row-gap: 2px !important; }
  .final-screen .final-row > .final-piece .avatar { width: 26px !important; height: 26px !important; }
  .final-screen .final-row > .final-bar { height: 5px; }
}
/* Desktop: the panel is 320px wide and as tall as the window allows, so every size follows --fit (fit.css; 1px at a
   1220px-high window, about .74px at 900) like the rest of the stage. A 720px-high window then holds the card, the rows
   and both buttons without scrolling. */
@media not ((hover: none) and (pointer: coarse) and (max-width: 932px)) {
  .main-stage .final-screen .land-sidecar.final-ranking { gap: calc(11 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking > .final-row { column-gap: calc(16 * var(--fit, 1px)) !important; row-gap: calc(7 * var(--fit, 1px)) !important; padding-block: calc(11 * var(--fit, 1px)) !important; }
  .final-screen .final-row > .final-piece .avatar { width: calc(54 * var(--fit, 1px)) !important; height: calc(54 * var(--fit, 1px)) !important; }
  .final-screen .final-row > .rank-number { font-size: calc(27 * var(--fit, 1px)) !important; }
  .final-screen .final-row .land-player-name { font-size: max(13px, calc(23 * var(--fit, 1px))) !important; }
  #root .final-screen .final-row > strong { font-size: calc(32 * var(--fit, 1px)) !important; }
  .final-screen .final-row > .final-bar { height: max(5px, calc(10 * var(--fit, 1px))); }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row { padding-block: calc(7 * var(--fit, 1px)) !important; row-gap: calc(5 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-piece .avatar { width: calc(40 * var(--fit, 1px)) !important; height: calc(40 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row .land-player-name { font-size: max(13px, calc(20 * var(--fit, 1px))) !important; }
  #root .final-screen .final-ranking:has(> .final-show-all) > .final-row > strong { font-size: max(15px, calc(27 * var(--fit, 1px))) !important; }
  .final-screen .final-ranking:has(> .final-show-all) > .final-row > .final-bar { height: max(5px, calc(8 * var(--fit, 1px))); }
  .main-stage .final-screen .land-sidecar.final-ranking:has(> .final-row:nth-child(10)) { gap: calc(7 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row { padding-block: calc(3 * var(--fit, 1px)) !important; row-gap: calc(3 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-piece .avatar { width: calc(28 * var(--fit, 1px)) !important; height: calc(28 * var(--fit, 1px)) !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row .land-player-name { font-size: max(12px, calc(19 * var(--fit, 1px))) !important; }
  #root .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > strong { font-size: max(13px, calc(21 * var(--fit, 1px))) !important; }
  .final-screen .final-ranking:has(> .final-row:nth-child(10)) > .final-row > .final-bar { height: 4px; }
  .final-screen .highlight-reel { gap: calc(11 * var(--fit, 1px)); padding: calc(16 * var(--fit, 1px)) 14px calc(27 * var(--fit, 1px)); }
  .final-screen .hl-clip { min-height: max(98px, calc(150 * var(--fit, 1px))); }
  .final-screen .hl-stage { min-width: calc(86 * var(--fit, 1px)); height: calc(86 * var(--fit, 1px)); }
  .final-screen .hl-stage.is-pair { min-width: calc(140 * var(--fit, 1px)); }
  .final-screen .hl-piece .avatar { width: calc(60 * var(--fit, 1px)) !important; height: calc(60 * var(--fit, 1px)) !important; }
  .final-screen .hl-stage.is-solo .hl-piece .avatar { width: calc(70 * var(--fit, 1px)) !important; height: calc(70 * var(--fit, 1px)) !important; }
  .final-screen .hl-rays { width: calc(86 * var(--fit, 1px)); height: calc(86 * var(--fit, 1px)); }
  .final-screen .hl-glyph { font-size: calc(24 * var(--fit, 1px)); }
  .final-screen .hl-icon { font-size: calc(27 * var(--fit, 1px)); }
  .final-screen .hl-kicker { font-size: max(11px, calc(17.5 * var(--fit, 1px))); }
  .final-screen .hl-title { font-size: max(14px, calc(23 * var(--fit, 1px))); }
  .final-screen .hl-detail { font-size: max(11px, calc(17 * var(--fit, 1px))); -webkit-line-clamp: 3; }
}
/* A short desktop window shows a big room the way a phone does: top 3 and your own row. */
@media (max-height: 760px) { .final-screen .final-ranking > .final-row.beyond-phone { display: none !important; } }

/* Face styles (PlayerAvatar FACE_EYES / FACE_MOUTHS). The carved pumpkin's pale core flickers like a candle.
   It animates opacity only, so the touch-mode `.avatar{filter:none!important}` rule in mobile.css cannot switch it off. */
@keyframes pumpkin-candle { 0%, 100% { opacity: 1; } 30% { opacity: .78; } 55% { opacity: .95; } 80% { opacity: .7; } }
.avatar .pumpkin-glow { animation: pumpkin-candle 2.6s ease-in-out infinite; }
.face-choice .pumpkin-glow, .identity-choice .pumpkin-glow { animation: none; }
/* Eye and mouth choices zoom in on the face, so the difference between styles reads on a 31px button. */
.identity-choice.face-choice { overflow: hidden; }
.identity-choice.face-choice .avatar { transform: scale(1.3); transform-origin: 50% 56%; }
.identity-choice.face-choice.selected { outline: 2px solid var(--mc-yellow, #d8ff36); outline-offset: -2px; }
.identity-choice.mouth-choice .avatar, .mouth-choices .face-choice .avatar { transform-origin: 50% 68%; }
/* Eyewear while a single-eye style is on: shown, dimmed and struck through, not selectable (aria-disabled; the title gives the reason). */
.identity-choice.is-unavailable { cursor: not-allowed; border-style: dashed; background: transparent; }
.identity-choice.is-unavailable .avatar { opacity: .32; filter: grayscale(1); }
.identity-choice.is-unavailable::after { content: ""; position: absolute; inset: 50% 5px auto 5px; height: 2px; border-radius: 2px; background: var(--ad-muted, #a99bc2); transform: rotate(-45deg); pointer-events: none; }
.identity-choice.is-unavailable:hover { transform: none; }
.lobby-look-note { grid-column: 1 / -1; margin: 2px 0 0; font: 600 12px/1.3 var(--ad-font-ui, inherit); color: var(--ad-muted, #a99bc2); }
@media (prefers-reduced-motion: reduce) { .avatar .pumpkin-glow { animation: none; } }
