/* ═══════════════════════════════════════════════════════════════════════════
   Jest — app styles, in the Arcade language (theme.css).

   Flat rounded surfaces on a dark ground. Brass marks reward and the side to
   play; violet is the second side and the ladder; green and coral are verdicts
   and always travel with a word or an icon.

   Class names are the contract with app.js, which builds much of the DOM —
   rename one here only together with the script.
   ═══════════════════════════════════════════════════════════════════════════ */

[hidden] { display: none !important; }

.page {
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) 32px 48px;
}
@media (max-width: 640px) { .page { padding: var(--space-4) var(--space-4) var(--space-8); } }

/* ── masthead ────────────────────────────────────────────────────────────── */

.masthead {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-4); flex-wrap: wrap;
  padding-bottom: var(--space-4);
}

.kicker {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.masthead h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}

.masthead nav { display: flex; gap: var(--space-1); align-items: center; flex-wrap: wrap; }
.nav-rule { width: 1px; height: 22px; background: var(--color-divider); margin: 0 6px; }

.standfirst {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-muted);
  margin: var(--space-2) 0 var(--space-6);
  max-width: 62ch;
}
.standfirst em { font-style: normal; color: var(--color-text); }

/* Whose pick it is. */
.turn-line {
  margin: 0 0 var(--space-3);
  font-size: 13px; letter-spacing: 0.04em; text-transform: none;
  color: var(--color-muted);
}
.turn-line strong { font-weight: 700; color: var(--color-accent); }

/* How much of the board is spent. */
.progress {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--space-4);
}
.progress-track {
  flex: 1; height: 8px;
  background: var(--color-line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: var(--color-text);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-count {
  font-size: 13px; font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}

/* ── the board ───────────────────────────────────────────────────────────── */

.programme-wrap { overflow-x: auto; }

.programme {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(90px, 1fr));
  grid-auto-rows: auto;
  gap: 8px;
}

.column-head {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 3px 0 var(--color-accent);
}
.column-head h3 {
  font-size: 13px; line-height: 1.15; margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tile {
  position: relative;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 10px var(--space-2);
  min-height: 58px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  color: var(--color-text);
  transition: background 0.14s ease, border-color 0.14s ease,
              transform 0.14s ease, box-shadow 0.14s ease;
}
.tile:hover:not(:disabled) {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.tile:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow-sm); }
.tile:disabled { cursor: default; background: var(--color-neutral-900); border-style: dashed; }

.tile-value {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-accent);
  transition: transform 0.14s ease;
}
.tile:hover:not(:disabled) .tile-value { transform: scale(1.06); }
.tile:disabled .tile-value {
  font-size: 15px; font-weight: 700;
  color: var(--color-faint);
  text-decoration: line-through;
}

/* The Double — a small mark in the corner. */
.dagger {
  position: absolute; top: 6px; right: 9px;
  font-size: 12px;
  color: var(--color-mystery);
}

/* ── the standings ───────────────────────────────────────────────────────── */

.standings { margin: var(--space-2) 0 var(--space-4); }

.section-label {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-label h4 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin: 0; color: var(--color-muted);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--color-divider); }

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.team {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.team:nth-child(1) { --side: var(--color-accent); --side-text: var(--color-accent); --side-ink: var(--color-accent-ink); }
.team:nth-child(2) { --side: var(--color-accent-2); --side-text: var(--color-accent-2-text); --side-ink: var(--color-accent-2-ink); }

/* The side to choose next. */
.team.active { border-color: var(--side); }
.team.active::before {
  content: "Your turn";
  position: absolute; top: -12px; left: var(--space-4);
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: var(--side); color: var(--side-ink);
}
.team:not(.active) { opacity: 0.85; }
.team.leading .team-score::after {
  content: " ▲";
  font-size: 0.4em;
  vertical-align: middle;
  color: var(--side-text);
}

/* Points landing: the figure counts up while the delta floats off it. */
.score-delta {
  position: absolute;
  right: var(--space-4);
  top: 40%;
  font-family: var(--font-heading); font-weight: 800;
  font-size: 20px;
  color: var(--side-text, var(--color-accent));
  pointer-events: none;
  animation: float-off 1.1s ease-out forwards;
}
.score-delta.down { color: var(--color-wrong-text); }
@keyframes float-off {
  from { opacity: 0; transform: translateY(6px); }
  25%  { opacity: 1; }
  to   { opacity: 0; transform: translateY(-28px); }
}

.team-score { transition: transform 0.18s ease; transform-origin: left center; }
.team-score.bumped { transform: scale(1.1); }

.team-name {
  width: 100%; text-align: left;
  font-family: var(--font-heading); font-weight: 700; font-size: 17px;
  color: var(--side-text, var(--color-text));
  background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 4px 6px; margin: 0 0 var(--space-1) -6px;
}
.team-name:hover { border-color: var(--color-divider); }
.team-name:focus { outline: none; border-color: var(--side, var(--color-accent)); }

.team-score {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 34px; line-height: 1; letter-spacing: -0.02em;
  color: var(--color-text);
}
.team-score.negative { color: var(--color-wrong-text); }

.team-adjust { display: flex; gap: 6px; margin-top: var(--space-3); }
.team-adjust button {
  flex: 1; min-height: 36px; padding: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line); border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.team-adjust button:hover { border-color: var(--color-neutral-600); }

/* ── footer ──────────────────────────────────────────────────────────────── */

.colophon {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-4); flex-wrap: wrap;
  font-size: 13px; color: var(--color-faint);
}
.colophon nav { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.colophon .btn { font-size: 13px; }

/* ── setup screens ───────────────────────────────────────────────────────── */

.setup-panel {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  margin-top: var(--space-4);
}
@media (max-width: 640px) { .setup-panel { padding: var(--space-4); border-radius: var(--radius-lg); } }

.field { margin-bottom: var(--space-4); }
.field > label,
.field .label-row > label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}
.field .hint {
  font-weight: 400;
  color: var(--color-faint);
  font-size: 13px;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

.count-control { display: flex; align-items: center; gap: var(--space-2); }
.count-control .count {
  font-family: var(--font-heading); font-weight: 800; font-size: 20px;
  min-width: 22px; text-align: center; color: var(--color-text);
}
.count-control button {
  width: 34px; height: 34px; padding: 0;
  font-family: var(--font-body); font-weight: 700; font-size: 16px; line-height: 1;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line); border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.count-control button:hover:not(:disabled) { border-color: var(--color-accent); }
.count-control button:disabled { opacity: 0.4; cursor: not-allowed; }

.topic-list { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.topic-row { display: flex; align-items: center; gap: var(--space-3); }
.topic-row .roman {
  flex: 0 0 26px; text-align: right;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px;
  color: var(--color-faint);
}

.actions {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
  margin-top: var(--space-4);
}

.notice {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  margin: var(--space-4) 0 0;
}
.notice.error { background: var(--color-wrong-soft); border-color: #7A2E27; color: var(--color-text); }
.notice code {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: var(--color-surface-2);
  padding: 1px 5px; border-radius: 6px;
}

/* ── loading ─────────────────────────────────────────────────────────────── */

.loader { text-align: center; padding: 96px 0; max-width: 420px; margin: 0 auto; }
.loader-mark {
  width: 96px; height: 96px; margin: 0 auto;
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 44px; line-height: 1;
  color: var(--color-accent);
  border-radius: 50%;
  border: 8px solid var(--color-surface-2);
  border-top-color: var(--color-accent);
  animation: spin 1.4s linear infinite;
}
/* The ring turns; the mark inside stays upright. */
.loader-mark > span { display: block; animation: spin 1.4s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.loader h2 { font-size: 22px; margin: var(--space-6) 0 var(--space-2); }
.loader p { color: var(--color-muted); }

/* ── overlays ────────────────────────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 9, 13, 0.84);
  display: grid; place-items: center;
  padding: var(--space-6);
  overflow-y: auto;
  animation: fadein 0.16s ease;
}
@keyframes fadein { from { opacity: 0; } }
@keyframes plate-rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.plate-card {
  width: min(780px, 100%);
  background: var(--color-surface);
  color: var(--color-plate-ink);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: plate-rise 0.22s ease;
}
.plate-card.narrow { width: min(620px, 100%); }

/* The old oversized value behind the clue clashed with the value in the
   header, which already carries it. */
.ghost-numeral { display: none; }

.plate-body { position: relative; padding: var(--space-6) var(--space-8); }
@media (max-width: 640px) { .plate-body { padding: var(--space-6) var(--space-4) var(--space-4); } }

.plate-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.plate-head .category {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 0 14px; border-radius: 999px;
  background: var(--color-surface-2);
  font-size: 14px; font-weight: 700;
  color: var(--color-text);
}
.plate-head .value {
  font-family: var(--font-heading); font-weight: 800; font-size: 26px;
  color: var(--color-accent);
}

.double-mark {
  text-align: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--color-mystery);
  margin: 0 0 var(--space-2);
}

.clue-text {
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25; letter-spacing: -0.01em;
  text-align: center; text-wrap: balance;
  margin: var(--space-2) 0 var(--space-4);
}
.clue-text.final { font-size: clamp(22px, 3vw, 32px); }
.clue-text.prompt { font-size: clamp(20px, 2.4vw, 28px); }

.plate-body.centred { text-align: center; }

.final-category {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 30px;
  color: var(--color-accent);
  margin: 0 0 var(--space-6);
}
.micro-label.wide { letter-spacing: 0.12em; }
.wager-prompt { margin-bottom: var(--space-4); }
.answer-text.final { font-size: 30px; }

.response {
  text-align: center;
  animation: fadein 0.25s ease;
  margin-top: var(--space-2);
  padding: var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px dashed var(--color-neutral-600);
}
.micro-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-2);
}
.answer-text {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  color: var(--color-correct);
  margin: 0;
}
.acceptable {
  font-size: 14px;
  color: var(--color-muted);
  margin: 10px 0 0;
}

/* Who is on the hook for the clue currently open. */
.answering-label {
  text-align: center;
  font-size: 15px; font-weight: 600;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}
.answering-label.passed { color: var(--color-muted); }

.grading { margin-top: var(--space-6); animation: fadein 0.2s ease; }
.grading-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: var(--space-3); }
.grading-actions .plate-btn { min-width: 160px; }
/* First is the award, second the miss — colour plus the button's own word. */
.grading-actions .plate-btn:not(.muted) { background: var(--color-correct); color: var(--color-correct-ink); border-color: transparent; }
.grading-actions .plate-btn.muted { border: 2px solid var(--color-wrong); color: var(--color-wrong-text); background: transparent; }

