/* Spin It: a night-out game show look of our own. A deep plum night, the board in a frame of warm marquee lights,
   teal tiles that flip to cream when a letter's called, and a wheel in coral, marigold, teal, sky, and berry. Barlow
   Condensed for the board, money, and wheel; Atkinson Hyperlegible for reading. On a phone the game fits the screen
   and never scrolls: the board on top, then the wheel, with the controls on a panel along the bottom.
   Kept plain on purpose (Adam, 2026-11-24: "not too AI-ey"): solid colors with a simple bottom edge, like the
   physical pieces of a stage set, instead of gradients and glows; labels in sentence case, not tiny spaced capitals. */
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night: #12081f;
  --plum: #1a0b2e;
  --plum-2: #261142;
  --plum-3: #34185a;
  --edge: rgba(255, 214, 150, .18);
  --ink: #fff7ec;
  --soft: #e3d4f3;
  --muted: #ab97c8;
  --gold: #ffc94a;
  --gold-2: #f0a91c;
  --gold-ink: #2a1300;
  --coral: #ff6b5b;
  --teal: #19ad9e;
  --teal-2: #10877b;
  --cream: #fff5e0;
  --tile-ink: #2b0f47;
  --berry: #e2458f;
  --sky: #4b9dff;
  --bad: #ff8d80;
  --good: #7ae0c3;
  --body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --show: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gap: 3px;
  --frame: 14px; /* the marquee's band of lights */
  /* Twelve tiles across the narrowest phone, up to 34px, inside the frame and the board's own margin. */
  --tile: clamp(18px, calc((min(100vw, 560px) - 32px - 2 * (var(--frame) + 9px) - 11 * var(--gap)) / 12), 34px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; background: var(--night); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; color: var(--ink); font: 400 1rem/1.5 var(--body); -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--plum) 0%, var(--night) 100%);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 75%, transparent); outline-offset: 3px; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Top ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; max-width: 560px; margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 10px 4px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.55rem/1 var(--show); letter-spacing: .02em; }
