/* The games in the Design Minis site's own look, in colour: loaded over app.css when the page is opened with
   ?ui=site. The same pages and the same code; only the look changes, following the live site (site.css in
   the Cloudflare worktree):
   - the site's dark tokens: the page is the darkest layer, and each thing on it steps a little lighter;
   - every block a square panel or a cell of one hairline box; only pictures and 40px controls keep a 10px
     corner (thumbnails and form controls on the site);
   - type at weight 400 to 500, in sentence case, with the site's tight tracking on headings;
   - one key for every main action, built like the site's graphite key but in colour (blue, or the round's);
   - nothing presses down and nothing bounces.
   Colour means something: every kind of round owns one (--ink: its timer, the step it is on, the choice you
   picked, its main key), every player owns one (--c), and right and wrong are green and red. The round's icon
   square and the countdown are a square of the site's own background art in the round's colour (--art); the
   rest is flat, as a square of colour or a line along a panel's top, never a gradient or a glow. */

:root {
  --surface: oklch(20.5% 0.005 250);
  --surface-2: oklch(24% 0.006 250);
  --raised: oklch(27.5% 0.007 250);
  --edge: oklch(27% 0.006 250);
  --line: oklch(27% 0.006 250);
  --text: oklch(95% 0.003 250);
  --text-muted: oklch(70% 0.006 250);
  --text-faint: oklch(54% 0.006 250);
  --r-ctl: 10px;
  --r-thumb: 10px;
  --shadow-pill: 0 1px 2px oklch(0% 0 0 / 0.45), inset 0 0 0 1px oklch(100% 0 0 / 0.04);
  --shadow-panel: 0 18px 40px -14px oklch(0% 0 0 / 0.7), 0 2px 8px oklch(0% 0 0 / 0.4);
  --ease-pop: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Each round colour's square of the site's own background art (scripts/art-tiles.mjs). */
  --art-coral: url(/art/coral.webp);
  --art-teal: url(/art/teal.webp);
  --art-violet: url(/art/violet.webp);
  --art-pink: url(/art/pink.webp);
  --art-blue: url(/art/blue.webp);
  --art-green: url(/art/green.webp);
  --art-amber: url(/art/amber.webp);
  --art-gold: url(/art/gold.webp);
}
body { font: 400 15px/1.45 Geist, ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif; }