.score-rows { display: grid; gap: var(--space-2); max-width: 560px; margin: var(--space-6) auto 0; }
.score-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2);
  align-items: center;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
}
.score-row .who {
  text-align: left;
  font-family: var(--font-heading); font-weight: 700; font-size: 17px;
  overflow-wrap: anywhere;
}
.score-row.settled { opacity: 0.42; }

.plate-btn {
  min-height: 40px;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  padding: 0 18px;
  background: var(--color-accent);
  border: 1px solid transparent;
  color: var(--color-accent-ink);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.plate-btn:hover:not(:disabled) { background: var(--color-accent-400); }
.plate-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.plate-btn.ghost {
  background: var(--color-surface-2);
  border-color: var(--color-line);
  color: var(--color-text);
}
.plate-btn.ghost:hover:not(:disabled) { background: var(--color-surface-2); border-color: var(--color-neutral-600); }

.plate-btn.small { min-height: 36px; font-size: 13px; padding: 0 12px; min-width: 0; }
.plate-btn.muted {
  background: transparent;
  border-color: var(--color-neutral-600);
  color: var(--color-text);
}
.plate-btn.muted:hover:not(:disabled) { background: var(--color-surface-2); }

.plate-actions { display: flex; justify-content: center; gap: 8px; margin-top: var(--space-4); flex-wrap: wrap; }

.plate-card :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Wager step — the Double and the final round. */
.wager-step { text-align: center; }

.wager-input {
  width: 180px; min-height: 56px; text-align: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 26px;
  padding: 6px 10px;
  background: var(--color-bg);
  color: var(--color-accent);
  caret-color: var(--color-accent);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}
.wager-input:focus { outline: none; border-color: var(--color-accent); }

.wager-rows { display: grid; gap: var(--space-2); max-width: 520px; margin: var(--space-4) auto var(--space-6); }
.wager-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-3);
  align-items: center;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  text-align: left;
}
.wager-row .who { font-family: var(--font-heading); font-weight: 700; font-size: 17px; }
.wager-row .who small {
  display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px;
  color: var(--color-muted);
}
.wager-row .wager-input { width: 120px; min-height: 44px; font-size: 18px; }

/* ── the result ──────────────────────────────────────────────────────────── */

.laurel {
  width: 48px; height: 48px; margin: 0 auto var(--space-2);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-accent); color: var(--color-accent-ink);
  font-size: 0;
  animation: laurel-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* A trophy, drawn rather than typed, so it never depends on a glyph. */
.laurel::before {
  content: ""; width: 24px; height: 24px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes laurel-in {
  from { opacity: 0; transform: scale(0.7) rotate(-8deg); }
}

.victor {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -0.03em;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}
.victor-score {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 22px;
  color: var(--color-text);
  margin: 0;
}

.result-rows { display: grid; gap: var(--space-2); max-width: 420px; margin: var(--space-6) auto 0; }
.result-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-3);
  align-items: baseline;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading); font-weight: 700; font-size: 19px;
  text-align: left;
}
.result-row.won { color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-accent); }

/* ── toast ───────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%);
  z-index: 100;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-3) var(--space-4);
  font-size: 15px; font-weight: 600;
  max-width: 90vw;
}
.toast.error { background: var(--color-wrong-soft); border-color: #7A2E27; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── phone: one subject at a time ────────────────────────────────────────────
   Five-plus columns on a phone are unreadable, so the host pages through one
   subject at a time, with dots to keep the overview. */

.programme-mobile {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cat-pager {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  background: var(--color-surface-2);
}
.cat-pager button {
  height: 100%; min-height: 60px;
  background: transparent; border: 0;
  font-family: var(--font-body); font-weight: 700; font-size: 34px; line-height: 1;
  color: var(--color-text);
  cursor: pointer;
}
.cat-pager button:disabled { opacity: 0.25; cursor: default; }
.cat-pager button:active:not(:disabled) { background: var(--color-line); }

.cat-current { text-align: center; padding: var(--space-2) var(--space-1); }
.cat-current h3 {
  font-size: 18px; line-height: 1.15; margin: 0;
  overflow-wrap: anywhere;
}
.cat-remaining {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--color-muted);
  margin-top: 2px;
}

.cat-dots {
  display: flex; justify-content: center; gap: var(--space-1);
  padding: var(--space-2);
}
.cat-dots button {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  background: transparent; border: 0; cursor: pointer;
}
.cat-dots .pip {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--color-neutral-600);
  transition: transform 0.14s ease, background 0.14s ease;
}
.cat-dots .live .pip { background: var(--color-accent); border-color: var(--color-accent); }
.cat-dots .current .pip { transform: scale(1.5); }
.cat-dots .spent .pip { border-color: var(--color-neutral-600); }

.mobile-tiles { display: grid; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
.mobile-tiles .tile {
  min-height: 68px;
  font-size: 0; /* the value span carries the type */
}
.mobile-tiles .tile-value { font-size: 30px; }
.mobile-tiles .tile:disabled .tile-value { font-size: 20px; }

@media (max-width: 720px) {
  .masthead { gap: var(--space-3); padding-bottom: var(--space-3); }
  .masthead h1 { font-size: 32px; }
  .masthead nav { gap: 0; }
  .masthead nav .btn { font-size: 13px; padding-inline: var(--space-2); }

  .standfirst { font-size: 15px; margin: var(--space-2) 0 var(--space-3); }
  .standfirst-note { display: none; }

  .turn-note { display: none; }

  .progress { margin-bottom: var(--space-3); }

  .standings { margin-top: var(--space-6); }
  .team-score { font-size: 30px; }

  .grading-actions { flex-direction: column; }
  .grading-actions .plate-btn { width: 100%; min-height: 52px; }
  .clue-text { font-size: clamp(21px, 5.4vw, 30px); }
  .plate-head { flex-wrap: wrap; gap: var(--space-1); }
}

/* ── Daily 15 ────────────────────────────────────────────────────────────── */

.streak-bar {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0 var(--space-4);
}
.streak-figure {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--color-heat); color: #2A1206;
}
.streak-figure::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c1 3.5 5 5.5 5 10a5 5 0 0 1-10 0c0-2.2 1-3.6 2.2-4.8C9.6 10 10 11.5 11 12c.2-3 .4-6.2 1-9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c1 3.5 5 5.5 5 10a5 5 0 0 1-10 0c0-2.2 1-3.6 2.2-4.8C9.6 10 10 11.5 11 12c.2-3 .4-6.2 1-9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.streak-count {
  font-family: var(--font-heading); font-weight: 800; font-size: 20px; line-height: 1;
  color: inherit;
}
.streak-figure:has(.streak-count.cold) { background: var(--color-surface-2); color: var(--color-muted); }
.streak-label {
  font-size: 13px; font-weight: 700;
  color: inherit;
}
.streak-note {
  margin: 0; flex: 1;
  font-size: 15px;
  color: var(--color-muted);
}
.streak-note strong { font-weight: 700; color: var(--color-text); }

/* The day's card, in each of its states. */
.quiz-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
}
.quiz-card .topic-kicker {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 var(--space-2);
}
.quiz-card h2 {
  font-size: clamp(22px, 2.8vw, 30px); margin: 0 0 var(--space-3);
}
.quiz-card p.lead {
  font-size: 16px;
  color: var(--color-muted); margin: 0 0 var(--space-4);
}

/* Question progress: one segment per question. */
.q-progress { display: flex; gap: 4px; margin-bottom: var(--space-4); }
.q-progress span {
  flex: 1 1 0; min-width: 0; height: 8px; border-radius: 999px;
  background: var(--color-line);
}
.q-progress span.done { background: var(--color-correct); }
.q-progress span.current { background: var(--color-text); }

.q-count {
  font-size: 13px; font-weight: 600;
  color: var(--color-muted); margin: 0 0 var(--space-2);
}
.q-text {
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(19px, 2.2vw, 24px); line-height: 1.25;
  text-wrap: balance; margin: 0 0 var(--space-4);
}

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: var(--space-3);
  text-align: left; width: 100%; min-height: 46px;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line); border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}
.choice .letter {
  flex: none; width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  border-radius: 8px;
  background: var(--color-line);
  color: var(--color-text);
}
.choice:hover:not(:disabled) { border-color: var(--color-accent-2); }
.choice:disabled { cursor: default; }
.choice.right {
  border-color: var(--color-correct);
  background: var(--color-correct);
  color: var(--color-correct-ink);
}
.choice.right .letter { background: var(--color-correct-ink); color: var(--color-correct); }
.choice.wrong {
  border-color: var(--color-wrong);
  background: var(--color-wrong);
  color: var(--color-wrong-ink);
}
.choice.wrong .letter { background: var(--color-wrong-ink); color: var(--color-wrong); }
.choice.faded { opacity: 0.45; }