.brand__mark { width: 30px; height: 30px; }
.brand__rim { fill: #1d0a33; stroke: var(--gold); stroke-width: 1.4; }
.brand__mark .c1 { fill: var(--cream); } .brand__mark .c2 { fill: var(--gold); } .brand__mark .c3 { fill: var(--coral); }
.brand__star { fill: var(--gold); }
.bar__tools { display: flex; gap: 2px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--soft); transition: background-color .15s, color .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .dot { fill: currentColor; }
[data-sound] .mute { display: none; }
[data-sound].is-muted .mute { display: inline; }
[data-sound].is-muted .wave { display: none; }

/* ---------- Screens ---------- */
.stage { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
.screen.is-in { animation: enter .3s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.screen--note { padding: 64px 8px; text-align: center; }
.note__title { margin: 0; font: 700 1.9rem/1.15 var(--show); }
.note__text { margin: 10px auto 0; max-width: 34ch; color: var(--soft); }
.kicker { margin: 14px 0 0; color: var(--muted); font-size: .95rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 14px;
  font: 700 1.25rem/1 var(--show); letter-spacing: .02em; text-transform: uppercase; transition: transform .12s var(--ease), box-shadow .12s, opacity .15s; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .2); }
.btn:disabled { opacity: .38; cursor: default; transform: none; }
.btn small { font: 600 .95rem/1 var(--show); opacity: .8; letter-spacing: 0; text-transform: none; }
.btn--hot { color: var(--gold-ink); background: var(--gold); box-shadow: inset 0 -3px 0 rgba(120, 60, 0, .3); }
.btn--hot:hover:not(:disabled) { background: #ffd162; }
.btn--soft { color: var(--ink); background: var(--plum-3); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 0 0 1px var(--edge); }
.btn--soft:hover:not(:disabled) { background: #3e1d6a; }
.btn--ghost { color: var(--ink); box-shadow: 0 0 0 1.5px rgba(255, 247, 236, .35) inset; }
.link-btn { color: var(--gold); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Home ---------- */
.screen--home { display: grid; justify-items: center; text-align: center; padding-top: 8px; }
.home__title { margin: 10px 0 0; font: 700 clamp(3.6rem, 19vw, 5.2rem)/.9 var(--show); letter-spacing: .01em; text-transform: uppercase; text-shadow: 0 4px 0 #4a1838; }
.home__title span { color: var(--gold); }
/* The day at a glance: three puzzles and the bonus (Adam liked these tiles; they went back on 2026-11-24). */
.path { display: flex; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.path li { display: grid; justify-items: center; gap: 6px; }
.path b { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; font: 700 1.9rem/1 var(--show);
  color: var(--cream); background: var(--teal); box-shadow: inset 0 -4px 0 var(--teal-2); }
.path span { color: var(--soft); font: 600 .9rem/1 var(--show); letter-spacing: .08em; text-transform: uppercase; }
.path__bonus b { color: var(--gold-ink); background: var(--gold); box-shadow: inset 0 -4px 0 rgba(120, 60, 0, .3); }
.home__note { margin: 24px auto 0; max-width: 32ch; color: var(--soft); }
.screen--home .btn--hot { margin-top: 18px; min-width: 220px; min-height: 60px; font-size: 1.5rem; }
.home__how { margin: 16px 0 0; }

/* ---------- The game: fits the screen ---------- */
.screen--game { display: flex; flex-direction: column; height: calc(100svh - 60px - env(safe-area-inset-top)); min-height: 480px; }
.status { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 2px 2px 8px; }
.status__step { color: var(--gold); font: 700 1.2rem/1 var(--show); }
.status__money { display: grid; justify-items: end; gap: 2px; margin-left: auto; }
.status__money--total { margin-left: 0; }
.status__label { color: var(--muted); font-size: .75rem; line-height: 1.1; }
.status__money b { font: 700 1.35rem/1 var(--show); font-variant-numeric: tabular-nums; }
.status__money b.is-up { color: var(--good); } .status__money b.is-down { color: var(--bad); }
.status__money--total b { color: var(--gold); }

/* The board in its frame of lights: real bulbs, evenly spaced around the frame and its corners (drawn by the page into
   .marquee__lights), which chase around when a puzzle is solved. */
.marquee { position: relative; padding: calc(var(--frame) + 10px) calc(var(--frame) + 9px) calc(var(--frame) + 11px); border-radius: 18px; background: #5b2247;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 14px 30px -18px rgba(0, 0, 0, .9); }
.marquee::before { content: ""; position: absolute; inset: var(--frame); border-radius: 6px; background: #190b2b; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.marquee > * { position: relative; }
.marquee > .marquee__lights { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.marquee__lights .glow { fill: url(#bulb-halo); }
.marquee__lights .bulb { fill: #ffe9b3; }
.marquee__lights g { transition: opacity .2s; }
.marquee.is-chase .marquee__lights g { animation: chase .5s linear infinite; }
.marquee.is-chase .marquee__lights g.b { animation-delay: -.25s; }
@keyframes chase { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .18; } }
.category { margin: 0 0 10px; text-align: center; color: var(--gold); font: 700 1.1rem/1.1 var(--show); letter-spacing: .06em; text-transform: uppercase; }
.board { display: grid; grid-template-columns: repeat(12, var(--tile)); grid-auto-rows: calc(var(--tile) * 1.22); gap: var(--gap); justify-content: center; perspective: 600px; }
.cell { border-radius: 4px; background: rgba(255, 255, 255, .045); }
.cell--l, .cell--p { display: grid; place-items: center; font: 700 calc(var(--tile) * .92)/1 var(--show); text-transform: uppercase; }
.cell--l { color: transparent; background: var(--teal); box-shadow: inset 0 -2px 0 var(--teal-2); transform-style: preserve-3d; }
.cell--l.is-shown, .cell--p { color: var(--tile-ink); background: var(--cream); box-shadow: inset 0 -2px 0 #e6d7b8; }
.cell--l.is-lit { background: #ffd76a; box-shadow: inset 0 -2px 0 #e9b23c; }
.cell--l.is-typed { color: var(--tile-ink); background: #fff; box-shadow: 0 0 0 2px var(--gold) inset; }
.cell--l.is-cursor { box-shadow: 0 0 0 2px var(--gold) inset; animation: cursor 1s ease-in-out infinite; }
@keyframes cursor { 50% { box-shadow: 0 0 0 2px rgba(255, 201, 74, .4) inset; } }
.board.is-shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.strikes { margin: 8px 0 -4px; text-align: center; color: var(--bad); font: 700 .95rem/1.1 var(--show); }

.say { min-height: 1.5em; margin: 10px 0 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); font: 700 1.15rem/1.25 var(--show); }
.say.is-good { color: var(--good); } .say.is-bad { color: var(--bad); } .say.is-gold { color: var(--gold); }

/* The wheel: big, rising from the bottom of the screen (the page sizes it to the room left, --wheel, up to 560px and
   wider than a phone, so its sides run off the edges). The controls sit over its lower half. */
.arena { position: relative; flex: 1; min-height: 0; margin: 4px -16px 0; overflow: hidden; }
.wheel { position: absolute; left: 50%; top: 20px; width: var(--wheel, 320px); aspect-ratio: 1; translate: -50% 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.wheel.is-grabbed { cursor: grabbing; }
.wheel::before { content: ""; position: absolute; inset: 1.5%; border-radius: 50%; box-shadow: 0 16px 34px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .25); }
.wheel__svg { position: relative; display: block; width: 100%; height: 100%; will-change: transform; backface-visibility: hidden; }
.wheel__svg .w-text { font-family: var(--show); font-weight: 700; }
/* The window: a gold frame around the card at the top, lit while that card's amount is being played (coral on a Bust). */
.wheel__window { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.wheel__window path { stroke: var(--gold); stroke-width: 2.6; transition: stroke .2s, stroke-width .2s; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .5)); }
.wheel__window { transform-origin: 50% 50%; }
.wheel__window.is-lit path { stroke: #fff0a8; stroke-width: 3.6; }
.wheel__window.is-bust path { stroke: var(--coral); }
/* The tick on top of the window, which the pegs nudge as they pass (its angle is set by the page). */
.wheel__pointer { position: absolute; top: calc(2.75% - 13px); left: 50%; width: 18px; height: 16px; margin-left: -9px; fill: var(--gold); stroke: #8a5408; stroke-width: 1.2;
  stroke-linejoin: round; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); transform-origin: 50% 0; z-index: 2; }
.prize { position: absolute; inset: 0 16px auto; display: flex; align-items: baseline; justify-content: center; gap: 12px; padding-top: 4px; }
.prize p { margin: 0; }
.prize__label { color: var(--soft); font: 700 1.3rem/1 var(--show); }
.prize__amount { color: var(--gold); font: 700 2.6rem/1 var(--show); font-variant-numeric: tabular-nums; }

/* The controls: a panel along the bottom edge (its color carries on under Safari's floating address bar). */
.console { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: #1f0d35; border-top: 1px solid rgba(255, 214, 150, .2); box-shadow: 0 -12px 28px -14px rgba(0, 0, 0, .8); }
body[data-view="game"] .console { display: block; animation: console-in .36s var(--ease) both; }
@keyframes console-in { from { transform: translateY(100%); } }
.console::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 240px; background: #1f0d35; pointer-events: none; }
.console__in { max-width: 528px; margin: 0 auto; }
.actions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.actions .btn { min-height: 56px; padding: 0 4px; font-size: 1.05rem; flex-direction: column; gap: 2px; white-space: nowrap; }
.actions .btn--hot { font-size: 1.6rem; }

/* The letters, in the panel while picking one. */
.pad { display: flex; flex-direction: column; gap: 10px; }
.pad__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.pad__prompt { flex: 1; margin: 0; font: 700 1.25rem/1.2 var(--show); letter-spacing: .02em; }
.pad__prompt b { color: var(--gold); }
.pad__cancel { padding: 10px 4px; color: var(--soft); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.keys { display: grid; gap: 7px; user-select: none; -webkit-user-select: none; }
.keys__row { display: flex; justify-content: center; gap: 5px; }
.keys button { flex: 1 1 0; max-width: 46px; height: 50px; border-radius: 9px; font: 700 1.35rem/1 var(--show); text-transform: uppercase;
  color: var(--ink); background: var(--plum-3); box-shadow: 0 -2px 0 rgba(0, 0, 0, .25) inset, 0 0 0 1px var(--edge) inset; transition: background-color .12s, opacity .12s; }
.keys button.k-wide { flex: 1.6 1 0; max-width: 74px; font: 700 1rem/1 var(--show); }
.keys button.k-wide svg { width: 24px; height: 24px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.keys button.k-go { color: var(--gold-ink); background: var(--gold); }
.keys button.is-vowel { color: var(--gold); }
.keys button:disabled { opacity: .25; cursor: default; }
.keys button.is-used { opacity: .18; text-decoration: line-through; }
.keys button.is-picked { color: var(--gold-ink); background: var(--gold); opacity: 1; }
.keys button:active:not(:disabled) { background: #4a2479; }
.picks { display: flex; justify-content: center; gap: 6px; min-height: 40px; }
.picks span { display: grid; place-items: center; width: 36px; height: 40px; border-radius: 8px; font: 700 1.4rem/1 var(--show);
  color: var(--gold-ink); background: var(--gold); }
.picks span.is-empty { background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px var(--edge) inset; }
.picks span.is-vowel-slot.is-empty { box-shadow: 0 0 0 1px rgba(255, 201, 74, .45) inset; }
.pad__prompt .is-low b { color: var(--coral); }
.timer { height: 8px; margin-top: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--gold); transform-origin: left; transition: background-color .3s; }
.pad__prompt:has(.is-low) .timer i { background: var(--coral); }

/* ---------- A puzzle's end ---------- */
.screen--over { display: grid; gap: 14px; }
.tally p { margin: 0; }
.tally { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset; }
.tally__head { margin: 0 0 4px; text-align: center; font: 700 1.9rem/1.1 var(--show); }
.tally__head.is-good { color: var(--good); } .tally__head.is-bad { color: var(--bad); }
.tally__row { display: flex; justify-content: space-between; color: var(--soft); font: 600 1.15rem/1.3 var(--show); }
.tally__row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tally__row--sum { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--edge); color: var(--ink); }
.tally__row--sum b { color: var(--gold); font-size: 1.35rem; }

/* ---------- Results ---------- */
.screen--results { display: grid; justify-items: center; text-align: center; }
.final { display: grid; gap: 4px; margin: 14px 0 0; }
.final__label { color: var(--soft); font-size: 1rem; }
.final b { color: var(--gold); font: 700 clamp(3.4rem, 18vw, 4.6rem)/1 var(--show); font-variant-numeric: tabular-nums; }
.recap { display: grid; gap: 8px; width: 100%; margin: 20px 0 0; padding: 0; list-style: none; text-align: left; }
.recap li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset; }
.recap__cat { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.recap__phrase { grid-column: 1; font: 700 1.2rem/1.2 var(--show); text-transform: uppercase; }
.recap__won { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 700 1.35rem/1 var(--show); font-variant-numeric: tabular-nums; }
.recap__won.is-good { color: var(--good); } .recap__won.is-bad { color: var(--bad); }
.rank { margin: 14px 0 0; color: var(--soft); }
.rank b { color: var(--ink); }
.results__actions { display: grid; gap: 10px; width: 100%; max-width: 360px; margin: 18px 0 0; }
.next { margin: 14px 0 0; color: var(--soft); }
.next b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 30; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px;
  color: var(--tile-ink); background: var(--cream); font-weight: 700; box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .7);
  opacity: 0; translate: -50% -8px; pointer-events: none; transition: opacity .2s, translate .2s var(--ease); }
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- Sheets ---------- */
.sheet { width: min(560px, 100vw); max-height: min(88svh, 760px); margin: auto auto 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: 24px 24px 0 0;
  color: var(--ink); background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset, 0 -20px 60px rgba(0, 0, 0, .5); overflow: auto; overscroll-behavior: contain; }
.sheet[open] { animation: rise .32s var(--ease) both; }
.sheet.is-closing { animation: sink .25s ease both; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes sink { to { transform: translateY(40px); opacity: 0; } }
.sheet::backdrop { background: rgba(8, 3, 15, .65); backdrop-filter: blur(2px); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet h2 { margin: 0 44px 14px 0; font: 700 1.9rem/1.1 var(--show); }
.sheet h2:focus { outline: none; }
.sheet__close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--soft); }
.sheet__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet__lede { margin: 0 0 14px; color: var(--soft); }
.sheet .btn { width: 100%; margin-top: 16px; }
.how { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how li { position: relative; padding-left: 30px; counter-increment: how; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0; color: var(--gold); font: 700 1.3rem/1.1 var(--show); }
.how h3 { margin: 0; font: 700 1.25rem/1.2 var(--show); }
.how p { margin: 2px 0 0; color: var(--soft); }
.how__lede { margin: -4px 0 14px; color: var(--soft); }
.how--short { gap: 10px; }
.how--short p { margin-top: 0; }
.how__bonus { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--soft); line-height: 1.4; }
.how__bonus b { color: var(--gold); }
.name__input { width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; color: var(--ink); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1.5px var(--edge) inset;
  font: 400 1rem/1.3 var(--body); font-size: max(16px, 1rem); }
.name__input:focus, .name__input:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold) inset; }
.name__note { min-height: 1.3em; margin: 8px 0 0; color: var(--bad); font-size: .95rem; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.tabs button { flex: 1; padding: 9px; border-radius: 9px; color: var(--soft); font: 700 1.1rem/1 var(--show); }
.tabs button[aria-selected="true"] { color: var(--gold-ink); background: var(--gold); }
.lb__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lb__row, .lb__head { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; }
.lb__list--all .lb__row, .lb__list--all .lb__head { grid-template-columns: 34px 1fr auto auto; }
.lb__head { color: var(--muted); font-size: .82rem; }
.lb__row { background: rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.lb__row.is-you { background: rgba(255, 201, 74, .18); box-shadow: 0 0 0 1px rgba(255, 201, 74, .45) inset; }
.lb__row span:first-child { color: var(--muted); font-weight: 700; }
.lb__row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__note, .lb__you { margin: 12px 0 0; color: var(--soft); font-size: .95rem; }

/* ---------- Test rounds ---------- */
.testbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 528px; margin: 0 auto 4px; padding: 4px 6px 4px 12px; white-space: nowrap;
  border-radius: 12px; background: rgba(255, 201, 74, .14); box-shadow: 0 0 0 1px rgba(255, 201, 74, .35) inset; color: var(--soft); font-size: .92rem; }
.testbar p { margin: 0; } .testbar b { color: var(--gold); }
.testbar__days { display: flex; align-items: center; gap: 4px; }
.testbar button { padding: 5px 9px; border-radius: 8px; color: var(--ink); font-weight: 700; background: rgba(255, 255, 255, .08); }
.screen--game { height: calc(100svh - 60px - env(safe-area-inset-top) - var(--testbar, 0px)); }

/* Short phones: a smaller wheel, and the keys a touch shorter. */
@media (max-height: 700px) {
  .keys button { height: 44px; }
  :root { --frame: 12px; }
  .category { margin-bottom: 8px; }
  .say { margin-top: 6px; }
  .status__money b { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee.is-chase .marquee__lights g, .board.is-shake, .cell--l.is-cursor, body[data-view="game"] .console, .screen.is-in, .sheet[open], .sheet.is-closing { animation: none; }
}
.noscript { padding: 40px 20px; text-align: center; }

/* The name pop-up sits at the top on phones, so the keyboard can't cover the box and Save (as Categories! does). */
@media (max-width: 639px) {
  .sheet--name { width: calc(100% - 24px); margin: max(16px, env(safe-area-inset-top)) auto auto; border-radius: 22px; padding-bottom: 22px; }
}

/* Accessibility mode (public/settings.js): stronger secondary text and a bigger category line. */
html.a11y { --muted: var(--soft); --soft: #f3e9ff; }
html.a11y .category { font-size: 1.3rem; }
html.a11y .sheet { font-size: 1.08rem; }
/* "Easy" beside a name on today's leaderboard. */
/* Regular or Easy mode, under Today and All time: a smaller second choice. */
.modes { display: flex; justify-content: center; gap: 6px; margin: 10px 0 12px; }
.modes button { padding: 6px 14px; border-radius: 999px; color: var(--muted); font: 700 .88rem/1.2 var(--body); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.modes button[aria-pressed="true"] { color: var(--ink); background: var(--plum-3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

/* ---------- Head-to-head (2026-12-02): a room for two to four players, taking turns ---------- */
.home__friends { margin-top: 12px; }
.home__h2h { margin: 18px auto 0; max-width: 32ch; color: var(--soft); text-align: center; }
.sheet--room { text-align: left; }
.room__code { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; padding: 14px 16px;
  border-radius: 16px; background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset; }
.room__label { color: var(--muted); font-size: .9rem; }
.room__code b { color: var(--gold); font: 700 2.4rem/1 var(--show); letter-spacing: .22em; }
.room__players { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.room__players li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset; font: 700 1.2rem/1 var(--show); letter-spacing: .02em; }
.room__players li.is-empty { color: var(--muted); font: 400 1rem/1 var(--body); background: transparent; box-shadow: 0 0 0 1.5px rgba(255, 214, 150, .14) inset; }
.room__players .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.room__players .is-online .dot { background: var(--good); }
.room__players small { margin-left: auto; color: var(--muted); font: 600 .9rem/1 var(--body); letter-spacing: 0; }
.room__note { min-height: 1.4em; margin: 0 0 12px; color: var(--soft); }
.room__note.is-bad { color: var(--bad); }
.room__actions { display: grid; gap: 10px; }
.room__actions .btn { width: 100%; }
.room__small { margin: 14px 0 0; color: var(--muted); font-size: .9rem; }

/* Everyone's money above the board; whose turn it is is lit, with its clock running down along the bottom. */
.players { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 8px; padding: 0; }
.player { position: relative; overflow: hidden; display: grid; gap: 1px; padding: 7px 10px 9px; border-radius: 12px; background: var(--plum-2);
  box-shadow: 0 0 0 1px var(--edge) inset; min-width: 0; }
.player__name { overflow: hidden; color: var(--soft); font: 700 .95rem/1.1 var(--show); letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.player__total { color: var(--ink); font: 700 1.15rem/1.1 var(--show); font-variant-numeric: tabular-nums; }
.player__bank { min-height: 1em; color: var(--muted); font-size: .78rem; line-height: 1.1; white-space: nowrap; }
.player.is-on { background: var(--plum-3); box-shadow: 0 0 0 2px var(--gold) inset; }
.player.is-on .player__name { color: var(--gold); }
.player__secs { position: absolute; top: 7px; right: 10px; color: var(--gold); font: 700 .95rem/1.1 var(--show); font-variant-numeric: tabular-nums; }
.player__clock { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); transform-origin: left; transform: scaleX(0); }
.player.is-on .player__clock { transform: scaleX(1); }
.players--over { margin: 14px 0 0; }
.over__next { margin: 14px 0 0; color: var(--soft); text-align: center; font: 700 1.15rem/1.2 var(--show); }

/* The final standings. */
.standings { list-style: none; display: grid; gap: 8px; margin: 18px 0 0; padding: 0; }
.standings li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--plum-2); box-shadow: 0 0 0 1px var(--edge) inset; font: 700 1.25rem/1.1 var(--show); }
.standings li:first-child { box-shadow: 0 0 0 2px var(--gold) inset; }
.standings .place { color: var(--gold); min-width: 2.2ch; }
.standings .you { color: var(--muted); font: 600 .9rem/1 var(--body); }
.standings b { font-variant-numeric: tabular-nums; }
html.a11y .player__clock { display: none; }

/* Joining with a code: a friend read it out, or the link didn't come through. */
.room__join { margin-top: 18px; }
.room__or { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.room__or::before, .room__or::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .35; }
.room__join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.room__join-input { font-size: max(16px, 1.25rem); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.room__join-input::placeholder { letter-spacing: .04em; text-transform: none; font-weight: 400; }
.room__join-row .btn { min-width: 96px; height: auto; min-height: 0; align-self: stretch; }
.room__join-note { min-height: 1.3em; margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.room__join-note.is-bad { color: var(bad); }
.sheet--room h2:focus { outline: none; }
.room__acct { margin: 14px 0 0; color: var(--muted); font-size: .95rem; text-align: center; }
.room__acct .link-btn { padding: 4px 2px; font-size: inherit; }
