:root {
  --bg: #141316;
  --bg-clear: rgba(20, 19, 22, 0);
  --bg-raised: #1f1e22;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #ffffff;
  --ink-soft: #dcd8d2;
  --ink-muted: #9d988f;
  --dark: #141316;
  --dark-soft: rgba(20, 19, 22, 0.08);
  --dark-shadow: rgba(20, 19, 22, 0.18);
  --paper: #fbf8f2;
  --paper-tint: #f3efe8;
  --paper-mine: #ece6da;
  --paper-ink: #6d675e;
  --paper-muted: #9a948a;
  --well: rgba(0, 0, 0, 0.25);
  --glow: rgba(255, 210, 63, 0.07);
  --yellow-text: var(--yellow);
  --pink-text: var(--pink);
  --yellow: #ffd23f;
  --yellow-shadow: #c99700;
  --pink: #ff8fb1;
  --pink-ink: #c2185b;
  --radius: 22px;
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --dock-h: 0px;
  color-scheme: dark;
}

/* ── Themes ─────────────────────────────────────────────────────────────
   Charcoal (above) is the default. Each phone picks its own theme on the home screen
   or in the party sheet, and app.js sets it as data-theme on <html>. */

:root[data-theme='midnight'] {
  --bg: #0e1320;
  --bg-clear: rgba(14, 19, 32, 0);
  --bg-raised: #171e2e;
  --ink-soft: #cdd5e3;
  --ink-muted: #8b96aa;
  --dark: #0e1320;
  --dark-soft: rgba(14, 19, 32, 0.08);
  --dark-shadow: rgba(14, 19, 32, 0.18);
  --paper-tint: #eef1f6;
  --paper-mine: #e6eaf2;
  --paper-ink: #5b6476;
  --paper-muted: #8b93a3;
  --glow: rgba(255, 210, 63, 0.06);
}

/* The original look. */
:root[data-theme='purple'] {
  --bg: #1b1036;
  --bg-clear: rgba(27, 16, 54, 0);
  --bg-raised: #2a1b52;
  --surface: rgba(255, 255, 255, 0.07);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.14);
  --ink-soft: #d6ccf5;
  --ink-muted: #a597d4;
  --dark: #1b1036;
  --dark-soft: rgba(27, 16, 54, 0.08);
  --dark-shadow: rgba(27, 16, 54, 0.18);
  --paper: #fffaf0;
  --paper-tint: #efe9fb;
  --paper-mine: #e4dcfb;
  --paper-ink: #5d4f8a;
  --paper-muted: #8a7fb0;
  --glow: rgba(255, 143, 177, 0.16);
}

/* The one light theme. Yellow and pink are too pale for text on cream, so text uses darker steps. */
:root[data-theme='cream'] {
  --bg: #f6f1e7;
  --bg-clear: rgba(246, 241, 231, 0);
  --bg-raised: #fffdf8;
  --surface: #fffdf8;
  --surface-strong: #ece5d6;
  --line: rgba(33, 29, 26, 0.12);
  --ink: #211d1a;
  --ink-soft: #4b453f;
  --ink-muted: #857d73;
  --dark: #211d1a;
  --dark-soft: rgba(33, 29, 26, 0.07);
  --dark-shadow: rgba(33, 29, 26, 0.16);
  --paper: #fffdf8;
  --paper-tint: #f4efe4;
  --paper-mine: #f1ead9;
  --well: #ece5d6;
  --glow: transparent;
  --yellow-text: #9a7000;
  --pink-text: var(--pink-ink);
  color-scheme: light;
}
:root[data-theme='cream'] :is(.panel, .tile, .player-chip, .intensity-option) { box-shadow: 0 1px 2px rgba(33, 29, 26, 0.06); }
:root[data-theme='cream'] .btn:not(.btn-primary, .btn-dark, .btn-ghost) { box-shadow: 0 3px 0 rgba(33, 29, 26, 0.14), inset 0 0 0 1px var(--line); }
:root[data-theme='cream'] .btn:not(.btn-primary, .btn-dark, .btn-ghost):active:not(:disabled) { box-shadow: 0 1px 0 rgba(33, 29, 26, 0.14), inset 0 0 0 1px var(--line); }
:root[data-theme='cream'] .logo-word span { -webkit-text-stroke: 0.07em var(--ink); paint-order: stroke fill; }
:root[data-theme='cream'] .logo-mark .echo { filter: saturate(0) brightness(0.6); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
button, .tile, .answer-card, .chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(48rem 30rem at 50% -12%, var(--glow), transparent 65%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.35rem; line-height: 1.2; }

/* ── Layout ─────────────────────────────────────────────────────────── */

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--dock-h) + 28px);
}
.top:not([hidden]) + .app { padding-top: 6px; }

.screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; animation: enter 0.28s ease-out; }
.center { text-align: center; }
.muted { color: var(--ink-muted); }
.lead { color: var(--ink-soft); text-align: center; font-size: 1.05rem; }
.eyebrow { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.big-emoji { font-size: 3.4rem; line-height: 1; }
.center-screen { min-height: 60dvh; place-content: center; justify-items: center; text-align: center; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(var(--bg) 70%, var(--bg-clear));
}
.top-mid { font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; white-space: nowrap; }

.dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  padding: 22px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(var(--bg-clear), var(--bg) 26px);
  pointer-events: none;
}
.typing .dock { display: none; }
.dock-inner { max-width: 520px; margin: 0 auto; display: grid; gap: 10px; pointer-events: auto; }
.dock-note {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 999px;
}
.countdown { position: relative; overflow: hidden; isolation: isolate; }
.countdown-fill { position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, 0.35); transform-origin: left; animation: countdown linear forwards; }
.dock-note.countdown .countdown-fill { background: rgba(255, 210, 63, 0.18); }
.host-tools { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.host-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); }

/* ── Buttons & inputs ───────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--dark);
  background: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .tile:focus-visible, .answer-card:focus-visible, .chip:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.btn.busy:disabled { opacity: 1; cursor: progress; animation: breathe 0.9s ease-in-out infinite; }
.btn-primary { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-shadow); }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--yellow-shadow); }
.btn-big { width: 100%; font-size: 1.2rem; padding: 18px 20px; border-radius: 20px; }
.btn-ghost { background: var(--surface-strong); color: var(--ink); box-shadow: none; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-small { font-size: 0.9rem; padding: 8px 14px; border-radius: 12px; }
.link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  justify-self: center;
  padding: 6px;
}

.text-input {
  width: 100%;
  background: var(--well);
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1.15rem;
  outline: none;
  transition: border-color 0.15s;
}
.text-input::placeholder { color: var(--ink-muted); }
.text-input:focus { border-color: var(--yellow); }

.field-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  font-weight: 600;
  cursor: pointer;
}
.chip-code { letter-spacing: 0.12em; padding-left: 10px; }

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-strong);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Home & join ────────────────────────────────────────────────────── */

.logo { text-align: center; padding-top: 18px; }
.logo-mark { position: relative; display: inline-block; font-size: 4.2rem; line-height: 1; animation: bob 3s ease-in-out infinite; }
.logo-mark .echo { position: absolute; left: 0.42em; top: -0.06em; opacity: 0.32; filter: saturate(0) brightness(1.4); z-index: -1; }
.logo-word { font-size: 3.1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-top: 6px; }
.logo-word span { color: var(--yellow); }
.tagline { color: var(--ink-soft); margin-top: 10px; font-size: 1.1rem; }
.logo.compact { padding-top: 4px; }
.logo.compact .logo-mark { font-size: 2.8rem; }
.logo.compact .logo-word { font-size: 2.2rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.count { color: var(--ink-muted); font-weight: 600; font-size: 0.9rem; }

.avatar-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 12px;
  margin: 0 -4px 4px;
  scrollbar-width: none;
}
.avatar-picker::-webkit-scrollbar { display: none; }
.avatar-option {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-strong);
  font-size: 1.65rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.avatar-option.on { background: var(--yellow); transform: scale(1.12); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 0.9rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.code-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; font-size: 1.4rem; }

