:root {
  /* the Countdown Chart: a white chart sheet, ink rules, a violet band and markers, tangerine for the one action */
  --bg: #f5f1ff; /* pale lavender: the page; rows, fields and buttons sit on it */
  --bg-2: #ebe5fc;
  --panel: #ffffff;
  --panel-2: #ece7fd;
  --line: #d7d3e6;
  --rule: #111111;
  --ink: #111111;
  --muted: #5a5868;
  --tangerine: #ff9b3d; /* the one primary action, with ink text */
  --gold: var(--tangerine); /* the old name, still used by older rules */
  --gold-ink: #111111;
  --accent-ink: #5a2fe0; /* violet as text and markers on white (AA) */
  --violet: #6a3df0;
  --violet-btn: #6a3df0;
  --violet-tint: #e4dbff;
  --tangerine-tint: #fff1e3;
  --red: #c8243a;
  --green: #0b7d48;
  /* each way to play has its own colour, like genres on a chart (icons and rules: 3:1 on the sheet) */
  --c-daily: #c46200;
  --c-solo: #6a3df0;
  --c-campaign: #0e8f52;
  --c-host: #d6246e;
  --c-find: #1479c4;
  --radius: 6px;
  --display: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  /* room for the part of the page an on-screen keyboard covers (set by the page; 0 when it's closed) */
  padding-bottom: var(--kb, 0px);
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.45 var(--display);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: 1100px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.narrow { max-width: 560px; }

/* ---------- logo ---------- */
.logo { font-family: var(--display); font-weight: 800; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.logo .mark { background: var(--gold); color: var(--gold-ink); border-radius: 6px; padding: 2px 10px; font-size: 24px; line-height: 1.3; }
.logo .word { font-size: 20px; }
.logo-lg { flex-direction: column; gap: 12px; }
.logo-lg .mark { font-size: clamp(64px, 16vw, 132px); border-radius: 6px; padding: 6px 28px; line-height: 1.1; }
.logo-lg .word { font-size: clamp(26px, 5vw, 40px); }
.tagline { font-size: 20px; margin: 0; color: var(--muted); }
@media (max-width: 560px) { .phone-top .logo .word { display: none; } }

/* ---------- buttons & inputs ---------- */
a.btn { text-decoration: none; text-align: center; display: inline-block; }
.btn {
  appearance: none; border: 0; border-radius: 6px; padding: 12px 22px; font-weight: 700; cursor: pointer;
  background: var(--panel-2); color: var(--ink); transition: transform 0.06s, filter 0.15s; white-space: nowrap;
  font-family: var(--display); letter-spacing: -0.01em; font-size: 17px;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-violet { background: var(--violet-btn); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-lg { padding: 16px 28px; font-size: 20px; }
.btn-block { width: 100%; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.input {
  width: 100%; border: 2px solid var(--line); background: var(--bg-2); border-radius: 6px; padding: 12px 14px; outline: none; min-width: 0;
}
.input:focus { border-color: var(--accent-ink); }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--display); font-weight: 800; font-size: 24px; text-align: center; }
label.field { white-space: nowrap; }
label.field { display: grid; gap: 6px; font-weight: 600; color: var(--muted); font-size: 14px; }

/* ---------- search bar (the game's centrepiece) ---------- */
.search {
  display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); border-radius: 6px;
  padding: 10px 10px 10px 22px; border: 2px solid var(--rule);
}
.search svg { flex: none; opacity: 0.55; }
.search .prefix { font-weight: 700; white-space: nowrap; font-size: clamp(17px, 2.6vw, 26px); font-family: var(--display); }
.search .prefix.only { white-space: normal; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: clamp(17px, 2.6vw, 26px); color: var(--accent-ink); font-weight: 600; }
.search input::placeholder { color: var(--muted); font-weight: 500; }
.search .btn { padding: 10px 18px; font-size: 16px; }
.search.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (max-width: 560px) {
  .search { flex-wrap: wrap; border-radius: 6px; padding: 12px 14px; gap: 8px; }
  .search .prefix { white-space: normal; width: 100%; }
  .search svg { display: none; }
}

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 10px; }
@media (max-width: 640px) { .tile { min-height: 46px; } .tile .num { width: 32px; height: 32px; } .tile .txt { font-size: 16px; } .board { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; gap: 7px; } }
.tile {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px 8px 8px;
  background: var(--panel); border: 0; border-top: 2px solid var(--rule); border-radius: 0; overflow: hidden;
}
.tile .num {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: var(--bg);
  font-family: var(--display); font-weight: 800; color: var(--muted);
}
.tile .txt { flex: 1; min-width: 0; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; position: relative; }
.tile .pts { flex: none; font-family: var(--display); font-weight: 800; color: var(--muted); font-size: 15px; position: relative; }
.tile.found { background: var(--violet-tint); color: var(--ink); }
.tile.found.fresh { animation: enter 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
.tile.found .num { color: var(--accent-ink); }
.tile.found .pts { color: var(--gold-ink); }
.tile.missed { background: var(--bg-2); border-style: dashed; }
.tile.missed .txt { color: var(--muted); }
.tile .bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: rgb(139 107 255 / 0.28); transition: width 0.5s ease; }
.tile .sub { font-weight: 600; font-size: 0.78em; opacity: 0.7; margin-top: 2px; }
.tile .star { font-size: 12px; font-weight: 800; background: var(--violet); color: #fff; padding: 2px 6px; border-radius: 6px; margin-inline-start: 6px; vertical-align: middle; }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }

.strikes { display: flex; gap: 8px; }
.strike { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: 22px; background: var(--panel); color: var(--line); border: 1px solid var(--line); font-family: var(--display); }
.strike.on { background: var(--red); color: #fff; border-color: transparent; animation: pop 0.3s; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* ---------- layout bits ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat b { font-family: var(--display); font-size: 26px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 6px; background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.card { background: var(--panel); border: 0; border-top: 3px solid var(--rule); border-radius: 0; padding: 16px 0 4px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.spacer { height: 18px; }

/* home */
.home { min-height: 100dvh; display: grid; place-items: center; }
.home-hero { text-align: center; display: grid; gap: 22px; justify-items: center; width: 100%; }
.demo { width: min(640px, 100%); text-align: start; }
.demo .suggest { background: #fff; color: var(--ink); border-radius: 0 0 22px 22px; margin: -8px 14px 0; padding: 14px 18px 8px; ; }
.demo .suggest div { padding: 4px 0; color: var(--muted); }
.demo .suggest div b { color: var(--ink); }
.typing { color: var(--accent-ink); font-weight: 600; font-size: clamp(17px, 2.6vw, 26px); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(900px, 100%); }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } }
.choice { text-align: start; display: grid; gap: 8px; align-content: start; }
.choice h3 { font-size: 22px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--bg-2); border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--accent-ink); background: rgb(255 201 74 / 0.12); color: var(--accent-ink); }

