/* 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: #111c6b;
  --deep: #0b1450;
  --paper: #fff6e5;
  --paper-dim: #d9d3ff;
  --ink: #14183a;
  --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 (common.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.92rem; 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; } }
.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); }

@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); }

/* 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; }

/* 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; }
.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.8rem; color: #5a5f86; }
.feedback-form .optional { font-weight: 500; color: #5a5f86; }
.feedback-form .hint { font-size: 0.85rem; }
.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; }

/* ---------- 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; }
}