.install { display: flex; align-items: center; gap: 12px; }
.install-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-text p { margin-top: 2px; color: var(--ink-muted); font-size: 0.9rem; }

.invite-banner { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 18px; }

.howto { display: grid; gap: 14px; }
.howto .field-label { margin-bottom: 0; }
.howto .panel-head { margin-bottom: 0; }
.howto-note { font-size: 0.85rem; color: var(--ink-muted); }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--yellow); color: var(--dark); flex: none; margin-top: 1px; }
.step b { display: block; }
.step p { margin-top: 2px; color: var(--ink-soft); font-size: 0.95rem; }
.scoring { display: flex; flex-wrap: wrap; gap: 6px; }
.scoring span { font-size: 0.8rem; background: var(--surface-strong); padding: 4px 10px; border-radius: 999px; }

/* ── Lobby ──────────────────────────────────────────────────────────── */

.invite {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  color: var(--dark);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}
.qr { width: 132px; height: 132px; flex: none; border-radius: 12px; background: #fff; }
.invite-info { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.invite-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.6; }
.code-big { font-size: clamp(1.9rem, 9vw, 2.7rem); font-weight: 700; letter-spacing: 0.14em; line-height: 1.05; }
.invite-url { font-size: 0.82rem; opacity: 0.65; word-break: break-all; margin-bottom: 8px; }
@media (max-width: 360px) {
  .invite { flex-direction: column; text-align: center; }
  .invite-info { justify-items: center; }
}

.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.player-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 16px; padding: 7px 8px; min-width: 0; }
.player-chip .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.player-chip.enter { animation: pop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
.player-chip.away { opacity: 0.45; }
.player-chip.ghost { background: none; border: 2px dashed var(--line); color: var(--ink-muted); }
.ghost-avatar { --c: var(--surface); color: var(--ink-muted); font-weight: 700; }
.kick { border: 0; background: none; color: var(--ink-muted); width: 36px; height: 36px; margin: -4px -4px -4px 0; border-radius: 50%; cursor: pointer; flex: none; font-size: 1rem; }
.kick:active { background: var(--surface-strong); color: var(--ink); }
@media (hover: hover) { .kick:hover { background: var(--surface-strong); color: var(--ink); } }
.crowned { position: relative; display: inline-flex; flex: none; }
.crowned::after { content: '👑'; position: absolute; top: -10px; left: -6px; font-size: 17px; transform: rotate(-18deg); }

.settings .hint { color: var(--ink-soft); font-size: 0.92rem; margin: 10px 0 0; }
.panel-head.spaced { margin-top: 20px; }
.intensity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.intensity-option {
  appearance: none;
  border: 2px solid var(--line);
  background: none;
  color: var(--ink);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
}
.intensity-option.on { background: var(--yellow); border-color: var(--yellow); color: var(--dark); }
.intensity-option.wide { grid-column: span 2; justify-content: center; }
.intensity-emoji { font-size: 1.4rem; line-height: 1; }
.settings-summary { display: grid; gap: 10px; }
.intensity-now { display: flex; align-items: center; gap: 12px; }
.intensity-now .intensity-emoji { font-size: 2rem; }
.intensity-now p { color: var(--ink-soft); font-size: 0.92rem; }
.segmented { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; background: var(--well); padding: 5px; border-radius: 16px; }
.seg { border: 0; background: none; border-radius: 12px; padding: 10px; font-weight: 600; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft); }
.seg.on { background: var(--yellow); color: var(--dark); }
.seg-sub { display: block; font-size: 0.78rem; font-weight: 500; opacity: 0.75; }

.theme-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-option { appearance: none; border: 0; background: none; padding: 4px 0; display: grid; justify-items: center; gap: 6px; font-weight: 600; font-size: 0.85rem; color: var(--ink-muted); cursor: pointer; }
.theme-option.on { color: var(--ink); }
.theme-option:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 12px; }
/* A mini screen: the theme's background with the yellow every theme shares. */
.theme-swatch { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle, var(--yellow) 0 28%, transparent 30%), var(--swatch); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.15s; }
.theme-option.on .theme-swatch { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px var(--yellow); }

/* ── Avatars ────────────────────────────────────────────────────────── */

