/* Party Quiz — one stylesheet for every page.
   Look: a board-game box. Cobalt table, paper tokens with hard offset shadows you can "press",
   four answer colors that always come with a shape so color is never the only cue. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2-variations"), url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --cobalt: #1d33b8;
  --night: #0f1b6b;
  --deep: #0b1450;
  --paper: #fff6e5;
  --paper-dim: #d9d3ff;
  --ink: #0b1450;
  --tangerine: #ff7a1a;
  --lemon: #ffd23f;
  --mint: #22c997;
  --bubblegum: #ff5c9e;
  --good: #22c997;
  --bad: #ff6b6b;
  --muted: #aab4f2;
  --accent: #ffd23f;
  --glow: rgba(255, 255, 255, 0.07);
  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --radius-token: 14px;
  --press: 0 6px 0 var(--deep);
  --press-small: 0 4px 0 var(--deep);
  color-scheme: dark;
}


/* ---------- Party color schemes (picked on the home page or the host's setup screen) ----------
   Only the table colors and the accent change; the four answer colors stay, so every game reads the same. */
:root[data-theme="birthday"] { --cobalt: #a2198f; --night: #74106a; --deep: #400838; --accent: #ffd23f; --paper-dim: #ffd6f3; --muted: #f0a6df; --glow: rgba(255, 210, 63, 0.16); }
:root[data-theme="halloween"] { --cobalt: #33184f; --night: #22103a; --deep: #0f0619; --accent: #ff8a1f; --paper-dim: #e6d5ff; --muted: #b69ad8; --glow: rgba(255, 138, 31, 0.16); }
:root[data-theme="christmas"] { --cobalt: #12683a; --night: #0b4a28; --deep: #042414; --accent: #ffd23f; --paper-dim: #d6f5df; --muted: #9bd8ae; --glow: rgba(255, 92, 92, 0.16); }
:root[data-theme="spring"] { --cobalt: #6c4fc9; --night: #4f37a3; --deep: #2b1d66; --accent: #ffe680; --paper-dim: #efe6ff; --muted: #c7b8f5; --glow: rgba(141, 240, 196, 0.2); }
:root[data-theme="stars"] { --cobalt: #1a2a6c; --night: #111c4f; --deep: #070d2c; --accent: #ff7385; --paper-dim: #dfe5ff; --muted: #a9b5ea; --glow: rgba(255, 84, 104, 0.15); }
:root[data-theme="ocean"] { --cobalt: #095d66; --night: #064a52; --deep: #022c33; --accent: #ffd23f; --paper-dim: #d3f6f8; --muted: #8ed3da; --glow: rgba(125, 249, 255, 0.15); }
:root[data-theme="galaxy"] { --cobalt: #2a1158; --night: #1c0b3d; --deep: #0b031d; --accent: #7df9ff; --paper-dim: #e3d9ff; --muted: #a996e0; --glow: rgba(255, 92, 158, 0.17); }
:root[data-theme="neon"] { --cobalt: #15151c; --night: #22222c; --deep: #000000; --accent: #3dff7a; --paper-dim: #dcdce6; --muted: #9c9cae; --glow: rgba(61, 255, 122, 0.12); }
:root[data-theme="sunset"] { --cobalt: #9e2e17; --night: #7a2210; --deep: #40100a; --accent: #ffd23f; --paper-dim: #ffe0d0; --muted: #f5ae97; --glow: rgba(255, 210, 63, 0.18); }
:root[data-theme="forest"] { --cobalt: #24583a; --night: #193f29; --deep: #0a2014; --accent: #f4b942; --paper-dim: #dcefdc; --muted: #a3cbaa; --glow: rgba(244, 185, 66, 0.15); }
:root[data-theme="sky"] { --cobalt: #1c62a8; --night: #154b82; --deep: #08233f; --accent: #ffe066; --paper-dim: #dcebfb; --muted: #a2c6ec; --glow: rgba(255, 255, 255, 0.12); }
:root[data-theme="berry"] { --cobalt: #8a1d55; --night: #66133e; --deep: #33061d; --accent: #7df9ff; --paper-dim: #ffd8ea; --muted: #eaa2c6; --glow: rgba(125, 249, 255, 0.14); }
:root[data-theme="autumn"] { --cobalt: #7a3412; --night: #5c260c; --deep: #2e1204; --accent: #ffb547; --paper-dim: #ffe2c9; --muted: #e9b48f; --glow: rgba(255, 181, 71, 0.16); }
:root[data-theme="royal"] { --cobalt: #3f2585; --night: #2d1a63; --deep: #140a33; --accent: #ffd23f; --paper-dim: #e4dcff; --muted: #b5a6ea; --glow: rgba(255, 210, 63, 0.14); }
:root[data-theme="slate"] { --cobalt: #2d3a4c; --night: #212b39; --deep: #0c121b; --accent: #4fe0cc; --paper-dim: #dde4ee; --muted: #a3b1c4; --glow: rgba(79, 224, 204, 0.12); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse 120% 70% at 50% -10%, var(--glow), transparent 70%) fixed, var(--cobalt);
  color: var(--paper);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  font-variation-settings: "opsz" 24;
}
a { color: var(--accent); }
a:not(.btn):hover { color: var(--paper); }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, .display {
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  font-variation-settings: "opsz" 96;
}
p { margin: 0 0 0.8em; }

/* ---------- Buttons: paper tokens that press down ---------- */
.btn {
  appearance: none;
  border: 3px solid var(--deep);
  border-radius: var(--radius-token);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  font-stretch: 85%;
  font-size: 1.05em;
  padding: 0.6em 1.15em;
  box-shadow: var(--press);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--deep); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.go { background: var(--accent); }
.btn.big { font-size: 1.35em; padding: 0.7em 1.4em; }
.btn.quiet { background: transparent; color: var(--paper); border-color: var(--paper-dim); box-shadow: none; }
.btn.quiet:active { transform: none; }
.btn.wide { width: 100%; }
.btn.small { font-size: 0.9em; padding: 0.4em 0.8em; box-shadow: var(--press-small); }

/* ---------- Forms ---------- */
label { font-weight: 650; }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], input[type="email"], select {
  font: inherit;
  font-size: 1.1em;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--deep);
  border-radius: 12px;
  padding: 0.55em 0.7em;
  width: 100%;
  min-width: 0;
}
input::placeholder { color: #8a8aa8; }
.error { color: #ffc9c9; font-weight: 650; min-height: 1.4em; margin: 0.4em 0 0; }

/* ---------- The room code: four letter tiles (the one loud thing) ---------- */
.code-tiles { display: inline-flex; gap: 0.18em; }
.code-tiles span {
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.3em;
  background: var(--paper);
  color: var(--ink);
  border: 0.06em solid var(--deep);
  border-radius: 0.14em;
  box-shadow: 0 0.09em 0 var(--deep);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
}
.code-tiles span:nth-child(odd) { transform: rotate(-3deg); }
.code-tiles span:nth-child(even) { transform: rotate(2.5deg) translateY(0.04em); }

/* ---------- Answer colors + shapes ---------- */
.shape { display: inline-block; width: 1em; height: 1em; flex: 0 0 auto; background: var(--ink); }
.shape.s0 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.shape.s1 { border-radius: 50%; }
.shape.s2 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape.s3 { border-radius: 3px; transform: scale(0.86); }
.c0 { --tile: var(--tangerine); }
.c1 { --tile: var(--lemon); }
.c2 { --tile: var(--mint); }
.c3 { --tile: var(--bubblegum); }

/* ---------- Landing page ---------- */
.landing { max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.wordmark { font-size: 1.6rem; color: var(--paper); text-decoration: none; }
.wordmark .dot { color: var(--accent); }
.landing-top nav { display: flex; gap: 18px; font-weight: 650; }
.landing-top nav a { color: var(--paper); text-decoration: none; }
.landing-top nav a:hover { color: var(--accent); }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); }
.hero .lede { font-size: 1.2rem; max-width: 34em; margin-top: 18px; color: var(--paper-dim); }
.join-card {
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--deep);
  border-radius: 22px;
  box-shadow: 0 10px 0 var(--deep);
  padding: 24px;
}
.join-card h2 { font-size: 1.9rem; margin-bottom: 6px; }
.join-card p { color: #3c4170; }
.code-entry { display: flex; gap: 8px; margin: 14px 0 12px; }
.code-entry input {
  width: 100%;
  font-size: 2.2rem;
  font-weight: 800;
  font-stretch: 75%;
  text-align: center;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 0.25em 0 0.25em 0.35em;
}
.join-card .error { color: #b3261e; }
.host-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.host-row span { color: var(--paper-dim); }
.games-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 64px; }
.game-card { border-top: 4px solid var(--tile); padding-top: 14px; }
.game-card h3 { font-size: 1.5rem; display: flex; align-items: center; gap: 0.4em; }
.game-card h3 .shape { background: var(--tile); width: 0.8em; height: 0.8em; }
.game-card p { color: var(--paper-dim); margin-top: 8px; font-size: 0.98rem; }
.how { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.how li { list-style: none; counter-increment: step; color: var(--paper-dim); }
.how li::before { content: counter(step); display: block; font-weight: 800; font-stretch: 75%; font-size: 2.4rem; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.how { padding: 0; }
/* How-to-play video: a picture with a play button until pressed, then the YouTube player (video.js). */
.tutorial { margin-top: 64px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px 36px; align-items: center; }
.tutorial h2 { font-size: 1.9rem; line-height: 1.1; }
.tutorial-text p { color: var(--paper-dim); margin-top: 10px; }
.tutorial-text .video-note { font-size: 0.9375rem; color: var(--muted); }
.tutorial-text .video-note a, .video-block figcaption a { color: var(--paper-dim); }
.video-facade, .video-frame { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
.video-facade img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; background: rgba(10, 10, 30, 0.72); transition: transform 0.15s ease, background-color 0.15s ease; }
.video-play::before { content: ""; position: absolute; left: 31px; top: 24px; border-style: solid; border-width: 15px 0 15px 25px; border-color: transparent transparent transparent #fff; }
.video-facade:hover .video-play, .video-facade:focus-visible .video-play { background: #e0262b; transform: scale(1.07); }
.video-facade:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.video-block { margin: 28px 0 8px; max-width: 760px; }
.video-block figcaption { margin-top: 10px; color: var(--paper-dim); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .video-play { transition: none; } }
/* "Play on your TV" (v1.33, tools/tv_help.py, on both sites): the same player as a button, the steps in writing, and the
   small link on setup screens. */
button.video-facade { padding: 0; cursor: pointer; font: inherit; color: inherit; }
.tv-help { margin: 40px 0 8px; max-width: 760px; }
.tv-help.tutorial { max-width: none; }
.tv-help-text h2, .tv-help-text h3 { line-height: 1.1; }
.tv-help-text p { color: var(--paper-dim); margin-top: 10px; }
.tv-help-text .video-note { font-size: 0.9375rem; color: var(--muted); margin-bottom: 16px; }
.tv-help-text .video-note a { color: var(--paper-dim); }
.tv-help.tutorial .tv-help-text .video-note { margin-bottom: 0; }
.tv-help-steps { grid-column: 1 / -1; margin-top: 16px; background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 14px; padding: 12px 16px; }
.tv-help.tutorial .tv-help-steps { margin-top: 0; }
.tv-help-steps summary { cursor: pointer; font-weight: 700; color: var(--paper); }
.tv-help-ways { padding-left: 1.1em; margin-top: 4px; }
.tv-help-ways li { margin-top: 10px; color: var(--paper-dim); }
.tv-help-ways strong { color: var(--paper); }
.tv-help-steps .tv-help-small { margin-top: 12px; font-size: 0.9375rem; color: var(--muted); }
.tv-help-link { margin-top: 14px; font-size: 0.95rem; }
.tv-help-link a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--paper-dim); }
.tv-help-link svg { flex: none; }
.site-foot { margin-top: 64px; padding-top: 18px; border-top: 2px solid rgba(255, 246, 229, 0.18); display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 0.95rem; }
.site-foot a { color: var(--paper-dim); }
/* Roomful Trivia is part of the umbrella site (v1.11): the credit line in the footer, the Bingo links after a game. */
.site-foot .family { flex-basis: 100%; }
.next-night { text-align: center; margin: 14px 0 4px; font-weight: 650; }
.next-night a { color: var(--accent); }
.bingo-night { margin: 1.4em 0; font-weight: 650; }
.bingo-night a { color: var(--accent); }
@media (max-width: 480px) {
  .landing-top { flex-wrap: wrap; row-gap: 10px; }
  .landing-top nav { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero .join-card { order: -1; } /* on a phone you're most likely here to join */
  .games-strip { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: 1fr; }
  .tutorial { grid-template-columns: 1fr; margin-top: 48px; }
}
@media (max-width: 480px) {
  .games-strip { grid-template-columns: 1fr; }
  .landing-top nav { gap: 12px; font-size: 0.95rem; }
}

/* ---------- Plain content pages (scores, about, admin) ---------- */
.page { max-width: 900px; margin: 0 auto; padding: 24px 18px 56px; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 18px 0 12px; }
.page h2 { font-size: 1.7rem; margin: 28px 0 10px; }
.panel { background: var(--night); border-radius: 18px; padding: 18px; border: 2px solid rgba(255, 246, 229, 0.12); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 12px 0 18px; }
.toolbar label { display: grid; gap: 4px; font-size: 0.9rem; }
.toolbar select { width: auto; font-size: 1rem; }
.seg { display: inline-flex; border: 3px solid var(--deep); border-radius: 14px; overflow: hidden; box-shadow: var(--press-small); flex-wrap: wrap; }
.seg button { font: inherit; font-weight: 700; background: var(--paper); color: var(--ink); border: 0; padding: 0.5em 0.9em; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--deep); }
.seg button[aria-pressed="true"] { background: var(--accent); }
table.board { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
table.board th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.85rem; padding: 6px 8px; }
table.board td { padding: 9px 8px; border-top: 1px solid rgba(255, 246, 229, 0.12); }
table.board th.num { text-align: right; }
table.board td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 750; }
table.board tr:first-child td { border-top: 0; }
.empty { color: var(--muted); padding: 20px 4px; }

/* ---------- TV / host screen ---------- */
body.tv { font-size: clamp(16px, 1.25vw, 30px); overflow-x: hidden; }
.stage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 1.4em 2em 1.2em; gap: 1em; }
.stage-top { display: flex; align-items: center; gap: 1.2em; }
.stage-top .meta { color: var(--paper-dim); font-weight: 600; }
.stage-top .spacer { flex: 1; }
.stage-top .join-hint { display: flex; align-items: center; gap: 0.6em; font-weight: 650; }
.stage-top .join-hint .code-tiles { font-size: 1.5em; }
.host-controls { display: flex; gap: 0.6em; }
.host-controls .btn { font-size: 0.8em; }
.stage-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.1em; min-height: 0; }
.stage-foot { display: flex; align-items: center; gap: 1em; min-height: 2.6em; }

.timer { height: 0.7em; border-radius: 99px; background: var(--deep); overflow: hidden; flex: 1; }
.timer i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 99px; transform-origin: left center; }
.timer.low i { background: var(--tangerine); }

.chips { display: flex; flex-wrap: wrap; gap: 0.45em; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  background: var(--night); color: var(--paper); border: 2px solid rgba(255, 246, 229, 0.25);
  border-radius: 99px; padding: 0.25em 0.8em; font-weight: 650;
}
.chip.done { background: var(--paper); color: var(--ink); border-color: var(--deep); }
.chip.away { opacity: 0.5; }
.chip button { all: unset; cursor: pointer; font-weight: 800; padding: 0 0.15em; color: var(--muted); }
.chip button:hover, .chip button:focus-visible { color: var(--bad); }
/* v2.4: the admin's chip x (blocked words, masked names) is at least a 24 px target (WCAG 2.2 minimum), the chip no taller */
#adminArea .chip button { display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; margin: -0.3em -0.45em -0.3em 0; }
#adminArea .chip button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; border-radius: 50%; }

/* Setup */
.setup { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 2em; align-items: start; }
.setup h2 { font-size: 1.6em; margin-bottom: 0.5em; }
.game-pick { display: grid; gap: 0.7em; }
.game-pick label {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2em 0.7em; align-items: start;
  background: var(--night); border: 3px solid transparent; border-radius: 16px; padding: 0.8em 1em; cursor: pointer;
}
.game-pick label:has(input:checked) { border-color: var(--accent); background: var(--deep); }
.game-pick input { position: absolute; opacity: 0; }
.game-pick .shape { grid-row: span 2; width: 1.4em; height: 1.4em; background: var(--tile); margin-top: 0.15em; }
.game-pick strong { font-size: 1.25em; font-stretch: 85%; }
.game-pick small { color: var(--paper-dim); font-size: 0.85em; }
.game-pick label:has(input:focus-visible) { outline: 4px solid var(--accent); outline-offset: 2px; }
.options { display: flex; flex-wrap: wrap; gap: 1em 1.4em; margin-top: 1.2em; }
.options fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.35em; }
.options legend { font-weight: 650; margin-bottom: 0.35em; padding: 0; }
.cat-groups { display: grid; gap: 1em; max-height: 62vh; overflow: auto; padding-right: 0.4em; }
.cat-group h3 { font-size: 1.1em; font-stretch: 90%; display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.45em; }
.cat-group h3 button { all: unset; cursor: pointer; font-size: 0.75em; font-weight: 600; color: var(--accent); text-decoration: underline; }
.cat-list { display: flex; flex-wrap: wrap; gap: 0.45em; }
.cat-toggle {
  font: inherit; font-size: 0.92em; font-weight: 650; cursor: pointer;
  background: transparent; color: var(--paper); border: 2px solid rgba(255, 246, 229, 0.35); border-radius: 99px; padding: 0.3em 0.85em;
}
.cat-toggle[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cat-toggle:disabled { opacity: 0.35; cursor: default; }
.setup-foot { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; margin-top: 1.4em; }
.setup-foot .note { color: var(--paper-dim); margin: 0; flex-basis: 100%; }

.mode-box { margin-bottom: 1em; display: grid; gap: 0.7em; }
.mode-box fieldset { border: 0; padding: 0; margin: 0; }
.mode-box legend { font-weight: 650; margin-bottom: 0.35em; padding: 0; }
.mode-box .field { display: grid; gap: 0.3em; max-width: 22em; }
.mode-box .note { color: var(--paper-dim); margin: 0; }
/* "How will you play?": three equal buttons that fill the box, stacked where the box is narrow (v1.19). */
.mode-box .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.mode-box .seg button { padding: 0.6em 0.5em; text-align: center; line-height: 1.25; }
@media (max-width: 560px) {
  .mode-box .seg { grid-template-columns: 1fr; }
  .mode-box .seg button { padding: 0.65em 0.9em; }
  .mode-box .seg button + button { border-left: 0; border-top: 2px solid var(--deep); }
}

/* Lobby */
.lobby { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2em; align-items: center; }
.lobby .code-tiles { font-size: 7.5em; }
.lobby .how-join { font-size: 1.5em; font-weight: 650; margin: 0.4em 0 0.2em; }
.lobby .how-join b { color: var(--accent); }
.lobby .qr { background: var(--paper); border: 4px solid var(--deep); border-radius: 20px; box-shadow: var(--press); padding: 0.8em; width: min(22em, 100%); justify-self: center; }
.lobby .qr canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.lobby .qr p { color: var(--ink); text-align: center; margin: 0.4em 0 0; font-weight: 650; }
.lobby-players { margin-top: 1.6em; }
.lobby-players h2 { font-size: 1.4em; margin-bottom: 0.4em; }
.lobby-players .chips { font-size: 1.15em; }
.lobby-rules { margin-top: 1.2em; font-size: 1.15em; color: var(--paper-dim); max-width: 34em; }
.lobby-rules strong { color: var(--paper); }
.rules-line { color: var(--paper-dim); font-size: 1.05rem; line-height: 1.45; margin: 0 auto; max-width: 30em; text-align: center; }
details.rules-line { margin-top: 4px; }
details.rules-line p { margin-top: 6px; }
details.rules-line summary { cursor: pointer; font-weight: 650; color: var(--paper); }
.lobby-actions { display: flex; gap: 0.8em; align-items: center; flex-wrap: wrap; margin-top: 1.4em; }

/* Question screens */
.cat-tag { font-weight: 700; color: var(--accent); font-size: 1.1em; }
.cat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3em 0.7em; }
/* A question's level and what it is worth (Buzz-in, Closest Guess). Fixed colors with dark text: readable in every scheme. */
.level { display: inline-block; font-size: 0.8em; font-weight: 700; line-height: 1.2; padding: 0.15em 0.65em; border-radius: 99px; color: var(--ink); white-space: nowrap; }
.level-1 { background: var(--mint); }
.level-2 { background: var(--lemon); }
.level-3 { background: var(--tangerine); }
.phone-main .level { align-self: flex-start; font-size: 0.85rem; }
.result-big .level { margin-top: 2px; }
.phone-card > .level { margin-bottom: 8px; }
.question { font-size: 3.1em; font-weight: 750; font-stretch: 88%; line-height: 1.08; max-width: 26em; text-wrap: balance; }
.question .blank { display: inline-block; min-width: 3.5em; border-bottom: 0.1em solid var(--accent); margin: 0 0.1em; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8em; }
.answer {
  background: var(--tile); color: var(--ink); border: 3px solid var(--deep); border-radius: 18px; box-shadow: var(--press);
  display: flex; align-items: center; gap: 0.6em; padding: 0.7em 1em; font-size: 1.8em; font-weight: 750; font-stretch: 90%; line-height: 1.1;
}
.answer .shape { width: 0.9em; height: 0.9em; }
.answer .count { margin-left: auto; font-size: 0.75em; background: var(--paper); border-radius: 99px; padding: 0.05em 0.6em; font-variant-numeric: tabular-nums; }
.answers.revealed .answer:not(.right) { opacity: 0.32; box-shadow: none; }
button.answer { font-family: inherit; text-align: left; width: 100%; cursor: pointer; }
button.answer:not(.c0):not(.c1):not(.c2):not(.c3) { background: var(--paper); }
button.answer:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--deep); }
button.answer:disabled { opacity: 0.32; box-shadow: none; cursor: default; }
button.answer.picked { outline: 0.18em solid var(--paper); outline-offset: 0.12em; }
.tv-number-form { display: flex; align-items: center; gap: 0.8em; flex-wrap: wrap; }
input.tv-number { font-size: 2.4em; font-weight: 800; width: 7em; text-align: center; }
.answers.revealed .answer.right { outline: 0.18em solid var(--paper); outline-offset: 0.12em; }
.answers.many { grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); }
.answers.many .answer { font-size: 1.4em; background: var(--paper); }
.clues { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4em; }
.clues li { font-size: 1.7em; font-weight: 650; display: flex; gap: 0.6em; align-items: baseline; }
.clues li::before { content: ""; width: 0.5em; height: 0.5em; background: var(--accent); border-radius: 50%; flex: 0 0 auto; transform: translateY(-0.1em); }
.clues li.later { color: rgba(255, 246, 229, 0.25); }
.clues li.later::before { background: rgba(255, 246, 229, 0.25); }
.worth { font-weight: 800; font-stretch: 80%; font-size: 1.3em; color: var(--accent); }
.big-hint { font-size: 1.6em; color: var(--paper-dim); font-weight: 600; }
.answered-line { color: var(--paper-dim); font-weight: 650; white-space: nowrap; }

/* Reveal */
.reveal-grid .question { font-size: 2.1em; }
.reveal-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2em; align-items: start; }
.reveal-grid > div { display: grid; gap: 0.7em; align-content: start; }
.reveal-grid > div > .cat-line { margin-bottom: -0.4em; }
.fact { font-size: 1.35em; color: var(--paper); background: var(--night); border-radius: 16px; padding: 0.8em 1em; max-width: 34em; }
.truth { font-size: 4em; font-weight: 800; font-stretch: 80%; line-height: 1; color: var(--accent); }
.scorelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35em; font-size: 1.3em; }
.scorelist li { display: grid; grid-template-columns: 1.6em 1fr auto auto; gap: 0.5em; align-items: baseline; background: var(--night); border-radius: 12px; padding: 0.35em 0.7em; }
.scorelist .rank { color: var(--muted); font-weight: 700; }
.scorelist .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorelist .gain { color: var(--good); font-weight: 750; font-size: 0.85em; }
.scorelist .pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.bluff-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5em; }
.bluff-results li { background: var(--night); border-radius: 14px; padding: 0.55em 0.9em; font-size: 1.25em; }
.bluff-results li.truth-row { background: var(--paper); color: var(--ink); }
.bluff-results .text { font-weight: 750; font-size: 1.15em; }
.bluff-results .who { color: var(--paper-dim); font-size: 0.85em; }
.bluff-results li.truth-row .who { color: #3c4170; }
.guess-board { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35em; font-size: 1.3em; }
.guess-board li { display: grid; grid-template-columns: 1.6em 1fr auto auto; gap: 0.6em; background: var(--night); border-radius: 12px; padding: 0.35em 0.7em; align-items: baseline; }
.guess-board .gain { color: var(--good); font-weight: 750; }

/* Intro + final */
.intro { max-width: 40em; }
.intro h1 { font-size: 5em; }
.intro p { font-size: 1.6em; color: var(--paper-dim); margin-top: 0.6em; }
.podium { display: flex; align-items: end; justify-content: center; gap: 1em; margin: 0.5em 0 1em; }
.podium .step { background: var(--paper); color: var(--ink); border: 4px solid var(--deep); border-radius: 16px 16px 6px 6px; box-shadow: var(--press); width: 11em; text-align: center; padding: 0.8em 0.6em; }
.podium .step .place { font-size: 2.6em; font-weight: 800; font-stretch: 75%; line-height: 1; }
.podium .step .who { font-size: 1.4em; font-weight: 750; overflow-wrap: anywhere; }
.podium .step .pts { font-variant-numeric: tabular-nums; font-weight: 650; }
.podium .first { min-height: 15em; background: var(--accent); }
.podium .second { min-height: 11.5em; }
.podium .third { min-height: 9em; }
.final-actions { display: flex; gap: 0.8em; justify-content: center; flex-wrap: wrap; }
.final-note { text-align: center; color: var(--paper-dim); }

@media (max-width: 900px) {
  body.tv { font-size: 15px; }
  .setup, .lobby, .reveal-grid { grid-template-columns: 1fr; }
  .lobby .code-tiles { font-size: 4.5em; }
  .question { font-size: 2em; }
  .answer { font-size: 1.3em; }
  .answers { grid-template-columns: 1fr; }
  .intro h1 { font-size: 3em; }
  .stage { padding: 1em; }
  .stage-top { flex-wrap: wrap; }
}

/* ---------- Phone ---------- */
body.phone { font-size: 18px; }
.phone-wrap { max-width: 520px; margin: 0 auto; padding: 14px 16px 28px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px; }
/* Keep clear of notches, rounded corners and the gesture bar. */
.phone-wrap { padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.phone-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.phone-top .me { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-top .score { font-variant-numeric: tabular-nums; color: var(--accent); }
.phone-main { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.phone-card { background: var(--paper); color: var(--ink); border: 3px solid var(--deep); border-radius: 20px; box-shadow: var(--press); padding: 18px; }
.phone-card h1 { font-size: 2rem; margin-bottom: 8px; }
.phone-card p { color: #3c4170; }
.phone-card .error { color: #b3261e; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field .code-input { font-size: 2rem; font-weight: 800; font-stretch: 75%; text-align: center; letter-spacing: 0.35em; text-transform: uppercase; padding-left: 0.35em; }
.phone-q { font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
/* Room between a question and its answer box, so the box's focus ring never sits on the last line. */
.phone-card > .phone-q { margin-bottom: 16px; }
.phone-sub { color: var(--paper-dim); }
.phone-timer { height: 10px; border-radius: 99px; background: var(--deep); overflow: hidden; }
.phone-timer i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left center; }
.pad { display: grid; gap: 12px; }
.pad button {
  appearance: none; font: inherit; font-size: 1.15rem; font-weight: 750; line-height: 1.2; text-align: left; cursor: pointer;
  background: var(--tile, var(--paper)); color: var(--ink); border: 3px solid var(--deep); border-radius: 16px; box-shadow: var(--press);
  padding: 16px; display: flex; align-items: center; gap: 12px; min-height: 64px; touch-action: manipulation;
}
.pad button:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--deep); }
.pad button:disabled { opacity: 0.35; }
.pad button.mine { opacity: 1; outline: 4px solid var(--paper); outline-offset: 3px; }
.pad .shape { width: 26px; height: 26px; }
.pad.choices { grid-template-columns: 1fr 1fr; }
.pad.choices button { flex-direction: column; align-items: flex-start; min-height: 120px; }
.phone-clues { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--paper); font-weight: 600; }
.phone-clues li::before { content: "• "; color: var(--accent); }
.result-big { text-align: center; padding: 26px 10px; }
.result-big .headline { font-size: 2.8rem; font-weight: 800; font-stretch: 80%; line-height: 1; }
.result-big .points { font-size: 2rem; font-weight: 800; color: var(--good); margin-top: 8px; }
.result-big.miss .points { color: var(--paper-dim); }
.result-big p { color: var(--paper-dim); margin-top: 10px; }
.waiting { text-align: center; color: var(--paper-dim); padding: 40px 10px; font-size: 1.2rem; }
.waiting strong { display: block; color: var(--paper); font-size: 1.8rem; font-stretch: 85%; margin-bottom: 6px; }
.rank-line { text-align: center; color: var(--paper-dim); }
.locked-in { text-align: center; font-weight: 750; font-size: 1.3rem; padding: 10px; }
@media (max-width: 360px) { .pad.choices { grid-template-columns: 1fr; } .pad.choices button { min-height: 72px; flex-direction: row; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--paper); color: var(--ink); border: 3px solid var(--deep); border-radius: 14px; padding: 10px 16px; font-weight: 700; box-shadow: var(--press-small); z-index: 50; max-width: calc(100% - 32px); }


/* ---------- Theme picker ---------- */
.theme-picker { display: flex; flex-wrap: wrap; gap: 0.5em; }
.theme-picker button {
  font: inherit; font-size: 0.9em; font-weight: 650; cursor: pointer; color: var(--paper);
  background: transparent; border: 2px solid rgba(255, 246, 229, 0.3); border-radius: 99px;
  padding: 0.25em 0.8em 0.25em 0.3em; display: inline-flex; align-items: center; gap: 0.45em;
}
.theme-picker button[aria-pressed="true"] { border-color: var(--accent); background: var(--deep); }
.theme-picker .swatch { width: 1.5em; height: 1.5em; border-radius: 50%; border: 2px solid var(--paper); flex: 0 0 auto; }
/* Swatches only, no names: round buttons with a clear ring on the chosen one. */
.theme-picker button { padding: 0.25em; border-radius: 50%; }
.theme-picker .swatch { width: 2em; height: 2em; }
.theme-picker button:hover { border-color: var(--paper-dim); }
.theme-picker button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.theme-row { margin-top: 22px; display: grid; gap: 8px; }
.theme-row > span { font-weight: 650; color: var(--paper-dim); }
.options fieldset.wide { flex-basis: 100%; }

/* ---------- Sound toggle ---------- */
.sound-btn { font-size: 0.8em; min-width: 2.6em; }
.phone-top .sound-btn { font-size: 0.85rem; padding: 0.3em 0.6em; }
.phone-top .right-side { display: flex; align-items: center; gap: 10px; }

/* ---------- Right / wrong effects ---------- */
@keyframes pop-in { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse-right { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15%, 55% { transform: translateX(-0.35em); } 35%, 75% { transform: translateX(0.35em); } }
@keyframes rise { from { transform: translateY(0.8em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow-good { 0% { box-shadow: 0 0 0 0 rgba(34, 201, 151, 0.9); } 100% { box-shadow: 0 0 0 1.2em rgba(34, 201, 151, 0); } }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(0.3) rotate(-6deg); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.12) rotate(2deg); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.04); opacity: 0; } }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

.fx .answers.revealed .answer.right { animation: pulse-right 0.7s ease-in-out 3, glow-good 1.2s ease-out 1; }
.answer.wrong-pick { position: relative; opacity: 1 !important; outline: 0.18em solid var(--bad); outline-offset: 0.12em; }
.answer.wrong-pick::after { content: "\2715"; position: absolute; right: 0.5em; top: 50%; transform: translateY(-50%); font-size: 1.3em; color: var(--bad); font-weight: 900; text-shadow: 0 2px 0 var(--deep); }
.fx .answer.wrong-pick { animation: shake 0.5s ease-in-out 2; }

/* Who got it (TV, phones mode) */
.verdict { display: flex; align-items: baseline; gap: 0.6em; flex-wrap: wrap; }
.verdict strong { font-size: 2.2em; font-weight: 800; font-stretch: 80%; line-height: 1; }
.verdict.good strong { color: var(--good); }
.verdict.bad strong { color: var(--bad); }
.verdict span { color: var(--paper-dim); font-weight: 650; font-size: 1.1em; }
.fx .verdict { animation: pop-in 0.5s ease-out both; }
.who-got { display: flex; flex-wrap: wrap; gap: 0.45em; }
.who-got .tag {
  display: inline-flex; align-items: center; gap: 0.35em; border-radius: 99px; padding: 0.25em 0.8em 0.25em 0.35em; font-weight: 750;
  background: var(--night); color: var(--paper); border: 2px solid rgba(255, 246, 229, 0.2); font-size: 1.05em;
}
.who-got .tag i { font-style: normal; display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; font-size: 0.85em; font-weight: 900; background: var(--muted); color: var(--ink); }
.who-got .tag.right { background: var(--good); color: var(--ink); border-color: var(--deep); }
.who-got .tag.right i { background: var(--paper); color: #0d7a59; }
.who-got .tag.close { background: var(--lemon); color: var(--ink); border-color: var(--deep); }
.who-got .tag.close i { background: var(--paper); color: var(--ink); }
.who-got .tag.wrong { border-color: var(--bad); }
.who-got .tag.wrong i { background: var(--bad); color: var(--paper); }
.who-got .tag.none { opacity: 0.55; }
.fx .who-got .tag { animation: pop-in 0.45s ease-out both; }
.scorelist li.right { box-shadow: inset 0.3em 0 0 var(--good); }
.scorelist li.close { box-shadow: inset 0.3em 0 0 var(--lemon); }
.scorelist li.wrong { box-shadow: inset 0.3em 0 0 var(--bad); }
.scorelist .mark { font-weight: 900; }
.scorelist li.right .mark { color: var(--good); }
.scorelist li.wrong .mark { color: var(--bad); }
.fx .scorelist li { animation: rise 0.4s ease-out both; }

/* Big center message (playing together, and phones) */
.burst {
  position: fixed; left: 50%; top: 46%; z-index: 70; pointer-events: none; text-align: center;
  background: var(--paper); color: var(--ink); border: 0.12em solid var(--deep); border-radius: 0.4em; box-shadow: 0 0.12em 0 var(--deep);
  padding: 0.25em 0.6em 0.3em; font-weight: 800; font-stretch: 78%; line-height: 1; white-space: nowrap;
  font-size: clamp(3rem, 9vw, 9rem); animation: burst 2.3s ease-out both;
}
.burst small { display: block; font-size: 0.42em; font-stretch: 90%; margin-top: 0.15em; }
.burst.right { background: var(--good); }
.burst.close { background: var(--lemon); }
.burst.wrong { background: var(--bad); color: var(--paper); }
.burst.none { background: var(--paper); }
.burst.record { background: var(--accent); white-space: normal; max-width: 92vw; animation-duration: 3.6s; font-size: clamp(2.4rem, 6vw, 6rem); }
.screen-flash { position: fixed; inset: 0; pointer-events: none; z-index: 65; animation: flash 0.9s ease-out both; }
.screen-flash.right { background: radial-gradient(circle at 50% 45%, rgba(34, 201, 151, 0.55), transparent 65%); }
.screen-flash.close { background: radial-gradient(circle at 50% 45%, rgba(255, 210, 63, 0.5), transparent 65%); }
.screen-flash.wrong { background: radial-gradient(circle at 50% 45%, rgba(255, 107, 107, 0.55), transparent 65%); }
.fx-shake { animation: shake 0.45s ease-in-out 1; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 68; }

/* Phone results */
.result-big { border-radius: 22px; }
.result-big.right { background: rgba(34, 201, 151, 0.18); }
.result-big.close { background: rgba(255, 210, 63, 0.16); }
.result-big.wrong { background: rgba(255, 107, 107, 0.16); }
.result-big .badge { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 38px; font-weight: 900; margin-bottom: 10px; border: 3px solid var(--deep); box-shadow: var(--press-small); }
.result-big.right .badge { background: var(--good); color: var(--ink); }
.result-big.close .badge { background: var(--lemon); color: var(--ink); }
.result-big.wrong .badge { background: var(--bad); color: var(--paper); }
.result-big.none .badge { background: var(--night); color: var(--paper-dim); }
.result-big.wrong .headline { color: #ffd0d0; }
.fx .result-big .badge { animation: pop-in 0.55s ease-out both; }
.fx .result-big.right .headline, .fx .result-big.close .headline { animation: pop-in 0.6s 0.1s ease-out both; }
.fx .result-big.wrong .headline { animation: shake 0.5s 0.15s ease-in-out 2; }
.fx .result-big .points { animation: rise 0.5s 0.35s ease-out both; }
.result-big.record { background: rgba(255, 210, 63, 0.18); }
.record-line { font-weight: 800; color: var(--accent); font-size: 1.3rem; margin-top: 8px; }
.fx .record-line { animation: pop-in 0.6s 0.3s ease-out both; }

/* Rate the question: deliberately small and quiet */
.rate { display: flex; align-items: center; justify-content: center; gap: 0.5em; color: var(--muted); font-size: 0.85rem; margin-top: auto; padding-top: 8px; }
.rate button { all: unset; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0.3em 0.45em; border-radius: 99px; border: 1px solid transparent; filter: grayscale(1); opacity: 0.7; }
.rate button:hover, .rate button:focus-visible { opacity: 1; border-color: var(--muted); }
.rate button[aria-pressed="true"] { filter: none; opacity: 1; border-color: var(--paper-dim); background: var(--night); }
.rate .thanks { min-width: 4.5em; }
body.tv .rate { justify-content: flex-end; font-size: 0.8em; padding-top: 0; }
body.phone .phone-main .rate { margin-top: 0; padding-top: 0; } /* phones: stays right under the result, never pushed below the fold */

/* Paused */
.paused-bar {
  display: flex; align-items: center; gap: 0.8em; flex-wrap: wrap; background: var(--deep); border: 3px solid var(--accent);
  border-radius: 18px; padding: 0.6em 1em; font-weight: 700;
}
.paused-bar .label { font-size: 1.4em; font-weight: 800; font-stretch: 85%; margin-right: auto; display: inline-flex; align-items: center; gap: 0.45em; }
.paused-bar .label::before { content: ""; width: 0.75em; height: 0.9em; border-left: 0.25em solid var(--accent); border-right: 0.25em solid var(--accent); }
.phone-paused { text-align: center; color: var(--accent); font-weight: 750; }
.host-controls .btn.paused { background: var(--accent); }

/* High-score celebration on the final screen */
.records { display: grid; gap: 0.4em; justify-items: center; }
.records .new-high { font-size: 3em; font-weight: 800; font-stretch: 75%; color: var(--accent); line-height: 1; text-align: center; }
.fx .records .new-high { animation: pop-in 0.7s ease-out both, pulse-right 0.9s 0.7s ease-in-out 4; }
.records ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5em; justify-content: center; }
.records li { background: var(--night); border: 2px solid var(--accent); border-radius: 99px; padding: 0.25em 0.9em; font-weight: 700; }
.podium .step .badge { display: inline-block; margin-top: 0.3em; background: var(--ink); color: var(--accent); border-radius: 99px; padding: 0.1em 0.6em; font-size: 0.85em; font-weight: 800; }
.fx .podium .step { animation: rise 0.6s ease-out both; }
.fx .podium .second { animation-delay: 0.5s; }
.fx .podium .third { animation-delay: 0.25s; }
.fx .podium .first { animation-delay: 0.85s; }

/* Admin extras */
.danger-zone { border-color: rgba(255, 107, 107, 0.5); }
.danger-zone .btn { background: var(--bad); color: var(--ink); }
.q-row td { vertical-align: top; }
.q-row .q-text { font-weight: 650; }
.q-row .q-meta { color: var(--muted); font-size: 0.85rem; }
.q-row.retired .q-text { text-decoration: line-through; opacity: 0.7; }
.votes { white-space: nowrap; font-variant-numeric: tabular-nums; }
.votes .down { color: var(--bad); font-weight: 800; }

/* ---------- Ad spaces (hidden unless config.php turns them on, or ?adpreview=1) ---------- */
.ad-slot { display: grid; gap: 6px; justify-items: center; margin: 28px auto; width: 100%; }
.ad-slot.wide { max-width: 728px; }
.house-tag { display: inline-block; margin-left: 0.5em; padding: 0.05em 0.5em; border-radius: 99px; border: 1px solid var(--paper-dim); color: var(--paper-dim); font-size: 0.75em; font-weight: 700; vertical-align: 0.1em; white-space: nowrap; }
.house-note { color: var(--paper-dim); font-size: 0.92rem; margin: 10px 0 0; }
.ad-slot.spaced { margin: 48px auto; } /* content pages: clear space from links and buttons (v1.20) */
.ad-slot.spaced.rf-ad--far, .rf-pages .ad-slot.spaced.rf-ad--far { margin-top: 150px; } /* v2.17: a slot that follows buttons (a daily's result screen, a page's last CTA) keeps 150 px from them */
.ad-slot.spaced.rf-ad--far-below { margin-bottom: 150px; } /* v2.17: a slot with buttons right after it (Trivia's topic index) */
.ad-slot.box { max-width: 300px; }
.ad-slot.tv { max-width: 728px; margin: 0.8em auto 0; }
.ad-slot.preview { border: 2px dashed var(--muted); border-radius: 12px; color: var(--muted); padding: 12px; place-content: center; text-align: center; }
.ad-slot.preview.wide, .ad-slot.preview.tv { min-height: 90px; }
.ad-slot.preview.box { min-height: 250px; }
.ad-slot .ad-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ad-slot .ad-size { font-size: 0.85rem; }
.ad-slot .ad-note { font-size: 0.75rem; color: var(--muted); }
.ad-slot.google { min-height: 100px; }
.ad-slot ins.adsbygoogle { display: block; width: 100%; }
.house-ad {
  display: grid; gap: 4px; width: 100%; text-decoration: none; color: var(--ink); background: var(--paper);
  border: 3px solid var(--deep); border-radius: 14px; box-shadow: var(--press-small); padding: 12px 16px; text-align: left;
}
.house-ad strong { font-size: 1.1rem; }
.house-ad span { color: #3c4170; font-size: 0.95rem; }
.house-ad .cta { color: var(--ink); font-weight: 750; }
.house-ad:hover { color: var(--ink); transform: translateY(-1px); }
body.tv .ad-slot .house-ad strong { font-size: 1em; }
.lobby-side { display: grid; gap: 1em; justify-items: center; }
.lobby-side .ad-slot { margin: 0; }
.phone-main .ad-slot { margin: 18px auto 0; }

/* ---------- Terms, feedback, small print ---------- */
.legal main { max-width: 46em; }
.legal h2 { font-size: 1.35rem; margin: 26px 0 8px; }
.legal li { margin-bottom: 6px; }
.legal .effective { color: var(--muted); }
.legal .summary { background: var(--night); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; }
.copyright { color: var(--muted); margin-top: 32px; }
.small-print { font-size: 0.85em; color: var(--muted); }
.phone-card .small-print { color: #5a5f86; }
.phone-card .small-print a, .phone-card .hint a { color: #1d33b8; }
.feedback-form { max-width: 40em; display: grid; gap: 4px; }
.feedback-form .kind-pick { border: 0; padding: 0; margin: 0 0 14px; }
.feedback-form legend { font-weight: 650; margin-bottom: 6px; padding: 0; }
.feedback-form textarea {
  font: inherit; font-size: 1.05em; color: var(--ink); background: #fffdf8; border: 3px solid var(--deep); border-radius: 12px;
  padding: 0.55em 0.7em; width: 100%; resize: vertical; min-height: 8em;
}
.feedback-form .count { justify-self: end; font-size: 0.8125rem; color: #5a5f86; }
.feedback-form .optional { font-weight: 500; color: #5a5f86; }
.feedback-form .hint { font-size: 0.9375rem; }
.feedback-form .btn { justify-self: start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thanks-card { max-width: 40em; }
.thanks-card h2 { margin-bottom: 8px; }
.feedback-list { display: grid; gap: 10px; }
.feedback-item { background: var(--night); border-radius: 12px; padding: 12px 14px; border-left: 4px solid var(--accent); }
.feedback-item.read { border-left-color: transparent; opacity: 0.75; }
.feedback-item .meta { color: var(--muted); font-size: 0.85rem; }
.feedback-item .msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 8px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .burst { animation: flash 2.2s ease-out both !important; transform: translate(-50%, -50%); }
}

/* ---------- Playing on phones only (solo, or hosted on a phone) ---------- */
.phone-play { background: rgba(255, 246, 229, 0.08); border: 3px dashed rgba(255, 246, 229, 0.35); border-radius: 22px; padding: 20px; }
.phone-play h2 { font-size: 1.6rem; margin-bottom: 6px; }
.phone-play p { color: var(--paper-dim); }
.phone-play-actions { display: grid; gap: 12px; margin-top: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--deep); }
.join-card .check, .phone-card .check { color: var(--ink); }
.solo-setup .seg { display: flex; width: 100%; }
.solo-setup .seg button { flex: 1; padding: 0.55em 0.4em; }
.solo-setup fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.solo-setup legend { font-weight: 750; margin-bottom: 6px; }
.solo-games { display: grid; gap: 8px; }
.solo-games label { display: flex; gap: 10px; align-items: flex-start; border: 3px solid var(--deep); border-radius: 14px; padding: 10px 12px; background: var(--paper); cursor: pointer; }
.solo-games label:has(input:checked) { background: var(--tile, var(--accent)); }
.solo-games input { margin-top: 4px; accent-color: var(--deep); }
.solo-games small { display: block; color: #3c4170; font-weight: 500; }
.solo-cats details { border-top: 2px solid rgba(20, 24, 58, 0.15); padding: 8px 0; }
.solo-cats summary { font-weight: 750; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.solo-cats summary span { color: #5a5f86; font-weight: 600; }
.solo-cats .cat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.solo-cats .cat-list button { font: inherit; font-size: 0.9rem; font-weight: 650; border: 2px solid var(--deep); border-radius: 99px; background: var(--paper); color: var(--ink); padding: 4px 10px; cursor: pointer; }
.solo-cats .cat-list button[aria-pressed="true"] { background: var(--accent); }
.solo-cats .all-none { display: flex; gap: 8px; margin-top: 6px; }
/* Quiet buttons on a light card: dark text and outline instead of the light-on-dark default. */
.phone-card .btn.quiet, .join-card .btn.quiet { color: var(--ink); border-color: var(--deep); background: transparent; }
.phone-card .btn.quiet:hover, .join-card .btn.quiet:hover { background: rgba(20, 24, 58, 0.08); }
.phone-host { display: grid; gap: 12px; text-align: center; }
.phone-host .code-tiles { font-size: 3.2rem; justify-content: center; }
.phone-host .share-row { display: grid; gap: 10px; }
.host-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-top: 6px; border-top: 2px solid rgba(255, 246, 229, 0.18); }
/* Host buttons never slip off the bottom of a phone: they stick to the visible bottom edge, above the
   gesture bar on phones that draw the page behind it (Android 15 Chrome with viewport-fit=cover). */
.phone-main .host-bar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 5; background: var(--cobalt); padding-bottom: 8px; }
.host-bar .btn { flex: 1; min-width: 6em; }
/* While the keyboard is up, the host buttons stay in the page instead of floating over the answer box. */
body.typing .phone-main .host-bar { position: static; }

/* Admin: daily feedback email settings */
.page h3 { font-size: 1.25rem; margin: 22px 0 6px; }
.toolbar label.inline-check { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; padding-bottom: 8px; cursor: pointer; }
.toolbar label.inline-check input { width: 20px; height: 20px; accent-color: var(--accent); }
#digestTo { min-width: min(22em, 80vw); }
.page .note { color: var(--paper-dim); }

/* ---------- No-TV games on a laptop or tablet ----------
   body.roomy = the setup page, and any game whose questions show on the players' own screens.
   On a wide screen it uses more of the room instead of a phone-width column. */
.setup-cols { display: block; }
@media (min-width: 760px) {
  body.phone.roomy { font-size: 20px; }
  body.phone.roomy .phone-wrap { max-width: 1040px; padding: 24px 32px calc(40px + env(safe-area-inset-bottom, 0px)); gap: 20px; }
  body.phone.roomy .phone-main { gap: 20px; }
  body.phone.roomy .phone-card { padding: 28px 32px; }
  body.phone.roomy .phone-card h1 { font-size: 2.6rem; }
  body.phone.roomy .phone-q { font-size: clamp(1.7rem, 2.8vw, 2.6rem); line-height: 1.2; }
  body.phone.roomy .phone-timer { height: 14px; }
  body.phone.roomy .pad { gap: 18px; }
  body.phone.roomy .pad button { font-size: 1.35rem; padding: 22px; min-height: 84px; }
  body.phone.roomy .pad.choices button { min-height: min(26vh, 220px); font-size: clamp(1.35rem, 2vw, 1.8rem); justify-content: center; gap: 16px; }
  body.phone.roomy .pad .shape { width: 36px; height: 36px; }
  body.phone.roomy .phone-clues { font-size: 1.25rem; gap: 8px; }
  body.phone.roomy .result-big .headline { font-size: 4.4rem; }
  body.phone.roomy .result-big .points { font-size: 2.8rem; }
  body.phone.roomy .waiting { font-size: 1.4rem; padding: 56px 20px; }
  body.phone.roomy .waiting strong { font-size: 2.6rem; }
  body.phone.roomy .locked-in { font-size: 1.6rem; }
  body.phone.roomy .host-bar { max-width: 720px; width: 100%; margin: 0 auto; }
  body.phone.roomy .phone-host .code-tiles { font-size: 4.4rem; }
  /* Big buttons and small forms stay a comfortable width instead of stretching across a laptop screen. */
  body.phone.roomy .phone-main .btn.wide { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; justify-self: center; }
  body.phone.roomy .phone-main > .phone-card:not(.solo-setup) { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
  body.phone.roomy .solo-setup .btn.wide { max-width: none; }
}
@media (min-width: 900px) {
  /* Setup: game choices on the left, categories and your name on the right. */
  .solo-setup .setup-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: start; }
  .solo-setup .solo-cats details[open] .cat-list { max-height: none; }
  .solo-setup .solo-games label { padding: 12px 14px; }
}

/* Admin: site analytics. One accent color for every bar (each chart shows a single measure). */
.stats { display: grid; gap: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(3, 1fr); } }
.stat-tile { background: var(--night); border: 2px solid rgba(255, 246, 229, 0.12); border-radius: 16px; padding: 12px 14px; display: grid; gap: 2px; }
.stat-tile .stat-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat-tile strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-tile small { color: var(--paper-dim); font-size: 0.85rem; }
.stat-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .stat-grid.two { grid-template-columns: 1fr 1fr; } .stat-grid.three { grid-template-columns: 1fr 1fr 1fr; } }
.stat-card { background: var(--night); border: 2px solid rgba(255, 246, 229, 0.12); border-radius: 18px; padding: 14px 16px; min-width: 0; }
.page .stat-card h3 { font-size: 1.05rem; margin: 0 0 10px; }
.stat-card h4 { font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
.stat-card .empty { padding: 6px 0; }
.stat-card details { margin-top: 10px; }
.stat-card summary { cursor: pointer; color: var(--paper-dim); font-size: 0.9rem; }
.stat-hint { color: var(--paper-dim); font-size: 0.85rem; margin-top: 8px; }
.table-scroll { overflow-x: auto; }
.stat-card table.board { font-size: 0.95rem; }
.stat-card table.board th.num { text-align: right; }
.stat-card table.board td:first-child { white-space: nowrap; }
.stat-card table.problems td.problem-text { white-space: normal; min-width: 12em; }
.stat-card table.board td.nowrap, .stat-card table.board th.nowrap { white-space: nowrap; }
.stat-card table.problems td, .stat-card table.problems th { padding-left: 6px; padding-right: 6px; }
/* Admin: live view. Names wrap; away players are greyed. */
.stat-card table.live td.live-names { white-space: normal; min-width: 12em; }
.live-name { margin-right: 0.3em; }
.live-name.away { color: var(--muted); font-style: italic; }
.status { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 8px 2px; border-radius: 99px; white-space: nowrap; }
.status.new { background: var(--bubblegum); color: var(--ink); }
.status.recurring { background: var(--tangerine); color: var(--ink); }
.status.recent { background: var(--lemon); color: var(--ink); }
.status.quiet { background: rgba(255, 246, 229, 0.14); color: var(--paper-dim); }
.strip { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; vertical-align: middle; }
.strip-bar { display: block; width: 6px; height: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.strip-bar.none { height: 2px; background: rgba(255, 246, 229, 0.2); }
.bar-list { list-style: none; display: grid; gap: 6px; padding: 0; margin: 0; }
.bar-list li { display: grid; grid-template-columns: minmax(7em, 44%) 1fr auto; align-items: center; gap: 8px; font-size: 0.9rem; }
.bar-list.wide li { grid-template-columns: minmax(10em, 62%) 1fr auto; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; }
.bar-list .bar { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.5em; text-align: right; }
.bar-list li:hover .bar-label, .bar-list li:hover .bar-value { color: var(--accent); }
.columns { display: flex; align-items: stretch; gap: 2px; height: 140px; }
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.col-plot { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid rgba(255, 246, 229, 0.25); }
.col-bar { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.col:hover .col-bar { filter: brightness(1.2); }
.col-label { font-size: 0.7rem; color: var(--muted); text-align: center; height: 1.4em; white-space: nowrap; overflow: visible; }

/* Final screen: a player can still take their saved score off the high-score boards. */
.off-board-choice { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; text-align: center; color: var(--paper-dim); font-size: 0.95rem; }
.off-board-choice .btn { flex: 0 0 auto; }
.off-board-choice .error { flex-basis: 100%; margin: 0; color: #ffb4ab; }

/* ---------- Solo quick play (quick.html and its final screen, v1.19) ---------- */
.quick-start { display: grid; gap: 14px; }
.quick-start h1 { margin-bottom: 0; }
.quick-start p { margin: 0; }
.quick-start .phone-sub { color: #3c4170; }
.quick-cat { display: grid; gap: 4px; background: var(--accent); color: var(--ink); border: 3px solid var(--deep); border-radius: 16px; padding: 14px 16px; }
.quick-label { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.quick-name { font-size: 2rem; line-height: 1.1; }
.quick-blurb { font-size: 0.95rem; }
.quick-pick { font-weight: 700; font-size: 0.95rem; margin-top: 10px; }
.quick-cat select { width: 100%; }
.quick-start .rules-line { color: #3c4170; text-align: left; max-width: none; font-size: 0.98rem; }
.quick-start .small-print { font-size: 0.85rem; }
.add-score { display: grid; gap: 10px; background: var(--paper); color: var(--ink); border: 3px solid var(--deep); border-radius: 16px; padding: 14px; text-align: center; }
.add-score .phone-sub { color: #3c4170; font-size: 0.9rem; }
.add-score .error { color: #b3261e; margin: 0; }
.add-score .error:empty { display: none; }
.add-score-row { display: flex; flex-wrap: wrap; gap: 10px; }
.add-score-row input { flex: 1 1 13em; min-width: 0; }
.add-score-row .btn { flex: 1 1 auto; }
.quick-again { display: grid; gap: 12px; }
.quick-next { margin: 0; }
.quick-next label { color: var(--paper-dim); font-weight: 650; }

/* ---------- Tip jar (a plain link to Ko-fi) ---------- */
.site-foot a.tip-link { color: var(--accent); font-weight: 700; }
.site-foot .social { display: inline-flex; align-items: center; gap: 12px; }
.site-foot .social a { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; color: var(--paper-dim); }
.site-foot .social a:hover, .site-foot .social a:focus-visible { color: var(--accent); }
.tip-line { text-align: center; color: var(--paper-dim); font-size: 0.95rem; margin: 18px 0 4px; }
.tip-line a { color: var(--accent); font-weight: 750; }

/* ---------- Spreading the word (final screens) ---------- */
.spread-row { display: grid; gap: 10px; margin-top: 14px; }
.final-note.spread-note strong { color: var(--accent); }

/* ---------- Content pages (How to play, trivia questions) ---------- */
.trivia-page .lede { font-size: 1.15rem; color: var(--paper-dim); max-width: 42em; }
.trivia-page .crumbs { margin: 0; color: var(--muted); font-size: 0.95rem; }
.trivia-page .crumbs a { color: var(--paper-dim); }
.trivia-page ul, .trivia-page ol.steps { padding-left: 1.3em; }
.trivia-page li { margin: 6px 0; }
.qa { list-style: none; padding: 0; margin: 18px 0 8px; counter-reset: qa; display: grid; gap: 10px; }
.qa li { counter-increment: qa; margin: 0; }
.qa details { background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 14px; padding: 12px 16px; }
.qa summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; list-style: none; display: flex; gap: 10px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: counter(qa) "."; color: var(--accent); font-weight: 800; min-width: 1.6em; }
/* Pages built since v1.4 write each number in the page (one list across the Easy, Medium and Hard sections). */
.qa.numbered summary::before { content: none; }
.qa .qa-n { color: var(--accent); font-weight: 800; min-width: 1.6em; flex: none; }
.trivia-page .uses p { color: var(--paper-dim); }
.qa details[open] summary { margin-bottom: 8px; }
.qa details p { margin: 0 0 0 2.2em; color: var(--paper-dim); }
.qa details p strong { color: var(--accent); }
.play-cta { margin: 36px 0 12px; background: var(--night); border-left: 4px solid var(--accent); border-radius: 14px; padding: 6px 20px 18px; }
.play-cta .host-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.topic-links { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0 !important; }
.topic-links a { color: var(--paper-dim); font-weight: 650; }
.topic-cards { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 22px 0; }
.topic-cards li { margin: 0; }
.topic-cards a { display: grid; align-content: start; gap: 4px; height: 100%; box-sizing: border-box; background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 14px; padding: 14px 16px; color: var(--paper); text-decoration: none; }
.topic-cards a:hover, .topic-cards a:focus-visible { border-color: var(--accent); }
.topic-cards strong { font-size: 1.15rem; }
.topic-cards span { color: var(--paper-dim); font-size: 0.95rem; }

/* Seasonal spotlight (filled by common.js in the run-up to a holiday). */
.season { margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 20px 24px; border-radius: 18px; background: var(--season-bg, var(--night)); border: 2px solid var(--season-line, var(--accent)); color: #fff6e5; }
.season[hidden] { display: none; }
.season-icon { font-size: 2.8rem; line-height: 1; }
.season-text { flex: 1 1 300px; }
.season-text h2 { font-size: 1.6rem; line-height: 1.15; margin: 2px 0 0; color: #fff6e5; }
.season-text p { margin: 6px 0 0; color: #f3e9ff; }
.season-text .season-kicker { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--season-line, var(--accent)); }
.season-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.season-actions .btn.quiet { color: #fff6e5; border-color: rgba(255, 246, 229, 0.7); }
.season-halloween { --season-bg: #2a1442; --season-line: #ff8a1f; }
.season-thanksgiving { --season-bg: #5a250b; --season-line: #ffb547; }
.season-holidays { --season-bg: #0b4a28; --season-line: #ffd23f; }
.season-christmas { --season-bg: #7a1424; --season-line: #ffd23f; }
.trivia-page .season { margin: 8px 0 28px; }
@media (max-width: 720px) {
  .season { margin-top: 36px; padding: 18px; }
  .season-actions { width: 100%; }
  .season-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Touch screens (v1.36): a button drawn under the finger just after a tap waits half a second before it takes a tap
   (js/common.js, and js/room.js on the umbrella site), and fades in meanwhile so it is clear it isn't ready yet. */
.tap-wait { animation: tap-wait 0.5s ease-out; }
@keyframes tap-wait { from { opacity: 0.4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tap-wait { animation: none; opacity: 0.6; } }

/* =====================================================================================================================
   v2.0 DESIGN SYSTEM (package P1). Everything below is prefixed rf- so it never changes a v1 screen; screens move over
   one at a time (P2-P5). Mobile-first: base rules are for a 360-420px phone, wider screens add min-width queries.
   Contract with copy-paste markup: reports/p1.md. Living style guide: /styleguide.html. Icons: css/icons.svg
   (tools/build_icons.py). No inline style anywhere: numbers a script owns (a timer's fraction, a confetti piece's
   position) are custom properties set with element.style.setProperty('--rf-p', 0.58), which the CSP allows.
   ===================================================================================================================== */
:root {
  /* Grounds. Cream = browsing (home, daily, results). Room Blue = you're in a room. Night = the TV, and paused.
     Room Blue and Night follow the party color scheme (--cobalt, --night); cream and ink never change. */
  --rf-cream: #fff6e5;
  --rf-white: #ffffff;
  --rf-ink: #0b1450;              /* outlines, shadows, text on every color */
  --rf-blue: var(--cobalt);
  --rf-night: var(--night);
  --rf-outline: var(--deep);      /* = ink in the classic scheme, the scheme's darkest shade otherwise */
  --rf-muted-cream: #4a5290;      /* 6.7:1 on cream */
  --rf-muted-room: #c9d0ff;       /* 6.3:1 on Room Blue; each scheme uses its own --paper-dim */
  --rf-line-cream: #e8dcc4;
  --rf-link-cream: #1d33b8;
  --rf-danger: #b3124f;           /* danger text on white or cream, 6.6:1 */
  --rf-primary: var(--accent);    /* the main button and "you": lemon, or the scheme's accent */
  /* The four shapes: shape carries the meaning, color is backup. Text on them is always ink. */
  --rf-orange: #ff7a1a;           /* A, triangle */
  --rf-yellow: #ffd23f;           /* B, circle */
  --rf-green: #22c997;            /* C, diamond */
  --rf-pink: #ff5c9e;             /* D, square */
  --rf-lilac: #a98bff;
  --rf-teal: #2ec4d6;
  --rf-good: #22c997;
  --rf-bad: #ff5c9e;
  /* Game accents (ink text on every one). Bingo green and Cards teal are close: always show the icon and name too. */
  --rf-game-trivia: #ffd23f;
  --rf-game-bingo: #22c997;
  --rf-game-charades: #ff5c9e;
  --rf-game-words: #ff7a1a;
  --rf-game-mystery: #a98bff;
  --rf-game-cards: #2ec4d6;
  /* Type: Bricolage Grotesque only. Phone scale; .rf-tv swaps in the TV scale (x2.4, never below 28px). */
  --rf-fs-display: 56px;
  --rf-fs-title: 32px;
  --rf-fs-question: clamp(24px, 7.4vw, 30px);
  --rf-fs-body: 18px;
  --rf-fs-small: 15px;
  --rf-fs-label: 14px;
  --rf-fs-code: 72px;
  /* Spacing (4-pt), radius, depth */
  --rf-s1: 4px; --rf-s2: 8px; --rf-s3: 12px; --rf-s4: 16px; --rf-s5: 24px; --rf-s6: 32px; --rf-s7: 48px; --rf-s8: 64px;
  --rf-gutter: 24px;
  --rf-side: 20px;
  --rf-r-chip: 12px;
  --rf-r-tile: 20px;
  --rf-r-card: 28px;
  --rf-r-pill: 999px;
  --rf-line: 3px;
  --rf-press: 0 6px 0 var(--rf-outline);        /* straight down: buttons are keys you press */
  --rf-press-sm: 0 4px 0 var(--rf-outline);
  --rf-pressed: 0 1px 0 var(--rf-outline);
  --rf-drop: 5px;                                /* how far a key travels when pressed */
  --rf-dur-press: 80ms;
  --rf-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}
:root[data-theme] { --rf-muted-room: var(--paper-dim); }
/* v2.1 (P12, Steve): a party scheme paints the whole page again, as in v1. Classic keeps the approved cream; every other
   scheme swaps the cream ground for its own tint (home, setup, results, dailies), while Room Blue and Night (game screens,
   TV) already take its colors. Ink stays the text color; muted text, links and the danger red are darkened per scheme so
   every pair keeps 4.5:1 (ink 8.9:1 or more, muted 5.7:1 or more, links = the scheme's --deep, danger 5:1 or more). */
:root[data-theme] { --rf-link-cream: var(--deep); --rf-danger: #8a0e3c; --rf-line-cream: rgba(11, 20, 80, 0.18); }
:root[data-theme="birthday"] { --rf-cream: #e1b5db; --rf-muted-cream: #632e5c; }
:root[data-theme="halloween"] { --rf-cream: #ffbf84; --rf-muted-cream: #442f31; }
:root[data-theme="christmas"] { --rf-cream: #b3cfc0; --rf-muted-cream: #2a4a3a; }
:root[data-theme="spring"] { --rf-cream: #bbf6dc; --rf-muted-cream: #4b4d80; }
:root[data-theme="stars"] { --rf-cream: #babfd3; --rf-muted-cream: #2e3451; }
:root[data-theme="ocean"] { --rf-cream: #b8fcff; --rf-muted-cream: #2a5a60; }
:root[data-theme="galaxy"] { --rf-cream: #bfb8cd; --rf-muted-cream: #332b44; }
:root[data-theme="neon"] { --rf-cream: #94ffb6; --rf-muted-cream: #213828; }
:root[data-theme="sunset"] { --rf-cream: #e0bcb5; --rf-muted-cream: #633630; }
:root[data-theme="forest"] { --rf-cream: #b9cac0; --rf-muted-cream: #30453a; }
:root[data-theme="sky"] { --rf-cream: #b6cde3; --rf-muted-cream: #2e4863; }
:root[data-theme="berry"] { --rf-cream: #dab7c9; --rf-muted-cream: #582d43; }
:root[data-theme="autumn"] { --rf-cream: #ffd391; --rf-muted-cream: #5c3c23; }
:root[data-theme="royal"] { --rf-cream: #c2b9d8; --rf-muted-cream: #3a3057; }
:root[data-theme="slate"] { --rf-cream: #9eeee3; --rf-muted-cream: #2c4247; }

/* ---------- Grounds (put one on <body> or on a section) ---------- */
.rf-cream, .rf-room, .rf-night {
  font-family: var(--font); font-size: var(--rf-fs-body); font-weight: 500; line-height: 1.4;
  font-variation-settings: normal; font-stretch: 100%;
  background: var(--rf-bg); color: var(--rf-fg);
}
.rf-cream {
  --rf-bg: var(--rf-cream); --rf-fg: var(--rf-ink); --rf-muted: var(--rf-muted-cream); --rf-panel: var(--rf-white);
  --rf-panel-line: var(--rf-line-cream); --rf-track: var(--rf-line-cream); --rf-link: var(--rf-link-cream);
  --rf-ring: var(--rf-ink); --rf-focus: var(--rf-link-cream); --rf-ghost: var(--rf-ink); --rf-error: var(--rf-danger);
}
.rf-room {
  --rf-bg: var(--rf-blue); --rf-fg: var(--rf-white); --rf-muted: var(--rf-muted-room); --rf-panel: var(--rf-night);
  --rf-panel-line: transparent; --rf-track: var(--rf-night); --rf-link: var(--accent);
  --rf-ring: var(--rf-white); --rf-focus: var(--accent); --rf-ghost: var(--rf-muted-room); --rf-error: #ffe0ea; /* v2.4: 4.75:1 or better on all 16 room colors (was #ffc2d6: 3.87 spring, 4.15 sky) */
}
.rf-night {
  --rf-bg: var(--rf-night); --rf-fg: var(--rf-white); --rf-muted: var(--rf-muted-room); --rf-panel: var(--rf-blue);
  --rf-panel-line: transparent; --rf-track: var(--rf-blue); --rf-link: var(--accent);
  --rf-ring: var(--rf-white); --rf-focus: var(--accent); --rf-ghost: var(--rf-muted-room); --rf-error: #ffe0ea; /* v2.4: 4.75:1 or better on all 16 room colors (was #ffc2d6: 3.87 spring, 4.15 sky) */
}
body.rf-cream, body.rf-room, body.rf-night { margin: 0; min-height: 100vh; min-height: 100dvh; }
.rf-cream :focus-visible, .rf-room :focus-visible, .rf-night :focus-visible { outline: 3px solid var(--rf-focus); outline-offset: 3px; }
.rf-cream a:not([class]), .rf-room a:not([class]), .rf-night a:not([class]) { color: var(--rf-link); font-weight: 700; }
.rf-cream a:not([class]):hover, .rf-room a:not([class]):hover, .rf-night a:not([class]):hover { color: var(--rf-fg); }
/* A card of the other ground inside a page (the cream invite card on Room Blue, a blue band on a cream page). */
.rf-card {
  background: var(--rf-cream); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-card);
  box-shadow: var(--rf-press); padding: 18px; display: flex; flex-direction: column; gap: 16px;
  --rf-fg: var(--rf-ink); --rf-muted: var(--rf-muted-cream); --rf-panel: var(--rf-white); --rf-panel-line: var(--rf-line-cream);
  --rf-track: var(--rf-line-cream); --rf-link: var(--rf-link-cream); --rf-ring: var(--rf-ink); --rf-focus: var(--rf-link-cream); --rf-ghost: var(--rf-ink);
  --rf-error: var(--rf-danger);
}
.rf-card--white { background: var(--rf-white); }
.rf-card--flat { box-shadow: none; }
.rf-panel { background: var(--rf-panel); color: var(--rf-fg); border: 2px solid var(--rf-panel-line); border-radius: 22px; padding: 16px; }
.rf-band {   /* the blue header band of a cream results page */
  background: var(--rf-blue); color: var(--rf-white); border-bottom: var(--rf-line) solid var(--rf-outline); border-radius: 0 0 36px 36px;
  --rf-fg: var(--rf-white); --rf-muted: var(--rf-muted-room); --rf-panel: var(--rf-night); --rf-track: var(--rf-night); --rf-ring: var(--rf-white);
  --rf-focus: var(--accent); --rf-link: var(--accent); --rf-ghost: var(--rf-muted-room); --rf-error: #ffe0ea; /* v2.4: 4.75:1 or better on all 16 room colors (was #ffc2d6: 3.87 spring, 4.15 sky) */
}

/* ---------- Layout ---------- */
.rf-screen {   /* one phone screen: a column, safe-area aware; .rf-push sends what follows into the thumb zone */
  width: 100%; max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 20px;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.rf-push { margin-top: auto; }
.rf-page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px var(--rf-side) 48px; display: flex; flex-direction: column; gap: 24px; }
.rf-stack { display: flex; flex-direction: column; gap: 12px; }
.rf-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rf-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.rf-spacer { flex: 1; }
.rf-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rf-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) {
  .rf-screen--wide { max-width: 1040px; padding-left: 32px; padding-right: 32px; }
  .rf-page { padding: 28px 32px 64px; gap: 32px; }
  .rf-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--rf-gutter); align-items: start; }
}

/* ---------- Type ---------- */
.rf-display, .rf-title, .rf-question, .rf-label, .rf-h2 { margin: 0; font-stretch: 100%; font-variation-settings: normal; }
.rf-display { font-size: var(--rf-fs-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rf-title { font-size: var(--rf-fs-title); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.rf-h2 { font-size: 20px; font-weight: 800; line-height: 1.15; }
.rf-question { font-size: var(--rf-fs-question); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: pretty; overflow-wrap: anywhere; }
.rf-body { font-size: var(--rf-fs-body); font-weight: 500; }
.rf-small { font-size: var(--rf-fs-small); font-weight: 600; }
.rf-label { font-size: var(--rf-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rf-muted); }
.rf-muted { color: var(--rf-muted); }
.rf-num { font-variant-numeric: tabular-nums; }
.rf-codefont { font-size: var(--rf-fs-code); font-weight: 800; letter-spacing: 0.04em; line-height: 1; }

/* ---------- Icons (css/icons.svg) ---------- */
.rf-icon {
  width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
}
.rf-icon--sm { width: 18px; height: 18px; }
.rf-icon--md { width: 28px; height: 28px; }
.rf-icon--lg { width: 40px; height: 40px; stroke-width: 2; }
.rf-icon--bold { stroke-width: 2.75; }
/* A solid shape glyph (ink on an answer tile), and the outlined colored shape that marks a player. */
.rf-shape { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle; fill: currentColor; stroke: none; }
.rf-avatar {
  width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; overflow: visible;
  fill: var(--rf-tile, var(--rf-yellow)); stroke: var(--rf-ink); stroke-width: 3; stroke-linejoin: round;
}
.rf-avatar--md { width: 30px; height: 30px; }
.rf-avatar--lg { width: 132px; height: 132px; stroke-width: 2; filter: drop-shadow(0 6px 0 var(--rf-ink)); }
.rf-avatar--xl { width: 176px; height: 176px; stroke-width: 2; filter: drop-shadow(0 6px 0 var(--rf-ink)); }
.rf-avatar.is-waiting { fill: none; stroke: currentColor; opacity: 0.35; }
.rf-brand { width: 44px; height: 44px; flex: none; }
/* Colors as classes: the four answers (shape i always gets color i), the extra player tints, and the six games. */
.rf-a0, .rf-tint-orange { --rf-tile: var(--rf-orange); }
.rf-a1, .rf-tint-yellow { --rf-tile: var(--rf-yellow); }
.rf-a2, .rf-tint-green { --rf-tile: var(--rf-green); }
.rf-a3, .rf-tint-pink { --rf-tile: var(--rf-pink); }
.rf-tint-lilac { --rf-tile: var(--rf-lilac); }
.rf-tint-teal { --rf-tile: var(--rf-teal); }
[data-game="trivia"] { --rf-game: var(--rf-game-trivia); }
[data-game="bingo"] { --rf-game: var(--rf-game-bingo); }
[data-game="charades"] { --rf-game: var(--rf-game-charades); }
[data-game="words"] { --rf-game: var(--rf-game-words); }
[data-game="mystery"] { --rf-game: var(--rf-game-mystery); }
[data-game="cards"] { --rf-game: var(--rf-game-cards); }

/* ---------- Buttons (all at least 44px; primary 64, secondary 56, icon 52) ---------- */
.rf-btn {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-tile);
  background: var(--rf-white); color: var(--rf-ink); box-shadow: 0 5px 0 var(--rf-outline);
  font: inherit; font-size: 19px; font-weight: 700; line-height: 1.1; text-align: center; text-decoration: none;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
.rf-btn:hover, a.rf-btn:hover { color: var(--rf-ink); }
.rf-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
.rf-btn:disabled, .rf-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }
.rf-btn--primary { min-height: 64px; background: var(--rf-primary); font-size: 22px; font-weight: 800; box-shadow: var(--rf-press); }
.rf-btn--xl { min-height: 76px; border-radius: 24px; font-size: 28px; }
.rf-btn--sm { min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 16px; font-weight: 800; box-shadow: var(--rf-press-sm); }
.rf-btn--block { display: flex; width: 100%; }
.rf-btn--icon { width: 52px; min-height: 52px; padding: 0; border-radius: 16px; flex: none; }
.rf-btn--icon.rf-btn--sm { width: 44px; min-height: 44px; }
/* Outline only, for a second choice on a colored ground ("Change name" on Room Blue). */
.rf-btn--ghost, a.rf-btn--ghost:hover { background: transparent; color: var(--rf-fg); border-color: var(--rf-ghost); box-shadow: none; min-height: 52px; border-radius: 18px; }
.rf-btn--ghost:active:not(:disabled) { transform: none; box-shadow: none; background: rgba(255, 255, 255, 0.08); }
/* Filled with the darker panel color, no outline ("Final scores next"). */
.rf-btn--panel, a.rf-btn--panel:hover { background: var(--rf-panel); color: var(--rf-fg); border-color: transparent; box-shadow: none; border-radius: 18px; }
.rf-btn--panel:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.rf-btn--danger, a.rf-btn--danger:hover { color: var(--rf-danger); }
.rf-btn--link, a.rf-btn--link:hover { min-height: 44px; padding: 0 12px; background: none; border: 0; box-shadow: none; color: var(--rf-link); font-weight: 800; }
.rf-btn--link:active:not(:disabled) { transform: none; box-shadow: none; }
.rf-btn--dashed, .rf-btn--dashed:disabled { background: transparent; color: var(--rf-muted); border-style: dashed; border-color: var(--rf-muted); box-shadow: none; opacity: 1; }
.rf-btn .rf-icon { width: 24px; height: 24px; }
.rf-btn--sm .rf-icon { width: 20px; height: 20px; }
.rf-btn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }   /* "Play again" + a square share key */
.rf-btn-row > .rf-btn--icon { width: 64px; min-height: 64px; border-radius: 20px; }

/* ---------- Form fields ---------- */
.rf-field { display: flex; flex-direction: column; gap: 6px; }
.rf-field > label, .rf-field > .rf-field-label { font-weight: 700; font-size: 16px; }
/* input.rf-input / select.rf-input: (0,1,1), the same weight as v1's input[type="text"], select rule above, and later, so the
   v2 field wins wherever both match (v2.0 integration; P4/P5c asked for it). */
.rf-input, input.rf-input, select.rf-input {
  width: 100%; min-width: 0; min-height: 56px; padding: 0 16px; border: var(--rf-line) solid var(--rf-outline); border-radius: 16px;
  background: var(--rf-white); color: var(--rf-ink); font: inherit; font-size: 20px; font-weight: 600;
}
.rf-input::placeholder, input.rf-input::placeholder { color: #6b72a6; }
.rf-code-input, input.rf-code-input { min-height: 72px; text-align: center; font-size: 44px; font-weight: 800; letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase; }
.rf-error { margin: 0; min-height: 1.4em; font-weight: 700; color: var(--rf-error, var(--rf-danger)); }

/* ---------- Room code ---------- */
.rf-code { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rf-code > span {
  display: flex; align-items: center; justify-content: center; height: 86px; border: var(--rf-line) solid var(--rf-outline); border-radius: 18px;
  background: var(--rf-white); color: var(--rf-ink); font-size: 60px; font-weight: 800; line-height: 1;
}
.rf-code--sm { display: inline-grid; grid-template-columns: repeat(4, 44px); gap: 6px; }
.rf-code--sm > span { height: 52px; border-radius: 12px; font-size: 34px; }
.rf-codepill {   /* "BKTW" in a screen's top bar */
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--rf-r-pill);
  background: var(--rf-panel); color: var(--rf-fg); font-weight: 800; font-size: 20px; letter-spacing: 0.12em;
}
.rf-codepill .rf-codepill-label { font-weight: 600; letter-spacing: 0; color: var(--rf-muted); margin-right: 10px; }

/* ---------- Chips (players) and pills (facts) ---------- */
.rf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 0 14px 0 8px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-pill); background: var(--rf-cream); color: var(--rf-ink);
  font-size: 16px; font-weight: 700; line-height: 1.1;
}
.rf-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-chip--me { background: var(--rf-primary); font-weight: 800; }
.rf-chip--away { opacity: 0.6; }
.rf-chip--away .rf-chip-name { font-style: italic; }
.rf-chip--more { background: transparent; color: var(--rf-muted); border-style: dashed; border-color: var(--rf-muted); padding: 0 16px; font-weight: 700; }
.rf-chip.has-x { padding-right: 0; gap: 4px; }
.rf-chip-x {
  appearance: none; display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -3px -3px -3px 0; padding: 0; border: 0;
  border-radius: 0 999px 999px 0; background: transparent; color: var(--rf-muted-cream); cursor: pointer;
}
.rf-chip-x .rf-icon { width: 16px; height: 16px; stroke-width: 3; }
.rf-chip-x:hover, .rf-chip-x:focus-visible { color: var(--rf-danger); }
.rf-chip .rf-icon { width: 18px; height: 18px; }
.rf-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--rf-r-pill);
  background: var(--rf-panel); color: var(--rf-fg); font-size: 16px; font-weight: 800; line-height: 1.1; white-space: nowrap;
}
.rf-pill--score { background: var(--rf-ink); color: var(--rf-yellow); font-variant-numeric: tabular-nums; }
.rf-pill--accent { background: var(--rf-primary); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); }
.rf-pill--game { background: var(--rf-game, var(--rf-yellow)); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); min-height: 44px; }
.rf-pill--plain { background: var(--rf-white); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); min-height: 44px; }
.rf-pill--good { background: var(--rf-good); color: var(--rf-ink); }
.rf-pill--level-1 { background: var(--rf-green); color: var(--rf-ink); min-height: 28px; padding: 0 10px; font-size: 14px; }
.rf-pill--level-2 { background: var(--rf-yellow); color: var(--rf-ink); min-height: 28px; padding: 0 10px; font-size: 14px; }
.rf-pill--level-3 { background: var(--rf-pink); color: var(--rf-ink); min-height: 28px; padding: 0 10px; font-size: 14px; }
.rf-pill--lg { min-height: 48px; padding: 0 18px; font-size: 26px; }
.rf-pill .rf-icon { width: 20px; height: 20px; }

/* ---------- Segmented control (buttons with aria-pressed, or radio labels) ---------- */
.rf-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: 18px; background: var(--rf-white); color: var(--rf-ink);
}
.rf-seg > button, .rf-seg > label {
  appearance: none; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin: 0;
  padding: 4px 10px; border: 0; border-radius: 13px; background: transparent; color: var(--rf-ink); font: inherit; font-size: 16px;
  font-weight: 700; line-height: 1.15; text-align: center; cursor: pointer; touch-action: manipulation;
}
.rf-seg > button[aria-pressed="true"], .rf-seg > button[aria-checked="true"], .rf-seg > label:has(input:checked) {
  background: var(--rf-primary); font-weight: 800; box-shadow: inset 0 0 0 2px var(--rf-ink);
}
.rf-seg > label > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* v2.21: the difficulty buttons rest (Wiki-guess and Bluff questions have no levels) */
.rf-seg > button:disabled, .seg button:disabled { opacity: 0.5; cursor: default; }
.rf-levelhint { margin: 6px 0 0; }
.options fieldset > .seg { justify-self: start; } /* the v1 setup: the hint under the levels mustn't stretch them */
.rf-seg > label:has(input:focus-visible) { outline: 3px solid var(--rf-focus, var(--rf-link-cream)); outline-offset: 2px; }
.rf-seg--stack { grid-auto-flow: row; }
.rf-seg .rf-icon { width: 20px; height: 20px; }

/* ---------- Timers: a bar and a ring. --rf-p is the fraction left (0..1); .is-low turns them pink. ---------- */
.rf-timer { --rf-p: 1; height: 14px; border-radius: var(--rf-r-pill); background: var(--rf-track); overflow: hidden; }
.rf-timer > i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--rf-primary); transform-origin: left center; transform: scaleX(var(--rf-p)); }
.rf-timer.is-low > i { background: var(--rf-pink); }
/* No script needed: give it --rf-dur (e.g. 20s) and add .is-running; the bar drains once. */
.rf-timer.is-running > i { animation: rf-drain var(--rf-dur, 20s) linear forwards; }
@keyframes rf-drain { from { transform: scaleX(var(--rf-p)); } to { transform: scaleX(0); } }
.rf-ring { --rf-p: 1; position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; color: var(--rf-ring-fg, var(--rf-fg)); }
.rf-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 5; overflow: visible; }
.rf-ring .rf-ring-track { stroke: var(--rf-ring-track, var(--rf-track)); }
.rf-ring .rf-ring-fill { stroke: var(--rf-primary); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--rf-p) * 100); }
.rf-ring.is-low .rf-ring-fill { stroke: var(--rf-pink); }
.rf-ring-num { position: relative; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rf-ring--lg { width: 96px; height: 96px; }
.rf-ring--lg > svg { stroke-width: 4; }
.rf-ring--lg .rf-ring-num { font-size: 34px; }

/* ---------- Progress: "3 of 6 answered", today's dailies, the streak week ---------- */
.rf-answered { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 18px; font-weight: 800; }
.rf-answered-shapes { display: flex; flex-wrap: wrap; gap: 6px; }
.rf-answered-shapes .rf-avatar { width: 26px; height: 26px; }
.rf-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.rf-steps > i { display: block; height: 12px; border-radius: var(--rf-r-pill); background: var(--rf-track); }
.rf-steps > i.is-done { background: var(--rf-good); }
.rf-week { display: flex; gap: 6px; }
.rf-week > i { display: block; width: 12px; height: 28px; border-radius: 6px; background: var(--rf-yellow); }
.rf-week > i.is-missed { background: transparent; border: 2px dashed var(--rf-muted); }
.rf-waiting {   /* "Waiting for the host" with three shapes taking turns */
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: var(--rf-r-pill);
  background: var(--rf-panel); color: var(--rf-fg); font-size: 18px; font-weight: 700;
}
.rf-waiting-dots { display: inline-flex; gap: 5px; }
.rf-waiting-dots .rf-shape { width: 12px; height: 12px; }
.rf-waiting-dots .rf-shape:nth-child(1) { color: var(--rf-orange); }
.rf-waiting-dots .rf-shape:nth-child(2) { color: var(--rf-yellow); opacity: 0.6; }
.rf-waiting-dots .rf-shape:nth-child(3) { color: var(--rf-green); opacity: 0.3; }

/* ---------- Answer tiles: the four shapes ---------- */
.rf-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rf-answer {
  appearance: none; position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 10px;
  min-height: clamp(128px, 24vh, 210px); margin: 0; padding: 16px; border: var(--rf-line) solid var(--rf-outline); border-radius: 26px;
  background: var(--rf-tile, var(--rf-white)); color: var(--rf-ink); box-shadow: var(--rf-press);
  font: inherit; font-size: clamp(20px, 6.4vw, 26px); font-weight: 800; line-height: 1.08; text-align: left; overflow-wrap: break-word; hyphens: auto; text-decoration: none;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out, opacity 0.25s ease;
}
.rf-answer .rf-shape { width: 48px; height: 48px; }
.rf-answer-text { min-width: 0; }
.rf-answer:active:not(:disabled) { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
/* Picked = pressed down + a ring (white on Room Blue, ink on cream). */
.rf-answer.is-picked, .rf-answer[aria-pressed="true"] {
  transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); outline: 4px solid var(--rf-ring, var(--rf-white)); outline-offset: 3px; opacity: 1;
}
.rf-answer:disabled { cursor: default; }
.rf-answers.is-locked .rf-answer:not(.is-picked):not([aria-pressed="true"]) { opacity: 0.35; box-shadow: none; }
.rf-answers.is-revealed .rf-answer:not(.is-right) { opacity: 0.32; box-shadow: none; }
.rf-answers.is-revealed .rf-answer.is-right { opacity: 1; outline: 4px solid var(--rf-ring, var(--rf-white)); outline-offset: 3px; }
.rf-answers.is-revealed .rf-answer.is-wrong { opacity: 0.8; outline: 4px dashed var(--rf-ring, var(--rf-white)); outline-offset: 3px; }
.rf-answer-mark {   /* a check or x badge in the tile's corner after the reveal */
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--rf-white); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-ink);
}
.rf-answer-mark .rf-icon { width: 22px; height: 22px; stroke-width: 3.25; }
.rf-answer-count {   /* how many picked it (TV) */
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.3em; border-radius: var(--rf-r-pill);
  background: var(--rf-ink); color: var(--rf-white); font-size: 0.6em; font-weight: 800; font-variant-numeric: tabular-nums;
}
.rf-answer-count.is-zero { background: rgba(11, 20, 80, 0.2); color: var(--rf-ink); }
/* Long answers, or more than four: one tile per row, shape at the left. */
.rf-answers--list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rf-answers--list .rf-answer { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 72px; padding: 12px 16px; border-radius: 20px; font-size: 21px; }
.rf-answers--list .rf-answer .rf-shape { width: 32px; height: 32px; }
.rf-answer--plain { --rf-tile: var(--rf-white); }
@media (max-width: 340px) {
  .rf-answers:not(.rf-answers--list) { grid-template-columns: minmax(0, 1fr); }
  .rf-answers:not(.rf-answers--list) .rf-answer { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 76px; font-size: 22px; }
  .rf-answers:not(.rf-answers--list) .rf-answer .rf-shape { width: 32px; height: 32px; }
}
@media (min-width: 760px) {
  .rf-answers { gap: 18px; }
  .rf-answer { min-height: min(26vh, 230px); font-size: clamp(26px, 2.4vw, 34px); }
  .rf-answer .rf-shape { width: 56px; height: 56px; }
}

/* ---------- Verdict (phone result) ---------- */
.rf-verdict { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.rf-verdict-badge {
  display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; background: var(--rf-good); color: var(--rf-ink);
  border: 4px solid var(--rf-ink); box-shadow: var(--rf-press);
}
.rf-verdict-badge .rf-icon { width: 64px; height: 64px; stroke-width: 3.25; }
.rf-verdict--wrong .rf-verdict-badge { background: var(--rf-pink); }
.rf-verdict--close .rf-verdict-badge { background: var(--rf-yellow); }
.rf-verdict--none .rf-verdict-badge { background: var(--rf-panel); color: var(--rf-fg); border-color: var(--rf-outline); }
.rf-verdict-title { margin: 0; font-size: 64px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }

/* ---------- Standings rows, the winner, the podium ---------- */
.rf-standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rf-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border: 2px solid var(--rf-panel-line); border-radius: 18px;
  background: var(--rf-panel); color: var(--rf-fg); font-size: 19px;
}
.rf-row-rank { width: 1.3em; flex: none; font-size: 20px; font-weight: 800; color: var(--rf-muted); font-variant-numeric: tabular-nums; }
.rf-row-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-row-gain { padding: 2px 8px; border-radius: var(--rf-r-pill); background: var(--rf-good); color: var(--rf-ink); font-weight: 800; font-size: 0.8em; font-variant-numeric: tabular-nums; }
.rf-row-pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.rf-row-move { width: 18px; height: 18px; stroke-width: 3; }
.rf-row .rf-avatar { width: 26px; height: 26px; }
.rf-row--lead, .rf-row.is-me {
  min-height: 60px; background: var(--rf-primary); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline);
}
.rf-row--lead .rf-row-rank, .rf-row.is-me .rf-row-rank { color: var(--rf-ink); }
.rf-row--lead .rf-row-name, .rf-row.is-me .rf-row-name { font-weight: 800; }
.rf-standings--compact { gap: 6px; }
.rf-standings--compact .rf-row { min-height: 48px; padding: 0 14px; border-radius: 14px; font-size: 17px; }
.rf-standings--compact .rf-row-rank { font-size: 17px; }
.rf-standings--compact .rf-avatar { width: 22px; height: 22px; }
.rf-winner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 20px 28px; text-align: center; overflow: hidden; }
.rf-winner > * { position: relative; }
.rf-winner-name { margin: 0; font-size: var(--rf-fs-display); font-weight: 800; letter-spacing: -0.04em; line-height: 1; overflow-wrap: anywhere; }
.rf-deco { position: absolute !important; left: 0; top: 0; width: 100%; height: 300px; pointer-events: none; }
.rf-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; }
.rf-podium-step {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 12px 6px; min-width: 0;
  background: var(--rf-white); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); border-radius: 18px 18px 8px 8px; box-shadow: var(--rf-press);
  text-align: center;
}
.rf-podium-step .rf-avatar { width: 40px; height: 40px; }
.rf-podium-place { font-size: 34px; font-weight: 800; line-height: 1; }
.rf-podium-name { max-width: 100%; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-podium-pts { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.rf-podium-step--1 { order: 2; min-height: 190px; background: var(--rf-primary); }
.rf-podium-step--2 { order: 1; min-height: 150px; }
.rf-podium-step--3 { order: 3; min-height: 120px; }

/* ---------- Toast ---------- */
.rf-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 32px); min-height: 52px; padding: 10px 18px;
  border: var(--rf-line) solid var(--rf-ink); border-radius: 18px; background: var(--rf-cream); color: var(--rf-ink); box-shadow: var(--rf-press-sm);
  font-size: 17px; font-weight: 700; line-height: 1.25;
}
.rf-toast--good { background: var(--rf-good); }
.rf-toast--bad { background: var(--rf-pink); }
.rf-toast--static { position: static; transform: none; }

/* ---------- Bottom sheet: <dialog class="rf-sheet"> opened with showModal(), or a plain element with .rf-scrim ---------- */
.rf-sheet {
  position: fixed; inset: auto 0 0 0; z-index: 90; box-sizing: border-box; width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh;
  margin: 0 auto; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 20px;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px)); border: 0; border-top: var(--rf-line) solid var(--rf-ink);
  border-radius: 32px 32px 0 0; background: var(--rf-cream); color: var(--rf-ink);
  --rf-fg: var(--rf-ink); --rf-muted: var(--rf-muted-cream); --rf-panel: var(--rf-white); --rf-panel-line: var(--rf-line-cream);
  --rf-track: var(--rf-line-cream); --rf-link: var(--rf-link-cream); --rf-ring: var(--rf-ink); --rf-focus: var(--rf-link-cream);
  --rf-ghost: var(--rf-ink); --rf-error: var(--rf-danger);
}
dialog.rf-sheet:not([open]) { display: none; }
dialog.rf-sheet { top: auto; bottom: 0; }
.rf-sheet::backdrop { background: rgba(11, 20, 80, 0.72); }
.rf-scrim { position: fixed; inset: 0; z-index: 89; background: rgba(11, 20, 80, 0.72); }
.rf-sheet--inline { position: relative; inset: auto; z-index: auto; max-height: none; }
.rf-sheet-grab { align-self: center; width: 48px; height: 5px; flex: none; border-radius: var(--rf-r-pill); background: #c9bfa8; }
.rf-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rf-sheet-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-stretch: 100%; font-variation-settings: normal; line-height: 1.1; }
.rf-close {
  appearance: none; display: grid; place-items: center; width: 48px; height: 48px; flex: none; padding: 0; border: var(--rf-line) solid var(--rf-ink);
  border-radius: 16px; background: var(--rf-white); color: var(--rf-ink); cursor: pointer;
}
.rf-close .rf-icon { stroke-width: 2.75; }
.rf-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rf-action {
  appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 8px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: 20px; background: var(--rf-white); color: var(--rf-ink); box-shadow: 0 5px 0 var(--rf-outline);
  font: inherit; font-size: 16px; font-weight: 800; line-height: 1.15; text-align: center; text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
.rf-action:hover, a.rf-action:hover { color: var(--rf-ink); }
.rf-action:active:not(:disabled) { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
.rf-action .rf-icon { width: 28px; height: 28px; }
.rf-action--primary { background: var(--rf-primary); }
.rf-action--danger, a.rf-action--danger:hover { color: var(--rf-danger); }
.rf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rf-list-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px 6px 14px; border: 2px solid var(--rf-line-cream);
  border-radius: 18px; background: var(--rf-white); color: var(--rf-ink);
}
.rf-list-row .rf-avatar { width: 30px; height: 30px; }
.rf-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rf-list-title { font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-list-sub { font-size: 13px; font-weight: 600; color: var(--rf-muted-cream); }
.rf-list-row.is-away { opacity: 0.75; }

/* ---------- The host bar: a capsule at the top of the host's phone ---------- */
.rf-hostbar {
  display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 8px; border-radius: 22px;
  background: var(--rf-outline); color: var(--rf-white);
}
.rf-hostbar--sticky { position: sticky; top: max(8px, env(safe-area-inset-top, 0px)); z-index: 20; }
.rf-hostbar-count { display: flex; flex-direction: column; padding-left: 4px; line-height: 1.05; }
.rf-hostbar-count b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rf-hostbar-count small { font-size: 13px; font-weight: 600; color: var(--rf-muted-room); }
.rf-hostbar-btn {
  appearance: none; display: grid; place-items: center; width: 48px; height: 48px; flex: none; padding: 0; border: 0; border-radius: 14px;
  background: var(--rf-blue); color: var(--rf-white); text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.rf-hostbar-btn:hover, a.rf-hostbar-btn:hover { color: var(--rf-white); }
.rf-hostbar-btn:active:not(:disabled) { transform: translateY(2px); }
.rf-hostbar-btn .rf-icon { width: 22px; height: 22px; stroke-width: 2.6; }
.rf-hostbar-btn--go, a.rf-hostbar-btn--go:hover { width: 56px; background: var(--rf-primary); color: var(--rf-ink); }
.rf-hostbar-btn--plain { width: 44px; background: transparent; }
.rf-hostbar-btn[aria-pressed="true"] { background: var(--rf-primary); color: var(--rf-ink); }
.rf-hostbar { --rf-ring-fg: var(--rf-white); --rf-ring-track: var(--rf-blue); }
.rf-hostbadge {   /* "This phone is the host" */
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: var(--rf-line) solid var(--rf-outline);
  border-radius: var(--rf-r-pill); background: var(--rf-primary); color: var(--rf-ink); font-size: 16px; font-weight: 800;
}
.rf-hostbadge .rf-icon { width: 20px; height: 20px; }

/* ---------- Daily: the streak card and a row per daily ---------- */
.rf-streak {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--rf-r-card); background: var(--rf-ink); color: var(--rf-white);
  --rf-muted: var(--rf-muted-room); --rf-track: var(--rf-blue);
}
.rf-streak-top { display: flex; align-items: center; gap: 14px; }
.rf-streak-flame { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 20px; background: var(--rf-yellow); color: var(--rf-ink); }
.rf-streak-flame .rf-icon { width: 36px; height: 36px; }
.rf-streak-num { display: flex; flex-direction: column; line-height: 1; }
.rf-streak-num b { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rf-streak-num span { font-size: 16px; font-weight: 700; color: var(--rf-muted-room); }
.rf-streak .rf-week { margin-left: auto; }
.rf-streak .rf-week > i.is-missed { border-color: var(--rf-muted-room); }
.rf-dailies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rf-daily {
  display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 10px 12px 10px 16px; border: var(--rf-line) solid var(--rf-outline);
  border-radius: 22px; background: var(--rf-white); color: var(--rf-ink); text-decoration: none;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
a.rf-daily:hover { color: var(--rf-ink); }
.rf-daily-icon {
  display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: var(--rf-line) solid var(--rf-outline); border-radius: 16px;
  background: var(--rf-game, var(--rf-yellow)); color: var(--rf-ink);
}
.rf-daily-icon .rf-icon { width: 28px; height: 28px; }
.rf-daily-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rf-daily-title { font-size: 20px; font-weight: 800; line-height: 1.15; }
.rf-daily-sub { font-size: 15px; font-weight: 600; color: var(--rf-muted-cream); }
.rf-daily-done { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: var(--rf-line) solid var(--rf-ink); border-radius: 50%; background: var(--rf-good); color: var(--rf-ink); }
.rf-daily-done .rf-icon { width: 18px; height: 18px; stroke-width: 3.25; }
.rf-daily-play { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; flex: none; border-radius: 14px; background: var(--rf-ink); color: var(--rf-white); font-size: 17px; font-weight: 800; }
.rf-daily--todo { background: var(--rf-game, var(--rf-yellow)); box-shadow: 0 5px 0 var(--rf-outline); }
.rf-daily--todo .rf-daily-icon { background: var(--rf-cream); }
.rf-daily--todo .rf-daily-sub { color: var(--rf-ink); font-weight: 700; }
a.rf-daily--todo:active { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }

/* ---------- Games: a chip, a tile for the "Next game" strip ---------- */
.rf-gamechip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border: var(--rf-line) solid var(--rf-outline);
  border-radius: var(--rf-r-pill); background: var(--rf-game, var(--rf-yellow)); color: var(--rf-ink); font-size: 20px; font-weight: 800; text-decoration: none;
}
a.rf-gamechip:hover { color: var(--rf-ink); }
.rf-gamestrip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 10px; margin-right: calc(-1 * var(--rf-side)); scrollbar-width: none; }
.rf-gamestrip::-webkit-scrollbar { display: none; }
.rf-gametile {
  appearance: none; flex: 0 0 92px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 100px; padding: 8px 4px; border: var(--rf-line) solid var(--rf-outline); border-radius: 20px; background: var(--rf-game, var(--rf-yellow));
  color: var(--rf-ink); box-shadow: var(--rf-press-sm); font: inherit; font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
a.rf-gametile:hover, .rf-gametile:hover { color: var(--rf-ink); }
.rf-gametile:active:not(:disabled) { transform: translateY(3px); box-shadow: var(--rf-pressed); }
.rf-gametile .rf-icon { width: 28px; height: 28px; }

/* ---------- Rate the question ---------- */
.rf-rate { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px; font-weight: 700; color: var(--rf-muted); }
.rf-rate button {
  appearance: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: var(--rf-line) solid var(--rf-ink);
  border-radius: 18px; background: var(--rf-white); color: var(--rf-ink); cursor: pointer;
}
.rf-rate button[aria-pressed="true"] { background: var(--rf-primary); }
.rf-rate .rf-icon { width: 26px; height: 26px; }

/* ---------- Ad slot. P8 fills it; this is only how it looks. Dashed placeholder while ads are off (?adpreview=1). ---------- */
.rf-ad { display: grid; place-items: center; width: 100%; max-width: 728px; margin: 0 auto; }
.rf-ad--banner { max-width: 360px; min-height: 96px; }    /* 320 x 50 or 320 x 100 */
.rf-ad--box { max-width: 336px; min-height: 250px; }      /* 300 x 250 */
.rf-ad--leader { min-height: 96px; }                      /* 728 x 90 */
.rf-ad--preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--rf-muted);
  border-radius: 16px; color: var(--rf-muted); text-align: center;
}
.rf-ad-label { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rf-ad-size { font-size: 13px; font-weight: 500; }

/* ---------- QR frame ---------- */
.rf-qr { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; }
.rf-qr-box { display: block; width: 112px; height: 112px; flex: none; padding: 6px; border: var(--rf-line) solid var(--rf-ink); border-radius: 12px; background: var(--rf-white); }
.rf-qr-box > canvas, .rf-qr-box > svg, .rf-qr-box > img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.rf-qr--lg .rf-qr-box { width: 240px; height: 240px; padding: 12px; border-radius: 20px; }
.rf-qr figcaption, .rf-qr-caption { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.rf-invite { display: flex; align-items: center; gap: 14px; }
.rf-invite-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rf-invite-url { font-size: 18px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }

/* ---------- Confetti hook: a script adds <div class="rf-confetti" aria-hidden="true"> with <i class="rf-s0..3 rf-a0..3">
   pieces, sets --rf-x (left), --rf-r (spin), --rf-d (delay) on each, and removes it after 1.6s. Never loops. ---------- */
.rf-confetti { position: fixed; inset: 0; z-index: 85; overflow: hidden; pointer-events: none; }
.rf-confetti > i {
  position: absolute; top: -32px; left: var(--rf-x, 50%); width: var(--rf-size, 16px); height: var(--rf-size, 16px);
  background: var(--rf-tile, var(--rf-yellow)); transform: rotate(var(--rf-r, 0deg)); opacity: 0;
}
.rf-s0 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.rf-s1 { border-radius: 50%; }
.rf-s2 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rf-s3 { border-radius: 3px; }

/* ---------- Motion. Everything moves only when the viewer hasn't asked for less. ---------- */
@keyframes rf-pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rf-rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rf-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.05); } }
@keyframes rf-toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes rf-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rf-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(var(--rf-r, 0deg)); }
  100% { opacity: 0.9; transform: translate(var(--rf-dx, 0px), 110vh) rotate(calc(var(--rf-r, 0deg) + 540deg)); }
}
@keyframes rf-turn { 0%, 100% { opacity: 0.3; } 33% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .rf-pop { animation: rf-pop 0.42s var(--rf-ease-pop) both; animation-delay: var(--rf-delay, 0s); }   /* a new player's chip */
  .rf-rise { animation: rf-rise 0.4s ease-out both; animation-delay: var(--rf-delay, 0s); }            /* standings sliding in */
  .rf-answers.is-revealed .rf-answer.is-right { animation: rf-bump 0.6s ease-in-out 2; }               /* the reveal */
  .rf-verdict .rf-verdict-badge { animation: rf-pop 0.5s var(--rf-ease-pop) both; }
  .rf-verdict .rf-verdict-title { animation: rf-pop 0.55s 0.08s var(--rf-ease-pop) both; }
  .rf-toast:not(.rf-toast--static) { animation: rf-toast-in 0.25s ease-out both; }
  .rf-sheet[open], .rf-sheet.is-open { animation: rf-sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .rf-waiting-dots .rf-shape { animation: rf-turn 1.2s ease-in-out infinite; }
  .rf-waiting-dots .rf-shape:nth-child(2) { animation-delay: 0.4s; }
  .rf-waiting-dots .rf-shape:nth-child(3) { animation-delay: 0.8s; }
  .rf-confetti > i { animation: rf-fall var(--rf-t, 1.2s) cubic-bezier(0.2, 0.6, 0.4, 1) var(--rf-d, 0s) forwards; }
  .rf-timer > i { transition: transform 0.25s linear; }
  .rf-ring .rf-ring-fill { transition: stroke-dashoffset 0.25s linear; }
}
@media (prefers-reduced-motion: reduce) {
  .rf-confetti { display: none; }
  .rf-timer.is-running > i { animation: none; }
  .rf-btn, .rf-answer, .rf-action, .rf-daily, .rf-gametile { transition: none; }
}

/* ---------- TV ("10-foot"): body.rf-tv on the Night ground. Read-only: nothing on it looks tappable, so no outlines or
   shadows on tiles, chips or pills; no text under 28px. Sizes scale with the screen (design px at 1920 wide). ---------- */
.rf-tv {
  --rf-fs-display: clamp(64px, 6.25vw, 180px);
  --rf-fs-title: clamp(48px, 3.75vw, 108px);
  --rf-fs-question: clamp(44px, 4.17vw, 120px);
  --rf-fs-body: clamp(28px, 1.875vw, 54px);
  --rf-fs-small: clamp(28px, 1.56vw, 46px);
  --rf-fs-label: clamp(28px, 1.46vw, 42px);
  --rf-fs-code: clamp(120px, 10.4vw, 300px);
  font-size: var(--rf-fs-body);
  overflow-x: hidden;
}
.rf-tv-stage {
  position: relative; display: flex; flex-direction: column; gap: clamp(24px, 2.2vw, 64px); min-height: 100vh; min-height: 100dvh;
  padding: clamp(24px, 2.9vw, 84px) clamp(32px, 4.6vw, 132px) clamp(28px, 3.3vw, 96px); overflow: hidden;
}
.rf-tv-bar { display: flex; align-items: center; gap: clamp(14px, 1.04vw, 30px); flex-wrap: wrap; }
.rf-tv .rf-question { font-size: var(--rf-fs-question); letter-spacing: -0.03em; line-height: 1.05; max-width: 82%; text-wrap: balance; }
.rf-tv .rf-label { font-size: var(--rf-fs-label); }
.rf-tv .rf-pill, .rf-tv .rf-codepill, .rf-tv .rf-gamechip {
  min-height: clamp(52px, 3.125vw, 90px); padding: 0 clamp(18px, 1.25vw, 36px); gap: 0.45em; border: 0; font-size: clamp(28px, 1.56vw, 46px);
}
.rf-tv .rf-pill .rf-icon, .rf-tv .rf-gamechip .rf-icon { width: 1.1em; height: 1.1em; }
.rf-tv .rf-chips { gap: clamp(12px, 0.94vw, 28px); }
.rf-tv .rf-chip { min-height: clamp(60px, 3.96vw, 114px); gap: 0.45em; padding: 0 0.95em 0 0.5em; border: 0; font-size: clamp(28px, 1.67vw, 48px); font-weight: 800; }
.rf-tv .rf-chip .rf-avatar { width: 1.4em; height: 1.4em; }
.rf-tv .rf-chip--more { border: 4px dashed var(--rf-muted); }
.rf-tv .rf-answers { gap: clamp(16px, 1.46vw, 42px); }
.rf-tv .rf-answer {
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.5em; min-height: clamp(120px, 15vh, 260px); padding: 0 0.6em;
  border: 0; border-radius: clamp(24px, 2.08vw, 60px); box-shadow: none; font-size: clamp(40px, 3.75vw, 108px); cursor: default;
}
.rf-tv .rf-answer .rf-shape { width: 1.33em; height: 1.33em; }
.rf-tv .rf-answer-count { font-size: max(28px, 0.6em); }
.rf-tv .rf-answer-text { flex: 1; }
.rf-tv .rf-answers.is-revealed .rf-answer:not(.is-right) { opacity: 0.28; }
.rf-tv .rf-answers.is-revealed .rf-answer.is-right { outline: 0.1em solid var(--rf-white); outline-offset: 0.08em; }
.rf-tv .rf-timer { height: clamp(14px, 1.25vw, 36px); }
.rf-tv .rf-code { display: flex; gap: clamp(14px, 1.46vw, 42px); }
.rf-tv .rf-code > span {
  width: 1.1em; height: 1.3em; border-width: 0.03em; border-radius: 0.2em; background: var(--rf-cream); box-shadow: 0 0.07em 0 var(--rf-ink);
  font-size: var(--rf-fs-code);
}
.rf-tv .rf-qr-box { width: clamp(220px, 25vw, 720px); height: clamp(220px, 25vw, 720px); padding: 0.4em; border-width: 6px; border-radius: 36px; }
.rf-tv .rf-qr figcaption, .rf-tv .rf-qr-caption { font-size: clamp(28px, 1.875vw, 54px); gap: 0.4em; }
.rf-tv .rf-qr figcaption .rf-icon, .rf-tv .rf-qr-caption .rf-icon { width: 1.1em; height: 1.1em; }
.rf-tv .rf-answered { font-size: clamp(28px, 1.875vw, 54px); gap: 0.6em; }
.rf-tv .rf-answered-shapes { gap: 0.4em; }
.rf-tv .rf-answered-shapes .rf-avatar { width: 1.55em; height: 1.55em; }
.rf-tv .rf-standings { gap: clamp(10px, 0.73vw, 21px); }
.rf-tv .rf-row { min-height: clamp(64px, 4.6vw, 132px); padding: 0 0.7em; border: 0; border-radius: 0.6em; font-size: clamp(28px, 2.08vw, 60px); gap: 0.55em; }
.rf-tv .rf-row-rank { font-size: 1em; }
.rf-tv .rf-row .rf-avatar { width: 1.2em; height: 1.2em; }
.rf-tv .rf-row--lead { border: 0; }
.rf-tv .rf-row-move { width: 0.8em; height: 0.8em; }
.rf-tv .rf-ring { width: clamp(80px, 6.25vw, 180px); height: clamp(80px, 6.25vw, 180px); }
.rf-tv .rf-ring > svg { stroke-width: 4; }
.rf-tv .rf-ring-num { font-size: clamp(32px, 2.5vw, 72px); }
.rf-tv .rf-waiting { min-height: clamp(60px, 3.96vw, 114px); padding: 0 0.9em; font-size: clamp(28px, 1.67vw, 48px); }
.rf-tv .rf-waiting-dots .rf-shape { width: 0.5em; height: 0.5em; }
.rf-tv .rf-avatar--xl { width: clamp(176px, 14vw, 400px); height: clamp(176px, 14vw, 400px); }
.rf-tv .rf-icon { width: 1.2em; height: 1.2em; }
.rf-tv-tile {   /* a flat rounded square holding an icon ("Read the TV") */
  display: inline-grid; place-items: center; width: clamp(64px, 3.96vw, 114px); height: clamp(64px, 3.96vw, 114px); flex: none;
  border-radius: 0.32em; background: var(--rf-panel); color: var(--rf-white);
}
.rf-tv-hint { display: inline-flex; align-items: center; gap: 0.55em; font-weight: 700; }
.rf-pill.rf-muted, .rf-codepill.rf-muted { color: var(--rf-muted); }

/* v2.0 admin page: Daily content (js/admin-daily.js, P10). Approved = mint, Not yet = the accent outline, No content = muted. */
.dc-table { font-size: 0.95rem; }
.dc-table th.dc-head { white-space: nowrap; font-size: 0.8rem; }
.dc-table th.dc-day { white-space: nowrap; font-weight: 500; color: var(--paper-dim); }
.dc-table tr.dc-today th.dc-day strong { color: var(--accent); }
.dc-tag { margin-left: 6px; font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.dc-cell { padding: 4px 4px; }
.dc-toggle { min-height: 44px; min-width: 80px; padding: 6px 8px; border-radius: 10px; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.dc-toggle.dc-ok { background: var(--good); color: #0b1a3a; border: 2px solid var(--good); }
.dc-toggle.dc-wait { background: transparent; color: var(--accent); border: 2px dashed var(--accent); }
.dc-toggle:focus-visible { outline: 3px solid var(--paper-dim); outline-offset: 2px; }
.dc-none { color: var(--muted); font-size: 0.85rem; }
.dc-ok-text { color: var(--good); font-size: 0.85rem; }
.dc-wait-text { color: var(--accent); font-size: 0.85rem; }
.dc-actions { white-space: nowrap; }
.dc-actions .btn { min-height: 44px; margin: 2px; }
.dc-review-box { padding: 8px 4px 16px; }
.dc-parts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.dc-part { background: var(--deep); border-radius: 14px; padding: 12px 14px; }
.dc-part h4 { margin: 0 0 6px; }
.dc-part ol, .dc-part ul { padding-left: 1.2em; margin: 6px 0; }
.dc-part li { margin-bottom: 6px; }
table.board.dc-bingo { width: auto; font-size: 0.9rem; }
table.board.dc-bingo td, table.board.dc-bingo th { text-align: center; padding: 4px 8px; }

/* ---------- Done (v2.0 P11): every final screen's way back to the game's menu; the TV's final says to tap it ---------- */
.rf-done-row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; margin-top: 8px; }
.rf-done-hint { margin: 0; text-align: center; }
.rf-tv-done { display: flex; align-items: center; justify-content: center; gap: 0.5em; margin: 0; color: var(--rf-muted); font-weight: 700; font-size: clamp(22px, 1.46vw, 42px); text-align: center; }
.rf-tv-done .rf-icon { width: 1.1em; height: 1.1em; flex: none; }
/* ---------- Party colors panel (v2.0 P12, js/theme.js RoomfulTheme.picker / [data-theme-picker]). The panel is Room Blue,
   so it takes the scheme you pick at once: the change shows right where you tapped, even on a cream page. ---------- */
.rf-themes {
  background: var(--rf-blue); color: var(--rf-white); border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-card);
  box-shadow: var(--rf-press-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; font-family: var(--font);
  font-stretch: 100%; font-variation-settings: normal; text-align: left;
}
.rf-themes-slot:empty { display: none; }
.rf-themes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rf-themes .rf-themes-head .rf-themes-title { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.3; font-weight: 800; font-stretch: 100%;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--rf-white); }
.rf-themes-name { font-size: 18px; font-weight: 800; color: var(--rf-white); }
.rf-themes .theme-picker.rf-themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.rf-themes .theme-picker button {
  width: 100%; min-width: 44px; min-height: 44px; aspect-ratio: 1; padding: 3px; margin: 0; border-radius: 50%;
  border: 3px solid transparent; background: transparent; box-shadow: none; display: grid; place-items: center; cursor: pointer; color: var(--rf-white);
}
.rf-themes .theme-picker .swatch { width: 100%; height: 100%; max-width: 40px; max-height: 40px; border-radius: 50%; border: 2px solid var(--rf-white); }
.rf-themes .theme-picker button:hover { border-color: var(--rf-muted-room); }
.rf-themes .theme-picker button[aria-pressed="true"] { border-color: var(--rf-white); background: var(--rf-outline); box-shadow: none; }
.rf-themes .theme-picker button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rf-themes-note { margin: 0; font-size: var(--rf-fs-small); font-weight: 600; color: var(--rf-muted-room); }
.rf-themes--compact { padding: 12px; gap: 8px; box-shadow: none; }
.rf-sheet .rf-themes { margin-top: 8px; }

/* ---------- Reveal effects (v2.0 P12, js/fx.js RoomfulFx): right tile bump, wrong tile shake, a number that pops, and the
   shape flash (four shapes bursting out of a tile). Nothing moves for prefers-reduced-motion. ---------- */
.rf-fx-flash { position: fixed; left: var(--rf-fx-x, 50%); top: var(--rf-fx-y, 40%); width: 0; height: 0; z-index: 86; pointer-events: none; }
.rf-fx-flash > i { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; background: var(--rf-tile, var(--rf-yellow)); opacity: 0; }
@keyframes rf-fx-burst {
  0% { transform: translate(0, 0) scale(0.3); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--rf-fx-dx, 0px), var(--rf-fx-dy, 0px)) scale(1) rotate(200deg); opacity: 0; }
}
@keyframes rf-fx-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes rf-fx-bump { 0% { transform: scale(1); } 35% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes rf-fx-pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .rf-fx-flash > i { animation: rf-fx-burst 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
  .rf-fx-right { animation: rf-fx-bump 0.45s var(--rf-ease-pop) 2; }
  .rf-fx-wrong { animation: rf-fx-shake 0.45s ease-in-out 1; }
  .rf-fx-pop { animation: rf-fx-pop 0.5s var(--rf-ease-pop) both; animation-delay: var(--rf-delay, 0s); }
}
@media (prefers-reduced-motion: reduce) { .rf-fx-flash { display: none; } }
/* The high-score star on a scheme's ground: ink (the dark gold is for cream only). */
:root[data-theme] .tg-final .tg-record .rf-icon { color: var(--rf-ink); }

/* ---------- v2.20: the one page header (tools/site_header.py), on every Roomful page ---------- */
:is(.rf-pages, .rf-site) .landing-top { gap: 10px 16px; margin-bottom: 18px; min-height: 52px; }
:is(.rf-pages, .rf-site) .landing-top .wordmark {
  display: inline-flex; align-items: center; gap: 10px; color: var(--rf-ink); font-size: 26px; font-weight: 800; letter-spacing: -0.03em;
  text-decoration: none; min-height: 44px;
}
:is(.rf-pages, .rf-site) .landing-top .wordmark .rf-brand { width: 40px; height: 40px; }   /* the four-shape mark, inline from the sprite (shell()) */
:is(.rf-pages, .rf-site) .landing-top .wordmark .dot { display: none; }
:is(.rf-pages, .rf-site) .landing-top nav { display: flex; flex-wrap: wrap; gap: 6px; }
:is(.rf-pages, .rf-site) .landing-top nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--rf-ink);
  font-size: 16px; font-weight: 700; text-decoration: none;
}
:is(.rf-pages, .rf-site) .landing-top nav a:hover { background: var(--rf-white); color: var(--rf-ink); }
@media (max-width: 759px) {
  /* Phones: the wordmark, then the games wrapping onto a second row when they must (v2.2, FIX-C, QA-C #8: the one-row
     scroller hid Trivia/Words off the right edge with no cue at 360-412 px; the dailies already wrapped, P13). */
  :is(.rf-pages, .rf-site) .landing-top { flex-wrap: wrap; row-gap: 4px; margin-bottom: 10px; }
  :is(.rf-pages, .rf-site) .landing-top .wordmark { font-size: 22px; flex: none; }
  :is(.rf-pages, .rf-site) .landing-top .wordmark .rf-brand { width: 34px; height: 34px; }
  :is(.rf-pages, .rf-site) .landing-top nav { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; overflow-x: visible; gap: 0 2px; margin: 0 -10px; padding: 0; }
  :is(.rf-pages, .rf-site) .landing-top nav a { flex: none; padding: 0 10px; font-size: 15px; }
}

:is(.rf-pages, .rf-site) .crumbs { font-size: 0.95rem; font-weight: 600; margin: 4px 0 0; color: var(--rf-muted-cream); }
:is(.rf-pages, .rf-site) .crumbs a { color: var(--rf-link-cream); }
.rf-topblock { display: flow-root; }
body.rf-site > .rf-topblock { width: 100%; max-width: 1080px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
body[data-noheader] .rf-topblock { display: none; }   /* game screens: the header is in the page, never shown (an attribute: js/host.js rewrites the body's classes) */
/* Roomful Trivia's own links: a second row of chips under the shared header (scrolls sideways on a phone, never wraps) */
.rf-subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.rf-subnav::-webkit-scrollbar { display: none; }
.rf-subnav .rf-gamechip { flex: none; min-height: 44px; padding: 0 14px; font-size: 16px; background: var(--rf-white); }
.rf-subnav .rf-gamechip[aria-current] { background: var(--rf-game); }
.rf-home-head { display: flex; flex-direction: column; gap: 2px; }
:is(.rf-pages, .rf-site) .rf-home-title { margin: 0; font-size: clamp(1.6rem, 6.6vw, 2.6rem); line-height: 1.05; text-wrap: balance; font-weight: 800; }
.rf-home-tag { margin: 0; font-size: 18px; font-weight: 700; color: var(--rf-muted-cream); }
:is(.rf-home-top[data-game], .rf-home-head[data-game]) .rf-home-tag::before, .rf-home-tag--dot::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--rf-ink); border-radius: 50%;
  background: var(--rf-game, var(--rf-white)); vertical-align: 1px;
}
/* v2.20: real screenshots of the games (tools/make_game_shots.js) */
.rf-shot { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 14px; }
.rf-shots { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 14px 0; }
.rf-shots .rf-shot { margin: 0; flex: 1 1 280px; min-width: 0; object-fit: contain; }
.rf-shots .rf-shot:last-child { flex: 0 1 180px; }
/* v2.24 (R3): the Host Pass (js/pass.js): the host setups' one quiet line under Open, and the /pass and /pass/thanks pages. */
.rf-pass-line { margin: 10px 0 0; font-size: var(--rf-fs-small); font-weight: 600; color: var(--rf-muted); text-align: center; }
.rf-pass-line a { color: inherit; text-decoration: underline; }
.rf-pass-line.is-bad, .rf-pass-say.is-bad, .rf-pass-status.is-bad { color: var(--rf-error, var(--rf-danger)); }
.rf-pass-say.is-good { color: var(--rf-ink); }
.rf-pass-picks { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rf-pass-pick { margin: 0; padding: 18px; border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-tile); background: var(--rf-white); color: var(--rf-ink); }
.rf-pass-pick h3 { margin: 0 0 6px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.rf-pass-price { font-size: 1.3em; font-weight: 800; }
.rf-pass-pick .rf-btn { width: 100%; margin-top: 6px; }
.rf-pass-off { font-weight: 700; }
.rf-pass-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 0.08em; }
.rf-pass-code--big { margin: 8px 0 14px; font-size: clamp(28px, 8vw, 44px); text-align: center; user-select: all; }
.rf-pass-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.rf-pass-row .rf-input { flex: 1 1 220px; text-transform: uppercase; letter-spacing: 0.06em; }
.rf-pass-row .rf-btn { flex: 0 0 auto; }
.rf-pass-mine { margin: 18px 0; padding: 14px 18px; border-radius: var(--rf-r-tile); border: var(--rf-line) solid var(--rf-outline); background: var(--rf-white); color: var(--rf-ink); }
.rf-pass-mine h2 { margin-top: 0; }
.rf-pass-thanks { max-width: 640px; }
@media (max-width: 559px) { .rf-pass-row .rf-btn { width: 100%; } }
