:root {
  --bg: #15122b;
  --bg-2: #1c1840;
  --panel: #241f4d;
  --panel-2: #2d2760;
  --line: #3a3378;
  --ink: #f6f1ff;
  --muted: #aaa1d6;
  --gold: #ffc94a;
  --gold-ink: #2a1d00;
  --violet: #8b6bff;
  --red: #ff5d6c;
  --green: #3ddc97;
  --radius: 18px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #2b2370 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #3a1d5e 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -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: 12px; 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: 28px; padding: 6px 28px; line-height: 1.1; box-shadow: 0 16px 50px rgb(255 201 74 / 0.25); }
.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: 999px; 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); 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(--gold); outline-offset: 2px; }

.input {
  width: 100%; border: 2px solid var(--line); background: var(--bg-2); border-radius: 14px; padding: 12px 14px; outline: none; min-width: 0;
}
.input:focus { border-color: var(--gold); }
.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: #1d1838; border-radius: 999px;
  padding: 10px 10px 10px 22px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.35), 0 0 0 4px rgb(255 201 74 / 0.15);
}
.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: #5b33ff; font-weight: 600; }
.search input::placeholder { color: #7d7799; 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: 22px; 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: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.tile .num {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; 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: linear-gradient(180deg, #ffd56e, var(--gold)); border-color: transparent; color: var(--gold-ink); animation: flip 0.45s ease-out; }
.tile.found .num { background: rgb(0 0 0 / 0.12); color: var(--gold-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: 0 auto 0 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-left: 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: 10px; 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: 999px; background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.card { background: rgb(36 31 77 / 0.85); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }
.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: left; }
.demo .suggest { background: #fff; color: #1d1838; border-radius: 0 0 22px 22px; margin: -8px 14px 0; padding: 14px 18px 8px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.3); }
.demo .suggest div { padding: 4px 0; color: #6b6590; }
.demo .suggest div b { color: #1d1838; }
.typing { color: #5b33ff; 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: left; 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: 999px; padding: 8px 14px; cursor: pointer; font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--gold); background: rgb(255 201 74 / 0.12); color: var(--gold); }

/* 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: 14px; 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(--gold); 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: 999px; 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: 10px; 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: 12px; }
.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 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: 16px 16px 0 0; padding: 14px 8px; background: var(--panel-2); }
.podium .p1 { min-height: 190px; background: linear-gradient(180deg, #ffd56e, 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: 14px; 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: 12px; font-weight: 700; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgb(0 0 0 / 0.4);
}
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--green); color: #052; }

.conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 6px 14px; border-radius: 999px; 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: 12px; 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: 10px; }
button.big-code { appearance: none; background: none; border: 0; padding: 0; text-align: left; }
.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(--gold); 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: rgb(21 18 43 / .95); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.host-bar .host-tag { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.host-bar .btn { padding: 8px 14px; }
body.has-host-bar { padding-bottom: calc(var(--host-bar-h, 76px) + 32px); }
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: 16px; background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.35);
}
.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: linear-gradient(180deg, #4a3a9e, #3b2f86); border-color: var(--violet); color: #fff; }
.tile.others .num { background: var(--violet); color: #fff; }
.tile.others .pts { color: #d9ceff; }
.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 .sub .first { color: inherit; 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: 999px; display: grid; place-items: center;
  background: rgb(255 255 255 / .16); color: #fff;
}
.tile .badge.you { background: var(--gold-ink); color: var(--gold); 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: 0; }
  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: 8px 8px 8px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.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: 12px; 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: linear-gradient(135deg, rgb(139 107 255 / 0.28), rgb(36 31 77 / 0.85)); }
.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(--gold); }
.tile.hinted .txt { color: var(--gold); letter-spacing: 0.02em; }
.tile .star.hinted { background: var(--gold-ink); color: var(--gold); }

/* ---------- higher-or-lower bonus ---------- */
.bonus { margin-bottom: 16px; display: grid; gap: 10px; border-color: var(--gold); }
.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(--gold); }
.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: 14px; 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(--gold); }
.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-right: 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: 999px; 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: #15122b; }
.team-btn[aria-pressed="true"] .muted { color: #15122b; }
.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: left; min-height: 56px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; color: #1d1838; font-size: 17px; cursor: pointer; }
.bluff-opt b { color: #5b33ff; }
.bluff-opt:hover:not(:disabled) { border-color: var(--gold); }
.bluff-opt.picked { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(255 201 74 / 0.45); }
.bluff-opt:disabled { opacity: 0.55; cursor: default; }
.bluff-res { padding: 12px 16px; border-radius: 16px; background: var(--panel); border: 1px dashed var(--line); display: grid; gap: 4px; text-align: left; }
.bluff-res.real { background: linear-gradient(180deg, #ffd56e, 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-left: 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(--gold); background: linear-gradient(135deg, rgb(255 201 74 / 0.24), rgb(36 31 77 / 0.85)); }
.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(--gold); }
.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: left; }
.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; }

/* 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: linear-gradient(135deg, rgb(61 220 151 / 0.2), rgb(36 31 77 / 0.85)); }
.choice.featured.public .pill { background: var(--green); color: #052; }
.btn-green { background: var(--green); color: #052; }
.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); box-shadow: 0 0 0 0 rgb(61 220 151 / 0.6); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgb(61 220 151 / 0); } 100% { box-shadow: 0 0 0 0 rgb(61 220 151 / 0); } }
@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 */
.code-bar { display: flex; align-items: center; gap: 10px; width: min(460px, 100%); padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.code-bar label { font-weight: 700; color: var(--muted); white-space: nowrap; }
.code-bar .code-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 20px; border-radius: 999px; }
.code-bar .btn { flex: none; padding: 10px 22px; }
.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; } .code-bar { padding-left: 14px; } }

/* 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='%23aaa1d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 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 10px 30px rgb(0 0 0 / 0.45); }
  #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: 999px; 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: 20px; }
  .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 */
@media (max-width: 360px) {
  .code-bar label { display: none; }
  .code-bar .code-input { letter-spacing: 0.15em; }
}
.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: left; }
.home-lb:empty { display: none; }
.home-lb-card h3 { font-size: 22px; }
.home-lb-card .lb li { padding: 7px 12px; }
.see-all { color: var(--gold); font-weight: 800; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }
.home-lb-card a:not(.see-all) { color: var(--gold); 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: 999px; 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(--gold); }
.leader-strip .go { color: var(--gold); 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; }