.avatar {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--paper-ink));
  display: inline-grid;
  place-items: center;
  font-size: calc(var(--size) * 0.58);
  line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}
.avatar-stack { display: inline-flex; vertical-align: middle; }
.avatar-stack .avatar + .avatar { margin-left: calc(var(--size) * -0.3); box-shadow: 0 0 0 2px var(--bg); }

.spotlight { display: grid; justify-items: center; text-align: center; gap: 12px; padding-top: 6px; }
.spotlight-avatar { position: relative; }
.spotlight-avatar .avatar { box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.25), 0 0 60px rgba(255, 210, 63, 0.45); animation: glow 2.4s ease-in-out infinite; }
.spotlight h1 { font-size: 1.75rem; line-height: 1.15; }

/* ── Category tiles ─────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  appearance: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 98px;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s, box-shadow 0.12s;
  touch-action: manipulation;
}
button.tile:active { transform: scale(0.97); background: var(--surface-strong); }
.tile-emoji { font-size: 1.6rem; line-height: 1; }
.tile-name { font-weight: 600; font-size: 1.05rem; line-height: 1.1; }
.tile-surprise {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px dashed var(--line);
}
.tile-surprise.wide { grid-column: span 2; min-height: 70px; }
.watching .tile { opacity: 0.5; cursor: default; }
.tiles.locked .tile:not(.chosen) { opacity: 0.35; }
.tile.chosen { background: var(--yellow); color: var(--dark); border-color: var(--yellow); }

/* ── Question & answering ───────────────────────────────────────────── */

.question {
  display: grid;
  gap: 12px;
  justify-items: start;
  background: var(--paper);
  color: var(--dark);
  border-radius: var(--radius);
  padding: 18px 20px 22px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}
.question-text { font-size: clamp(1.35rem, 5.6vw, 1.7rem); font-weight: 600; line-height: 1.2; }
.question.small { padding: 14px 16px; gap: 6px; box-shadow: none; }
.question.small .question-text { font-size: 1.1rem; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dark-soft);
  color: var(--dark);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 11px;
  border-radius: 999px;
}

.level-tag { font-size: 0.8rem; font-weight: 600; color: var(--paper-ink); }
.level-pill { display: inline-block; font-weight: 600; font-size: 0.95rem; padding: 6px 14px; border-radius: 999px; background: var(--surface-strong); }

/* Hints: tap-only chips the spotlight sends once they've answered. They land on the question card. */
.hint-row { display: flex; flex-wrap: wrap; gap: 6px; }
.hint-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--yellow); color: var(--dark); font-weight: 600; font-size: 0.9rem; padding: 4px 11px; border-radius: 999px; }
.hint-chip.new { animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.hint-picker.asked { border-color: rgba(255, 210, 63, 0.5); background: rgba(255, 210, 63, 0.1); }
.hint-picker .panel-head h2 { font-size: 1.15rem; }
.hint-options { display: flex; flex-wrap: wrap; gap: 8px; }
.hint-option { min-height: 44px; border: 0; background: var(--surface-strong); color: var(--ink); font-weight: 600; padding: 9px 15px; border-radius: 999px; cursor: pointer; }
.hint-option:active:not(:disabled) { transform: translateY(2px); }
.hint-option:disabled { opacity: 0.5; }
.hint-option:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.hint-note { font-size: 0.85rem; color: var(--ink-muted); margin-top: 10px; }
.ask-hint { display: grid; justify-items: center; }

.role { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.role-star { border-color: rgba(255, 210, 63, 0.5); background: rgba(255, 210, 63, 0.1); }
.role-title { font-weight: 700; font-size: 1.1rem; }
.role-sub { color: var(--ink-soft); font-size: 0.95rem; }

.answer-box { position: relative; }
.answer-input { resize: none; min-height: 100px; font-size: 1.3rem; padding-bottom: 28px; }
.counter { position: absolute; right: 14px; bottom: 10px; font-size: 0.8rem; color: var(--ink-muted); pointer-events: none; }

.waiting { display: grid; gap: 10px; justify-items: center; text-align: center; padding-top: 6px; }
.my-answer { background: var(--surface-strong); border-radius: 16px; padding: 12px 16px; font-size: 1.15rem; font-weight: 500; max-width: 100%; overflow-wrap: anywhere; }
.waiting-for { display: grid; gap: 8px; justify-items: center; margin-top: 8px; }
.waiting-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.waiting-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 500; animation: breathe 1.6s ease-in-out infinite; }
.dots::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }

/* ── Answer cards ───────────────────────────────────────────────────── */

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.answer-card {
  appearance: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--paper);
  color: var(--dark);
  border-radius: 20px;
  padding: 18px;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
  animation: deal 0.4s ease-out backwards;
  touch-action: manipulation;
}
button.answer-card { cursor: pointer; }
button.answer-card:active { transform: scale(0.98); }
.answer-card.selected { transform: scale(1.02); box-shadow: 0 0 0 4px var(--yellow), 0 5px 0 rgba(0, 0, 0, 0.25); }
.answer-card.mine { background: var(--paper-mine); }
.card-tag { font-size: 0.75rem; font-weight: 600; background: var(--dark); color: #fff; padding: 3px 10px; border-radius: 999px; }

.answer-card.real {
  background: var(--yellow);
  font-size: 1.55rem;
  font-weight: 600;
  transform: none;
  box-shadow: 0 6px 0 var(--yellow-shadow), 0 0 60px rgba(255, 210, 63, 0.35);
  animation: pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.byline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 600; }

/* ── Judge (2 players) ──────────────────────────────────────────────── */

.copy {
  display: grid;
  gap: 10px;
  background: var(--paper);
  color: var(--dark);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  animation: deal 0.4s ease-out backwards;
}
.copy-who { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: var(--paper-ink); }
.copy-text { font-size: 1.35rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.copy-pending { color: var(--paper-muted); font-weight: 500; }
.verdicts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.verdict {
  appearance: none;
  border: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 4px 10px;
  border-radius: 16px;
  background: var(--paper-tint);
  color: var(--dark);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 0 var(--dark-shadow);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s;
}
.verdict:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--dark-shadow); }
.verdict-emoji { font-size: 1.9rem; line-height: 1.1; }
.verdict small { font-size: 0.78rem; opacity: 0.7; }
.verdicts.locked .verdict:not(.chosen) { opacity: 0.3; }
.verdict.chosen { background: var(--yellow); transform: scale(1.05); }
.stamp {
  justify-self: start;
  padding: 5px 12px;
  border: 3px solid currentColor;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: rotate(-4deg);
  animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) backwards;
}
.stamp-nailed, .stamp-meld { color: var(--pink-ink); }
.stamp-close { color: #9a7000; }
.stamp-off { color: var(--paper-muted); }

.sync { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.sync-head { display: flex; align-items: center; gap: 12px; }
.sync-emoji { font-size: 2rem; line-height: 1; }
.sync-label { font-weight: 700; font-size: 1.1rem; }
.sync-sub { color: var(--ink-soft); font-size: 0.9rem; }
.sync-bar { height: 12px; border-radius: 99px; background: var(--well); overflow: hidden; }
.sync-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), var(--pink)); animation: grow 0.9s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.sync.big { padding: 20px; text-align: center; }
.sync.big .sync-head { flex-direction: column; gap: 6px; }
.sync.big .sync-emoji { font-size: 3rem; }
.sync.big .sync-label { font-size: 1.6rem; }
.sync-pair { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; color: var(--ink-soft); }

/* ── Reveal ─────────────────────────────────────────────────────────── */

.found-line { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; font-weight: 500; color: var(--ink-soft); }
.meld { background: var(--surface); border: 2px solid var(--pink); border-radius: 18px; padding: 14px 16px; font-weight: 600; text-align: center; }
.result { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-strong); border-radius: 18px; padding: 14px 16px; }
.result-head { font-weight: 600; font-size: 1.05rem; }
.result-sub { color: var(--ink-soft); font-size: 0.92rem; margin-top: 2px; }
.points-badge { background: var(--yellow); color: var(--dark); font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 1.2rem; flex: none; animation: pop 0.5s 0.3s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; }
.points-badge.zero { background: var(--surface-strong); color: var(--ink-soft); }