/* Reveal and typed modes */
.typed-row { display: flex; gap: var(--space-2); }
.typed-row .input { font-size: 17px; }
.verdict {
  font-family: var(--font-heading); font-weight: 700; font-size: 20px;
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
}
.verdict.right { color: var(--color-correct); background: var(--color-correct-soft); }
.verdict.wrong { color: var(--color-wrong-text); background: var(--color-wrong-soft); }
.verdict strong { color: var(--color-text); }

.self-mark { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }

.quiz-actions {
  display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center;
  margin-top: var(--space-6);
}

/* Score summary */
.quiz-score {
  font-family: var(--font-heading); font-weight: 800; font-size: 56px; line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--color-text); margin: 0 0 var(--space-2);
}
.review { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.review-item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border-left: 4px solid var(--color-wrong);
}
.review-item.right { border-left-color: var(--color-correct); }
.review-item .q { font-weight: 600; font-size: 15px; margin: 0 0 2px; }
.review-item .a { font-size: 14px; color: var(--color-muted); margin: 0; }
.review-item .a em { color: var(--color-correct); font-style: normal; font-weight: 700; }

/* Topic picker */
.chosen-topics, .suggested-topics { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chosen-topics:empty::after {
  content: "Nothing chosen yet — add one below.";
  color: var(--color-faint); font-size: 15px;
}
.topic-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px;
  padding: 0 8px 0 16px;
  font-size: 14px; font-weight: 700;
  border-radius: 999px;
  color: var(--color-accent-ink);
  background: var(--color-accent);
}
.topic-chip button {
  width: 28px; height: 28px; padding: 0; line-height: 1;
  background: transparent; border: 0; cursor: pointer; border-radius: 50%;
  color: var(--color-accent-ink); font-size: 16px;
}
.topic-chip button:hover { background: rgba(0, 0, 0, 0.12); }
.suggest-chip {
  min-height: 40px;
  padding: 0 16px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line); border-radius: 999px;
  color: var(--color-text); cursor: pointer;
  transition: border-color 0.14s ease;
}
.suggest-chip:hover { border-color: var(--color-accent); }
.suggest-chip.taken { opacity: 0.35; cursor: default; }

.topic-add { display: flex; gap: var(--space-2); }

@media (max-width: 720px) {
  .streak-bar { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .quiz-card { padding: var(--space-4); border-radius: var(--radius-lg); }
  .quiz-actions .btn, .typed-row .btn { flex: 1; min-height: 48px; }
  .choice { font-size: 16px; }
  .quiz-score { font-size: 64px; }
}

/* ── sign-in ─────────────────────────────────────────────────────────────── */

.auth-slot { display: inline-flex; align-items: center; gap: var(--space-2); }
.auth-who {
  font-size: 14px; font-weight: 600;
  color: var(--color-muted);
  max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 720px) {
  .auth-who { max-width: 14ch; font-size: 13px; }
}

.sync-hint {
  font-size: 14px;
  color: var(--color-muted);
  margin: 0 0 var(--space-4);
}

/* The gate: nothing else is reachable until a sign-in lands. */
.signin {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--space-6) var(--space-4);
  position: relative;
  overflow: hidden;
}
.signin::before {
  content: "J";
  position: absolute; right: -6vw; top: -8vh;
  font-family: var(--font-heading); font-weight: 800;
  font-size: min(90vw, 760px); line-height: 1;
  color: #161922;
  pointer-events: none;
}
.signin-card {
  position: relative;
  width: min(440px, 100%);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.signin-title {
  font-size: clamp(40px, 7vw, 56px); letter-spacing: -0.04em; line-height: 0.95;
  margin: 0;
}
.signin-sub { font-size: 16px; color: var(--color-muted); margin: 0; max-width: 32ch; }
.signin-modes { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.signin-modes span {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
}
.signin-modes span:nth-child(1) { background: var(--color-accent-900); color: var(--color-accent); }
.signin-modes span:nth-child(2) { background: var(--color-accent-2-900); color: var(--color-accent-2-text); }
.signin-modes span:nth-child(3) { background: var(--color-surface-2); color: var(--color-text); }
.signin-modes span:nth-child(4) { background: #2A1A26; color: #FFC2DC; }
.signin-modes span:nth-child(5) { background: #123227; color: var(--color-correct); }
.signin-panel {
  margin-top: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.signin-panel .btn { width: 100%; min-height: 48px; font-size: 15px; }
.signin-google { background: #F2F0EA; color: #13151C; border-color: transparent; }
.signin-google:hover:not(:disabled) { background: #FFFFFF; }
.signin-google svg { width: 20px; height: 20px; flex: none; }
.signin-note { font-size: 13px; color: var(--color-muted); text-align: center; margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Home and The Ladder.
   ═══════════════════════════════════════════════════════════════════════════ */

.page.wide { max-width: 760px; }

/* ── home ────────────────────────────────────────────────────────────────── */

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) 0 var(--space-6);
}
.hero-mark {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--color-accent); color: var(--color-accent-ink);
  font-family: var(--font-heading); font-weight: 800; font-size: 26px; line-height: 1;
}
.hero-mark::before { content: "J"; }
.hero-title {
  flex: 1; min-width: 200px;
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -0.03em;
  margin: 0;
}
.hero-sub {
  flex-basis: 100%;
  order: 3;
  font-size: 15px; color: var(--color-muted);
  margin: 0;
}
.hero .auth-slot { justify-content: flex-end; }

.mode-grid {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--space-8);
}

/* Game cards: a little picture of the game made from its own pieces, then
   just the name, one line and a few tags. */
.mode-card {
  --art-bg: var(--color-surface-2);
  --art-ink: var(--color-text);
  position: relative; display: flex; flex-direction: column;
  text-align: left; cursor: pointer; overflow: hidden;
  padding: 0; background: var(--color-surface);
  border: 2px solid transparent; border-radius: var(--radius-xl);
  color: var(--color-text); font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--color-neutral-600); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
.mode-card:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.mode-card.feature { background: var(--color-accent); color: var(--color-accent-ink); }
.mode-card.feature:hover { border-color: var(--color-accent-200); }

.mode-art {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 128px; margin: 8px 8px 0; border-radius: calc(var(--radius-xl) - 6px);
  background: var(--art-bg); color: var(--art-ink); overflow: hidden;
}
.mode-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; flex: 1; }
.mode-name { font: 800 22px/1.05 var(--font-heading); letter-spacing: -0.02em; padding-right: 36px; }
.mode-line { font-size: 14px; line-height: 1.4; color: var(--color-muted); }
.mode-card.feature .mode-line { color: rgba(26, 19, 6, 0.78); }
.mode-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.mode-tags span {
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--color-surface-2); color: var(--color-muted);
}
.mode-card.feature .mode-tags span { background: rgba(26, 19, 6, 0.12); color: var(--color-accent-ink); }
.mode-arrow {
  position: absolute; right: 14px; bottom: 16px; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--color-bg); color: var(--color-text);
  transition: transform 0.2s ease;
}
.mode-card.feature .mode-arrow { background: var(--color-accent-ink); color: var(--color-accent); }
.mode-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mode-card:hover .mode-arrow { transform: translateX(3px); }

/* Daily 15: fifteen days, the streak filling in, today pulsing. */
.art-daily { --art-bg: rgba(26, 19, 6, 0.10); gap: 18px; }
.d-num { font: 800 64px/1 var(--font-heading); letter-spacing: -0.05em; color: var(--color-accent-ink); }
.d-days { display: grid; grid-template-columns: repeat(5, 14px); gap: 6px; }
.d-days i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid rgba(26, 19, 6, 0.35); box-sizing: border-box; }
.d-days i.on { background: var(--color-accent-ink); border-color: var(--color-accent-ink); }
.d-days i.today { border-color: var(--color-accent-ink); animation: today 1.6s ease-in-out infinite; }
@keyframes today { 50% { background: rgba(26, 19, 6, 0.45); } }