/* ---------- Type ---------- */
.label { font: 500 12.5px/1.2 Geist; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.label.inked { color: var(--ink); }
.title { font-weight: 500; font-size: clamp(32px, 5.2vw, 44px); line-height: 1.08; letter-spacing: -0.04em; }
.h2 { font-weight: 500; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.15; letter-spacing: -0.035em; }
.lede { font-size: 15.5px; line-height: 1.6; }

/* ---------- The bar: grey squares, as the site's phone bar ---------- */
.bar { min-height: 64px; padding: 0 12px 0 24px; gap: 8px; }
.brand-game { font-weight: 500; font-size: 15px; letter-spacing: -0.01em; }
.code-chip { display: grid; place-items: center; height: 40px; padding: 0 12px; border-radius: 0; background: var(--surface); font: 500 13px/1 var(--mono); letter-spacing: 0.16em; }
.icon-btn, .text-btn { border-radius: 0; background: var(--surface); color: var(--text); }
.icon-btn:hover, .text-btn:hover { background: var(--surface-2); }
.text-btn { padding: 0 14px; font-weight: 500; font-size: 14px; }

/* The page's column is a hairline box from the bar to the dock, like the site's content. */
@media (min-width: 721px) {
  .stage { border-inline: 1px solid var(--line); }
}

/* ---------- Keys ---------- */
/* One key for every main action (Play, Create room, Join, Start, Lock it in): the site's key, built like its
   graphite one (a face lightening slightly to the top, a bright hairline along it, a darker rim, a soft
   shadow), in colour: blue on the pages around a game, the round's own colour in a round. */
.key {
  height: 40px; padding: 0 18px; margin-bottom: 0; gap: 8px; border: 1px solid color-mix(in oklab, var(--ink) 45%, #000); border-radius: var(--r-ctl);
  background: linear-gradient(180deg, color-mix(in oklab, var(--ink) 100%, #fff 6%) 0%, var(--ink) 100%); color: var(--on-ink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), inset 0 -1px 1px rgb(255 255 255 / 0.05), 0 1px 1px rgb(0 0 0 / 0.5), 0 3px 8px rgb(0 0 0 / 0.35);
  font: 500 14px/1 Geist; letter-spacing: -0.005em; text-transform: none; text-shadow: none; transform: none;
  transition: box-shadow 0.1s ease, filter 0.15s ease;
}
/* Hover and press only change the light, never the size or the place (app.css's keys press down). */
.key:hover:not(:disabled) { filter: brightness(1.06); }
.key:active:not(:disabled), .key.pressed { transform: none; filter: brightness(0.92); box-shadow: 0 1px 1px rgb(0 0 0 / 0.5); }
.key .ic { width: 18px; height: 18px; }
.key.big { height: 48px; padding: 0 22px; border-radius: var(--r-ctl); font-size: 15px; }
.key.small, .key.small:active:not(:disabled) { height: 32px; padding: 0 12px; margin-bottom: 0; border-radius: 8px; font-size: 13px; transform: none; }
/* Everything else is a grey square that lightens under the pointer. */
.key.ghost, .key.ghost:hover:not(:disabled), .key.ghost:active:not(:disabled) {
  border: 0; background: var(--surface); color: var(--text); box-shadow: none; text-shadow: none;
}
.key.ghost:hover:not(:disabled) { background: var(--surface-2); filter: none; }
.key.ghost:active:not(:disabled) { filter: none; }
/* Join sits beside the room-code field: the same height and corners as the field. */
.join-row .key { height: 48px; padding: 0 22px; font-size: 15px; }
/* A choice that's on (the length of a level): flat in the page's colour. */
.key.small.ink, .key.small.ink:hover:not(:disabled), .key.small.ink:active:not(:disabled) {
  border: 0; background: var(--ink); color: var(--on-ink); box-shadow: none; filter: none;
}
.key:disabled { border-color: transparent; background: var(--surface); color: var(--text-faint); box-shadow: none; text-shadow: none; filter: none; }

/* ---------- Panels, fields ---------- */
.card { border: 0; border-radius: 0; box-shadow: none; background: var(--surface); }
.field { height: 48px; padding: 0 14px; border: 0; border-radius: var(--r-ctl); background: var(--surface); font-size: 15px; font-weight: 400; transition: background-color 0.15s, box-shadow 0.15s; }
.field:hover { background: var(--surface-2); }
.field:focus { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
.field.code { font-weight: 500; }
.or::before, .or::after { height: 1px; border-radius: 0; background: var(--line); }
.error { font-weight: 500; }

/* Icon squares: a round's icon on a square of the site's background art in that round's colour (the MeltKit
   pictures behind the site's hero and 404 page), white so it reads on every one of them. */
.chip-ink, .chip-ink.xl { border-radius: 0; background: var(--ink) var(--art, none) center / cover no-repeat; color: #fff; box-shadow: none; }
.chip-ink .ic { width: 46%; height: 46%; filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.55)); }

/* Players keep their colour, flat, on a rounded square like a thumbnail. */
.av { border-radius: calc(var(--s) * 0.24); box-shadow: none; font-weight: 500; }
.av .tick { border-radius: 6px; }
/* In the lobby the seat already says "Host"; the crown is kept for the winner. */
.seat .av .crown { display: none; }

/* ---------- Home ---------- */
/* The demo: a hairline box, the stage a grey panel, the kind of round a strip under it. */
.demo { border: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.demo-stage { background: var(--surface); }
/* The kind of round: its icon alone in a cell of its own, closed by a hairline the strip's full height, as the
   site gives its search panel's × a cell. The icon is solid and the colour of the text beside it, as the site's
   sidebar draws its first two (Featured, Originals). */
.demo-foot { padding: 0; gap: 0; align-items: stretch; border-top: 1px solid var(--line); }
.demo-foot .chip-ink { width: 60px; height: auto; align-self: stretch; background: none; border-right: 1px solid var(--line); color: var(--text); }
.demo-foot .chip-ink .ic { width: 20px; height: 20px; filter: none; }
.demo-foot .demo-what { padding: 12px 16px; }
.demo-foot .demo-dots { align-self: center; padding-right: 16px; }
.demo-what b { font-weight: 500; font-size: 14.5px; }
.demo-what span { font-size: 13px; }
.demo-dots { gap: 4px; }
.demo-dots i { width: 6px; height: 6px; border-radius: 0; background: var(--line); }
.demo-pts { border-radius: 6px; font: 500 13px/1 Geist; }
.demo-tile { border-radius: 6px; }
.demo-cc { border-radius: 0; background: var(--surface-2); }
.demo-sw { border-radius: 0; }
.demo-cap { font-weight: 500; }
.demo-pic { border-radius: var(--r-thumb); }
.demo-pic figcaption { border-radius: 0 0 var(--r-thumb) var(--r-thumb); }
.demo-pic .tag { border-radius: 6px; padding: 6px 9px; font: 500 12.5px/1 Geist; letter-spacing: 0; text-transform: none; background: var(--bg); color: var(--text); }
.demo-pic .tag.ai { background: var(--pink); color: var(--on-ink); }
.home-card { background: transparent; border: 1px solid var(--line); }
.home-card .key.big { width: 100%; }
/* Lists of cells: one hairline box, each cell closed by the lines it shares with the next. */
.rounds-grid, .roster, .stat-chips { gap: 0; padding: 0 1px 1px 0; }
.round-card, .seat, .stat { margin: 0 -1px -1px 0; border: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.round-card b { font-weight: 500; font-size: 15px; }

/* ---------- Lobby: one hairline box in three rows. The heads ("Room code", "Players") a strip along the top,
   the code and QR beside a 6 × 2 grid of seat cells, and the link beside the settings in a strip along the
   foot; every line runs straight across. ---------- */
.lobby { gap: 0; border: 1px solid var(--line); }
.lobby-join { border-right: 1px solid var(--line); }
.lobby-join-head, .lobby-head { padding: 20px var(--gap, 24px); border-bottom: 1px solid var(--line); }
.lobby-join-body { padding: var(--gap, 24px); }
.lobby-join-foot { padding: 24px var(--gap, 24px); border-top: 1px solid var(--line); }
.code-tiles { gap: 0; }
.code-tiles span { margin-right: -1px; border: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; font: 500 clamp(28px, 3.4vw, 38px)/1 var(--mono); }
.qr-card { border-radius: 0; box-shadow: none; padding: 12px; margin-top: 0; }
.qr-card p { font: 500 12px/1.2 Geist; letter-spacing: 0; text-transform: none; color: #55585e; }
.invite { padding: 4px 4px 4px 12px; border: 0; border-radius: var(--r-ctl); background: var(--surface); }
.lobby-count { font: 500 14px/1 Geist; color: var(--text-muted); }
.lobby .roster { margin: 0; padding: 0; gap: 0; }
.lobby .seat { margin: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lobby .seat:nth-child(6n) { border-right: 0; }
.seat.empty.ghost { opacity: 1; }
.seat.empty.ghost:hover { background: transparent; }
.seat.empty.ghost .plus { border-color: var(--line); }
.lobby-start { margin: 0; padding: 24px var(--gap, 24px); }
.lobby-note { font-size: 13.5px; }
/* Six seats a row: the second row leaves its bottom line to the strip under it, so that line is the strip's
   top, level with the link strip's top in the rail. */
@media (min-width: 721px) {
  .lobby .seat:nth-child(n + 7) { border-bottom: 0; }
  .lobby-start { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .lobby-join { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .lobby .seat:nth-child(6n) { border-right: 1px solid var(--line); }
  .lobby .seat:nth-child(3n) { border-right: 0; }
}
.seat { padding: 20px 10px 16px; }
.seat:not(.empty) { box-shadow: inset 0 2px 0 var(--c); }
.seat .nm { font-weight: 500; }
.seat .role { font: 400 12.5px/1 Geist; letter-spacing: 0; text-transform: none; }
.seat.empty { border-style: solid; }
.seat.empty:hover { background: var(--surface); border-color: var(--line); }
.seat.empty .plus { width: 48px; height: 48px; border-radius: 0; border: 1px dashed currentColor; }
.seat.empty .plus .ic { width: 20px; height: 20px; }
.waiting-line, .wait-card, .watching { font-weight: 400; }
.wait-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--text-muted); }

/* ---------- Stats and the countdown ---------- */
.stat { padding: 0; text-align: left; box-shadow: inset 0 2px 0 var(--tone); }
.stat .stat-head { padding: 12px 14px 0; color: var(--text-muted); font: 500 12.5px/1.2 Geist; letter-spacing: 0; text-transform: none; }
.stat .stat-body { justify-content: flex-start; padding: 8px 14px 14px; border-radius: 0; background: transparent; color: var(--text); font: 500 22px/1 Geist; letter-spacing: -0.02em; }
.stat .stat-body .ic { color: var(--tone); }
.count { width: 104px; height: 104px; border-radius: 0; background: var(--ink) var(--art, none) center / cover no-repeat; color: #fff; font: 500 56px/1 Geist; letter-spacing: -0.04em; text-shadow: 0 1px 3px rgb(0 0 0 / 0.55); box-shadow: none; }
.countdown { border-radius: 0; background: color-mix(in oklab, var(--bg) 94%, transparent); }

/* ---------- A round ---------- */
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }
.round-view { animation-duration: 0.3s; }
.pips { gap: 3px; }
.pip { height: 4px; border-radius: 0; }
.pip.now { background: var(--ink); box-shadow: none; }
.pip.x2::after { top: -18px; font: 500 12px/1 Geist; letter-spacing: 0; }
.score-chip { height: 40px; padding: 0 14px 0 12px; border: 0; border-radius: 0; background: var(--surface); font: 500 15px/1 Geist; }
.streak-chip { font: 500 13px/1 Geist; letter-spacing: 0; text-transform: none; }
.round-head .chip-ink { --size: 48px; }
.track { height: 4px; border-radius: 0; }
.fill { border-radius: 0; box-shadow: none; }
.fill::after { display: none; }
.secs { font: 500 20px/1 var(--mono); }
.hint { font-size: 15.5px; }

/* Choices: a grey panel; the one you picked gets a ring in the round's colour, the answer one in green or red.
   A ring (outline) rather than a border, so it shows round a picture too and nothing moves. */
.opt, .pair { border: 0; border-radius: 0; box-shadow: none; background: var(--surface); outline: 2px solid transparent; outline-offset: 3px; transition: background-color 0.15s, outline-color 0.15s, opacity 0.2s; }
.opts:not(.locked):not(.revealed) .opt:hover { background: var(--surface-2); }
.opts:not(.locked):not(.revealed) .opt:active, button.pair:active { transform: none; box-shadow: none; }
.opt.picked, .pair.picked { border: 0; outline-color: var(--ink); box-shadow: none; }
.opt-label { transition: background-color 0.15s; }
.opt.picked .opt-label { background: color-mix(in oklab, var(--ink) 14%, transparent); }
.pair.picked { background: color-mix(in oklab, var(--ink) 12%, var(--surface)); }
.opt.right { border: 0; outline-color: var(--green); box-shadow: none; }
.opt.wrong { border: 0; outline-color: var(--red); box-shadow: none; }
.opt-label { font: 500 16px/1.25 Geist; }
.opt .marks .av, .tile .marks .av { box-shadow: 0 0 0 2px var(--bg); }

/* Odd one out: the tiles are the content, so they keep a small corner. */
.tile { border-radius: 6px; }
.tile.picked { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.tile.right { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--green); }
.tile.wrong { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--red); }

/* Dead centre: the card is a hairline box; the button in it is what's being judged, so it stays as it is. */
.cc-card { border: 1px solid var(--line); border-radius: 0; background: var(--surface); }

/* Colour match */
.swatch, .guess { border-radius: 0; }
.swatch .cap, .guess .cap { font-weight: 500; }
.sl::-webkit-slider-runnable-track { height: 12px; border-radius: 0; box-shadow: none; }
.sl::-moz-range-track { height: 12px; border-radius: 0; }
.sl::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -5px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(0 0 0 / 0.25); }
.sl::-moz-range-thumb { width: 22px; height: 22px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.5); }
.sl-row output, .dial-out { font-weight: 500; }

/* Read the room */
.pair { padding: 8px; }
.pair-card { border-radius: 6px; }
.pair .check { border-radius: 6px; }
.pair.winner::after { border-radius: 6px; font: 500 12px/1 Geist; letter-spacing: 0; text-transform: none; }
.pair-name { font-weight: 500; }
.votes-n { font-weight: 500; }
.other { border: 0; border-radius: 8px; background: var(--surface); }
.place-card { border-radius: 0; }
.pal { border-radius: 6px; }

/* Pictures: rounded like the site's thumbnails. */
.stem-img, .opt-img { border-radius: var(--r-thumb); background: var(--surface); }
.opt .tag, .stem-img .tag { border-radius: 6px; padding: 6px 9px; font: 500 12.5px/1 Geist; letter-spacing: 0; text-transform: none; background: var(--bg); color: var(--text); }
.opt .tag.ai, .stem-img .tag.ai { background: var(--pink); color: var(--on-ink); }
.credit-row b { font-weight: 500; }
.made { border-radius: 6px; font: 500 12px/1.2 Geist; letter-spacing: 0; text-transform: none; }

/* ---------- Results: rows of one list, a hairline under each ---------- */
.rows { gap: 0; border-top: 1px solid var(--line); }
.row { min-height: 60px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.row.me { border: 0; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--c) 8%, transparent); box-shadow: inset 2px 0 0 var(--c); }
.row .rank, .row .pts, .row .nm { font-weight: 500; }
.row .you { font: 500 12px/1 Geist; letter-spacing: 0; }
.medal { border-radius: 6px; box-shadow: none; font: 500 14px/1 Geist; }
.gain { height: 26px; border-radius: 6px; font: 500 13px/1 Geist; }
.moved { font: 500 12px/1 Geist; }

/* ---------- The game screens, after Brilliant's lessons, on the dark page ----------
   Friendlier than the pages around them: rounded cards and pills, a bolder question, bright green and red
   for right and wrong. A round is a slim progress bar with the score, the question in one block, the task
   sized to fit the screen, and a rounded bar floating at the foot from the start: the time and who's in while
   you think, then the same bar turning green, red or amber with your result. */
:root { --green: #34d27b; }
.stage[data-view="round"] {
  padding-top: 24px;
  /* The height the task can have: the window less the bars, the question and the answer bar. */
  --avail: max(200px, calc(100dvh - 350px - var(--sheet-grow, 0px)));
}
.stage[data-view="round"].has-sheet { padding-bottom: 150px; }

/* Progress: rounded segments, done ones green, this one lit. */
.stage[data-view="round"] .pips { gap: 4px; }
.stage[data-view="round"] .pip { height: 8px; border-radius: 99px; background: var(--surface-2); }
.stage[data-view="round"] .pip.done { background: var(--green); }
.stage[data-view="round"] .pip.now { background: color-mix(in oklab, var(--green) 45%, var(--surface-2)); }
.stage[data-view="round"] .pip.x2::after { top: -20px; color: var(--amber); font: 600 12px/1 Geist; }
.stage[data-view="round"] .score-chip { height: 36px; padding: 0 14px 0 10px; border-radius: 99px; font: 600 15px/1 Geist; }
.stage[data-view="round"] .score-chip .ic { color: var(--amber); }
.stage[data-view="round"] .streak-chip { color: var(--amber); font: 600 13px/1 Geist; }

/* The question: only the round's title, centred, as Uxcel and Brilliant ask theirs. The progress bar already
   says which round it is (its ×2 marks the double final), so no icon and no "Level 1 · Round 2 of 20". A line
   on how to play shows under it only the first time a kind of round comes up (app.js, showHint). */
.stage[data-view="round"] .round-head { display: block; margin-top: 28px; text-align: center; }
.stage[data-view="round"] .round-head .chip-ink, .stage[data-view="round"] .round-head .label { display: none; }
.stage[data-view="round"] .round-head .h2 { margin: 0; font-weight: 650; font-size: clamp(22px, 2.8vw, 28px); letter-spacing: -0.03em; }
.stage[data-view="round"] .round-head .hint { margin: 6px auto 0; max-width: 46ch; font-size: 15px; color: var(--text-muted); }
.stage[data-view="round"] .task { margin-top: 22px; }

/* Answers: rounded cards. A ring in the round's colour on the one you picked, green on the right one, red on
   a wrong pick; around pictures too, and nothing moves. */
.stage[data-view="round"] :is(.opt, .pair, .stem-img, .cc-card, .swatch, .guess, .place-card, .tile) { border-radius: 16px; }
.stage[data-view="round"] :is(.opt, .pair) { outline-width: 3px; outline-offset: 3px; }
.stage[data-view="round"] .opt-label { min-height: 64px; box-shadow: inset 0 0 0 2px var(--surface-2); font: 600 17px/1.2 Geist; }
.stage[data-view="round"] .opts:not(.locked):not(.revealed) .opt-label:hover { box-shadow: inset 0 0 0 2px var(--text-faint); }
.stage[data-view="round"] .opt .tag, .stage[data-view="round"] .stem-img .tag { border-radius: 99px; padding: 6px 11px; font: 600 12.5px/1 Geist; }
.stage[data-view="round"] .countdown { border-radius: 24px; }
.stage[data-view="round"] .count { border-radius: 30px; font-weight: 650; }

/* Pictures fill the room there is, whatever the window: two side by side, four in a square, or one above the
   answer buttons. (Sizes come from the 4:5 pictures and the 12px gaps.) */
.stage[data-view="round"] .opts.imgs { max-width: none; }
.stage[data-view="round"] .opts.imgs.n2 { width: min(100%, calc(var(--avail) * 1.6 + 12px)); }
.stage[data-view="round"] .opts.imgs.n4 { width: min(100%, calc(var(--avail) * 0.8)); }
.stage[data-view="round"] .stem-img { width: min(100%, calc((var(--avail) - 84px) * 0.8)); max-width: none; }

/* The answer bar. */
.sheet {
  left: 16px; right: 16px; bottom: 16px; max-width: 808px; margin: 0 auto; padding: 14px 18px; overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--tone) 40%, transparent); border-radius: 20px;
  --sheet-bg: color-mix(in oklab, var(--tone) 15%, var(--surface)); background: var(--sheet-bg); box-shadow: 0 18px 40px -14px oklch(0% 0 0 / 0.75);
  animation: sheet-turn 0.28s ease-out both;
}
@keyframes sheet-turn { from { opacity: 0.5; transform: scale(0.98); } }
.sheet.waiting { border-color: var(--line); background: var(--surface); animation: sheet-up 0.35s var(--ease-pop) both; }
.sheet .fill { background: var(--ink); }
.sheet .timer.low .fill { background: var(--red); }
.sheet-in { gap: 14px; }
.sheet-badge { width: 44px; height: 44px; border-radius: 13px; box-shadow: none; }
.sheet-badge .ic { width: 24px; height: 24px; }
.sheet-badge.secs { background: var(--surface-2); color: var(--text); font: 600 19px/1 var(--mono); }
.sheet-title { font: 650 19px/1.2 Geist; letter-spacing: -0.02em; }
.sheet.waiting .sheet-title { color: var(--text); font: 600 16px/1.25 Geist; letter-spacing: -0.01em; }
.sheet-sub { margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--text-muted); }
.sheet-pts { padding: 8px 13px; border-radius: 99px; background: color-mix(in oklab, var(--tone) 20%, transparent); font: 650 20px/1 Geist; letter-spacing: -0.02em; }
/* One row, as Brilliant's: the badge, what happened, the standings (scrolling sideways in a big room, left out
   when you play alone), and the points. */
.sheet-in { flex-wrap: nowrap; }
.sheet-text { flex: 1 1 0; min-width: 0; }
.sheet-extra { order: 3; width: auto; min-width: 0; max-width: 46%; min-height: 0; }
.sheet-score { order: 4; }
.sheet .lb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sheet .lb::-webkit-scrollbar { display: none; }
.sheet .lb:has(> li:only-child) { display: none; }
.sheet-extra .faint { font-size: 13px; white-space: nowrap; }
/* The story behind an answer sits where the line under the grade was: the grade, then two lines of who made
   the pictures, the points beside them, and the standings in a row of their own. The pictures above shrink as
   the bar grows (--sheet-grow). */
.stage[data-view="round"] :is(.opts.imgs, .stem-img) { transition: width 0.3s ease; }
.sheet-in:has(> .story) {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "badge text score" "badge story score" "extra extra extra";
  column-gap: 14px; row-gap: 0; align-items: start;
}
.sheet-in:has(> .story) > .sheet-badge { grid-area: badge; }
.sheet-in:has(> .story) > .sheet-text { grid-area: text; }
.sheet-in:has(> .story) > .story { grid-area: story; margin-top: 3px; }
.sheet-in:has(> .story) > .sheet-score { grid-area: score; }
.sheet-in:has(> .story) > .sheet-extra { grid-area: extra; max-width: none; margin-top: 10px; }
.sheet-in:has(> .story) > .sheet-extra:has(.lb > li:only-child), .sheet-in:has(> .story) > .sheet-extra:empty { display: none; }
.story-text { font-size: 14px; color: var(--text-muted); }
.story-text :is(b, i) { color: var(--text); }
.story-text b { font-weight: 600; }
.story-more { font: 600 14px/1.45 Geist; }
.story-hold { margin-top: 12px; }
.hold-text { font-size: 13.5px; }
.hold-go { height: 36px; padding: 0 16px; }
.lb-item { flex: none; height: 32px; border: 0; border-radius: 99px; background: oklch(0% 0 0 / 0.28); }
.lb-item.me { box-shadow: inset 0 0 0 1.5px var(--c); }
.lb-rank, .lb-sc { font-weight: 600; }
.lb .gain { border-radius: 99px; }

/* The end of a level, after Brilliant's "Lesson complete": the art, the headline, rounded stat cards (the
   number big, its name small under it), the podium when there's a room, one main button. */
.stage[data-view="final"] { display: flex; flex-direction: column; justify-content: center; }
.stage[data-view="final"] .final-art { border-radius: 30px; font-weight: 700; }
.stage[data-view="final"] .final-head .title { font-weight: 650; }
.stage[data-view="final"] .final-head .label { display: none; }
.stage[data-view="final"] .stat-chips { gap: 12px; padding: 0; }
.stage[data-view="final"] .stat {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; margin: 0; padding: 20px 12px 18px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: none; text-align: center;
}
.stage[data-view="final"] .stat .stat-head { padding: 0; color: var(--text-muted); font: 600 11.5px/1.2 Geist; letter-spacing: 0.08em; text-transform: uppercase; }
.stage[data-view="final"] .stat .stat-body { justify-content: center; padding: 0; font: 650 30px/1 Geist; letter-spacing: -0.03em; }
.stage[data-view="final"] .stat .stat-body .ic { width: 22px; height: 22px; }
.block { border-radius: 14px 14px 4px 4px; box-shadow: none; font: 650 28px/1 Geist; letter-spacing: -0.03em; }
.spot .nm { font-weight: 600; }
.spot.empty .block, .spot.empty .av { border: 1px dashed var(--line); font-weight: 400; }
.my-stats { margin-top: 36px; }
.stage[data-view="final"] .final-actions .key { border-radius: 14px; }
/* With a room, the podium joins in, kept compact so the stats and the next step stay on a laptop's screen;
   the art steps back to make room for it. */
.stage[data-view="final"]:has(.podium) .final-art { width: 72px; height: 72px; border-radius: 22px; font-size: 34px; }
.stage[data-view="final"]:has(.podium) .final-art .ic { width: 34px; height: 34px; }
.stage[data-view="final"]:has(.podium) .final-hero::after { width: 150px; height: 28px; margin-top: -10px; }
.stage[data-view="final"] .podium { margin-top: 28px; max-width: 480px; }
.stage[data-view="final"] .spot .av.xl { --s: 64px; }
.stage[data-view="final"] .spot .av.xl .crown { top: -24px; width: 30px; height: 30px; }
.stage[data-view="final"] .spot.p1 .block { height: 96px; }
.stage[data-view="final"] .spot.p2 .block { height: 70px; }
.stage[data-view="final"] .spot.p3 .block { height: 50px; }
.stage[data-view="final"] .my-stats { margin-top: 28px; }
.stage[data-view="final"] .final-actions { margin-top: 24px; }

@media (max-width: 720px) {
  .sheet { left: 10px; right: 10px; bottom: 10px; padding: 12px 14px; border-radius: 18px; }
  .sheet-in { flex-wrap: wrap; }
  .sheet-extra { order: 5; max-width: none; width: 100%; }
  .sheet-extra:not(:has(li:nth-child(2))) { display: none; }
  .sheet-in:has(> .story) { grid-template-areas: "badge text score" "story story story" "extra extra extra"; align-items: center; }
  .sheet-in:has(> .story) > .story { margin-top: 10px; }
  /* The three stat cards stay in one row, smaller. */
  .stage[data-view="final"] .my-stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .stage[data-view="final"] .my-stats .stat.green { grid-column: auto; order: 0; }
  .stage[data-view="final"] .stat { padding: 14px 6px 12px; border-radius: 16px; }
  .stage[data-view="final"] .stat .stat-body { font-size: 22px; }
  .stage[data-view="final"] .stat .stat-body .ic { width: 17px; height: 17px; }
  .stage[data-view="final"] .stat .stat-head { font-size: 10px; letter-spacing: 0.06em; }
  .stage[data-view="final"] .final-actions .wait-card { justify-content: center; text-align: center; }
  .stage[data-view="round"] { --avail: max(180px, calc(100dvh - 360px - var(--sheet-grow, 0px))); }
}

/* ---------- Dock and reactions ---------- */
.chip { height: 36px; border-radius: 8px; font-weight: 500; }
.react, .react:active { height: 32px; margin-bottom: 0; border: 0; border-radius: 8px; box-shadow: none; background: var(--surface); font-weight: 500; transform: none; transition: background-color 0.15s; }
.react:hover { background: var(--surface-2); }
.toast { border: 1px solid var(--line); border-radius: 8px; background: var(--raised); box-shadow: var(--shadow-panel); font-weight: 500; }

/* ---------- Phones: strips and cells run to the screen's edges, as on the site ---------- */
@media (max-width: 720px) {
  .bar { padding: 0 12px 0 16px; }
  .key.big { height: 48px; }
}