.section { display: grid; gap: 10px; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.decoy { background: var(--surface); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; }
.decoy-text { font-size: 1.15rem; font-weight: 500; overflow-wrap: anywhere; }
.decoy-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.decoy-by, .fooled { display: inline-flex; align-items: center; gap: 6px; }
.fooled { color: var(--pink-text); font-weight: 600; }

.scoreboard { display: grid; gap: 6px; }
.score-row { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 7px 12px 7px 10px; }
.score-row.me { box-shadow: inset 0 0 0 2px var(--yellow); }
.score-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rank { color: var(--ink-muted); font-weight: 600; text-align: center; }
.delta { color: var(--yellow-text); font-weight: 700; font-size: 0.9rem; }
.score { font-weight: 700; font-size: 1.15rem; min-width: 2ch; text-align: right; }

/* ── End ────────────────────────────────────────────────────────────── */

.winner { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 4px; }
.winner-avatars { display: flex; gap: 8px; }
.winner-avatars .avatar { box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.3), 0 0 70px rgba(255, 210, 63, 0.5); }
.winner h1 { font-size: 2.1rem; line-height: 1.1; margin-top: 6px; }
.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.award { background: var(--surface); border-radius: 18px; padding: 14px; display: grid; gap: 4px; align-content: start; }
.award-title { font-weight: 700; }
.award-who { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.award-desc { font-size: 0.8rem; color: var(--ink-muted); }

/* ── Reactions, toasts, sheet, effects ──────────────────────────────── */

.reactions { display: flex; justify-content: center; gap: 8px; }
.react {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.1s;
  touch-action: manipulation;
}
.react:active { transform: scale(0.85); }

.fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.float {
  position: absolute;
  bottom: calc(var(--dock-h) + 8px);
  display: grid;
  justify-items: center;
  font-size: 2.3rem;
  line-height: 1;
  animation: float-up 2.4s ease-out forwards;
}
.float small { font-size: 0.7rem; font-weight: 600; background: rgba(0, 0, 0, 0.45); padding: 2px 6px; border-radius: 999px; margin-top: 2px; }
.confetti { position: absolute; left: 50%; top: 38%; width: 9px; height: 9px; border-radius: 50%; background: var(--c); animation: burst 1.2s cubic-bezier(0.15, 0.7, 0.3, 1) forwards; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 12px);
  z-index: 40;
  max-width: calc(100% - 32px);
  transform: translate(-50%, calc(-100% - 24px));
  background: #fff;
  color: var(--dark);
  font-weight: 600;
  text-align: center;
  padding: 10px 18px;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* The shadow only while it's showing: tucked above the screen, it would peek in (you can see it on Cream). */
.toast.show { transform: translate(-50%, 0); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

.banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 35;
  background: var(--yellow);
  color: var(--dark);
  text-align: center;
  font-weight: 600;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
}

.sheet {
  border: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  margin: auto auto 0;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 40px);
  background: var(--bg-raised);
  color: var(--ink);
  border-radius: 26px 26px 0 0;
  overscroll-behavior: contain;
}
.sheet::before { content: ''; display: block; width: 40px; height: 5px; margin: 10px auto 0; border-radius: 99px; background: var(--line); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
.ask-question { padding: 6px 0 4px; }
.ask-detail { color: var(--ink-soft); margin-top: -6px; }
.sheet-body { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { border: 0; background: var(--surface-strong); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; }

.shake { animation: shake 0.4s; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes stamp { from { transform: rotate(-4deg) scale(2.2); opacity: 0; } }
@keyframes grow { from { width: 0; } }
@keyframes countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes deal { from { opacity: 0; transform: translateY(16px) rotate(0deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.25), 0 0 40px rgba(255, 210, 63, 0.35); } 50% { box-shadow: 0 0 0 10px rgba(255, 210, 63, 0.18), 0 0 80px rgba(255, 210, 63, 0.55); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes float-up {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  12% { transform: translateY(-30px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-55vh) translateX(var(--drift)) scale(1); opacity: 0; }
}
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