/* The Ladder: rungs narrowing towards the million; the current one lit. */
.art-ladder { --art-bg: linear-gradient(160deg, #1E1B33, #15142A); }
.l-rungs { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 78%; }
.l-rungs i {
  width: var(--w); height: 18px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  background: rgba(177, 166, 255, 0.10); border: 1px solid rgba(177, 166, 255, 0.18);
  font: 700 11px/1 var(--font-body); color: var(--color-accent-2-text);
  transition: transform 0.25s ease, background 0.25s ease;
}
.l-rungs i.top { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.l-rungs i.now { background: var(--color-accent-2); border-color: var(--color-accent-2); color: var(--color-accent-2-ink); }
.l-rungs i.safe { border-style: dashed; }
.l-rungs i.done { opacity: 0.55; }
.mode-card:hover .l-rungs i.now { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.25); }

/* Quiz Night: the board itself, a few tiles played, one turned over. */
.art-board { --art-bg: linear-gradient(160deg, #10241D, #0F1A17); flex-direction: column; gap: 7px; }
.b-teams { display: flex; gap: 6px; }
.b-teams b { padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(79, 209, 165, 0.16); color: var(--color-correct); }
.b-teams b + b { background: rgba(255, 159, 90, 0.16); color: var(--color-heat); }
.b-grid { display: grid; grid-template-columns: repeat(4, 40px); gap: 5px; }
.b-grid i {
  height: 22px; border-radius: 5px; display: grid; place-items: center;
  font: 800 11px/1 var(--font-heading); font-style: normal;
  background: #1C3A30; color: var(--color-correct);
  transition: transform 0.35s ease;
}
.b-grid i.used { background: transparent; border: 1px dashed rgba(79, 209, 165, 0.25); color: transparent; }
.b-grid i.open { background: var(--color-accent); color: var(--color-accent-ink); }
.mode-card:hover .b-grid i.open { transform: rotateX(360deg); }

/* Cast Chain: two posters joined by actors. */
.art-chain { --art-bg: linear-gradient(160deg, #2A1626, #1A1220); gap: 0; }
.c-poster { width: 54px; height: 76px; border-radius: 8px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); }
.c-poster.a { background: linear-gradient(160deg, #FF9F5A, #B5442E); transform: rotate(-6deg); }
.c-poster.b { background: linear-gradient(160deg, #8B7CF6, #3A3370); transform: rotate(6deg); }
.c-link {
  position: relative; display: flex; align-items: center; justify-content: space-around;
  width: 120px; height: 24px;
  background: repeating-linear-gradient(90deg, rgba(255, 194, 220, 0.6) 0 6px, transparent 6px 11px) center / 100% 2px no-repeat;
}
.c-link i {
  width: 22px; height: 22px; border-radius: 999px; background: #FF7AB6;
  box-shadow: 0 0 0 3px #2A1626; transition: transform 0.25s ease;
}
.c-link i + i { background: #FFC2DC; }
.mode-card:hover .c-link i { transform: scale(1.18); }
.mode-card:hover .c-link { animation: links 0.8s linear infinite; }
@keyframes links { to { background-position: 11px 50%; } }

/* Guess Bollywood: the four letters in their role colours. */
.art-guess { --art-bg: linear-gradient(160deg, #241A12, #1A1410); display: grid; grid-template-columns: repeat(2, 52px); gap: 8px; place-content: center; }
.art-guess i {
  height: 50px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-style: normal; transition: transform 0.25s ease;
}
.art-guess b { font: 800 24px/1 var(--font-heading); }
.art-guess small { font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; margin-top: 2px; }
.art-guess .g-actor { background: var(--color-accent-2); color: var(--color-accent-2-ink); }
.art-guess .g-actress { background: var(--color-mystery); color: #2A0A1A; }
.art-guess .g-movie { background: var(--color-accent); color: var(--color-accent-ink); }
.art-guess .g-song { background: var(--color-heat); color: #2A1206; }
.mode-card:hover .art-guess i:nth-child(odd) { transform: rotate(-5deg); }
.mode-card:hover .art-guess i:nth-child(even) { transform: rotate(5deg); }

@media (max-width: 560px) {
  .mode-art { height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-days i.today, .mode-card:hover .c-link { animation: none; }
  .mode-card, .mode-arrow, .l-rungs i, .b-grid i, .c-link i, .art-guess i { transition: none; }
  .mode-card:hover { transform: none; }
}

/* ── the ladder: result ──────────────────────────────────────────────────── */

.winnings {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(36px, 6vw, 56px); line-height: 1; letter-spacing: -0.03em;
  color: var(--color-accent);
  margin: var(--space-2) 0;
}
.result-note { color: var(--color-muted); font-size: 16px; }
.result-answer {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: 15px; color: var(--color-muted);
}
.result-answer strong { color: var(--color-correct); font-weight: 700; }

/* ── the ladder: play ────────────────────────────────────────────────────── */

/* The old studio set is retired; the elements stay so the script still finds them. */
.set { display: none; }
.disc-wrap svg.spiro { display: none; }

.lifeline-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.lifelines { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.lifeline {
  position: relative;
  min-width: 56px; height: 44px;
  display: grid; place-items: center;
  padding: 0 var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.1s ease, opacity 0.14s ease;
}
.lifeline:hover:not(:disabled) { border-color: var(--color-accent-2); transform: translateY(-1px); }
.lifeline:disabled { cursor: default; }
.lifeline svg { width: 36px; height: 22px; display: block; }
.lifeline svg * { stroke: currentColor; }
.lifeline .fifty {
  font-family: var(--font-heading); font-weight: 800; font-size: 17px;
  color: currentColor;
}
.lifeline.spent { opacity: 0.3; text-decoration: line-through; }

.walk-away {
  min-width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-line); border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
}
.walk-away:hover { border-color: var(--color-wrong); }
.walk-away svg { width: 24px; height: 22px; }
.walk-away svg * { stroke: currentColor; }
.bar-right { display: flex; gap: var(--space-2); align-items: center; }

.lifeline-result {
  max-width: 100%; margin: 0 0 var(--space-4);
  background: var(--color-accent-2-900);
  border: 1px dashed var(--color-accent-2-800);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 15px; color: var(--color-accent-2-200);
  animation: fadein 0.2s ease;
}

/* The rung and its value — once a disc and a banner, now a plain header. */
.stage { padding: 0 0 var(--space-4); }
.disc-wrap { display: block; width: auto; height: auto; }
.banner { display: block; }
.banner-inner {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
}
.banner-value {
  order: 2;
  font-family: var(--font-heading); font-weight: 800; font-size: 22px; line-height: 1.1;
  color: var(--color-accent);
}
.banner-rung {
  order: 1;
  font-family: var(--font-heading); font-weight: 800; font-size: 19px;
  color: var(--color-text);
}

/* Question and answers. */
.question-panel {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-4);
}
.question-inner { padding: var(--space-4) var(--space-6); }
.question-text {
  margin: 0;
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.25;
  text-wrap: balance;
}

.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .answer-grid { grid-template-columns: 1fr; } }

.answer {
  padding: 0;
  background: none;
  border: 0; cursor: pointer;
  border-radius: var(--radius-md);
  font: inherit;
}
.answer-inner {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 48px;
  padding: var(--space-1) var(--space-3);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.answer:hover:not(:disabled) .answer-inner { border-color: var(--color-accent-2); }
.answer:disabled { cursor: default; }

.answer .diamond { display: none; }
.answer .letter {
  flex: none; width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--color-line);
  font-family: var(--font-body); font-weight: 800; font-size: 13px;
  color: var(--color-text);
}
.answer .answer-label {
  font-family: var(--font-body); font-weight: 600;
  font-size: 15px; color: var(--color-text);
}

/* Locked in violet, right in green — each with its own text colour. */
.answer.chosen .answer-inner { background: var(--color-accent-2-900); border: 2px solid var(--color-accent-2); }
.answer.chosen .letter { background: var(--color-accent-2); color: var(--color-accent-2-ink); }
.answer.correct .answer-inner { background: var(--color-correct); border-color: var(--color-correct); }
.answer.correct .letter { background: var(--color-correct-ink); color: var(--color-correct); }
.answer.correct .answer-label { color: var(--color-correct-ink); }
.answer.eliminated { visibility: hidden; }

@keyframes flicker {
  0%, 100% { border-color: var(--color-accent-2); }
  50%      { border-color: var(--color-line); }
}
.answer.awaiting .answer-inner { animation: flicker 0.5s steps(1, end) 4; }

/* ── the ladder: rungs ───────────────────────────────────────────────────── */

.ladder-rungs { display: flex; flex-direction: column-reverse; gap: 4px; }

.rung {
  display: grid; grid-template-columns: 28px 1fr;
  align-items: center; gap: var(--space-3);
  min-height: 34px;
  padding: 4px var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--color-muted);
}
.rung .n { text-align: right; font-size: 13px; color: var(--color-faint); }
.rung.safe { color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-neutral-600); }
.rung.safe .n::after { content: " ●"; color: var(--color-accent); font-size: 9px; vertical-align: middle; }
.rung.won { color: var(--color-accent); }

.rung.current { padding: 0; display: block; background: var(--color-accent-2); color: var(--color-accent-2-ink); }
.rung.current .row {
  display: grid; grid-template-columns: 28px 1fr;
  align-items: center; gap: var(--space-3);
  min-height: 34px;
  padding: 4px var(--space-3);
  font-weight: 800;
}
.rung.current .n { color: var(--color-accent-2-ink); }

.tree-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(320px, 90vw);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border-left: 1px solid var(--color-line);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  animation: slide-in 0.2s ease;
}
@keyframes slide-in { from { transform: translateX(100%); } }
.tree-panel h4 { margin-bottom: var(--space-4); }
.tree-panel .btn { margin-top: var(--space-4); width: 100%; }

.prize-preview {
  margin-top: var(--space-6); max-width: 360px;
  background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-4);
}
.prize-preview h4 { margin-bottom: var(--space-3); }


/* ═══════════════════════════════════════════════════════════════════════════
   Quiz Night — the rules on screen.
   ═══════════════════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Side colours, used wherever a side is named. */
[data-side="0"], .side-0 { --side: var(--color-accent); --side-text: var(--color-accent); --side-ink: var(--color-accent-ink); --side-soft: var(--color-accent-900); --side-line: var(--color-accent-800); }
[data-side="1"], .side-1 { --side: var(--color-accent-2); --side-text: var(--color-accent-2-text); --side-ink: var(--color-accent-2-ink); --side-soft: var(--color-accent-2-900); --side-line: var(--color-accent-2-800); }
strong.side-0, strong.side-1 { color: var(--side-text); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--color-accent);
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── setup: the two sides ── */

.sides-setup { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (max-width: 720px) { .sides-setup { grid-template-columns: 1fr; } }
.side-form {
  margin: 0; min-width: 0;
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 2px solid var(--side-line);
}
.side-form > label { font-size: 13px; font-weight: 600; color: var(--color-muted); }
.side-name { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--side-text); }
.side-players-label { font-size: 13px; font-weight: 600; color: var(--color-muted); margin-top: var(--space-1); }
.side-players-label .hint { font-weight: 400; color: var(--color-faint); }
.side-players { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.side-players .input { min-height: 38px; font-size: 14px; }

/* ── the scorecards, now at the top ── */

.team { border-color: var(--color-line); }
.team.active { border-color: var(--side); }
.team-top { display: flex; align-items: center; gap: var(--space-2); min-height: 34px; }
.team-top .team-name { flex: 1; min-width: 0; margin: 0 0 0 -6px; }
.team-streak { font-size: 13px; font-weight: 700; color: var(--color-muted); white-space: nowrap; }
.team-streak.hot { color: var(--color-heat); }
.team-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 2px 0 var(--space-2); }
.team-row .team-score { flex: 1; min-width: 120px; }
.team-row .team-adjust { margin: 0; flex: none; }
.team-row .team-adjust button { flex: none; min-width: 42px; min-height: 30px; font-size: 12px; }
.team-extras { display: flex; flex-direction: column; gap: var(--space-2); }
.team-pips, .team-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.team-pips .pip {
  min-width: 0; padding: 5px 6px; border-radius: 8px;
  font-size: 12px; font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--color-surface-2); color: var(--color-muted);
}
.team-pips .pip.on { background: var(--side); color: var(--side-ink); }

.box {
  min-height: 30px; padding: 0 6px;
  border-radius: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 12px;
  border: 1px dashed var(--color-mystery);
  background: #2A1A26; color: #FFC2DC;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.1s ease;
}
.box:hover:not(:disabled) { background: #3A2234; }
.box.armed { border: none; background: var(--color-mystery); color: #2A0A1A; }
.box.idle { opacity: 0.55; cursor: default; }
.box.used { opacity: 0.3; text-decoration: line-through; cursor: default; border-color: var(--color-neutral-600); background: transparent; color: var(--color-faint); }
.box:disabled { cursor: default; }

.turn-bar { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: 0 0 var(--space-4); }
.turn-bar .turn-line { margin: 0; font-size: 14px; color: var(--color-muted); }
.turn-bar .progress { flex: 1; min-width: 220px; margin: 0; }
.armed-note {
  display: inline-flex; align-items: center; min-height: 28px; margin-left: var(--space-2);
  padding: 0 10px; border-radius: 999px;
  background: var(--color-mystery); color: #2A0A1A;
  font-size: 12px; font-weight: 700;
}

/* Played tiles say who took them. */
.tile { flex-direction: column; gap: 2px; }
.tile:disabled[data-owner] { border-style: solid; }
.tile[data-owner="0"] { background: var(--color-accent-900); border-color: var(--color-accent-800); }
.tile[data-owner="1"] { background: var(--color-accent-2-900); border-color: var(--color-accent-2-800); }
.tile-owner {
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  color: var(--color-muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile[data-owner="0"] .tile-owner { color: var(--color-accent); }
.tile[data-owner="1"] .tile-owner { color: var(--color-accent-2-text); }
.mobile-tiles .tile-owner { font-size: 13px; }

/* ── the question ── */

.q-card { border-color: var(--side, var(--color-line)); transition: border-color 0.2s ease; }
.q-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.q-chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--color-surface-2); color: var(--color-text);
}
.q-chip.heat { background: var(--color-heat); color: #2A1206; }
.q-chip.myst { background: var(--color-mystery); color: #2A0A1A; }
.q-chip.closed { background: var(--color-surface-2); color: var(--color-muted); }
.q-chip.violet { background: var(--color-accent-2-900); color: var(--color-accent-2-200); }
.q-chip.side { background: var(--side); color: var(--side-ink); }

.blitz-intro { text-align: center; padding: var(--space-6) 0 var(--space-2); }
.blitz-title {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(36px, 6vw, 56px); line-height: 1; letter-spacing: -0.03em;
  color: var(--color-heat); margin: 0 0 var(--space-3);
  animation: breathe 0.5s ease-in-out 3;
}
.blitz-note { color: var(--color-muted); font-size: 16px; margin: 0 auto; max-width: 40ch; }
.plate-btn.blitz { background: var(--color-heat); color: #2A1206; }
.plate-btn.blitz:hover:not(:disabled) { background: #FFB37D; }

.answering-label strong { font-weight: 800; }

.steal-banner {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--side); color: var(--side-ink);
  font-weight: 700; text-align: center;
  animation: breathe 0.8s ease-in-out infinite;
}

.q-timer { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.q-timer-track { flex: 1; height: 8px; border-radius: 999px; background: var(--color-line); overflow: hidden; }
.q-timer-fill { height: 100%; width: 100%; border-radius: 999px; background: var(--side, var(--color-accent)); transition: width 0.1s linear, background 0.3s ease; }
.q-timer-fill.low { background: var(--color-wrong); }
.q-timer-num {
  min-width: 40px; text-align: right;
  font-family: var(--font-heading); font-weight: 800; font-size: 24px; line-height: 1;
}
.q-timer-num.low { color: var(--color-wrong-text); animation: breathe 0.5s ease-in-out infinite; }

.spoken {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px dashed var(--color-neutral-600);
}
.spoken-note { color: var(--color-muted); margin: 0 0 var(--space-3); }
.spoken-note strong { color: var(--color-accent); }
.spoken-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plate-btn.good { background: var(--color-correct); color: var(--color-correct-ink); }
.plate-btn.good:hover:not(:disabled) { background: #6BDCB5; }
.plate-btn.bad { background: transparent; border: 2px solid var(--color-wrong); color: var(--color-wrong-text); }
.plate-btn.bad:hover:not(:disabled) { background: var(--color-wrong-soft); }
.plate-btn.opts { margin-left: auto; background: var(--color-accent-2-900); border: 1px solid var(--color-accent-2-800); color: var(--color-accent-2-200); }
.plate-btn.opts:hover:not(:disabled) { background: #2A2550; }
@media (max-width: 720px) { .plate-btn.opts { margin-left: 0; } .spoken-actions .plate-btn { flex: 1 1 auto; } }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 4px;
  border-radius: 5px; font: 700 11px var(--font-body);
  background: rgba(0, 0, 0, 0.18); color: inherit;
}
@media (hover: none) { kbd { display: none; } }

.q-options { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .q-options { grid-template-columns: 1fr; } }

.q-feedback {
  margin-top: var(--space-4);
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  animation: fadein 0.2s ease;
}
.q-feedback strong { font-family: var(--font-heading); font-weight: 800; font-size: 18px; }
.q-feedback small { font-size: 13px; color: var(--color-muted); }
.q-feedback.good { background: var(--color-correct-soft); border: 1px solid #2E6B54; }
.q-feedback.good strong { color: var(--color-correct); }
.q-feedback.bad { background: var(--color-wrong-soft); border: 1px solid #7A2E27; }
.q-feedback.bad strong { color: var(--color-wrong-text); }
.q-feedback.neutral { background: var(--color-surface-2); border: 1px solid var(--color-line); }

.q-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.q-spacer { flex: 1; }
.peek-text { font-size: 14px; font-weight: 700; color: var(--color-correct); }
#peekBtn { user-select: none; -webkit-user-select: none; touch-action: none; }

/* ── rules ── */

.rules h2 { margin-bottom: var(--space-4); }
.rules p { color: var(--color-muted); max-width: 68ch; }
.rules strong { color: var(--color-text); }

/* ── the end ── */

.victor.side-0 { color: var(--color-accent); }
.victor.side-1 { color: var(--color-accent-2-text); }
.end-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-6); text-align: left; }
@media (max-width: 720px) { .end-cols { grid-template-columns: 1fr; } }
.end-col {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 2px solid var(--color-line);
}
.end-col.won { border-color: var(--side); }
.end-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.end-name { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--side-text); }
.end-score { font-family: var(--font-heading); font-weight: 800; font-size: 30px; line-height: 1; }
.end-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.end-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 12px; background: var(--color-surface-2); text-align: center;
}
.end-stat b { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.end-stat span { font-size: 11px; font-weight: 600; color: var(--color-muted); line-height: 1.2; }
.end-note { font-size: 13px; color: var(--color-muted); margin: 0; }
.end-members { list-style: none; margin: 0; padding: 0; }
.end-members li {
  display: flex; justify-content: space-between; gap: var(--space-2);
  padding: 8px 0; border-bottom: 1px solid var(--color-surface-2);
  font-size: 15px; font-weight: 600;
}
.end-members li:last-child { border-bottom: 0; }
.end-members li.mvp { color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   Shared small controls: segmented choice, checkbox chips, field labels.
   ═══════════════════════════════════════════════════════════════════════════ */

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--color-muted); margin-bottom: var(--space-2); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--color-bg); border: 1px solid var(--color-line); }
.seg button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--radius-sm);
  font: 600 14px var(--font-body); color: var(--color-muted); background: transparent; cursor: pointer;
}
.seg button:hover { color: var(--color-text); }
.seg button[aria-checked="true"] { background: var(--color-text); color: var(--color-bg); }

.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 10px;
  border-radius: 999px; border: 1px solid var(--color-line); background: var(--color-surface-2);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--color-accent); margin: 0; }
.check:has(input:checked) { border-color: var(--color-accent); }
.check:has(input:disabled) { opacity: 0.55; cursor: default; }

.poster {
  flex: none; display: grid; place-items: center; overflow: hidden;
  width: 36px; height: 54px; border-radius: 6px; background: var(--color-surface-2);
  font: 800 16px var(--font-heading); color: var(--color-faint);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake 0.3s ease; }

/* ═══════════════════════════════════════════════════════════════════════════
   Cast Chain
   ═══════════════════════════════════════════════════════════════════════════ */

.chain-lobby { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-2); }
.chain-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent-ink); }

.chain-daily {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-xl);
  background: var(--color-accent); color: var(--color-accent-ink);
}
.chain-daily-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.chain-countdown { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--color-accent-ink); color: var(--color-accent); }
.chain-pair { display: flex; align-items: center; gap: var(--space-3); min-height: 90px; }
.chain-pair-empty { font-weight: 600; }
.pair-movie { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); }
.pair-movie .poster { width: 54px; height: 80px; background: rgba(0, 0, 0, 0.12); color: var(--color-accent-ink); }
.pair-title { font: 800 19px/1.15 var(--font-heading); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pair-year { font: 600 13px var(--font-body); opacity: 0.75; }
.pair-arrow { flex: none; font: 800 24px var(--font-heading); }
.chain-daily-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.chain-daily-status { font-size: 14px; font-weight: 600; }
.chain-daily .btn-primary { background: var(--color-accent-ink); color: var(--color-accent); }
.chain-daily .btn-primary:hover:not(:disabled) { background: #2A200A; }
@media (max-width: 560px) { .chain-pair { flex-direction: column; align-items: stretch; } .pair-arrow { transform: rotate(90deg); align-self: center; } }

.chain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 720px) { .chain-grid { grid-template-columns: 1fr; } }
.chain-panel {
  display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface);
}
.chain-panel h3 { margin: 0; font-size: 17px; }
.chain-panel h3 .hint { font: 400 13px var(--font-body); color: var(--color-faint); margin-left: 6px; }
.chain-panel-note { margin: 0; color: var(--color-muted); font-size: 14px; }
.chain-mods { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.chain-search { position: relative; width: 100%; }
.chain-search label { display: block; font-size: 12px; font-weight: 700; color: var(--color-muted); margin-bottom: 4px; }
.chain-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 320px; overflow-y: auto; padding: 4px;
  background: var(--color-surface-2); border: 1px solid var(--color-line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.chain-result {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 6px 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text);
  font: 600 14px var(--font-body); text-align: left; cursor: pointer;
}
.chain-result:hover, .chain-result:focus-visible { background: var(--color-line); }
.chain-result .poster { width: 28px; height: 42px; }
.chain-results-empty { padding: 10px; color: var(--color-muted); font-size: 14px; }

.chain-history { list-style: none; margin: 0; padding: 0; width: 100%; }
.chain-history li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 8px 0; border-bottom: 1px solid var(--color-surface-2); font-size: 14px; }
.chain-history li:last-child { border-bottom: 0; }
.chain-history li span:last-child { color: var(--color-muted); white-space: nowrap; }
.chain-history .chain-history-empty { color: var(--color-faint); }
.chain-credit { font-size: 12px; color: var(--color-faint); margin: 0; }

/* Playing */
.chain-bar { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.chain-ends { display: flex; align-items: center; gap: var(--space-2); }
.chain-end {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 10px 6px 6px; border-radius: var(--radius-md); background: var(--color-surface);
  font: 700 15px/1.2 var(--font-heading);
}
.chain-end.target { justify-content: flex-start; flex-direction: row-reverse; text-align: right; padding: 6px 6px 6px 10px; box-shadow: inset 0 0 0 2px var(--color-accent); }
.chain-end > span:last-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chain-swap {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--color-line); background: var(--color-surface-2); color: var(--color-text); cursor: pointer;
}
.chain-swap svg { width: 20px; height: 20px; }
.chain-swap:disabled { opacity: 0.35; cursor: default; }
.chain-stats { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: 14px; color: var(--color-muted); }
.chain-stat b { color: var(--color-text); font-size: 16px; }
#chainModsBadge { padding: 2px 10px; border-radius: 999px; background: var(--color-mystery); color: #2A0A1A; font-size: 12px; font-weight: 700; }
#chainQuit { margin-left: auto; }

.chain-path { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain-node { display: flex; align-items: center; gap: 6px; }
.chain-node + .chain-node::before { content: "→"; color: var(--color-faint); font-weight: 700; }
.chain-node button {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--color-line);
  background: var(--color-surface); color: var(--color-text); font: 600 13px var(--font-body); cursor: pointer;
}
.chain-node button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-node button:hover:not(:disabled) { border-color: var(--color-accent-2); }
.chain-node button:disabled { cursor: default; border-color: var(--color-accent-2); background: var(--color-accent-2-900); }
.chain-node .poster { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; }
.chain-node.person button { color: var(--color-accent-2-200); }

.chain-step { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.chain-step-label { margin: 0; font: 700 18px var(--font-heading); }
.chain-list { display: flex; flex-direction: column; gap: 6px; }
.chain-loading { color: var(--color-muted); padding: var(--space-4) 0; margin: 0; }
.chain-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px; padding: 6px 12px 6px 6px;
  border-radius: var(--radius-md); border: 1px solid var(--color-line); background: var(--color-surface);
  color: var(--color-text); text-align: left; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.chain-item:hover, .chain-item:focus-visible { border-color: var(--color-accent-2); background: var(--color-surface-2); }
.chain-item .poster { width: 40px; height: 60px; }
.chain-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chain-item-name { font: 700 16px var(--font-body); }
.chain-item-sub { font-size: 13px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-item.is-target { border: 2px solid var(--color-accent); background: var(--color-accent-900); }
.chain-target-tag { align-self: flex-start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-ink); font-size: 11px; font-weight: 800; }

.chain-final { list-style: none; margin: var(--space-4) auto 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: left; }
.chain-final .chain-node { gap: var(--space-2); font-weight: 600; }
.chain-final .chain-node + .chain-node::before { content: "↓"; display: none; }
.chain-final .chain-node .poster { width: 28px; height: 40px; border-radius: 4px; }
.chain-final .chain-node.person { color: var(--color-accent-2-200); }

/* ═══════════════════════════════════════════════════════════════════════════
   Guess Bollywood
   ═══════════════════════════════════════════════════════════════════════════ */

#guessSetup .standfirst { margin-top: 0; }
#guessSetup .standfirst strong { color: var(--color-accent); letter-spacing: 0.1em; }

.guess-top { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.guess-top .q-progress { margin: 0; }
.q-progress span.missed { background: var(--color-wrong); }
.guess-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--color-muted); }
.guess-score b { color: var(--color-accent); font-size: 16px; }

.guess-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  padding: var(--space-6) var(--space-4); border-radius: var(--radius-xl);
  background: var(--color-surface); border: 2px solid transparent; text-align: center;
  transition: border-color 0.2s ease;
}
.guess-card.solved { border-color: var(--color-correct); }
.guess-card.failed { border-color: var(--color-wrong); }
.guess-card-head { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.guess-worth { font-size: 14px; color: var(--color-muted); white-space: nowrap; }
@media (max-width: 560px) { .guess-worth { font-size: 12px; } }
.guess-worth b { color: var(--color-accent); font-size: 18px; }
.g-type-movie { background: var(--color-accent-900); color: var(--color-accent); }
.g-type-song { background: #2A1A26; color: #FFC2DC; }
.g-type-actor { background: var(--color-accent-2-900); color: var(--color-accent-2-200); }
.g-type-actress { background: #123227; color: var(--color-correct); }

.guess-initials { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3) var(--space-4); padding: var(--space-2) 0; }
.g-word { display: flex; gap: 3px; }
.g-tile {
  width: 28px; height: 38px; display: grid; place-items: center;
  border-radius: 6px; background: var(--color-bg); border: 1px solid var(--color-line);
  font: 800 18px var(--font-heading); color: var(--color-text);
}
.g-tile.first { width: 40px; height: 52px; font-size: 28px; background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.g-tile.shown:not(.first) { background: var(--color-surface-2); }
.guess-card.solved .g-tile.first { background: var(--color-correct); border-color: var(--color-correct); color: var(--color-correct-ink); }
.guess-card.failed .g-tile.first { background: var(--color-wrong); border-color: var(--color-wrong); color: var(--color-wrong-ink); }
@media (max-width: 560px) { .g-tile { width: 20px; height: 30px; font-size: 14px; } .g-tile.first { width: 32px; height: 42px; font-size: 22px; } }

.guess-hints { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 6px; counter-reset: hint; }
.guess-hints:empty { display: none; }
.guess-hints li {
  counter-increment: hint; display: flex; gap: var(--space-2); align-items: baseline; text-align: left;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--color-bg); border: 1px dashed var(--color-neutral-600);
  font-size: 15px; animation: fadein 0.2s ease;
}
.guess-hints li::before { content: counter(hint); flex: none; font: 800 12px var(--font-body); color: var(--color-accent); }

.guess-form { display: flex; gap: var(--space-2); width: 100%; max-width: 560px; }
.guess-form .input { flex: 1; font-size: 16px; }
.guess-card .q-feedback { width: 100%; max-width: 560px; margin: 0; text-align: left; }
.guess-actions { display: flex; justify-content: center; gap: var(--space-2); }

@media (max-width: 900px) { .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mode-grid { grid-template-columns: 1fr; } }

/* Guess Bollywood — four letters from one film, in a 2×2 grid:
   actor | actress on top, movie | song below. */
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); width: 100%; max-width: 560px; }
.g-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; padding: var(--space-3);
  border-radius: var(--radius-lg); background: var(--color-bg); border: 2px solid var(--color-line);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.g-role { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
.g-letter {
  width: 64px; height: 72px; display: grid; place-items: center; border-radius: 14px;
  background: var(--color-accent); color: var(--color-accent-ink);
  font: 800 44px/1 var(--font-heading);
}
.g-answer { min-height: 20px; font: 700 15px/1.25 var(--font-body); text-align: center; overflow-wrap: anywhere; }
.g-card[data-role="actor"] .g-letter { background: var(--color-accent-2); color: var(--color-accent-2-ink); }
.g-card[data-role="actress"] .g-letter { background: var(--color-mystery); color: #2A0A1A; }
.g-card[data-role="movie"] .g-letter { background: var(--color-accent); color: var(--color-accent-ink); }
.g-card[data-role="song"] .g-letter { background: var(--color-heat); color: #2A1206; }
.g-card.named { border-color: var(--color-correct); background: var(--color-correct-soft); }
.g-card.named .g-answer { color: var(--color-correct); }
.g-card.missed { border-color: #7A2E27; background: var(--color-wrong-soft); }
.g-card.missed .g-answer { color: var(--color-wrong-text); }
.g-card.missed .g-letter { opacity: 0.6; }
.g-card.flash { animation: pop 0.35s ease; }
.g-role .g-worth { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--color-surface-2); color: var(--color-text); font-size: 11px; letter-spacing: 0; }
.g-card.named .g-worth { background: var(--color-correct); color: var(--color-correct-ink); }
.g-card.missed .g-worth { display: none; }
.g-hints { list-style: none; margin: 2px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.g-hints:empty { display: none; }
.g-hints li {
  padding: 5px 8px; border-radius: 8px; background: var(--color-surface-2);
  font-size: 12.5px; line-height: 1.35; color: var(--color-text); text-align: left;
  counter-increment: hint;
}
.g-hints { counter-reset: hint; }
.g-hints li::before { content: counter(hint) ". "; font-weight: 700; color: var(--color-muted); }
.g-hint-btn {
  margin-top: 2px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px dashed var(--color-line); background: transparent; color: var(--color-muted);
  font: 600 12px/1.2 var(--font-body);
}
.g-hint-btn:hover:not(:disabled) { border-style: solid; border-color: var(--color-accent); color: var(--color-text); }
.g-hint-btn:disabled { opacity: 0.5; cursor: default; }
.g-hint-btn[hidden] { display: none; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
.guess-card.partial { border-color: var(--color-accent); }
@media (max-width: 560px) {
  .g-card { min-height: 120px; }
  .g-letter { width: 52px; height: 58px; font-size: 34px; }
  .g-answer { font-size: 13px; }
}

/* ── account menu (top right) ─────────────────────────────────────────────── */

.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 10px 0 3px; border-radius: 999px;
  border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-text);
  font: 600 14px/1 var(--font-body); cursor: pointer;
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--color-neutral-600); background: var(--color-surface-2); }
.acct-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chev { width: 16px; height: 16px; fill: none; stroke: var(--color-muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.avatar {
  flex: none; display: grid; place-items: center; overflow: hidden;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--color-accent-2); color: var(--color-accent-2-ink);
  font: 800 15px/1 var(--font-body);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 44px; height: 44px; font-size: 18px; }
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }

.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 280px; padding: 6px; border-radius: 16px;
  background: var(--color-surface); border: 1px solid var(--color-line);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.acct-menu[hidden] { display: none; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--color-line); }
.acct-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-who b { font-size: 15px; }
.acct-who span { font-size: 13px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--color-text);
  font: 600 14px/1.2 var(--font-body); text-align: left; cursor: pointer;
}
.acct-item:hover, .acct-item:focus-visible { background: var(--color-surface-2); outline: none; }
.acct-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--color-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acct-item.danger { color: #FF8A7A; }
.acct-item.danger svg { stroke: currentColor; }
.acct-rule { height: 1px; margin: 4px 0; background: var(--color-line); }
@media (max-width: 560px) {
  .acct-name, .acct-chev { display: none; }
  .acct-btn { padding: 0 3px; }
  .acct-menu { width: min(280px, calc(100vw - 32px)); }
}

/* ── profile & settings ───────────────────────────────────────────────────── */

.prof-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-bottom: var(--space-8); }
.prof-nav { position: sticky; top: var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.prof-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--color-muted); font-weight: 600; text-decoration: none; }
.prof-nav a:hover { background: var(--color-surface); color: var(--color-text); }
.prof-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.prof-main > section { scroll-margin-top: var(--space-4); }
.prof-card { padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-surface); display: flex; flex-direction: column; gap: var(--space-4); }
.prof-section { display: flex; flex-direction: column; gap: var(--space-3); }
.prof-main h2 { margin: 0; font-size: 20px; }
.prof-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.prof-head span, .prof-note { font-size: 13px; color: var(--color-faint); margin: 0; }
.prof-account { flex-direction: row; align-items: center; gap: var(--space-4); }
.prof-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prof-who h2 { font-size: 22px; }
.prof-who span { color: var(--color-muted); font-size: 14px; overflow-wrap: anywhere; }
.prof-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.prof-stat { display: flex; flex-direction: column; gap: 4px; padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface); }
.prof-stat b { font: 800 28px/1.1 var(--font-heading); }
.prof-stat span { font-size: 14px; color: var(--color-muted); }
.prof-stat small { font-size: 12px; color: var(--color-faint); }
#profDailySlot #quizTopics { padding: 0; background: none; border: 0; box-shadow: none; margin: 0; }
.prof-group { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.prof-group:first-child { border-top: 0; padding-top: 0; }
.prof-group h3 { margin: 0; font: 700 17px/1.3 var(--font-heading); }
.prof-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.prof-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.prof-row-label { width: 150px; font-size: 14px; font-weight: 600; color: var(--color-muted); }
.prof-device-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--color-line); }
.prof-device-row:first-child { border-top: 0; padding-top: 0; }
.prof-device-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.prof-device-row span { font-size: 13px; color: var(--color-muted); }
.btn-danger-ghost { background: transparent; border: 1px solid #5A2A24; color: #FF8A7A; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--color-wrong-soft); }
.btn-danger-ghost:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 900px) {
  .prof-layout { grid-template-columns: 1fr; }
  .prof-nav { display: none; }
  .prof-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof-group { grid-template-columns: 1fr; gap: var(--space-2); }
}
@media (max-width: 560px) {
  .prof-account { flex-wrap: wrap; }
  .prof-row-label { width: 100%; }
}
#profile.page { max-width: 1120px; }
.prof-nav { align-self: start; }

