/* Last Designer Standing: Design Minis, played like a game.
   From Design Minis: the dark page and its greys, Geist, the logo, hairlines for structure, MeltKit inks.
   From the playful apps we studied: keys that press down, chunky cards with a lip, fat progress bars,
   bold capital labels, a feedback panel from the bottom, stat chips, a podium, confetti.
   Every round owns an ink (--ink); every player owns one too (--c). */
@font-face { font-family: Geist; src: url(fonts/Geist-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/GeistMono-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: oklch(15.5% 0.004 250);
  --surface: oklch(20% 0.005 250);
  --surface-2: oklch(24.5% 0.006 250);
  --edge: oklch(31% 0.007 250);
  --line: oklch(27% 0.006 250);
  --text: oklch(96% 0.003 250);
  --text-muted: oklch(72% 0.006 250);
  --text-faint: oklch(55% 0.006 250);
  --on-ink: #101214;
  --paper: #f2efe8;
  --paper-ink: #1c1b19;
  --coral: #ff7477;
  --teal: #1fc8ae;
  --violet: #a98bff;
  --amber: #ffb800;
  --blue: #4ca8ff;
  --pink: #ff6fc0;
  --green: #7fd13b;
  --red: #ff5d62;
  --gold: #ffc83d;
  --silver: #c7ced6;
  --bronze: #e39257;
  --ink: var(--blue);
  --mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 450 16px/1.45 Geist, ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ic { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ---------- Type ---------- */
.label { display: block; font: 750 12px/1.2 Geist; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.label.inked { color: var(--ink); }
.title { font-weight: 800; font-size: clamp(40px, 7.4vw, 72px); line-height: 0.96; letter-spacing: -0.04em; text-wrap: balance; }
.h2 { font-weight: 800; font-size: clamp(28px, 4.6vw, 40px); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.lede { color: var(--text-muted); font-size: 18px; max-width: 32em; text-wrap: pretty; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* ---------- Top bar (hairline, as on the site) ---------- */
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand .logo { height: 34px; width: auto; display: block; color: var(--text); flex: none; }
.brand-sep { width: 1px; height: 22px; background: var(--line); flex: none; }
.brand-game { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.code-chip { font: 700 13px/1 var(--mono); letter-spacing: 0.16em; padding: 10px 10px 10px 12px; border-radius: 10px; background: var(--surface-2); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--text-muted); }
.icon-btn:hover { color: var(--text); background: var(--surface); }
.icon-btn .ic { width: 20px; height: 20px; }
.text-btn { height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-muted); font-weight: 600; }
.text-btn:hover { color: var(--text); background: var(--surface); }
.net { position: sticky; top: 0; z-index: 30; padding: 8px 24px; background: #3b2a12; color: #ffd28a; font-size: 14px; font-weight: 600; text-align: center; }

/* ---------- Stage ---------- */
.stage { flex: 1; width: 100%; max-width: 840px; margin: 0 auto; padding: 40px 24px 48px; }
.stage.has-sheet { padding-bottom: 220px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* ---------- Keys: buttons that press down ---------- */
.key {
  --face: var(--text); --lip: oklch(66% 0.006 250); --fg: var(--on-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 28px; margin-bottom: 5px; border-radius: 16px;
  background: var(--face); color: var(--fg); box-shadow: 0 5px 0 var(--lip);
  font: 800 15px/1 Geist; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.15s;
  user-select: none; -webkit-user-select: none;
}
.key:hover:not(:disabled) { filter: brightness(1.07); }
.key:active:not(:disabled), .key.pressed { transform: translateY(5px); box-shadow: 0 0 0 var(--lip); }
.key .ic { width: 20px; height: 20px; }
.key.ink { --face: var(--ink); --lip: color-mix(in oklab, var(--ink) 58%, #000); --fg: var(--on-ink); }
.key.ghost { --face: var(--surface); --lip: var(--edge); --fg: var(--text); border: 2px solid var(--edge); }
.key.big { height: 60px; font-size: 16px; border-radius: 18px; }
.key.wide { width: 100%; }
.key.small { height: 40px; padding: 0 16px; font-size: 12px; border-radius: 12px; box-shadow: 0 3px 0 var(--lip); margin-bottom: 3px; }
.key.small:active:not(:disabled) { transform: translateY(3px); }
.key:disabled { --face: var(--surface-2); --lip: oklch(19% 0.005 250); --fg: var(--text-faint); border-color: transparent; cursor: default; filter: none; }

/* ---------- Cards with a lip ---------- */
.card { background: var(--surface); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--edge); }
.card-pad { padding: 24px; }
.field {
  width: 100%; height: 56px; padding: 0 18px; border-radius: 14px; background: var(--bg);
  border: 2px solid var(--edge); outline: none; font-size: 18px; font-weight: 600;
}
.field:focus { border-color: var(--ink); }
.field.code { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--mono); font-weight: 700; }
.field.code::placeholder { letter-spacing: 0.02em; font-family: Geist, sans-serif; text-transform: none; font-weight: 500; }
.or { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--edge); border-radius: 2px; }
.join-row { display: flex; gap: 12px; align-items: flex-start; }
.join-row .field { flex: 1; }
.join-row .key { height: 51px; }
.error { margin-top: 14px; color: var(--red); font-weight: 600; }

/* Ink chips: a round's icon on its colour */
.chip-ink {
  --size: 44px; display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: 30%;
  background: var(--ink); color: var(--on-ink); box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.18); flex: none;
}
.chip-ink .ic { width: 55%; height: 55%; }
.chip-ink.xl { --size: 96px; border-radius: 30px; box-shadow: inset 0 -7px 0 rgb(0 0 0 / 0.18); }
.ink-odd { --ink: var(--coral); }
.ink-centre { --ink: var(--teal); }
.ink-colour { --ink: var(--violet); }
.ink-room { --ink: var(--amber); }
.ink-final { --ink: var(--gold); }

/* ---------- Avatars: the player's ink with their initial ---------- */
.av {
  --s: 40px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none;
  border-radius: 50%; background: var(--c); color: var(--on-ink); font: 800 calc(var(--s) * 0.42) / 1 Geist;
  box-shadow: inset 0 calc(var(--s) * -0.08) 0 rgb(0 0 0 / 0.2);
}
.av.s { --s: 30px; }
.av.l { --s: 64px; }
.av.xl { --s: 96px; }
.av.off { filter: grayscale(1); opacity: 0.45; }
.av .tick {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: var(--on-ink); box-shadow: 0 0 0 3px var(--bg);
}
.av .tick .ic { width: 13px; height: 13px; }
.av .crown { position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 26px; height: 26px; color: var(--gold); }
.av.xl .crown { top: -34px; width: 44px; height: 44px; }

/* ---------- Home: centred, with a round playing itself above the title ---------- */
.home-hero { padding-top: 4px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-hero .lede { margin-top: 18px; }
.home-hero .demo { margin: 36px 0 0; }
.play-key { margin-top: 32px; min-width: 260px; }
.home-card { margin: 32px auto 0; width: 100%; max-width: 560px; text-align: left; }
.home-card.enter { animation: fade-up 0.35s ease-out; }
.home-card .key.big { margin-top: 18px; }
.join-demo { display: flex; justify-content: center; margin-top: 40px; }
.join-demo .demo { margin-bottom: 0; }

/* The demo: a stage where two players answer and the answer shows, and under it which kind of round it is.
   Marks, points and the reveal wait hidden until the demo switches them .on. */
.demo {
  --stage: clamp(210px, 50vw, 300px); --scene: calc(var(--stage) - 40px);
  width: 100%; max-width: 560px; margin-bottom: 36px; overflow: hidden; text-align: left; background: var(--surface); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--edge);
}
.demo-stage { height: var(--stage); padding: 20px; display: grid; place-items: center; transition: opacity 0.35s, transform 0.35s; }
.demo-stage > * { animation: demo-in 0.45s var(--ease-pop) both; }
.demo-stage.out { opacity: 0; transform: translateX(-24px); }
@keyframes demo-in { from { opacity: 0; transform: translateX(28px); } }
.demo-foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 2px solid var(--edge); }
.demo-foot .chip-ink { --size: 38px; }
.demo-what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.demo-what b { font-weight: 800; font-size: 15px; line-height: 1.2; }
.demo-what span { font-size: 13.5px; line-height: 1.3; color: var(--text-muted); }
.demo-dots { display: flex; gap: 5px; flex: none; }
.demo-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--edge); }
.demo-dots i.on { background: var(--text); }
.demo-mark { position: absolute; right: 6px; bottom: 6px; z-index: 2; opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.35s var(--ease-pop); }
.demo-mark.on { opacity: 1; transform: none; }
.demo-mark .av { box-shadow: 0 0 0 2px var(--bg); }
.demo-pts {
  position: absolute; left: 50%; top: -12px; z-index: 3; translate: -50% 0; padding: 5px 9px; border-radius: 99px;
  background: var(--green); color: var(--on-ink); font: 800 13px/1 Geist; white-space: nowrap;
  opacity: 0; transform: translateY(8px) scale(0.7); transition: opacity 0.2s, transform 0.4s var(--ease-pop);
}
.demo-pts.on { opacity: 1; transform: none; }
/* Odd one out */
.demo-odd { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: min(100%, 400px); }
.demo-tile { position: relative; aspect-ratio: 1; border-radius: 8px; background: oklch(60% 0.11 205); transition: box-shadow 0.2s; }
.demo-tile.odd { background: oklch(64.5% 0.11 205); }
.demo-tile .demo-mark { right: 3px; bottom: 3px; }
.demo-tile .av.s { --s: 22px; }
.demo-tile.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--red); }
.demo-tile.odd.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--green); }
/* Dead centre */
.demo-cc { position: relative; height: var(--scene); aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.demo-cc-btn, .demo-cc-ghost {
  position: absolute; left: 30%; top: 34%; translate: -50% -50%; height: 36px; padding: 0 18px; display: grid; place-items: center;
  border-radius: 99px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.demo-cc-btn { z-index: 2; background: var(--text); color: var(--on-ink); transition: left 1.1s cubic-bezier(0.3, 0.7, 0.2, 1), top 1.1s cubic-bezier(0.3, 0.7, 0.2, 1); }
.demo-cc-btn.on { left: 50%; top: 50%; }
.demo-cc-ghost { left: 59%; top: 63%; border: 2px solid #4c9dff; color: #4c9dff; background: color-mix(in oklab, #4c9dff 14%, transparent); opacity: 0; transition: opacity 0.3s; }
.demo-cc-ghost.on { opacity: 1; }
.demo-cc-cross { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s; }
.demo-cc-cross::before, .demo-cc-cross::after { content: ""; position: absolute; background: var(--green); }
.demo-cc-cross::before { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.demo-cc-cross::after { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.demo-cc-cross.on { opacity: 1; }
.demo-cc .demo-pts { top: calc(50% - 46px); }
/* Colour match */
.demo-cm { height: var(--scene); width: min(100%, 420px); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; }
.demo-cm > div { position: relative; display: grid; gap: 8px; }
.demo-sw { display: block; aspect-ratio: 4 / 3; border-radius: 12px; }
.demo-sw.target { background: hsl(162 55% 42%); }
.demo-sw.yours { background: hsl(330 62% 58%); transition: background-color 2.2s cubic-bezier(0.3, 0.7, 0.2, 1); }
.demo-sw.yours.on { background: hsl(164 52% 43%); }
.demo-cap { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.demo-de { position: absolute; right: 8px; top: 8px; padding: 4px 8px; border-radius: 6px; background: rgb(0 0 0 / 0.45); color: #fff; font: 600 12px/1 var(--mono); opacity: 0; transition: opacity 0.3s; }
.demo-de.on { opacity: 1; }
/* Spot the AI (Human or Prompt?) */
.demo-pair { height: var(--scene); max-width: 100%; display: flex; justify-content: center; gap: 14px; }
.demo-pic { position: relative; flex: 0 1 auto; min-width: 0; min-height: 0; margin: 0; height: var(--scene); max-width: calc(50% - 7px); aspect-ratio: 4 / 5; border-radius: 12px; outline: 3px solid transparent; outline-offset: 3px; transition: outline-color 0.25s; }
.demo-pic img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.demo-pic .tag {
  position: absolute; left: 8px; top: 8px; z-index: 1; padding: 5px 9px; border-radius: 99px; background: var(--text); color: var(--on-ink);
  font: 800 11px/1 Geist; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0; transition: opacity 0.25s;
}
.demo-pic .tag.ai { background: var(--pink); }
.demo-pic figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 40px 8px 10px; border-radius: 0 0 12px 12px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.72)); color: #fff; font-size: 11.5px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.3s;
}
.demo-pic.on { outline-color: var(--red); }
.demo-pic.on:has(.tag.ai) { outline-color: var(--green); }
.demo-pic.on .tag, .demo-pic.on figcaption { opacity: 1; }
.rounds-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.round-card { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.round-card > div { display: flex; flex-direction: column; gap: 4px; }
.round-card b { font-weight: 800; font-size: 16px; line-height: 1.15; }
.round-card > div > span { font-size: 14px; color: var(--text-muted); line-height: 1.35; }
.round-card .chip-ink { --size: 40px; }

/* ---------- Lobby ----------
   After the party games that do this well (Mentimeter, Slido, Gartic Phone, Jackbox): how to join in a rail of
   its own, the code and the QR with equal weight and the link with its Copy beside it; the room beside it,
   with every one of the 12 seats shown so you can see how many can still join; and the settings and Start in
   a strip under the players, as the last thing to do. */
/* The lobby fills the page from the bar to the dock, with one even margin all round (--gap), and the same
   margin inside its cells, so every edge lines up. */
.stage[data-view="lobby"] { --gap: 32px; max-width: 1120px; padding: var(--gap); display: flex; flex-direction: column; }
.stage[data-view="lobby"] > div { flex: 1; display: flex; flex-direction: column; }
.stage[data-view="lobby"] .lobby { flex: 1; }
/* Three rows that both columns share (a head, the body, a foot), so the rail's "Room code" sits level with
   "Players" and its link level with the Start strip. */
.lobby { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 28px; }
.lobby-join, .lobby-room { grid-row: 1 / span 3; display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.lobby-join-head, .lobby-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; }
/* The code and the QR, centred in the height beside the seats. */
.lobby-join-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.lobby-join-foot { padding-top: 24px; }
.code-tiles { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code-tiles span {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge);
  font: 800 clamp(30px, 4vw, 42px)/1 var(--mono);
}
.qr-card { width: min(100%, 236px); padding: 14px; background: #fff; border-radius: 20px; box-shadow: 0 5px 0 oklch(70% 0.005 250); }
.qr-card svg { display: block; width: 100%; height: auto; }
.qr-card p { color: #3a3d42; font: 750 11px/1.2 Geist; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; margin-top: 10px; }
.invite { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px 4px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--edge); }
.invite code { flex: 1; min-width: 0; font: 13px var(--mono); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-count { font: 800 15px/1 Geist; font-variant-numeric: tabular-nums; }
.lobby-head .waiting-line { margin: 0 0 0 auto; text-align: right; }
/* The seats fill the body row; every seat has a square of the same size, a name line and a role line, so the
   squares line up across a row. */
.roster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 10px 16px; text-align: center; min-width: 0; }
.lobby-room .seat { --sq: clamp(64px, 8.5vh, 88px); justify-content: center; }
.lobby-room .seat .av.l { --s: var(--sq); }
.lobby-room .seat.empty .plus { width: var(--sq); height: var(--sq); }
.lobby-room .seat .nm { min-height: 1.45em; }
.lobby-room .seat.empty .nm { font-weight: 500; color: var(--text-faint); }
.lobby-room .seat .role { min-height: 1em; }
.seat .nm { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .role { font: 750 11px/1 Geist; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); min-height: 11px; }
.seat.new { animation: pop-in 0.5s var(--ease-pop) both; }
.seat.empty { background: transparent; border-style: dashed; box-shadow: none; color: var(--text-faint); justify-content: center; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.seat.empty:hover { color: var(--text); border-color: var(--text-faint); }
.seat.empty .plus { width: 64px; height: 64px; border-radius: 50%; border: 2px dashed currentColor; display: grid; place-items: center; }
.seat.empty .plus .ic { width: 26px; height: 26px; }
.seat.ghost { cursor: default; opacity: 0.45; }
@keyframes pop-in { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.waiting-line { color: var(--text-muted); font-weight: 600; min-height: 1.45em; }
.waiting-line.swap { animation: fade-up 0.4s ease-out; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.lobby-start { padding-top: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.lobby-start .lengths { margin: 0; }
.start-key { margin-left: auto; min-width: 260px; }
/* The note on the left, Start on the right, in one row; on a phone they stack. */
.lobby-note { flex: 1 1 260px; min-width: 0; font-size: 14px; }
.lobby-note span { display: block; }
.wait-card { flex: 1; padding: 20px 22px; display: flex; align-items: center; gap: 14px; font-weight: 600; background: var(--surface); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--edge); }
/* Narrower: the rail goes on top as a strip of its own, the code with the QR beside it. */
@media (max-width: 900px) {
  .stage[data-view="lobby"] { --gap: 24px; }
  .lobby { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 22px; }
  .lobby-join, .lobby-room { grid-row: auto; grid-template-rows: none; }
  .lobby-join-body { flex-direction: row; justify-content: space-between; gap: 24px; }
  .lobby-join-body .code-tiles { flex: 1; }
  .lobby-join .qr-card { flex: none; width: 160px; }
  .code-tiles span { aspect-ratio: auto; height: 76px; }
}

/* ---------- Stat chips (end screen) and the countdown number ---------- */
.intro { min-height: calc(100dvh - 64px - 88px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.stat-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; width: 100%; margin-top: 10px; }
.stat { --tone: var(--ink); border-radius: 16px; background: var(--tone); padding: 2px; box-shadow: 0 4px 0 color-mix(in oklab, var(--tone) 55%, #000); text-align: center; }
.stat .stat-head { display: block; padding: 6px 6px 5px; color: var(--on-ink); font: 800 11px/1.1 Geist; letter-spacing: 0.1em; text-transform: uppercase; }
.stat .stat-body { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border-radius: 14px; background: var(--surface); color: var(--tone); font: 800 20px/1 Geist; font-variant-numeric: tabular-nums; }
.stat .stat-body .ic { width: 20px; height: 20px; }
.stat.gold { --tone: var(--amber); }
.stat.green { --tone: var(--green); }
.stat.blue { --tone: var(--blue); }
.count {
  margin-top: 34px; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font: 900 64px/1 Geist; box-shadow: inset 0 -8px 0 rgb(0 0 0 / 0.2), 0 0 0 10px color-mix(in oklab, var(--ink) 22%, transparent);
}
.count.pop { animation: count-pop 0.5s var(--ease-pop); }
@keyframes count-pop { 0% { transform: scale(0.4); } 100% { transform: none; } }

/* ---------- A round: one screen from countdown to results ---------- */
/* backwards, not both: a transform left on the round would trap the fixed result panel inside it */
.round-view { animation: slide-in 0.42s var(--ease-pop) backwards; }
.round-view.first { animation: none; }
@keyframes slide-in { from { opacity: 0; transform: translateX(64px); } }
.task { position: relative; }
.countdown {
  position: absolute; inset: -10px; z-index: 6; display: grid; place-items: center; border-radius: 26px;
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.countdown .count { margin-top: 0; }
.countdown-in { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding: 16px; }
.level-banner { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pop-in 0.5s var(--ease-pop) both; }
.level-banner .h2 { font-size: clamp(30px, 5vw, 44px); }
/* Room for the level banner, however small the task under it is. */
.task:has(.level-banner) { min-height: 360px; }
.task.inert > :not(.countdown), .task.over > * { pointer-events: none; }
/* Once a round is over, the controls step aside so everyone's answers are what you see. */
.task.over .sliders, .task.over + .task-foot { display: none; }
.score-chip.bump { animation: bump 0.55s var(--ease-pop); }
@keyframes bump { 0% { transform: scale(1.3); } }
.hud { display: flex; align-items: center; gap: 14px; }
.pips { flex: 1; display: flex; gap: 6px; }
.pip { position: relative; flex: 1; height: 12px; border-radius: 99px; background: var(--surface-2); }
.pip.done { background: var(--text-faint); }
.pip.now { background: var(--ink); box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18); }
.pip.x2::after { content: "×2"; position: absolute; right: 0; top: -20px; font: 800 11px/1 Geist; color: var(--amber); letter-spacing: 0.04em; }
.score-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 12px; background: var(--surface); border: 2px solid var(--edge); font: 800 15px/1 Geist; font-variant-numeric: tabular-nums; }
.score-chip .ic { width: 18px; height: 18px; color: var(--amber); }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font: 800 12px/1 Geist; letter-spacing: 0.08em; text-transform: uppercase; }
.streak-chip .ic { width: 18px; height: 18px; }
.round-head { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.round-head .grow { flex: 1; min-width: 0; }
.round-head .h2 { margin-top: 4px; }
.locked-in { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.timer { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.track { position: relative; flex: 1; height: 20px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--ink); box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.15); }
.fill::after { content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 5px; border-radius: 5px; background: rgb(255 255 255 / 0.32); }
.timer.low .fill { background: var(--red); }
.timer.low .secs { color: var(--red); animation: throb 1s infinite; }
@keyframes throb { 50% { transform: scale(1.15); } }
.secs { min-width: 44px; text-align: right; font: 800 22px/1 Geist; font-variant-numeric: tabular-nums; }
.hint { margin-top: 14px; color: var(--text-muted); font-size: 17px; }
.task { margin-top: 22px; }
.task-foot { margin-top: 22px; }
.watching { padding: 18px 20px; font-weight: 600; color: var(--text-muted); margin-top: 18px; }

/* Odd one out */
.odd { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; max-width: 540px; margin: 0 auto; }
.tile { aspect-ratio: 1; border-radius: 12px; position: relative; transition: transform 0.12s var(--ease-pop), opacity 0.2s; }
.odd:not(.locked):not(.revealed) .tile:hover { transform: scale(0.95); }
.odd:not(.locked):not(.revealed) .tile:active { transform: scale(0.88); }
.tile.picked { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--text); transform: scale(0.94); }
.odd.locked .tile:not(.picked) { opacity: 0.5; }
.tile.right { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--green); opacity: 1 !important; }
.tile.wrong { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--red); opacity: 1 !important; }
.odd.revealed .tile:not(.right)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgb(14 16 18 / 0.5); }
.tile .marks { position: absolute; right: 5px; bottom: 5px; display: flex; z-index: 1; }
.tile .marks .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }

/* Dead centre: the card and the button stay flat, so nothing but the edges tells you where the middle is */
.cc-card {
  max-width: 660px; margin: 0 auto; position: relative; aspect-ratio: 3 / 2; border-radius: 20px; background: var(--surface); border: 2px solid var(--edge);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; overflow: hidden;
}
.cc-card.dragging { cursor: grabbing; }
.cc-card.locked { cursor: default; }
.cc-btn {
  position: absolute; left: 0; top: 0; padding: 0 24px; height: 46px; display: grid; place-items: center;
  border-radius: 999px; background: var(--text); color: var(--on-ink); font-weight: 700; white-space: nowrap; outline: none;
}
.cc-btn:focus-visible { box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink) 60%, transparent); }
.cc-cross-x, .cc-cross-y { position: absolute; background: var(--green); }
.cc-cross-x { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.cc-cross-y { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
/* `translate`, not `transform`: the pop-in animation owns transform, and must not undo the centring. */
.cc-ghost { position: absolute; translate: -50% -50%; pointer-events: none; animation: pop-in 0.5s var(--ease-pop) both; }
.cc-ghost-btn {
  height: 46px; padding: 0 24px; display: grid; place-items: center; border-radius: 999px; white-space: nowrap;
  border: 3px solid var(--c); color: var(--c); background: color-mix(in oklab, var(--c) 16%, transparent); font-weight: 700;
}
.cc-ghost .av { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; }

/* Colour match */
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swatch { overflow: hidden; padding: 0; }
.swatch .sw { aspect-ratio: 16 / 10; }
.swatch .cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 12px 16px; }
.swatch .cap .mono { white-space: nowrap; }
.sliders { margin-top: 24px; display: grid; gap: 20px; }
.sl-row { display: grid; grid-template-columns: 100px 1fr 48px; align-items: center; gap: 16px; }
.sl-row output { font: 800 16px var(--mono); text-align: right; }
.sl { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; touch-action: none; cursor: pointer; }
.sl::-webkit-slider-runnable-track { height: 20px; border-radius: 99px; background: var(--track); box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18); }
.sl::-moz-range-track { height: 20px; border-radius: 99px; background: var(--track); }
.sl::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 3px 0 oklch(66% 0.006 250), 0 0 0 1px rgb(0 0 0 / 0.25);
}
.sl::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 3px 0 oklch(66% 0.006 250); }
.sl:disabled { opacity: 0.5; cursor: default; }
.sl-h { --track: linear-gradient(90deg, hsl(0 var(--s) var(--l)), hsl(60 var(--s) var(--l)), hsl(120 var(--s) var(--l)), hsl(180 var(--s) var(--l)), hsl(240 var(--s) var(--l)), hsl(300 var(--s) var(--l)), hsl(360 var(--s) var(--l))); }
.sl-s { --track: linear-gradient(90deg, hsl(var(--h) 0% var(--l)), hsl(var(--h) 100% var(--l))); }
.sl-l { --track: linear-gradient(90deg, hsl(var(--h) var(--s) 0%), hsl(var(--h) var(--s) 50%), hsl(var(--h) var(--s) 100%)); }
.target-wide .sw { aspect-ratio: 16 / 5; }
.guesses { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.guess { overflow: hidden; animation: pop-in 0.5s var(--ease-pop) both; }
.guess .sw { aspect-ratio: 4 / 3; }
.guess .cap { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.guess .cap .mono { margin-left: auto; color: var(--text-muted); font-weight: 600; }

/* Read the room */
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pair { position: relative; text-align: left; display: flex; flex-direction: column; padding: 8px; border-radius: 22px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge); transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s; }
button.pair:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.pair.picked { border-color: var(--ink); box-shadow: 0 5px 0 color-mix(in oklab, var(--ink) 58%, #000); background: color-mix(in oklab, var(--ink) 12%, var(--surface)); }
.pair .check { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: none; place-items: center; box-shadow: 0 0 0 4px var(--bg); }
.pair.picked .check { display: grid; }
.pair .check .ic { width: 18px; height: 18px; }
.pair.winner::after {
  content: "Most picked"; position: absolute; top: -13px; left: 18px; padding: 6px 10px; border-radius: 99px;
  background: var(--green); color: var(--on-ink); font: 800 11px/1 Geist; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 0 4px var(--bg); animation: pop-in 0.4s var(--ease-pop) both;
}
.pair-card { background: var(--paper); color: var(--paper-ink); padding: 26px 22px 30px; border-radius: 15px; min-height: 220px; flex: 1; }
.pair-h { font-size: 34px; line-height: 1.04; letter-spacing: -0.01em; text-wrap: balance; }
.pair-b { margin-top: 14px; font-size: 15px; line-height: 1.5; opacity: 0.82; text-wrap: pretty; }
.pair-name { padding: 12px 8px 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.votes { padding: 6px 8px 8px; }
.votes .track { height: 16px; }
.votes-row { display: flex; align-items: center; gap: 10px; }
.votes-n { font: 800 15px/1 Geist; white-space: nowrap; }
.voters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 30px; }

/* ---------- Results list ---------- */
.rows { margin-top: 18px; display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: 34px auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px;
  min-height: 66px; border-radius: 18px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--edge);
}
.row.me { border-color: var(--c); box-shadow: 0 4px 0 color-mix(in oklab, var(--c) 55%, #000); background: color-mix(in oklab, var(--c) 10%, var(--surface)); }
.row .rank { font: 800 16px/1 Geist; color: var(--text-faint); text-align: center; }
.medal { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--on-ink); font: 900 14px/1 Geist; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.2); }
.medal.m1 { background: var(--gold); }
.medal.m2 { background: var(--silver); }
.medal.m3 { background: var(--bronze); }
.row .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row .you { margin-left: 8px; font: 800 10px/1 Geist; letter-spacing: 0.1em; color: var(--c); }
.row .detail { font: 600 14px var(--mono); color: var(--text-muted); text-align: right; white-space: nowrap; }
.row .pts { font: 800 17px/1 Geist; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.gain { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 99px; background: color-mix(in oklab, var(--green) 18%, transparent); color: var(--green); font: 800 14px/1 Geist; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gain.zero { background: var(--surface-2); color: var(--text-faint); }
.moved { font: 800 12px/1 Geist; color: var(--green); }

/* ---------- Feedback panel: slides up from the bottom ---------- */
.sheet {
  --tone: var(--text-muted); --sheet-bg: color-mix(in oklab, var(--tone) 16%, var(--bg)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--sheet-bg); border-top: 2px solid color-mix(in oklab, var(--tone) 45%, var(--bg));
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom)); animation: sheet-up 0.45s var(--ease-pop) both;
}
.sheet.great, .sheet.good { --tone: var(--green); }
.sheet.close { --tone: var(--amber); }
.sheet.miss { --tone: var(--red); }
.sheet.neutral { --tone: var(--ink); }
@keyframes sheet-up { from { transform: translateY(100%); } }
/* Before an answer the bar holds the time: a line draining along its top edge and the seconds in its badge. */
.sheet.waiting { --tone: var(--ink); }
.sheet .timer { position: absolute; left: 0; right: 0; top: 0; margin: 0; }
.sheet .track { height: 4px; border-radius: 0; background: transparent; }
.sheet .fill { border-radius: 0; box-shadow: none; }
.sheet .fill::after { display: none; }
.sheet-badge.secs { font: 800 22px/1 Geist; font-variant-numeric: tabular-nums; animation: none; }
.sheet .locked-in { margin-left: auto; }
.round-head .hint { margin-top: 6px; font-size: 16px; }
.sheet-in { max-width: 792px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sheet-badge { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); color: var(--on-ink); box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.2); flex: none; animation: pop-in 0.5s 0.15s var(--ease-pop) both; }
.sheet-badge .ic { width: 30px; height: 30px; }
.sheet-text { flex: 1; min-width: 180px; }
.sheet-title { color: var(--tone); font: 800 26px/1.1 Geist; letter-spacing: -0.02em; }
.sheet-sub { margin-top: 4px; color: var(--text); font-weight: 600; }
.sheet-sub .faint { font-weight: 500; }
.sheet-pts { font: 900 34px/1 Geist; color: var(--tone); font-variant-numeric: tabular-nums; }
.sheet-score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sheet-extra { width: 100%; min-height: 24px; }
/* The story behind an answer (who made the pictures), in place of the line under the grade: two lines of it,
   then "Read more" over the end of the second, which opens the rest and holds the next round until "Continue". */
.story { order: 4; width: 100%; min-width: 0; }
.story-clip { position: relative; }
.story-text { max-height: 2.9em; overflow: hidden; font-size: 15px; line-height: 1.45; color: var(--text); }
.story-text p { margin: 0; }
.story.open .story-text { max-height: min(38vh, 320px); overflow-y: auto; overscroll-behavior: contain; }
.story.open .story-text p + p { margin-top: 6px; }
.story-more { display: none; position: absolute; right: 0; bottom: 0; padding: 0 0 0 44px; border: 0; background: linear-gradient(90deg, transparent, var(--sheet-bg) 36px); color: var(--text); font: 700 15px/1.45 Geist; cursor: pointer; }
.story-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.story.long:not(.open) .story-more { display: block; }
.story-hold { display: none; align-items: center; gap: 12px; margin-top: 10px; }
.story.holding .story-hold { display: flex; }
.hold-text { color: var(--text-muted); font-size: 14px; }
.hold-go { margin-left: auto; }
/* After an answer, the line along the top runs out as the next round comes, and stands still while someone reads. */
.sheet .timer.next .fill { width: 100%; transform-origin: left; background: var(--tone); opacity: 0; transition: opacity 0.2s; }
.sheet .timer.next.on .fill { opacity: 0.85; }
/* The standings live in the panel: everyone by total, with what this round added. */
.lb { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.lb-item {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 10px; border-radius: 99px;
  background: color-mix(in oklab, var(--bg) 55%, transparent); border: 2px solid var(--edge); animation: pop-in 0.4s var(--ease-pop) both;
}
.lb-item.me { border-color: var(--c); }
.lb-rank { font: 800 13px/1 Geist; color: var(--text-faint); }
.lb-sc { font: 800 15px/1 Geist; font-variant-numeric: tabular-nums; }
.lb .gain { height: 26px; padding: 0 8px; font-size: 12px; }

/* ---------- Standings and the winner ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 12px; margin-top: 56px; max-width: 600px; margin-left: auto; margin-right: auto; }
.spot { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; animation: rise 0.8s var(--ease-pop) both; }
.spot.p1 { animation-delay: 0.5s; }
.spot.p2 { animation-delay: 0.2s; }
.spot.p3 { animation-delay: 0s; }
@keyframes rise { from { opacity: 0; transform: translateY(60px); } }
.spot .nm { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot .sc { font: 700 14px var(--mono); color: var(--text-muted); margin-top: -6px; }
.block {
  width: 100%; border-radius: 18px 18px 6px 6px; display: grid; place-items: start center; padding-top: 14px;
  background: var(--c); color: var(--on-ink); font: 900 34px/1 Geist; box-shadow: inset 0 -8px 0 rgb(0 0 0 / 0.16);
}
.spot.p1 .block { height: 150px; }
.spot.p2 .block { height: 110px; }
.spot.p3 .block { height: 80px; }
.spot.empty .block { background: transparent; border: 2px dashed var(--edge); box-shadow: none; color: var(--text-faint); font-size: 14px; font-weight: 700; place-items: center; padding: 0; }
.spot.empty .av { background: transparent; border: 2px dashed var(--edge); box-shadow: none; color: var(--text-faint); }
/* The end of a level opens with one piece of art (the round colour's square of the site's art, in the site
   look) with the level on it, lit from below. */
.final-hero { display: grid; justify-items: center; margin-bottom: 12px; }
.final-art {
  position: relative; z-index: 1; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 30px;
  background: var(--ink) var(--art, none) center / cover; color: #fff; font: 800 54px/1 Geist; text-shadow: 0 2px 10px rgb(0 0 0 / 0.45);
  animation: pop-in 0.6s var(--ease-pop) both;
}
.final-art .ic { width: 54px; height: 54px; filter: drop-shadow(0 2px 6px rgb(0 0 0 / 0.45)); }
.final-hero::after { content: ''; width: 220px; height: 40px; margin-top: -14px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--ink) 50%, transparent), transparent); }
.stat .of { color: var(--text-faint); font-size: 0.7em; }
.final-head { text-align: center; }
.final-head .lede { margin: 12px auto 0; }
.my-stats { max-width: 600px; margin: 40px auto 0; }
.final-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ---------- Dock: who's here and reactions ---------- */
.dock { border-top: 1px solid var(--line); padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 4px; border-radius: 99px; background: var(--surface); font-size: 14px; font-weight: 700; max-width: 220px; }
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .sc { font: 600 13px var(--mono); color: var(--text-muted); }
.chip.off { opacity: 0.45; }
.reacts { display: flex; gap: 8px; flex-wrap: wrap; }
.react { height: 36px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); margin-bottom: 3px; background: var(--surface); font-size: 13px; font-weight: 700; transition: transform 0.08s, box-shadow 0.08s; }
.react:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }

/* Reaction toasts float up from the bottom right */
.toasts { position: fixed; right: 20px; bottom: 96px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 50; }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 99px; background: var(--surface-2); border: 2px solid var(--edge); font-weight: 700; animation: toast 2.6s var(--ease-pop) both; }
.toast b { color: var(--c); }
@keyframes toast { 0% { opacity: 0; transform: translateY(20px) scale(0.8); } 14% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px); } }

/* ---------- How many rounds a level (lobby) ---------- */
.lengths { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.lengths .label { margin-right: 6px; }
.lengths .key { min-width: 58px; }

/* ---------- SVG the room draws: tap, slide and drag rounds ---------- */
.svgbox svg, .stem svg, .place-card svg { display: block; width: 100%; height: auto; }
.pick .stem { overflow: hidden; margin-bottom: 16px; }
.opts { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 12px; }
.opt {
  position: relative; overflow: hidden; border-radius: 18px; background: var(--surface); border: 2px solid var(--edge);
  box-shadow: 0 4px 0 var(--edge); transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s, opacity 0.2s;
}
.opt-svg svg { display: block; width: 100%; height: 100%; }
.opt-label { min-height: 68px; padding: 14px; font: 750 18px/1.2 Geist; text-align: center; }
.opt-label.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.opts:not(.locked):not(.revealed) .opt:hover { border-color: var(--text-faint); }
.opts:not(.locked):not(.revealed) .opt:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.opt.picked { border-color: var(--text); }
.opts.locked .opt:not(.picked) { opacity: 0.5; }
.opt.right { border-color: var(--green); box-shadow: 0 4px 0 color-mix(in oklab, var(--green) 55%, #000); opacity: 1 !important; }
.opt.wrong { border-color: var(--red); box-shadow: 0 4px 0 color-mix(in oklab, var(--red) 55%, #000); opacity: 1 !important; }
.opts.revealed .opt:not(.right):not(.wrong) { opacity: 0.45; }
.opt .marks { position: absolute; right: 6px; bottom: 6px; display: flex; z-index: 1; }
.opt .marks .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.dial-solo { max-width: 320px; margin: 0 auto; }
.dial-row { margin-top: 24px; grid-template-columns: 100px 1fr 72px; }
.dial-out { font: 800 18px var(--mono); text-align: right; }
.sl-plain { --track: linear-gradient(90deg, var(--ink) var(--pct, 50%), var(--surface-2) var(--pct, 50%)); }
.task.over .dial-row { display: none; }
.others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.others:empty { display: none; }
.other {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 5px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--edge); font-size: 14px; animation: pop-in 0.4s var(--ease-pop) both;
}
.place-card { overflow: hidden; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; }
.place-card:focus-visible { border-color: var(--ink); }
.place-card.dragging { cursor: grabbing; }
.place-card.locked { cursor: default; }
.pal { display: grid; grid-template-columns: repeat(5, 1fr); height: 170px; border-radius: 15px; overflow: hidden; }

/* ---------- Picture rounds (Human or Prompt?) ---------- */
.stem-img { position: relative; max-width: 420px; margin: 0 auto 16px; padding: 0; overflow: hidden; }
.stem-img img, .opt-img img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.opt-img { padding: 0; }
.opts.imgs { max-width: 660px; margin: 0 auto; }
.opts.imgs.n4 { max-width: 540px; }
.opt-label .ic { width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; }
.opt .tag, .stem-img .tag {
  position: absolute; left: 10px; top: 10px; z-index: 1; padding: 6px 10px; border-radius: 99px;
  font: 800 12px/1 Geist; letter-spacing: 0.08em; text-transform: uppercase; background: var(--text); color: var(--on-ink);
  animation: pop-in 0.4s var(--ease-pop) both;
}
.opt .tag.ai, .stem-img .tag.ai { background: var(--pink); }
.credits { max-width: 660px; margin: 14px auto 0; display: grid; gap: 10px; }
.credits:empty { display: none; }
.credit-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
.credit-row b { font-weight: 750; color: var(--text); }
.made { padding: 4px 9px; border-radius: 99px; font: 800 11px/1.2 Geist; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; background: var(--surface-2); color: var(--text); }
.made.ai { background: color-mix(in oklab, var(--pink) 22%, transparent); color: var(--pink); }

/* ---------- Phones ---------- */
@media (max-width: 720px) {
  .opt-label { font-size: 16px; min-height: 60px; }
  .dial-row { grid-template-columns: 64px 1fr 58px; }
  .pal { height: 110px; }
  .bar { padding: 0 12px 0 16px; gap: 8px; min-height: 60px; }
  .brand .logo { height: 30px; }
  .brand-sep, .brand-game { display: none; }
  .stage { padding: 28px 16px 36px; }
  .stage.has-sheet { padding-bottom: 260px; }
  .rounds-grid { grid-template-columns: 1fr; gap: 10px; }
  .round-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
  /* A phone is how people join, not how they invite: no QR, and of the free seats only the one that invites. */
  .qr-card { display: none; }
  .stage[data-view="lobby"] { --gap: 16px; }
  .code-tiles span { height: 68px; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seat.ghost { display: none; }
  .lobby-head .waiting-line { flex-basis: 100%; margin: 4px 0 0; text-align: left; }
  .start-key { margin-left: 0; min-width: 0; }
  .key.big { width: 100%; }
  .pairs { grid-template-columns: 1fr; gap: 14px; }
  .pair-card { min-height: 0; padding: 20px 18px 22px; }
  .pair-h { font-size: 26px; }
  .pair-b { font-size: 14px; margin-top: 10px; }
  .sl-row { grid-template-columns: 82px 1fr 40px; gap: 10px; }
  .swatches { gap: 10px; }
  .row { grid-template-columns: 28px auto 1fr auto auto; gap: 8px; padding: 10px 12px; }
  .row .detail { font-size: 12px; }
  .gain { padding: 0 8px; font-size: 13px; }
  .sheet { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-badge { width: 48px; height: 48px; }
  .sheet-title { font-size: 22px; }
  .sheet-pts { font-size: 28px; }
  .lb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lb-item { flex: none; }
  .react { flex: none; }
  .dock { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .dock .reacts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .podium { gap: 8px; margin-top: 48px; }
  .my-stats { grid-template-columns: 1fr 1fr; }
  .my-stats .stat.green { grid-column: 1 / -1; order: 3; }
  .spot .av.xl { --s: 72px; }
  .spot.p1 .block { height: 120px; }
  .spot.p2 .block { height: 88px; }
  .spot.p3 .block { height: 64px; }
  .toasts { right: 12px; bottom: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