/* host */
.host-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .host-grid { grid-template-columns: 1fr; } }
.join-box { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.join-box img { width: 200px; height: 200px; background: #fff; border-radius: 6px; padding: 8px; }
@media (max-width: 560px) { .join-box { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.big-code { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 8vw, 88px); letter-spacing: 0.12em; color: var(--accent-ink); line-height: 1; }
.url { font-weight: 700; font-size: 20px; word-break: break-all; }
.players { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; }
.player-chip { padding: 6px 12px; border-radius: 6px; background: var(--panel-2); font-weight: 700; border: 0; cursor: pointer; }
.player-chip.new { animation: pop 0.3s; }
.player-chip.off { opacity: 0.45; }
.player-chip:hover { background: var(--red); }
.settings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 380px) { .settings { grid-template-columns: 1fr; } }
select.input { appearance: none; }

.timer { --p: 1; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 30px;
  background: conic-gradient(var(--gold) calc(var(--p) * 360deg), var(--panel) 0); position: relative; flex: none; }
.timer::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
.timer span { position: relative; }
.timer.low { background: conic-gradient(var(--red) calc(var(--p) * 360deg), var(--panel) 0); }
.timer-sm { width: 56px; height: 56px; font-size: 20px; }
.timer-sm::before { inset: 5px; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { padding: 8px 12px; background: var(--bg-2); border-radius: 6px; font-weight: 600; animation: slide 0.3s; }
@keyframes slide { from { opacity: 0; transform: translateY(-6px); } }

.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb li { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg-2); border-radius: 6px; }
.lb .r { font-family: var(--display); font-weight: 800; color: var(--muted); }
.lb .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .s { font-family: var(--display); font-weight: 800; }
.lb .d { color: var(--green); font-weight: 700; font-size: 14px; }
.lb .d.t { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.lb li.me { outline: 2px solid var(--gold); }

.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; max-width: 640px; margin: 0 auto; }
.podium > div { text-align: center; border-radius: 6px 16px 0 0; padding: 14px 8px; background: var(--panel-2); }
.podium .p1 { min-height: 190px; background: var(--gold); color: var(--gold-ink); }
.podium .p2 { min-height: 150px; }
.podium .p3 { min-height: 120px; }
.podium b { display: block; font-family: var(--display); font-size: 40px; }
.podium .nm { font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }

.done-banner { text-align: center; padding: 14px; border-radius: 6px; background: var(--panel); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 6px; font-weight: 700; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgb(17 17 17 / 0.18);
}
.toast.bad { background: var(--red); color: #2b0b12; } /* dark on red reads at AA; white didn't */
.toast.good { background: var(--green); color: #fff; }

.conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 6px 14px; border-radius: 6px; font-weight: 700; font-size: 14px; z-index: 30; }

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

/* ---------- additions ---------- */
.warn { background: rgb(255 201 74 / 0.14); border: 1px solid rgb(255 201 74 / 0.4); color: var(--ink); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-weight: 600; }
.host-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.winner { font-size: clamp(36px, 6vw, 72px); margin-bottom: 16px; }
.between { justify-content: space-between; }
.gap-sm { margin: 12px 0 4px; }
.small { font-size: 14px; }
p.small { margin: 4px 0 10px; min-height: 1em; }
.feed.small { margin-top: 14px; }
.feed.small li { padding: 6px 10px; font-size: 14px; }
.done-banner { margin-bottom: 12px; background: var(--violet); color: #fff; }
@media (max-width: 640px) {
  /* keep the board in view: toasts at the top on phones */
  .toast { top: max(12px, env(safe-area-inset-top)); bottom: auto; }
  .phone-top { margin-bottom: 12px; flex-wrap: nowrap; }
  .phone-top .stat b { font-size: 22px; }
}

/* ---------- TV / big screen ---------- */

/* copying the invite */
.copyable { cursor: copy; border-radius: 6px; }
button.big-code { appearance: none; background: none; border: 0; padding: 0; text-align: start; }
.copyable:hover { background: rgb(255 255 255 / 0.06); }
.copy-row { gap: 8px; }
.copy-row .btn { padding: 10px 16px; font-size: 15px; }
.link-field { font-size: 14px; color: var(--muted); padding: 8px 12px; }
@media (max-width: 560px) { .copy-row { justify-content: center; } }

/* host: playing + controls */
.player-chip.is-host { border-color: var(--accent-ink); cursor: default; }
.host-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line);
}
.host-bar .host-tag { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.host-bar .btn { padding: 8px 14px; }
body.has-host-bar { padding-bottom: calc(var(--host-bar-h, 76px) + 32px + var(--kb, 0px)); }
body.has-host-bar .toast { bottom: calc(var(--host-bar-h, 76px) + 12px); }
@media (max-width: 640px) { body.has-host-bar .toast { bottom: auto; } }
.continue-bar {
  position: sticky; bottom: 12px; z-index: 5; margin-top: 16px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgb(17 17 17 / 0.12);
}
.continue-bar .btn:disabled { opacity: .7; cursor: default; }
body.has-host-bar .continue-bar { bottom: calc(var(--host-bar-h, 76px) + 12px); }

/* results: you / others / nobody */
.tile.found .sub { opacity: .85; }
.tile.others { background: var(--tangerine-tint); color: var(--ink); }
.tile.others .num { background: var(--violet); color: #fff; }
.tile.others .pts { color: var(--muted); }
.tile.others .bar { background: rgb(139 107 255 / 0.35); }
.tile.nobody { background: transparent; border-style: dashed; opacity: .6; }
.tile.nobody .txt { color: var(--muted); }
.tile .finders { font-weight: 600; font-size: 0.72em; opacity: 0.85; margin-top: 2px; }
.tile .finders .me { font-weight: 800; }
.tile .badge {
  flex: none; position: relative; font-family: var(--display); font-weight: 800; font-size: 13px;
  min-width: 30px; height: 26px; padding: 0 8px; border-radius: 6px; display: grid; place-items: center;
  background: rgb(255 255 255 / .16); color: #fff;
}
.tile .badge.you { background: var(--gold-ink); color: var(--accent-ink); letter-spacing: .06em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend .sw.found { background: var(--gold); }
.legend .sw.others { background: var(--violet); }
.legend .sw.nobody { border: 1.5px dashed var(--muted); }
.tile .num { position: relative; }
/* phones: the host controls sit at the top and stay there while scrolling, so they never cover
   the bottom of the page (or end up stuck above the on-screen keyboard) */
@media (max-width: 640px) {
  .host-bar {
    position: sticky; top: 0; bottom: auto; flex-wrap: nowrap; justify-content: space-between;
    gap: 8px; padding: max(6px, env(safe-area-inset-top)) 12px 6px; border-top: 0; border-bottom: 1px solid var(--line);
  }
  .host-bar .muted { font-size: 13px; white-space: nowrap; }
  .host-bar .btn { padding: 6px 10px; font-size: 14px; white-space: nowrap; }
  .host-bar .host-tag { display: none; }
  body.has-host-bar { padding-bottom: var(--kb, 0px); }
  body.has-host-bar .continue-bar { bottom: 12px; }
  body.has-host-bar .toast { top: calc(var(--host-bar-h, 48px) + 8px); bottom: auto; }
}
.round-info { margin: 0 0 6px; text-align: center; font-weight: 700; letter-spacing: .02em; }
.field-wide { grid-column: 1 / -1; display: grid; gap: 6px; font-weight: 600; color: var(--muted); font-size: 14px; }
.field-wide .chips { flex-wrap: nowrap; }
.field-wide .chip { flex: 1; padding: 10px 14px; font-size: 15px; }

/* suggested searches */
.sugg-form { display: flex; gap: 8px; }
.sugg-form .input { flex: 1; min-width: 0; font-size: 16px; }
.sugg-form .btn { flex: none; min-height: 48px; padding: 10px 18px; }
.sugg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sugg-list:empty { display: none; }
.sugg-list li { display: flex; align-items: center; gap: 10px; padding-block: 8px; padding-inline: 14px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; text-align: start; }
.sugg-list li.unplayed { opacity: .55; }
.sugg-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sugg-text { font-weight: 700; overflow-wrap: anywhere; }
.sugg-x { flex: none; width: 44px; height: 44px; border-radius: 6px; border: 0; background: var(--panel-2); color: var(--ink); font-size: 18px; cursor: pointer; }
.sugg-x:hover { background: var(--line); }
.sugg-x:focus-visible { outline: 3px solid var(--gold); }

/* ---------- home: the party first ---------- */
.choice.featured { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; justify-content: space-between; border-color: var(--violet); background: var(--panel); }
.choice.featured h3 { font-size: 28px; margin-bottom: 6px; }
.choice.featured .btn { flex: none; }
@media (max-width: 760px) { .choice.featured { flex-direction: column; align-items: stretch; } }

/* ---------- hints ---------- */
.hint-btn { padding: 8px 14px; font-size: 15px; border: 1.5px solid var(--line); }
.hint-btn:disabled { opacity: 0.55; }
.hint-btn[hidden] { display: none; }
.tile.hinted { border-style: dashed; border-color: var(--accent-ink); }
.tile.hinted .txt { color: var(--accent-ink); letter-spacing: 0.02em; }
.tile .star.hinted { background: var(--gold-ink); color: var(--accent-ink); }

/* ---------- higher-or-lower bonus ---------- */
.bonus { margin-bottom: 16px; display: grid; gap: 10px; border-color: var(--accent-ink); }
.bonus-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bonus-head b { font-family: var(--display); color: var(--accent-ink); }
.bonus-q { margin: 0; font-weight: 700; }
.bonus-opts { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.bonus-opts .vs { color: var(--muted); font-weight: 700; }
.bonus-opt { min-height: 52px; padding: 10px 14px; border-radius: 6px; border: 2px solid var(--line); background: var(--bg-2); color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; overflow-wrap: anywhere; }
.bonus-opt:hover:not(:disabled) { border-color: var(--accent-ink); }
.bonus-opt:disabled { cursor: default; }
.bonus-opt.right { border-color: var(--green); background: rgb(61 220 151 / 0.18); }
.bonus-opt.wrong { border-color: var(--red); background: rgb(255 93 108 / 0.16); }
.bonus-res { margin: 0; font-weight: 800; }
@media (max-width: 480px) { .bonus-opts { grid-template-columns: 1fr; } .bonus-opts .vs { text-align: center; } }

/* ---------- teams ---------- */
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 7px; vertical-align: middle; }
.team-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.team-btn { flex: 1; min-width: 90px; min-height: 44px; border-radius: 6px; border: 2px solid var(--team); background: var(--bg-2); color: var(--ink); font-weight: 800; cursor: pointer; }
.team-btn[aria-pressed="true"] { background: var(--team); color: var(--ink); }
.team-btn[aria-pressed="true"] .muted { color: var(--ink); }
.player-chip { border: 2px solid var(--team, transparent); }
.team-win { font-weight: 800; font-size: 18px; margin: 0; }
#p-teamboard .card { margin-bottom: 16px; }

/* ---------- bluff round ---------- */
.bluff-opts, .bluff-results { display: grid; gap: 10px; }
.bluff-opt { text-align: start; min-height: 56px; padding: 12px 16px; border-radius: 6px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-size: 17px; cursor: pointer; }
.bluff-opt b { color: var(--accent-ink); }
.bluff-opt:hover:not(:disabled) { border-color: var(--accent-ink); }
.bluff-opt.picked { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--violet); }
.bluff-opt:disabled { opacity: 0.55; cursor: default; }
.bluff-res { padding: 12px 16px; border-radius: 6px; background: var(--panel); border: 1px dashed var(--line); display: grid; gap: 4px; text-align: start; }
.bluff-res.real { background: var(--gold); color: var(--gold-ink); border: 0; }
.bluff-res.real .muted { color: var(--gold-ink); opacity: 0.8; }
.bluff-res.picked { outline: 3px solid var(--violet); }
.bluff-res-text { font-size: 17px; }
.bluff-res .star { margin-inline-start: 8px; }

/* ---------- results to share ---------- */
.share-grid { font-size: 22px; line-height: 1.25; margin: 14px 0 0; letter-spacing: 2px; white-space: pre; font-family: inherit; }
.podium .empty { background: transparent; }
.podium .small { font-weight: 700; }
/* labels inside stacked cards keep their own width */
.stack > .pill { justify-self: start; }
.center .stack > .pill { justify-self: center; }

/* home: two featured cards on top (party + today's puzzle), join and solo below */
.choices { grid-template-columns: repeat(2, 1fr); }
.choice.featured { grid-column: auto; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 18px; padding: 24px; }
.choice.featured h3 { font-size: 30px; margin: 10px 0 8px; }
.choice.featured .pill { background: rgb(139 107 255 / 0.3); color: #fff; }
.choice.featured.daily { border-color: var(--accent-ink); background: var(--panel); }
.choice.featured.daily .pill { background: var(--gold); color: var(--gold-ink); }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } }
/* smaller home cards: the button sits at the bottom, so Join and Play line up */
.choice:not(.featured) { display: flex; flex-direction: column; }
.choice:not(.featured) > .btn:last-child { margin-top: auto; }

/* ---------- where searches come from ---------- */
.country-change { display: grid; gap: 6px; margin-top: 10px; font-weight: 600; color: var(--muted); font-size: 14px; }
.country-change select { font-size: 15px; padding: 10px 12px; }
.chip { white-space: nowrap; }

/* ---------- daily: two boards + leaderboards ---------- */
.daily-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .daily-boards { grid-template-columns: 1fr; } }
.daily-board { align-content: start; }
.daily-board.world { border-color: var(--accent-ink); }
.daily-board h3 { font-size: 22px; }
.daily-board .country-change { margin-top: 0; }
.board-score { margin: 0; font-size: 18px; }
.board-score b { font-family: var(--display); font-size: 26px; }
.lb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tabs .chip { padding: 6px 12px; font-size: 14px; }
.lb li.gap { background: none; justify-content: center; display: block; text-align: center; color: var(--muted); padding: 0; }
.lb-form { text-align: start; }
.lb-done { margin: 0; }
.lb-days { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-days b { font-family: var(--display); text-align: center; }
.lb-day { width: 44px; height: 44px; padding: 0; font-size: 24px; border: 1.5px solid var(--line); }
.lb-day:disabled { opacity: 0.3; }
p.region-note { margin: 8px 0 0; min-height: 0; }

/* today's champions: one row per board (flag, region, language), then its top three with medals */
.champs-card h3 { font-size: 22px; }
.champ-standing { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 14px; background: rgb(255 155 61 / 0.16); color: var(--ink); font-weight: 700; }
.champ-standing svg { width: 24px; height: 24px; flex: none; color: var(--accent-ink); }
.champ-standing b { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.champ-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.champ { display: grid; grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 12px 14px; border-radius: 16px; background: var(--surf-2); }
.champ.own { box-shadow: inset 0 0 0 2px var(--accent-ink); }
.champ-board { display: flex; align-items: center; gap: 10px; min-width: 0; }
.champ-board > div { display: grid; min-width: 0; }
.champ-board b { font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.champ-flag { font-size: 28px; line-height: 1; flex: none; }
.champ-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-width: 0; }
.champ-top li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.champ-top .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.champ-top .s { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.champ-top li.me .n { color: var(--accent-ink); }
.medal { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; }
.medal.m1 { background: #ffd34d; color: #3a2a00; }
.medal.m2 { background: #c3cad9; color: #20263a; }
.medal.m3 { background: #f0b27a; color: #3d1f05; }
@media (max-width: 640px) { .champ { grid-template-columns: minmax(0, 1fr); } }

/* home: two featured cards, then three smaller ones (find a party, join, solo) */
.choices { grid-template-columns: repeat(6, 1fr); }
.choice.featured { grid-column: span 3; }
.choice:not(.featured) { grid-column: span 2; }
@media (max-width: 760px) { .choices { grid-template-columns: 1fr; } .choice.featured, .choice:not(.featured) { grid-column: auto; } }

/* public lobby */
.pub-players { justify-content: center; }
.pub-chip { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.pub-chip:hover { background: var(--panel-2); }
.vote-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.vote-x:hover:not(:disabled) { color: var(--red); background: rgb(255 93 108 / 0.12); }
.vote-x:disabled { color: var(--red); cursor: default; }

/* home: three featured cards (party with friends, find a party, today's puzzle), then join and solo */
.choice.featured { grid-column: span 2; }
.choice:not(.featured) { grid-column: span 3; }
.choice.featured.public { border-color: var(--green); background: var(--panel); }
.choice.featured.public .pill { background: var(--green); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.live-count { margin: 14px 0 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.live-count b { font-family: var(--display); font-size: 22px; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green);  }
@media (max-width: 980px) { .choice.featured { grid-column: span 3; } .choice.featured.daily { grid-column: 1 / -1; } }
@media (max-width: 760px) { .choice.featured, .choice.featured.daily, .choice:not(.featured) { grid-column: auto; } }

/* home: code box under the tagline; three featured cards (order set by the page); solo as a slim row */
/* the code box keeps room for five letters whatever the label's length in a language */
.choice.featured, .choice.featured.daily { grid-column: span 2; }
.choice.slim { grid-column: 1 / -1; order: 10; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.choice.slim h3 { font-size: 20px; }
.choice.slim > .btn:last-child { margin-top: 0; flex: none; }
@media (max-width: 980px) { .choice.featured, .choice.featured.daily { grid-column: span 3; } .choice.featured.last-featured { grid-column: 1 / -1; } }
@media (max-width: 760px) { .choice.featured, .choice.featured.daily, .choice.featured.last-featured, .choice.slim { grid-column: auto; } }
@media (max-width: 480px) { .choice.slim { flex-direction: column; align-items: stretch; } }

/* daily boards: columns may shrink below their content, long country names wrap, buttons line up at the bottom */
.daily-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .daily-boards { grid-template-columns: minmax(0, 1fr); } }
.daily-board { display: flex; flex-direction: column; gap: 14px; }
.daily-board h3 { overflow-wrap: anywhere; }
.daily-board .btn { white-space: normal; margin-top: auto; }
.daily-board .country-change select { width: 100%; }
.lb-tabs .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- UI audit fixes ---------- */

/* iPhones zoom into any form field under 16px and stay zoomed: every field gets 16px */
label.field .input:not(.code-input), label.field select, .link-field, .country-change select, select.input { font-size: 16px; }

/* dropdowns look like dropdowns */
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235a5868' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-inline-end: 38px; cursor: pointer;
}

/* two settings columns on phones too; one only on the narrowest */
@media (max-width: 380px) { .settings { grid-template-columns: 1fr 1fr; } }
@media (max-width: 340px) { .settings { grid-template-columns: 1fr; } }

/* in-game messages sit under the search bar instead of covering the timer */
.guess-msg { min-height: 1.4em; margin: 8px 2px 0; font-weight: 800; font-size: 15px; color: var(--muted); transition: opacity 0.2s; }
.guess-msg:empty { opacity: 0; }
.guess-msg.good { color: var(--green); }
.guess-msg.bad { color: var(--red); }

/* the guess box is easy to hit, and the whole white bar focuses it */
.search { cursor: text; }
.search input { min-height: 40px; }

/* live feed above the board: the latest two on phones, four on larger screens */
.feed.feed-top { margin: 0 0 12px; }
.feed.feed-top:empty { display: none; }
@media (max-width: 640px) { .feed.feed-top li:nth-child(n + 3) { display: none; } }

/* host bar: comfortable tap sizes; a guarded button turns red while waiting for the second tap */
.host-bar .btn { min-height: 40px; }
@media (max-width: 640px) { .host-bar .btn { min-height: 40px; padding: 8px 12px; } }
.btn-armed { background: var(--red); color: #fff; }

/* host lobby on phones: Start stays at the bottom of the screen while scrolling */
.start-dock { display: none; }
@media (max-width: 900px) {
  .start-dock { display: block; position: sticky; bottom: 12px; z-index: 6; margin-top: 16px; }
  .start-dock .btn { box-shadow: 0 6px 20px rgb(17 17 17 / 0.18); }
  #host-lobby #start { display: none; }
}

/* public lobby: a clear, tappable vote button */
.vote-x { min-height: 32px; padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.pub-chip { padding: 4px 4px 4px 12px; }

/* leaderboard tabs at a comfortable tap size */
.lb-tabs .chip { min-height: 40px; }

/* room code centered when the invite box is centered (phones) */
@media (max-width: 560px) { button.big-code { text-align: center; } }

/* home on phones: the cards come up sooner (smaller logo, demo without its dropdown) */
@media (max-width: 480px) {
  .logo-lg .mark { font-size: 52px; padding: 4px 20px; border-radius: 6px; }
  .logo-lg .word { font-size: 24px; }
  .home-hero { gap: 16px; }
  .demo .suggest { display: none; }
  .tagline { font-size: 17px; }
}
/* the code box on the narrowest phones: drop the label, keep the code readable */
/* narrow phones: the question on its own line, the code box and Join below it */
.vote-x { min-height: 36px; }
.pub-chip { min-height: 44px; }

/* home demo: one line, wide enough for the longest ending; on narrow phones the typed text is cut at the edge */
.demo { width: min(800px, 100%); }
.demo .search { flex-wrap: nowrap; }
.demo .typing { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
@media (max-width: 560px) { .demo .search { flex-wrap: wrap; } .demo .typing { flex-basis: 100%; } }

/* home: a small version of today's leaderboards under the game cards */
.home-lb { width: min(900px, 100%); text-align: start; }
.home-lb:empty { display: none; }
.home-lb-card h3 { font-size: 22px; }
.home-lb-card .lb li { padding: 7px 12px; }
.see-all { color: var(--accent-ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }
.home-lb-card a:not(.see-all) { color: var(--accent-ink); font-weight: 700; }

/* home: one line with today's Worldwide leader, under the code box */
.leader-strip {
  display: flex; align-items: center; gap: 8px; max-width: min(560px, 100%);
  padding: 8px 16px; border-radius: 6px; background: rgb(255 201 74 / 0.12); border: 1px solid rgb(255 201 74 / 0.35);
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600;
}
.leader-strip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-strip .who { color: var(--accent-ink); }
.leader-strip .go { color: var(--accent-ink); flex: none; }
.leader-strip:hover { background: rgb(255 201 74 / 0.2); }
/* the home column never grows wider than the screen; long lines shorten with "…" instead */
.home-hero { grid-template-columns: minmax(0, 1fr); }
.leader-strip { justify-self: center; }

/* answers you haven't found: clues from other players' finds, and the hint (letters spaced so each "_" is one letter) */
.mask { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.22em; word-spacing: 0.5em; white-space: normal; }
.mask-word { white-space: nowrap; }
.tile.clued { border-color: var(--violet); border-style: dashed; }
.tile.clued .txt { color: var(--ink); }
.tile.clued .sub, .tile.hinted .sub { font-family: var(--display); letter-spacing: 0; color: var(--muted); opacity: 1; }
.tile[data-slot] { cursor: pointer; }

/* ready in the lobby */
.player-chip.ready::after { content: " ✓"; color: var(--green); }
.ready-dock { position: sticky; bottom: 12px; z-index: 6; margin-top: 16px; }
.ready-dock .btn { box-shadow: 0 6px 20px rgb(17 17 17 / 0.18); }
#p-ready.is-ready { background: var(--panel-2); color: var(--green); border: 2px solid var(--green); }

.lb-actions { justify-content: center; gap: 8px; margin-top: 6px; }

/* daily stats */
.stats-card h3 { margin: 0 0 10px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; text-align: center; }
.stats div { background: var(--bg-2); border-radius: 6px; padding: 10px 4px; display: grid; gap: 2px; }
.stats b { font-family: var(--display); font-weight: 800; font-size: 20px; }
.stats span { color: var(--muted); font-size: 12px; line-height: 1.2; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* moving to another device */
.transfer summary { cursor: pointer; font-weight: 700; }
.transfer[open] summary { margin-bottom: 8px; }
.transfer .row { margin: 10px 0; align-items: center; }
.transfer-code { font-size: 26px; letter-spacing: 2px; }

/* right-to-left screens (Hebrew): the select arrow and back/forward arrows swap sides */
[dir="rtl"] select { background-position: left 14px center; }
[dir="rtl"] .lb-day, [dir="rtl"] .go, [dir="rtl"] .see-all .arr { display: inline-block; transform: scaleX(-1); }
/* searches and answers keep their own direction whatever the screen's language */
.prefix, .tile .txt, .bluff-opt, .share-grid { unicode-bidi: plaintext; }
/* a hidden answer's blanks have no letters to tell their direction: they follow the board's */
.tile .txt:has(> .mask) { unicode-bidi: normal; }

/* the language menu */
.home-top { display: flex; justify-content: space-between; width: 100%; justify-self: stretch; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.lang-pick select.input { width: auto; min-height: 36px; padding-block: 4px; font-size: 16px; }
.topbar .lang-pick { margin-inline-start: auto; }

/* profile, badges, rare finds */
.profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 480px) { .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 2px; opacity: 0.45; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; border-color: var(--accent-ink); background: rgb(255 201 74 / 0.1); }
.badge .be { font-size: 28px; }
.badge small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.rare-list, .league-list, .recap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rare-list li, .league-list li { background: var(--bg-2); border-radius: 6px; padding: 8px 12px; }
.league-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.league-list a { color: var(--ink); text-decoration: none; }
.recap-list li { display: grid; gap: 2px; background: var(--bg-2); border-radius: 6px; padding: 8px 12px; }
.celebrate {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px);
  background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: 18px; text-align: center;
  padding: 14px 22px; border-radius: 6px; box-shadow: 0 8px 24px rgb(17 17 17 / 0.2); animation: celebrate 3.2s ease forwards;
}
@keyframes celebrate { 0% { opacity: 0; transform: translate(-50%, 12px) scale(0.9); } 10%, 85% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .celebrate { animation: none; } }

/* after a round: rate the search, share an answer */
.round-extras { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0; }
.rate-row { display: flex; align-items: center; gap: 6px; }
.rate-btn { font-size: 20px; min-width: 44px; min-height: 44px; border-radius: 6px; border: 2px solid var(--line); background: var(--bg-2); cursor: pointer; }
.rate-btn[aria-pressed="true"] { border-color: var(--accent-ink); background: rgb(255 201 74 / 0.18); }

/* home: packs, player pick, profile */
.specials:empty { display: none; }
.specials { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.specials .choice { grid-column: auto; }
@media (max-width: 760px) { .specials { grid-template-columns: 1fr; } }
.choice.special { border-color: var(--accent-ink); }
.profile-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; width: min(900px, 100%);
  padding: 14px 18px; color: var(--ink); text-decoration: none; justify-self: center;
}
.profile-strip .go { color: var(--accent-ink); }
.profile-strip:hover { border-color: var(--accent-ink); }

/* challenges */
.challenge-card { border-color: var(--violet); }
.challenge-card.won { border-color: var(--accent-ink); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.vs div:not(.vs-mid) { display: grid; gap: 2px; }
.vs b { font-family: var(--display); font-size: 30px; }
.vs span { color: var(--muted); font-size: 14px; }
.vs-mid { color: var(--muted); font-weight: 800; }

.settings [hidden] { display: none !important; }
.real-top { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.real-top li::marker { color: var(--accent-ink); font-weight: 800; }
.badge .earned { color: var(--accent-ink); font-weight: 700; }

/* profile button, top right on every page outside a game */
.profile-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 14px;
  margin-inline-start: auto; min-height: 44px; box-sizing: border-box;
}
.profile-btn:hover, .profile-btn.here { border-color: var(--accent-ink); }
.pb-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--violet); color: #fff; font-family: var(--display); font-size: 17px;
}
.profile-btn:not(:has(.pb-count)) { padding-inline-end: 4px; }
.pb-count { color: var(--accent-ink); }
.top-right { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.top-right .profile-btn, .top-right .lang-pick { margin-inline-start: 0; }
.home-top { gap: 8px; align-items: center; }
.home-top .profile-btn { margin-inline-start: 0; }

/* the profile page */
.profile-head { display: flex; align-items: center; gap: 16px; }
.ph-avatar {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--violet); color: #fff; font-family: var(--display); font-size: 34px; font-weight: 800;
}
.ph-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.ph-main h1 { margin: 0; font-size: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-edit { justify-self: start; padding-inline: 0; min-height: 36px; }
/* the profile button stays on the logo's line: on phones the logo shows just its mark */
.topbar:has(.profile-btn) { flex-wrap: nowrap; }
@media (max-width: 520px) { .topbar:has(.profile-btn) .logo .word { display: none; } }
@media (max-width: 480px) { .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- round: hidden answers show their shape; the summary and the next button ---------- */
.tile.shape .txt { color: var(--muted); opacity: 0.55; }
.tile.shape .mask { letter-spacing: 0.18em; }
.round-sum { margin: 4px 0 10px; font-weight: 700; color: var(--muted); }
.round-sum b { font-family: var(--display); font-size: 1.25em; color: var(--ink); }
.missed { margin: 6px 2px 10px; min-height: 1.2em; }
.next-dock { position: sticky; bottom: 12px; z-index: 6; margin-top: 16px; }
.next-dock .btn { box-shadow: 0 6px 20px rgb(17 17 17 / 0.18); }

/* ---------- host lobby: settings fold away behind a one-line summary ---------- */
.settings-fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.settings-fold > summary::-webkit-details-marker { display: none; }
.settings-fold > summary h2 { margin: 0; }
.settings-fold > summary::after { content: "▸"; color: var(--muted); margin-inline-start: auto; transition: transform 0.15s; }
.settings-fold[open] > summary::after { transform: rotate(90deg); }
.settings-fold > :not(summary) { margin-top: 12px; }
.inline-help { display: inline; }
.inline-help > summary { display: inline; cursor: pointer; color: var(--violet-ink, #b9a8ff); font-weight: 700; list-style: none; }
.inline-help > summary::-webkit-details-marker { display: none; }
.inline-help[open] > summary { display: block; margin-bottom: 4px; }
.ptitle { display: inline-block; margin-inline-start: 6px; padding: 1px 7px; border-radius: 6px; background: var(--violet-tint); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; vertical-align: middle; }

/* ---------- home: the code bar sits below the cards ---------- */

/* ---------- quests ---------- */
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quest-list li { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border-radius: 6px; padding: 8px 10px; }
.quest-list li.done { opacity: 0.7; }
.quest-list li.done .qt b { text-decoration: line-through; }
.quest-list .qe { font-size: 22px; width: 30px; text-align: center; flex: none; }
.quest-list .qt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.quest-list .qt small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.quest-list .qx { font-family: var(--display); font-weight: 800; color: var(--accent-ink); flex: none; }
.quest-list .swap { padding: 4px 10px; min-height: 32px; font-size: 16px; }
.quests-line:empty { display: none; }

/* ---------- campaign trail ---------- */
.trail { display: grid; gap: 14px; }
.chapter.locked { opacity: 0.6; }
.chapter.current { border-top-color: var(--violet); }
.chapter.done { border-color: var(--green); }
.nodes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; position: relative; }
.nodes::before { content: ""; position: absolute; inset-block: 18px; inset-inline-start: 23px; border-inline-start: 2px dashed var(--line); }
.node { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 8px 8px; color: inherit; cursor: pointer; font: inherit; }
.node:hover { border-color: var(--violet); }
.node .nn { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--line); font-family: var(--display); font-weight: 800; color: var(--muted); }
.node.starred .nn { border-color: var(--accent-ink); color: var(--accent-ink); }
.node .np { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { font-size: 18px; color: var(--accent-ink); letter-spacing: 0.05em; flex: none; }
.stars .dim { color: var(--line); }
.chapter.current .node:not(.starred):first-of-type .nn { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { border-color: var(--violet); color: var(--accent-ink); } }
.campaign-card { border-color: rgb(139 107 255 / 0.5); }

/* ---------- home, compact: logo, one line, the big button, then five tiles ---------- */
.home { min-height: 0; display: block; place-items: normal; } /* newer browsers center block children under place-items too */
.home-hero { gap: 16px; }
.home .logo-lg .mark { font-size: clamp(44px, 9vw, 76px); padding: 4px 22px; border-radius: 6px; }
.home .logo-lg .word { font-size: clamp(22px, 4vw, 30px); }
.home .logo-lg { gap: 8px; }
.home .tagline { font-size: 18px; }
/* the home demo: a fixed-width search box, one line; when the typed ending outgrows it, the start scrolls
   out on the left (the text is right-aligned inside a clipped box) and the width never changes */
.demo-line { display: flex; align-items: center; gap: 8px; width: min(520px, 100%); box-sizing: border-box; margin: 0 auto; padding: 10px 18px; border-radius: 6px; background: #fff; color: var(--ink); font-weight: 700; font-size: 16px; text-align: start; }
.demo-line .demo-text { flex: 1; min-width: 0; display: flex; justify-content: flex-end; overflow: hidden; white-space: nowrap; }
.demo-line .demo-text > * { flex: none; }
.demo-line .demo-text::after { content: ""; flex: 1 1 auto; } /* fills the right while the text is short; shrinks away so long text clips on the left */
.demo-line .typing { color: var(--violet); margin-inline-start: 0.3em; font: inherit; font-weight: 700; } /* the generic .typing rule is for the game's own search box */
.demo-line .caret { width: 2px; height: 1.2em; margin-inline-start: 1px; background: var(--violet); border-radius: 1px; animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.demo-line svg { flex: none; width: 18px; height: 18px; }
.home .choices.specials { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .home .choices.specials { grid-template-columns: 1fr; } }

/* ---------- two columns of cards where the page is a set of cards (daily, profile) ---------- */
.cols { columns: 2 380px; column-gap: 18px; }
.cols > * { break-inside: avoid; margin-bottom: 18px; }
.cols > :last-child { margin-bottom: 0; }

/* ---------- daily: both boards the same height, button at the bottom ---------- */
.daily-board { display: flex; flex-direction: column; gap: 14px; }
.daily-board > .btn:last-child, .daily-board > [data-see] { margin-top: auto; }

/* ---------- campaign: a grid of stops per chapter ---------- */
.trail-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.trail-head .trail-score { display: grid; justify-items: end; gap: 2px; }
.trail-head .trail-score b { font-family: var(--display); font-size: 28px; color: var(--accent-ink); }
.trail-head .trail-help { grid-column: 1 / -1; }
.chapter.locked { opacity: 0.55; padding: 14px 20px; }
.nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.nodes::before { display: none; }
.node { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; text-align: center; }
.node .nn { width: 40px; height: 40px; font-size: 16px; }
.node.full .nn { background: var(--gold); color: var(--gold-ink); border-color: var(--accent-ink); }
.node .np { font-size: 11px; color: var(--muted); font-weight: 600; max-width: 100%; }
.node .stars { font-size: 14px; }
@media (max-width: 520px) { .nodes { grid-template-columns: repeat(5, 1fr); gap: 6px; } .node { padding: 8px 2px 6px; } .node .np { display: none; } .node .nn { width: 36px; height: 36px; } }
.chapter.current .node:not(.starred):first-of-type .nn { animation: none; }
.chapter.current .nodes li:has(.node:not(.starred)):first-of-type .nn { animation: pulse 1.6s infinite; }

/* ---------- titles: the locked ones as a list behind a toggle ---------- */
.locked-titles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }

/* ---------- hint: easy to spot ---------- */
.hint-btn { border-color: var(--accent-ink); color: var(--accent-ink); font-weight: 800; }
.hint-btn:disabled { color: var(--muted); border-color: var(--line); }
.topbar .pill { white-space: nowrap; }
.chapter.locked .row { flex-wrap: nowrap; }
.chapter.locked .row h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter.locked .row .small { flex: none; }
/* a dot from the player's browser id next to leaderboard names: same nickname, different player, different dot */
.ndot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 7px; vertical-align: middle; background: hsl(var(--h) 70% 60%); box-shadow: 0 0 0 2px #fff; }

.privacy h1 { margin: 0; }
.privacy h3 { margin: 10px 0 0; }
.privacy ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.privacy p { margin: 0; }
/* Google's sign-in button comes in a white iframe: clip it to its pill */
.gsi-wrap { display: inline-flex; align-items: center; border-radius: 6px; overflow: hidden; color-scheme: light; }
.gsi-wrap iframe { display: block; }
.ph-actions { margin-top: 4px; }
/* signed in: a Google mark on the avatar, and a green pill on the profile */
.pb-avatar { position: relative; }
.pb-g { position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: #1a73e8; font: 800 10px/15px var(--display); text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.pill.signed { background: rgb(61 220 151 / 0.18); color: var(--green); }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.ph-actions .btn { min-height: 36px; padding-inline: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pager .btn { min-width: 44px; padding-inline: 0; font-size: 22px; line-height: 1; }
.pager .btn:disabled { opacity: 0.35; }
/* the top bar on phones: the language select and the daily pill give way instead of overflowing */
@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .topbar .top-right { min-width: 0; gap: 6px; }
  .topbar .pb-count, .topbar .pill-extra { display: none; } /* the badge count and the streak wait for the profile page */
  .topbar .lang-pick { min-width: 0; flex: 0 1 auto; }
  .topbar .lang-pick > span { display: none; }
  .topbar .lang-pick select.input { min-width: 0; max-width: 104px; padding-inline: 10px 26px; }
  .topbar .pill { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
.site-foot { margin: 28px 0 8px; text-align: center; color: var(--muted); font-size: 13px; }
.site-foot a { color: var(--muted); }
.warn-pill { background: rgb(255 201 74 / 0.15); color: var(--accent-ink); }
.age-gate { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgb(0 0 0 / 0.35); }
.age-gate p { margin: 0; font-size: 15px; }
.age-gate .btn { min-height: 40px; }
.linkish { appearance: none; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.report-btn { appearance: none; background: none; border: 0; padding: 0 4px; color: var(--muted); cursor: pointer; font-size: 13px; opacity: 0.7; }
.report-btn:hover, .report-btn:focus-visible { opacity: 1; color: var(--accent-ink); }
.report-btn:disabled { opacity: 0.35; cursor: default; }
.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; }
.skip { position: absolute; top: -60px; inset-inline-start: 12px; z-index: 100; padding: 10px 14px; border-radius: 6px; background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.skip:focus { top: 12px; }
.node.gold .nn { background: var(--gold); color: var(--gold-ink); border-color: var(--rule); font-size: 17px; line-height: 1; padding-bottom: 1px; }
.node.gold { border-color: var(--accent-ink); }
.stars.gold-done { font-size: 44px; }

/* ================= the Countdown Chart =================
   A white chart sheet: ink rules between rows, huge rank numerals, a violet band and markers,
   tangerine for the one thing to press. No cards, glows or gradients. */
::selection { background: var(--gold); color: var(--ink); }
html { accent-color: var(--violet); caret-color: var(--violet); scrollbar-color: #b9b3cf transparent; }
.lb .s, .tile .pts, .stat b, .stats b, .board-score b, .timer, .podium b, .quest-list .qx, .trail-score b { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; }
a { color: var(--accent-ink); text-underline-offset: 3px; }

/* logo: the 99% in a violet block, the name in ink */
.logo { color: var(--ink); font-weight: 900; }
.logo .mark { background: var(--violet); color: #fff; border-radius: 4px; padding: 0 8px; font-size: 20px; line-height: 1.35; }
.logo .word { font-size: 17px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; }

/* buttons: square-ish, heavy, one tangerine action per screen */
.btn { border-radius: 6px; font-weight: 800; background: var(--panel-2); color: var(--ink); transition: background-color 0.15s, transform 0.06s; }
.btn:hover { filter: none; background: #ddd4fb; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #f58a26; }
.btn-violet { background: var(--violet); color: #fff; }
.btn-violet:hover { background: #5a2fe0; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #096a3d; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-armed, .btn-armed:hover { background: var(--red); color: #fff; }
.btn:disabled { opacity: 0.4; }

/* fields */
.input { background: #fff; border: 2px solid var(--line); border-radius: 6px; color: var(--ink); }
.input:focus { border-color: var(--violet); }
.input::placeholder { color: #75728a; }
.code-input { letter-spacing: 0.3em; }

/* pills and chips */
.pill { background: var(--violet-tint); color: var(--accent-ink); border-radius: 4px; font-weight: 800; }
.chip { background: #fff; border: 2px solid var(--line); border-radius: 6px; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }

/* the page head: the logo line; the sections below bring their own rules */
.topbar { padding-bottom: 4px; }
.stat span { color: var(--muted); letter-spacing: 0.06em; font-weight: 700; font-size: 12px; }

/* sections are ruled, not boxed */
.card { padding: 14px 0 4px; }
.card h2, .card h3 { margin-bottom: 2px; }
.stack > .card { border-top-width: 3px; }

/* the search bar */
.search { background: #fff; color: var(--ink); border: 2px solid var(--rule); border-radius: 6px; box-shadow: none; }
.search input { color: var(--accent-ink); font-weight: 700; }
.search svg { opacity: 0.7; }

/* ---------- the board: a top-10 chart ---------- */
.board { gap: 0 24px; border-bottom: 2px solid var(--rule); }
@media (max-width: 640px) { .board { gap: 0; } }
.tile { min-height: 54px; padding: 6px 10px 6px 0; gap: 10px; }
.tile .num { width: 44px; height: auto; background: none; border-radius: 0; font-size: 30px; font-weight: 900; color: var(--ink); line-height: 1; text-align: center; }
@media (max-width: 640px) { .tile .num { width: 38px; height: auto; font-size: 26px; } }
.tile .txt { font-size: 18px; font-weight: 700; }
.tile .pts { color: var(--muted); font-weight: 800; }
.tile.shape .txt, .tile:not(.found):not(.missed):not(.others):not(.nobody) .txt { color: #8a879c; }
.tile.shape .txt { opacity: 1; }
/* found: the row lights violet and the answer lands from the start of the line */
.tile.found { background: var(--violet-tint); }
.tile.found .txt { color: var(--ink); }
.tile.found .num, .tile.found .pts { color: var(--accent-ink); }
@keyframes enter { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[dir="rtl"] .tile.found.fresh { animation-name: enter-rtl; }
@keyframes enter-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.tile.missed { background: #fff; }
.tile.missed .txt { color: var(--muted); }
.tile.others { background: var(--tangerine-tint); }
.tile.others .num { background: none; color: #a34d00; }
.tile.others .pts { color: #8a4100; }
.tile.nobody { opacity: 1; }
.tile.nobody .txt, .tile.nobody .num { color: var(--muted); }
.tile .bar { background: rgb(106 61 240 / 0.12); }
.tile.others .bar { background: rgb(255 155 61 / 0.25); }
.tile .badge { background: var(--ink); color: #fff; border-radius: 4px; }
.tile .badge.you { background: var(--violet); color: #fff; }
.tile .star { background: var(--violet); color: #fff; border-radius: 4px; }
.tile .star.hinted { background: var(--gold); color: var(--ink); }
.tile.hinted, .tile.clued { border-style: solid; }
.tile.hinted .txt { color: var(--accent-ink); }
.legend .sw { border-radius: 2px; }
.legend .sw.found { background: var(--violet); }
.legend .sw.others { background: var(--gold); }
.legend .sw.nobody { border-color: var(--muted); }

.strike { background: #fff; color: var(--line); border: 2px solid var(--line); border-radius: 6px; }
.strike.on { background: var(--red); color: #fff; border-color: var(--red); }

/* timer: a tangerine ring on white */
.timer { background: conic-gradient(var(--gold) calc(var(--p) * 360deg), var(--bg-2) 0); }
.timer::before { background: #fff; }
.timer.low { background: conic-gradient(var(--red) calc(var(--p) * 360deg), var(--bg-2) 0); }

/* leaderboards: ruled rows, big ranks */
.lb { gap: 0; border-bottom: 1px solid var(--line); }
.lb li { background: none; border-radius: 0; border-top: 1px solid var(--line); padding: 9px 4px; }
.lb .r { font-size: 20px; font-weight: 900; color: var(--ink); }
.lb li.me { outline: 0; background: var(--tangerine-tint); }
.lb .d { color: var(--green); }
.home-lb-card .lb li { padding: 8px 4px; }
.see-all { color: var(--accent-ink); }

/* podium */
.podium > div { background: var(--violet-tint); border-radius: 6px 6px 0 0; border-bottom: 3px solid var(--rule); }
.podium .p1 { background: var(--gold); }

/* players, feed, lists */
.player-chip { background: var(--violet-tint); color: var(--ink); border-radius: 6px; }
.player-chip:hover { background: var(--red); color: #fff; }
.pub-chip:hover { background: var(--violet-tint); color: var(--ink); }
.sugg-list, .quest-list, .rare-list, .league-list, .recap-list, .feed { gap: 0; }
.sugg-list li, .quest-list li, .rare-list li, .league-list li, .recap-list li, .feed li { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding-inline: 2px; }
.feed.small li, .feed-top li { padding-block: 6px; }
.sugg-x { background: #fff; border: 2px solid var(--line); border-radius: 6px; }
.stats { gap: 0; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--line); }
.stats div { background: none; border-radius: 0; padding: 10px 4px; }
.stats div + div { border-inline-start: 1px solid var(--line); }
.badge { background: #fff; border: 2px solid var(--line); border-radius: 6px; }
.badge.on { border-color: var(--violet); background: var(--violet-tint); }
.bonus-opt, .bluff-opt, .rate-btn, .lb-day, .vote-x, .hint-btn { border-radius: 6px; background: #fff; color: var(--ink); }
.bonus-opt.right { background: #e3f4ea; border-color: var(--green); }
.bonus-opt.wrong { background: #fbe4e7; border-color: var(--red); }
.bluff-res { background: #fff; border: 2px dashed var(--line); border-radius: 6px; }
.bluff-res.picked { outline-color: var(--violet); }
.hint-btn { border: 2px solid var(--violet); color: var(--accent-ink); }
.node { background: #fff; border: 2px solid var(--line); border-radius: 6px; }
.node:hover { border-color: var(--violet); }
.node .nn { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 900; }
.node.starred .nn { border-color: var(--violet); color: var(--accent-ink); }
.node.full .nn { background: var(--violet); border-color: var(--violet); color: #fff; }
.node.gold .nn { background: var(--gold); border-color: var(--rule); color: var(--ink); }
.node.gold { border-color: var(--gold); }
.stars .dim { color: var(--line); }
.chapter.locked { opacity: 0.6; }
.chapter.done { border-top-color: var(--green); }
.team-btn { border-radius: 6px; background: #fff; }
.team-btn[aria-pressed="true"] { color: var(--ink); }
.warn { background: var(--tangerine-tint); border: 0; border-radius: 6px; color: var(--ink); }
.done-banner { background: var(--violet); color: #fff; border-radius: 6px; }
.ptitle { background: var(--violet-tint); color: var(--accent-ink); border-radius: 4px; }
.warn-pill { background: var(--tangerine-tint); color: #8a4100; }
.pill.signed { background: #e3f4ea; color: var(--green); }
.leader-strip { background: none; border: 0; border-block: 1px solid var(--line); border-radius: 0; padding: 10px 2px; max-width: none; color: var(--ink); }
.leader-strip:hover { background: none; color: var(--accent-ink); }
.leader-strip .ico { flex: none; color: var(--accent-ink); }
.live-dot { background: var(--green); }
.ndot { background: hsl(var(--h) 65% 45%); }

/* bars that stay on screen */
.host-bar { background: #fff; border-top: 3px solid var(--rule); }
@media (max-width: 640px) { .host-bar { border-bottom: 3px solid var(--rule); } }
.host-bar .host-tag { color: var(--accent-ink); }
.continue-bar { background: #fff; border: 2px solid var(--rule); border-radius: 6px; }
.age-gate { background: #fff; border-top: 3px solid var(--rule); box-shadow: 0 -6px 20px rgb(17 17 17 / 0.1); }
.toast { background: var(--ink); color: #fff; border-radius: 6px; }
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--green); color: #fff; }
.conn { border-radius: 6px; }
.skip { background: var(--gold); color: var(--ink); border-radius: 6px; }
.celebrate { border-radius: 6px; border: 2px solid var(--rule); }
.profile-btn { background: #fff; border: 2px solid var(--line); border-radius: 6px; }
.profile-btn:hover, .profile-btn.here { border-color: var(--violet); }
.pb-avatar, .ph-avatar { border-radius: 4px; }
.pb-g { box-shadow: 0 0 0 2px #fff; }
.copyable:hover { background: var(--bg-2); }
.join-box img { border: 2px solid var(--rule); border-radius: 6px; }
.site-foot { border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- home ---------- */
.home-band {
  background: var(--violet); color: #fff; margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0;
  padding: max(16px, env(safe-area-inset-top)) 16px 22px; display: grid; gap: 10px;
}
.home-band .home-top { align-items: center; }
.home-band .profile-btn { background: transparent; border-color: rgb(255 255 255 / 0.5); color: #fff; }
.home-band .profile-btn:hover { border-color: #fff; }
.home-band .pb-avatar { background: #fff; color: var(--violet); }
.home-band .pb-count { color: #fff; }
.home-band .lang-pick select.input { background-color: transparent; color: #fff; border-color: rgb(255 255 255 / 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.home-band .lang-pick select.input option { color: var(--ink); }
.home-band .lang-pick > span { filter: grayscale(1) brightness(3); }
.home-name { margin: 6px 0 0; font-size: clamp(40px, 9vw, 84px); font-weight: 900; line-height: 0.95; letter-spacing: -0.03em; text-wrap: balance; }
.home-name .pct { display: block; font-size: 0.5em; letter-spacing: 0; }
.home-band .tagline { color: #fff; font-size: clamp(17px, 2.4vw, 22px); font-weight: 500; }
.home { padding-top: max(16px, env(safe-area-inset-top)); }
.home-hero { text-align: start; justify-items: stretch; gap: 22px; margin-top: 18px; }
.home-hero > * { width: 100%; max-width: none; }

/* the demo: a made-up search counted down, its endings landing one by one */
.demo-chart { margin: 0; }
.demo-q { margin: 0 0 8px; font-size: clamp(22px, 4vw, 34px); font-weight: 800; letter-spacing: -0.01em; }
.demo-q span { color: var(--accent-ink); }
.demo-list { list-style: none; margin: 0; padding: 0; border-bottom: 2px solid var(--rule); }
.demo-list li { display: grid; grid-template-columns: 48px 1fr; align-items: center; min-height: 46px; border-top: 2px solid var(--rule); }
.demo-list b { font-size: 30px; font-weight: 900; line-height: 1; }
.demo-list span { font-weight: 700; font-size: 18px; color: var(--ink); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 3px; padding-block: 6px; }
.demo-list .cell { width: 9px; height: 3px; background: #8a879c; border-radius: 1px; }
.demo-list .sp { width: 9px; }
.demo-list li.on { background: var(--violet-tint); animation: enter 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
[dir="rtl"] .demo-list li.on { animation-name: enter-rtl; }
.demo-list li.on b { color: var(--accent-ink); }
.demo-list li.on span { display: block; unicode-bidi: plaintext; } /* a revealed answer keeps its own direction; blanks follow the page */

/* today's puzzle (or what comes next): an ink strip with the tangerine button */

/* ways to play: a ruled list, no icons */
.home .choices.specials { width: 100%; }
.home-lb { width: 100%; }
.choice.special, .choice { border-top-color: var(--rule); }
@media (prefers-reduced-motion: reduce) { .demo-list li.on { animation: none; } }

/* on the lavender page, ruled sections and chart rows are see-through; fields stay white */
.card, .tile, .tile.missed, .mode, .lb li, .demo-list li { background: none; }
.tile.found, .demo-list li.on { background: var(--violet-tint); }
.tile.others { background: var(--tangerine-tint); }
.lb li.me { background: var(--tangerine-tint); }
.timer::before { background: var(--bg); }
.host-bar, .age-gate { background: var(--bg); }
/* the home band runs edge to edge; its content lines up with the page column (padding % is of the column) */
body { overflow-x: clip; }
.home-band { margin-inline: calc(50% - 50vw); padding-inline: max(16px, calc(50vw - 50%)); }

p, li { text-wrap: pretty; }
.inline-help > summary { color: var(--accent-ink); }
.chapter.locked { opacity: 1; }
.chapter.locked h3, .chapter.locked .muted, .chapter.locked .small { color: var(--muted); }
.tile.shape .txt, .tile:not(.found):not(.missed):not(.others):not(.nobody) .txt { color: #6f6c82; }

/* drawn icons */
.ico { flex: none; vertical-align: -4px; }
.pb-avatar .ico, .ph-avatar .ico { width: 60%; height: 60%; }
.pb-count { display: inline-flex; align-items: center; gap: 3px; }
.pb-count .ico { width: 16px; height: 16px; }
.quest-list .qe { color: var(--green); }
.stars.gold-done .ico { width: 40px; height: 40px; color: var(--accent-ink); }
/* a secondary action: ink outline, never a second tangerine */
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule); }
.btn-outline:hover { background: var(--violet-tint); }

.rate-btn { display: inline-grid; place-items: center; color: var(--ink); }
.rate-btn[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }

/* a TV or big monitor across the room: the whole page scales up, so ranks and answers read from the sofa */
@media (min-width: 1600px) and (min-height: 900px) { html { zoom: 1.3; } }
@media (min-width: 2400px) and (min-height: 1300px) { html { zoom: 1.75; } }
/* the results' Continue sits above the reveal, never over it */
.continue-bar.at-top { position: static; margin-top: 14px; box-shadow: none; }
/* host lobby: who has joined sits under the join code, next to the settings */
.host-left { display: grid; gap: 18px; align-content: start; }
.settings > p:empty { display: none; }
/* a <details> inside a <p> splits it and leaves an empty paragraph: it takes no space */
.stack > p:empty { display: none; }

/* ================= liveliness: mode colours, icons, landing moments ================= */
.m-daily { --mode: var(--c-daily); }
.m-solo { --mode: var(--c-solo); }
.m-campaign { --mode: var(--c-campaign); }
.m-host { --mode: var(--c-host); }
.m-find { --mode: var(--c-find); }

/* the big strip leads with its mode's icon on a colour tile */

/* a new find: the row lands, its rank gives one bounce, and a NEW marker shows for a moment */
.tile.fresh .num { animation: rank-bump 0.5s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rank-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.new-tag { display: inline-block; margin-inline-start: 8px; padding: 1px 6px; border-radius: 4px; background: var(--tangerine); color: var(--ink); font-size: 11px; font-weight: 900; letter-spacing: 0.06em; vertical-align: middle; animation: new-tag 2.6s ease forwards; }
@keyframes new-tag { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
/* results: the share of the room that found it, as a chart marker */
.pct-tag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 0.92em; font-weight: 800; }
.tile.nobody .pct-tag { display: none; }

/* the podium rises, third place first and the winner last */
.podium > div { transform-origin: bottom; animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.podium .p3 { animation-delay: 0.15s; }
.podium .p2 { animation-delay: 0.45s; }
.podium .p1 { animation-delay: 0.8s; }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .new-tag { animation: none; opacity: 1; } }

/* ======================================================================
   THE APP
   Two themes. The page is the colour (saturated violet, or violet-black in dark);
   surfaces (cards, rows, fields, bars) sit on it and carry their own ink. Every
   component reads --ink/--muted/--line/--accent-ink from whatever it sits on.
   ====================================================================== */
:root, :root[data-theme="color"] {
  --page: #4a1fd1; --page-ink: #ffffff; --page-muted: #ddd3ff; --page-line: rgb(255 255 255 / 0.22); --page-accent: #ffc58a;
  --page-chip: rgb(255 255 255 / 0.14); --page-chip-hover: rgb(255 255 255 / 0.22);
  --surf: #ffffff; --surf-2: #f2eeff; --surf-ink: #15122b; --surf-muted: #5d5875; --surf-line: #e6e0f7; --surf-accent: #5a2fe0;
  --nav-bg: #ffffff; --nav-ink: #5d5875; --nav-on: #4a1fd1; --nav-on-bg: #ece6ff;
  --shadow: 0 1px 2px rgb(30 10 90 / 0.14), 0 10px 28px rgb(30 10 90 / 0.22);
  --shadow-sm: 0 1px 2px rgb(30 10 90 / 0.12), 0 3px 10px rgb(30 10 90 / 0.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #0f0b22; --page-ink: #f3efff; --page-muted: #aaa2cb; --page-line: rgb(255 255 255 / 0.12); --page-accent: #ffc58a;
  --page-chip: rgb(255 255 255 / 0.08); --page-chip-hover: rgb(255 255 255 / 0.14);
  --surf: #1c1638; --surf-2: #272050; --surf-ink: #f3efff; --surf-muted: #aaa2cb; --surf-line: #322a5e; --surf-accent: #c3b0ff;
  --nav-bg: #171233; --nav-ink: #aaa2cb; --nav-on: #f3efff; --nav-on-bg: #2d2560;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 10px 28px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4), 0 3px 10px rgb(0 0 0 / 0.3);
  color-scheme: dark;
}
:root {
  --c-daily: #b45309; --c-solo: #0f766e; --c-campaign: #15803d; --c-host: #be185d; --c-find: #1d4ed8;
  --found: #22c55e; --found-ink: #0b2a17; --others: #7cc4ff; --others-ink: #08263f;
  --radius: 18px;
  /* on the page */
  --bg: var(--page); --ink: var(--page-ink); --muted: var(--page-muted); --line: var(--page-line); --rule: var(--page-line);
  --accent-ink: var(--page-accent); --panel: var(--surf); --panel-2: var(--page-chip); --bg-2: var(--page-chip);
  --pill-bg: var(--page-chip); --pill-ink: var(--page-ink); --v-bg: #ffffff; --v-ink: #4a1fd1;
}
/* on a surface */
.card, .tile, .search, .input, .code-bar, .continue-bar, .bonus-opt, .bluff-opt, .bluff-res, .chip, .lb-day, .node, .badge,
.team-btn, .profile-btn, .sugg-x, .rate-btn, .toast, .host-bar, .age-gate, .demo-list li, .mode, .celebrate, .theme-btn, .appnav, .demo-chart, .podium > div {
  --ink: var(--surf-ink); --muted: var(--surf-muted); --line: var(--surf-line); --rule: var(--surf-line); --accent-ink: var(--surf-accent);
  --bg-2: var(--surf-2); --panel-2: var(--surf-2); --pill-bg: var(--surf-2); --pill-ink: var(--surf-accent); --v-bg: #6a3df0; --v-ink: #ffffff;
  color: var(--ink);
}
html, body { background: var(--page); }
body { color: var(--ink); transition: background-color 0.3s; }
a { color: var(--accent-ink); }
::selection { background: var(--tangerine); color: #15122b; }
.muted, .small.muted { color: var(--muted); }

/* ---------- surfaces ---------- */
.card { background: var(--surf); border: 0; border-radius: 22px; padding: 18px 18px 16px; box-shadow: var(--shadow); }
.card + .card, .stack > .card { border-top: 0; }
.chapter.current, .chapter.done, .daily-board.world, .choice.special, .choice { border-top: 0; }
.chapter.current { box-shadow: var(--shadow), inset 0 0 0 3px #6a3df0; }
.input, select.input, .search, .code-bar { background-color: var(--surf); border: 2px solid var(--surf-line); border-radius: 14px; color: var(--ink); }
.input:focus { border-color: #6a3df0; }
.search { border: 0; border-radius: 18px; box-shadow: var(--shadow); padding: 8px 8px 8px 18px; }
.pill { background: var(--pill-bg); color: var(--pill-ink); border-radius: 999px; padding: 4px 12px; }
.topbar .pill { background: var(--page-chip); color: var(--page-ink); }

/* ---------- buttons: rounded, they press ---------- */
.btn { border-radius: 14px; background: var(--panel-2); color: var(--ink); transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s, box-shadow 0.15s; }
.btn:hover { background: var(--page-chip-hover); }
.card .btn:hover, .continue-bar .btn:hover, .host-bar .btn:hover { background: var(--surf-line); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-gold, .btn-gold:hover, .card .btn-gold:hover { background: var(--tangerine); color: #15122b; box-shadow: 0 2px 0 rgb(0 0 0 / 0.18), 0 6px 16px rgb(20 10 60 / 0.22); }
.btn-gold:hover { background: #ffab5c; }
.btn-violet, .btn-violet:hover, .card .btn-violet:hover { background: var(--v-bg); color: var(--v-ink); }
.btn-outline { box-shadow: inset 0 0 0 2px currentColor; background: transparent; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-armed, .btn-armed:hover { background: var(--red); color: #fff; }
.chip { background: var(--surf); border: 2px solid var(--surf-line); border-radius: 999px; }
.chip[aria-pressed="true"] { background: #6a3df0; border-color: #6a3df0; color: #fff; }

/* ---------- the board: answer rows are rounded cards ---------- */
.board { gap: 8px 14px; border: 0; }
.tile { background: var(--surf); border: 0; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 6px 14px 6px 6px; min-height: 56px; }
.tile .num { width: 42px; height: 42px; border-radius: 12px; background: var(--surf-2); color: var(--ink); font-size: 24px; display: grid; place-items: center; }
.tile.shape .txt, .tile:not(.found):not(.missed):not(.others):not(.nobody) .txt { color: var(--muted); }
.tile.found { background: var(--found); --ink: var(--found-ink); --muted: var(--found-ink); color: var(--found-ink); }
.tile.found .num { background: rgb(255 255 255 / 0.4); color: var(--found-ink); }
.tile.found .pts, .tile.found .num { color: var(--found-ink); }
.tile.others { background: var(--others); --ink: var(--others-ink); --muted: var(--others-ink); color: var(--others-ink); }
.tile.others .num { background: rgb(255 255 255 / 0.45); color: var(--others-ink); }
.tile.others .pts { color: var(--others-ink); }
.tile.nobody { background: var(--surf); opacity: 0.85; }
.tile.nobody .num { background: var(--surf-2); color: var(--muted); }
.tile.hinted, .tile.clued { box-shadow: var(--shadow-sm), inset 0 0 0 2px #6a3df0; }
.tile .bar { background: rgb(255 255 255 / 0.35); border-radius: 16px; }
.tile .badge, .tile .badge.you { background: #15122b; color: #fff; border-radius: 999px; }
.tile .star { background: #15122b; color: #fff; border-radius: 999px; }
.new-tag { background: #15122b; color: #fff; border-radius: 999px; }
.pct-tag { background: #15122b; color: #fff; border-radius: 999px; }
.legend .sw { border-radius: 4px; }
.legend .sw.found { background: var(--found); }
.legend .sw.others { background: var(--others); }
.legend .sw.nobody { border-color: var(--muted); }
@media (max-width: 640px) { .tile .num { width: 36px; height: 36px; font-size: 21px; } .tile { min-height: 50px; } }
.strike { background: var(--page-chip); border: 0; color: var(--page-muted); border-radius: 12px; }
.strike.on { background: var(--red); color: #fff; }
.timer { background: conic-gradient(var(--tangerine) calc(var(--p) * 360deg), var(--page-chip) 0); }
.timer::before { background: var(--page); }
.round-info, .guess-msg { color: var(--page-ink); }
.guess-msg.good { color: var(--found); }
.guess-msg.bad { color: #ffb4bd; }

/* ---------- lists inside cards ---------- */
.lb li { border-top: 1px solid var(--line); }
.lb li.me { background: var(--surf-2); border-radius: 12px; }
.lb .r { color: var(--ink); }
.podium > div { background: var(--surf); color: var(--ink); border: 0; border-radius: 18px 18px 6px 6px; box-shadow: var(--shadow); --ink: var(--surf-ink); }
.podium .p1 { background: var(--tangerine); color: #15122b; }
.player-chip { background: var(--surf-2); color: var(--ink); border-radius: 999px; }
.feed li { border-top: 0; background: var(--page-chip); border-radius: 12px; padding: 8px 12px; margin-bottom: 6px; color: var(--page-ink); }
.card .feed li { background: var(--surf-2); color: var(--ink); }
.stats { border: 0; gap: 8px; }
.stats div { background: var(--surf-2); border-radius: 14px; border: 0 !important; }
.badge { border-radius: 16px; background: var(--surf); }
.badge.on { background: var(--surf-2); border-color: #6a3df0; }
.node { border-radius: 16px; background: var(--surf-2); border: 0; }
.node .nn { background: var(--surf); border-color: var(--surf-line); color: var(--ink); }
.node.full .nn { background: #6a3df0; border-color: #6a3df0; color: #fff; }
.bonus-opt, .bluff-opt { background: var(--surf); border: 2px solid var(--surf-line); border-radius: 14px; }
.bluff-res { background: var(--surf); border-radius: 14px; }
.bluff-res.real { background: var(--found); color: var(--found-ink); }
.bonus-opt.right { background: var(--found); color: var(--found-ink); border-color: var(--found); }
.bonus-opt.wrong { background: #ffd6db; color: #4a0d16; border-color: var(--red); }
.warn { background: var(--surf); color: var(--surf-ink); border-radius: 14px; box-shadow: var(--shadow-sm); }
.leader-strip { background: var(--page-chip); border: 0; border-radius: 999px; padding: 10px 16px; color: var(--page-ink); }
.leader-strip:hover { background: var(--page-chip-hover); color: var(--page-ink); }
.leader-strip .ico, .leader-strip .who, .leader-strip .go { color: var(--page-accent); }
.see-all { color: var(--accent-ink); }
.big-code { color: var(--accent-ink); }

/* ---------- floating things ---------- */
.toast { background: var(--surf); color: var(--surf-ink); border-radius: 14px; box-shadow: var(--shadow); }
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--found); color: var(--found-ink); }
.host-bar { background: var(--surf); border-top: 0; box-shadow: 0 -6px 24px rgb(0 0 0 / 0.18); }
.continue-bar { background: var(--surf); border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.age-gate { background: var(--surf); border-top: 0; box-shadow: 0 -8px 30px rgb(0 0 0 / 0.25); border-radius: 20px 20px 0 0; }
.profile-btn { background: var(--surf); border: 0; border-radius: 999px; box-shadow: var(--shadow-sm); }
.pb-avatar, .ph-avatar { border-radius: 999px; background: #6a3df0; color: #fff; }
.celebrate { border: 0; border-radius: 18px; }
.skip { border-radius: 12px; }

/* ---------- home ---------- */
.home-band { background: none; margin: 0; padding: 4px 0 6px; }
.home-band .tagline { color: var(--page-muted); }
.home-band .profile-btn { background: var(--surf); border: 0; color: var(--surf-ink); }
.home-band .pb-avatar { background: #6a3df0; color: #fff; }
.home-band .lang-pick select.input { background-color: var(--page-chip); border: 0; color: var(--page-ink); }
.home-name { color: var(--page-ink); font-size: clamp(38px, 7.5vw, 76px); }
.home-top { gap: 8px; }
.demo-chart { background: var(--surf); border-radius: 22px; padding: 16px 16px 14px; box-shadow: var(--shadow); --ink: var(--surf-ink); --muted: var(--surf-muted); color: var(--surf-ink); }
.demo-q { color: var(--surf-accent); }
.demo-list { border: 0; display: grid; gap: 6px; }
.demo-list li { border: 0; background: var(--surf-2); border-radius: 12px; min-height: 44px; grid-template-columns: 44px 1fr; }
.demo-list b { font-size: 22px; text-align: center; }
.demo-list li.on { background: var(--found); }
.demo-list li.on b, .demo-list li.on span { color: var(--found-ink); }
.demo-list .cell { background: var(--surf-muted); opacity: 0.6; }
/* ways to play: app tiles, each with its own colour */
.home .choices.specials .card { box-shadow: var(--shadow); }

/* the demo plays a party round: your find in green, your friends' in sky, a timer and the table */
.demo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.demo-head .demo-q { margin: 0; min-width: 0; }
.demo-timer { flex: none; font-weight: 900; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--surf-ink); background: var(--surf-2); border-radius: 12px; padding: 8px 10px; }
.demo-party .demo-list li { grid-template-columns: 44px minmax(0, 1fr) auto; }
.demo-party .demo-list li.others { background: var(--others); }
.demo-party .demo-list li.others b, .demo-party .demo-list li.others span { color: var(--others-ink); }
.demo-party .demo-list li.others { animation: enter 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
[dir="rtl"] .demo-party .demo-list li.others { animation-name: enter-rtl; }
.demo-party .demo-list .who { font-style: normal; font-size: 12px; font-weight: 800; padding-inline-end: 12px; color: inherit; opacity: 0.8; }
.demo-party .demo-list li.on .who { color: var(--found-ink); }
.demo-party .demo-list li.others .who { color: var(--others-ink); }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--surf-muted); font-size: 14px; font-weight: 700; }
.faces { display: flex; align-items: center; }
.face { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; border: 3px solid var(--surf); margin-inline-start: -8px; background: var(--c-solo); }
.face:first-child { margin-inline-start: 0; }
.face.f1 { background: var(--c-find); }
.face.f2 { background: var(--c-campaign); }
.face.f3 { background: var(--c-daily); }

/* two doors: play with friends (the main one) and alone */
.doors { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .doors { grid-template-columns: minmax(0, 1fr); } }
.door { display: grid; gap: 14px; }
.door-head { display: flex; align-items: center; gap: 14px; }
.door-head h2 { font-size: clamp(24px, 3.4vw, 32px); }
.door-head p { margin: 2px 0 0; }
.door-ico { flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--c-host); color: #fff; display: grid; place-items: center; }
.door-ico .ico { width: 38px; height: 38px; stroke-width: 2.2; }
.door-row { display: flex; gap: 10px; align-items: stretch; }
.door-row .input { flex: 1 1 0; min-width: 0; font-size: 16px; }
.door-row .btn { flex: none; }
.door-row .code-input { flex: 0 1 170px; min-width: 120px; font-size: 22px; }
.door-row.code-row .btn { flex: 1 1 auto; }
.live-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--surf-muted); font-size: 14px; font-weight: 700; }
.live-line a { color: var(--surf-accent); }
.live-line.hot { color: var(--surf-ink); }
@media (max-width: 520px) {
  .door-row { flex-wrap: wrap; }
  .door-row .btn, .door-row .code-input { flex: 1 1 100%; }
}
.door-solo { gap: 0; padding-bottom: 6px; }
.door-solo h3 { font-size: 18px; padding-bottom: 8px; }
.solo-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--surf-ink); border-top: 1px solid var(--surf-line); border-radius: 0; }
.solo-row:hover .solo-go { text-decoration: underline; text-underline-offset: 3px; }
.solo-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--mode); }
.solo-ico .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.solo-txt { display: grid; gap: 1px; min-width: 0; }
.solo-txt b { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.solo-txt small { color: var(--surf-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solo-go { color: var(--surf-accent); font-weight: 800; }
.solo-row .tab-alert { position: static; display: inline-grid; place-items: center; box-shadow: none; }
.site-foot { border-top: 0; color: var(--page-muted); }
.site-foot a { color: var(--page-muted); }

/* ---------- the app's navigation ---------- */
.appnav {
  position: fixed; z-index: 45; display: flex; background: var(--nav-bg);
  inset-inline: 0; bottom: 0; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgb(0 0 0 / 0.16);
}
.appnav .tab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; color: var(--nav-ink); text-decoration: none; font-size: 11px; font-weight: 700; }
.appnav .tab .ico { width: 24px; height: 24px; }
.appnav .tab[aria-current="page"] { color: var(--nav-on); background: var(--nav-on-bg); }
.appnav .tab:hover { color: var(--nav-on); }
.appnav .nav-logo, .appnav .nav-end { display: none; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom) + var(--kb, 0px)); }
.age-gate { bottom: calc(68px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .appnav { inset: 0 auto 0 0; width: 92px; flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 10px; box-shadow: 4px 0 24px rgb(0 0 0 / 0.12); }
  [dir="rtl"] .appnav { inset: 0 0 0 auto; box-shadow: -4px 0 24px rgb(0 0 0 / 0.12); }
  .appnav .tab { flex: none; padding: 10px 4px; font-size: 12px; }
  .appnav .nav-logo { display: grid; place-items: center; margin-bottom: 14px; text-decoration: none; }
  .appnav .nav-logo .mark { background: #6a3df0; color: #fff; font-weight: 900; font-size: 18px; border-radius: 12px; padding: 6px 8px; }
  .appnav .nav-end { display: grid; place-items: center; margin-top: auto; }
  body { padding-bottom: var(--kb, 0px); padding-inline-start: 92px; }
  .age-gate { bottom: 0; inset-inline-start: 92px; }
  .topbar .logo { visibility: hidden; } /* the rail carries the mark */
}
/* in a game, the board gets the whole screen */
body:has(#guess-form, #p-reveal, .host-bar, #host-lobby, #fake-form, .podium, #p-ready) .appnav { display: none; }
body:has(#guess-form, #p-reveal, .host-bar, #host-lobby, #fake-form, .podium, #p-ready) { padding-inline-start: 0; }
body:has(#guess-form, #p-reveal, #fake-form, .podium, #p-ready):not(:has(.host-bar)) { padding-bottom: var(--kb, 0px); }
body:has(#guess-form, #p-reveal, .host-bar, #host-lobby, #fake-form, .podium, #p-ready) .topbar .logo { visibility: visible; }

/* the theme switch */
.theme-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surf-2); color: var(--ink); cursor: pointer; }
.theme-btn:hover { background: var(--surf-line); }
.home-band .theme-btn { background: var(--page-chip); color: var(--page-ink); }

/* screens slide like an app's */
::view-transition-old(root) { animation: 160ms cubic-bezier(0.4, 0, 1, 1) both vt-out; }
::view-transition-new(root) { animation: 260ms cubic-bezier(0.22, 1, 0.36, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- game touches ---------- */
/* the top three ranks: gold, silver, bronze */
.tile:nth-child(1) .num { background: #ffd34d; color: #3a2a00; }
.tile:nth-child(2) .num { background: #c3cad9; color: #20263a; }
.tile:nth-child(3) .num { background: #f0b27a; color: #3d1f05; }
.tile.found:nth-child(-n + 3) .num { box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.12); }
/* lives: three hearts, a miss empties one */
.strikes { gap: 6px; }
.strike { width: auto; height: auto; background: none; border: 0; padding: 0; }
.strike svg { display: block; fill: #ff4d6d; stroke: none; filter: drop-shadow(0 2px 4px rgb(255 77 109 / 0.35)); }
.strike.on { background: none; }
.strike.on svg { fill: var(--page-chip-hover); filter: none; animation: life-lost 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes life-lost { 0% { transform: scale(1.3) rotate(-12deg); } 50% { transform: scale(0.85) rotate(8deg); } 100% { transform: none; } }
/* a new find: its points swell, then settle */
.tile.fresh .pts { animation: pts-pop 0.7s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes pts-pop { 0% { transform: scale(0.4); opacity: 0; } 45% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); } }
/* the round's numbers read like a game HUD */
.topbar .stat b { font-size: 28px; font-weight: 900; }
.topbar .stat span { color: var(--page-muted); }
@media (prefers-reduced-motion: reduce) { .strike.on svg, .tile.fresh .pts { animation: none; } }
.input::placeholder { color: var(--muted); }
/* badges are tiles inside their card, not cards of their own */
.badge { background: var(--surf-2); border: 0; box-shadow: none; }
.badge.on { background: var(--surf-2); box-shadow: inset 0 0 0 2px #6a3df0; }

/* ---------- theme fixes: everything takes its colours from the page or surface it sits on ---------- */
.rate-btn, .lb-day, .vote-x, .hint-btn, .team-btn, .sugg-x, .bonus-opt, .bluff-opt { background: var(--surf); color: var(--ink); border-color: var(--surf-line); }
.rate-btn[aria-pressed="true"] { background: #6a3df0; border-color: #6a3df0; color: #fff; }
.hint-btn { border: 2px solid #6a3df0; color: var(--accent-ink); }
.hint-btn:disabled { color: var(--muted); border-color: var(--surf-line); }
.team-btn[aria-pressed="true"] { background: var(--team); color: #15122b; }
.ptitle, .warn-pill, .pill.signed { background: var(--pill-bg); color: var(--pill-ink); }
.pill.signed { color: var(--found); }
.card .pill.signed { color: #15803d; }
:root[data-theme="dark"] .card .pill.signed { color: var(--found); }
/* the 99% mark and focus rings stand out from the violet page */
.topbar .logo .mark { background: #fff; color: #4a1fd1; }
:root[data-theme="dark"] .topbar .logo .mark { background: #6a3df0; color: #fff; }
.topbar .logo .word { color: var(--page-ink); }
:focus-visible { outline: 3px solid var(--page-accent); outline-offset: 2px; }
.card :focus-visible, .tile:focus-visible, .appnav :focus-visible, .search :focus-visible { outline-color: #6a3df0; }
:root[data-theme="dark"] .card :focus-visible, :root[data-theme="dark"] .appnav :focus-visible { outline-color: #c3b0ff; }

/* event packs and quests: an icon on a coloured tile */
.ico-tile { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--tile); color: #fff; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18); }
.ico-tile .ico { width: 30px; height: 30px; stroke-width: 2.1; }
.choice.slim.special { align-items: center; gap: 16px; }
.choice.slim.special > div { flex: 1; min-width: 0; }
.quest-list li { gap: 12px; }
.quest-list .ico-tile { width: 42px; height: 42px; border-radius: 13px; }
.quest-list .ico-tile .ico { width: 24px; height: 24px; }
.quest-list .ico-tile.done { color: var(--found-ink); }
.quest-list li.done .qt b { text-decoration: none; color: var(--muted); }
.badge .ico-tile { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 4px; }
.badge .ico-tile .ico { width: 26px; height: 26px; }
.badge:not(.on) .ico-tile { filter: grayscale(1); opacity: 0.6; }
@media (max-width: 480px) { .choice.slim.special { flex-direction: row; flex-wrap: wrap; } .choice.slim.special > .btn { flex-basis: 100%; } }
.quest-list .ico-tile { color: #fff; }
.quest-list .ico-tile.done { color: var(--found-ink); }
/* the dot by a leaderboard name: a clean filled circle, centred on the text, nothing to clip */
.ndot { width: 10px; height: 10px; margin-inline-end: 8px; vertical-align: 0.08em; box-shadow: none; background: hsl(var(--h) 70% 48%); }
:root[data-theme="dark"] .ndot { background: hsl(var(--h) 75% 66%); }

/* the wink under the tagline: missing an answer makes you the 1% */
.tagline-1 { margin: 2px 0 0; color: var(--page-accent); font-weight: 800; font-size: clamp(16px, 2.2vw, 20px); }

/* the Daily tab's alert while today's boards are unplayed */
.appnav .tab { position: relative; }
.tab-alert {
  position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red, #c8243a); color: #fff; font-size: 11px; font-weight: 900; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--nav-bg);
}

/* the app's own Google sign-in button (the website shows Google's) */
.btn-gsi { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #15122b; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .btn-gsi { background: #fff; color: #15122b; }