/* ── home: tabs and game groups ───────────────────────────────────────────── */

/* Each family of games gets its own banner: a tilted badge, a big title, a
   tagline and a count. Quiz Buff is game-show amber with a dotted board;
   Movie Buff is a cinema strip with sprocket holes along its edges. */
.buff {
  --buff-ink: var(--color-accent);
  --buff-soft: rgba(242, 181, 68, 0.10);
  position: relative; margin-bottom: var(--space-6);
  padding: var(--space-4); border-radius: calc(var(--radius-lg) + 6px);
  background: var(--buff-soft); border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.buff .mode-grid { margin-bottom: 0; position: relative; }
.buff-quiz {
  background:
    radial-gradient(rgba(242, 181, 68, 0.16) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--buff-soft);
}
.buff-movie {
  --buff-ink: #FF7AB6;
  --buff-soft: rgba(255, 122, 182, 0.08);
  padding-block: calc(var(--space-4) + 14px);
}
/* Sprocket holes along the top and bottom edges. */
.buff-movie::before, .buff-movie::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background:
    linear-gradient(90deg, transparent 6px, var(--color-bg) 6px, var(--color-bg) 16px, transparent 16px) 0 50% / 22px 7px repeat-x,
    rgba(255, 122, 182, 0.14);
}
.buff-movie::before { top: 0; }
.buff-movie::after { bottom: 0; }

.buff-head { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); position: relative; }
.buff-badge {
  flex: none; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--buff-ink); color: var(--color-bg);
  transform: rotate(-8deg);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1);
}
.buff-movie .buff-badge { transform: rotate(6deg); }
.buff-badge svg { width: 30px; height: 30px; }
.buff:hover .buff-badge { transform: rotate(0deg) scale(1.08); }
.buff-words { flex: 1; min-width: 0; }
.buff-title {
  margin: 0; font: 800 clamp(24px, 3vw, 30px)/1.05 var(--font-heading);
  letter-spacing: -0.02em; color: var(--color-text);
}
.buff-title::after {
  content: ""; display: block; width: 44px; height: 4px; margin-top: 6px;
  border-radius: 4px; background: var(--buff-ink);
  transition: width 0.3s ease;
}
.buff:hover .buff-title::after { width: 88px; }
.buff-tag { margin: 6px 0 0; font-size: 14px; color: var(--color-muted); }
.buff-count {
  flex: none; padding: 6px 12px; border-radius: 999px;
  font: 700 12px/1 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--buff-ink); border: 1.5px dashed var(--buff-ink);
}
@media (max-width: 560px) {
  .buff { padding: var(--space-3); }
  .buff-movie { padding-block: calc(var(--space-3) + 14px); }
  .buff-badge { width: 44px; height: 44px; border-radius: 14px; }
  .buff-badge svg { width: 26px; height: 26px; }
  .buff-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .buff-badge, .buff-title::after { transition: none; }
}

/* ── previous games ───────────────────────────────────────────────────────── */

.hist-bar { margin-bottom: var(--space-4); overflow-x: auto; }
.hist-list { display: flex; flex-direction: column; gap: var(--space-2); }
.hist-day { margin: var(--space-4) 0 var(--space-1); font: 700 13px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-faint); }
.hist-day:first-child { margin-top: 0; }
.hist-item { border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid transparent; }
.hist-item[open] { border-color: var(--color-line); }
.hist-item summary {
  display: grid; grid-template-columns: 130px minmax(0, 1fr) auto 72px; align-items: center; gap: var(--space-3);
  min-height: 60px; padding: var(--space-2) var(--space-4); cursor: pointer; list-style: none;
}
.hist-item summary::-webkit-details-marker { display: none; }
.hist-game { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--color-surface-2); color: var(--color-muted); white-space: nowrap; }
.g-daily .hist-game { background: var(--color-accent-900); color: var(--color-accent); }
.g-ladder .hist-game { background: var(--color-accent-2-900); color: var(--color-accent-2-text); }
.g-board .hist-game { background: #123227; color: var(--color-correct); }
.g-chain .hist-game { background: #2A1A10; color: var(--color-heat); }
.g-guess .hist-game { background: #2A1A26; color: #FFC2DC; }
.hist-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-main b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main span { font-size: 13px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-score { font: 800 18px/1 var(--font-heading); white-space: nowrap; }
.hist-item time { font-size: 13px; color: var(--color-faint); text-align: right; }
.hist-detail { padding: 0 var(--space-4) var(--space-4) calc(130px + var(--space-3) + var(--space-4)); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--color-muted); }
.hist-detail p { margin: 0; }
.hist-detail b { color: var(--color-text); font-weight: 600; }
.hist-detail ul { margin: 0; padding-left: 18px; }
.hist-item.flat > .hist-again { margin: 0 var(--space-4) var(--space-3) calc(130px + var(--space-3) + var(--space-4)); }
.hist-item:not([open]) > .hist-again { display: none; }
.hist-again { align-self: flex-start; margin-top: 4px; }
.hist-note { color: var(--color-muted); padding: var(--space-6); text-align: center; border-radius: var(--radius-md); background: var(--color-surface); }
.hist-more { display: flex; justify-content: center; margin: var(--space-4) 0 var(--space-8); }
@media (max-width: 720px) {
  .hist-item summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "game score" "main main" "time time"; row-gap: 6px; padding: var(--space-3); }
  .hist-game { grid-area: game; }
  .hist-main { grid-area: main; }
  .hist-score { grid-area: score; }
  .hist-item time { grid-area: time; text-align: left; }
  .hist-detail, .hist-item.flat > .hist-again { padding-left: var(--space-3); margin-left: var(--space-3); }
  .hist-detail { padding-left: var(--space-3); margin-left: 0; }
}

@media (min-width: 901px) {
  .buff-movie .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── bottom bar ───────────────────────────────────────────────────────────
   Phones: a full-width tab bar along the bottom edge, like most apps.
   Wider screens: the same three tabs as a floating pill, centred. */

body.has-dock { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.app-dock {
  position: fixed; z-index: 40; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px;
  border-radius: 999px; border: 1px solid var(--color-line);
  background: rgba(26, 29, 39, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.app-dock[hidden] { display: none; }
.app-dock button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--color-muted);
  font: 600 14px/1 var(--font-body); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.app-dock button:hover { color: var(--color-text); background: rgba(255, 255, 255, 0.05); }
.app-dock button[aria-current="page"] { background: var(--color-accent); color: var(--color-accent-ink); }
.app-dock svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-dock button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media (max-width: 720px) {
  body.has-dock { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .app-dock {
    left: 0; right: 0; bottom: 0; transform: none;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0; border: 0; border-top: 1px solid var(--color-line);
    background: rgba(19, 21, 28, 0.92); box-shadow: none;
  }
  .app-dock button {
    flex-direction: column; justify-content: center; gap: 4px;
    min-height: 56px; padding: 0 4px; border-radius: 14px;
    font-size: 11px;
  }
  .app-dock button[aria-current="page"] { background: transparent; color: var(--color-accent); }
  .app-dock button[aria-current="page"] svg {
    background: var(--color-accent-900); border-radius: 999px;
    width: 52px; height: 30px; padding: 5px 16px; box-sizing: border-box;
  }
  .app-dock svg { width: 22px; height: 22px; }
}

/* ── more sign-in options ─────────────────────────────────────────────────── */

.signin-apple { background: #000; color: #fff; border: 1px solid #3A3F52; }
.signin-apple:hover:not(:disabled) { background: #111; }
.signin-apple svg { width: 20px; height: 20px; flex: none; }
.signin-guest { align-self: center; min-height: 44px; font-size: 14px; }
.signin-legal { margin: 0; text-align: center; font-size: 12px; }
.signin-legal a { color: var(--color-faint); }

/* ── consent, delete and install dialogs ─────────────────────────────────── */

.consent-links { font-size: 14px; }
.ios-steps { margin: 0 0 var(--space-4); padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--color-neutral-200); }
.ios-steps svg { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--color-accent-2-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#deleteOverlay .field { margin: var(--space-3) 0; display: flex; flex-direction: column; gap: 6px; }
#deleteOverlay .notice { margin: 0 0 var(--space-3); }

/* ── profile additions ───────────────────────────────────────────────────── */

.prof-upgrade { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.prof-upgrade .btn { min-height: 44px; }
.prof-danger { border: 1px solid #5A2A24; background: linear-gradient(0deg, rgba(255, 107, 90, 0.05), rgba(255, 107, 90, 0.05)), var(--color-surface); }
.prof-danger .prof-head span a { color: var(--color-muted); }
.acct-item.accent { color: var(--color-accent); }
.acct-item.accent svg { stroke: currentColor; }

/* ── Cricket Buff: BidLeague ─────────────────────────────────────────────── */

.buff-cricket {
  --buff-ink: #5B8CFF;
  --buff-soft: rgba(91, 140, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.10), rgba(139, 124, 246, 0.06)),
    var(--color-bg);
}
.buff-cricket .buff-badge { transform: rotate(-6deg); }
.buff-cricket .mode-grid { grid-template-columns: 1fr; }
a.mode-card { text-decoration: none; }
@media (min-width: 721px) {
  .mode-card.wide { flex-direction: row; align-items: stretch; }
  .mode-card.wide .mode-art { width: 46%; height: auto; min-height: 150px; margin: 8px 0 8px 8px; flex: none; }
  .mode-card.wide .mode-body { justify-content: center; padding: 20px 64px 20px 24px; }
  .mode-card.wide .mode-tags { margin-top: 8px; }
}

/* BidLeague: the paddle up, the bids climbing, the hammer coming down. */
.art-auction { --art-bg: linear-gradient(135deg, #1A2A5E, #2A1F5C 60%, #3A1F4F); gap: 18px; }
.a-paddle {
  display: grid; place-items: center; align-content: center;
  width: 70px; height: 70px; border-radius: 999px;
  background: var(--color-accent); color: var(--color-accent-ink);
  box-shadow: 0 0 0 4px rgba(242, 181, 68, 0.25), 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: rotate(-8deg); position: relative;
}
.a-paddle::after {
  content: ""; position: absolute; left: 50%; top: 66px; width: 10px; height: 34px;
  margin-left: -5px; border-radius: 4px; background: #8A6A2A;
}
.a-paddle b { font: 800 22px/1 var(--font-heading); }
.a-paddle small { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; }
.a-bids { display: flex; flex-direction: column; gap: 5px; }
.a-bids i {
  font-style: normal; font: 700 12px/1 var(--font-body); color: #B8C7FF;
  padding: 5px 10px; border-radius: 999px; background: rgba(91, 140, 255, 0.16);
}
.a-bids i::before { content: "₹"; opacity: 0.7; margin-right: 2px; }
.a-bids i::after { content: " Cr"; opacity: 0.7; }
.a-bids i.win { background: var(--color-accent); color: var(--color-accent-ink); }
.a-sold {
  position: absolute; right: 14px; top: 12px;
  font: 800 13px/1 var(--font-heading); letter-spacing: 0.14em; color: var(--color-accent);
  border: 2px solid var(--color-accent); border-radius: 6px; padding: 5px 8px;
  transform: rotate(10deg); opacity: 0.9;
}
.mode-card:hover .a-paddle { animation: paddle 0.6s ease; }
@keyframes paddle { 40% { transform: rotate(-8deg) translateY(-8px); } }
.mode-card:hover .a-sold { animation: stamp 0.35s ease; }
@keyframes stamp { from { transform: rotate(10deg) scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mode-card:hover .a-paddle, .mode-card:hover .a-sold { animation: none; }
}

/* ── Each game card in its own colour ─────────────────────────────────────
   A deep tint of the game's hue for the card, a richer one for its picture,
   and tags and arrow in the same family. Text stays light on all of them. */

.mode-card {
  --hue-1: #1A1D27; --hue-2: #15171F;   /* card gradient */
  --tint: rgba(255, 255, 255, 0.08);    /* tags, arrow */
  --tint-ink: var(--color-muted);
  background: linear-gradient(160deg, var(--hue-1), var(--hue-2));
  border-color: rgba(255, 255, 255, 0.04);
}
.mode-card .mode-tags span { background: var(--tint); color: var(--tint-ink); }
.mode-card .mode-arrow { background: var(--tint); color: var(--tint-ink); }
.mode-card:hover { border-color: var(--tint-ink); }

.mode-card[data-mode="daily"]  { --hue-1: #2E2512; --hue-2: #1E190E; --tint: rgba(242, 181, 68, 0.16); --tint-ink: #F7C35E; }
.mode-card[data-mode="ladder"] { --hue-1: #241F42; --hue-2: #17142C; --tint: rgba(139, 124, 246, 0.18); --tint-ink: #B1A6FF; }
.mode-card[data-mode="board"]  { --hue-1: #14302A; --hue-2: #0E1D19; --tint: rgba(79, 209, 165, 0.16); --tint-ink: #6FE0B8; }
.mode-card[data-mode="chain"]  { --hue-1: #32172C; --hue-2: #1E1020; --tint: rgba(255, 122, 182, 0.16); --tint-ink: #FF9CC8; }
.mode-card[data-mode="guess"]  { --hue-1: #33200F; --hue-2: #1F150C; --tint: rgba(255, 159, 90, 0.16); --tint-ink: #FFB37E; }
a.mode-card.wide               { --hue-1: #182648; --hue-2: #121A33; --tint: rgba(91, 140, 255, 0.18); --tint-ink: #9DB9FF; }

/* Daily 15's picture, now on dark: amber days instead of ink on amber. */
.art-daily { --art-bg: linear-gradient(160deg, #3D3014, #2A2210); }
.d-num { color: var(--color-accent); }
.d-days i { border-color: rgba(242, 181, 68, 0.4); }
.d-days i.on { background: var(--color-accent); border-color: var(--color-accent); }
.d-days i.today { border-color: var(--color-accent); animation-name: today-amber; }
@keyframes today-amber { 50% { background: rgba(242, 181, 68, 0.45); } }

/* Pictures sit a step brighter than their card so they read as a panel. */
.mode-art { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
