/* =========================================================
   Guessify — design system
   Mobile first · light & dark themes · one accent (lime)
   ========================================================= */

/* ---------- Tokens: dark (default) ---------- */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-elev: #111113;
  --surface: #151517;
  --surface-2: #1c1c1f;
  --surface-3: #27272b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f5f4;
  --text-2: #a8a8ae;
  --text-3: #71717a;
  --accent: #c6f432;
  --accent-hover: #d4ff4f;
  --on-accent: #0a0a0b;
  --accent-text: #c6f432;
  --accent-soft: rgba(198, 244, 50, 0.12);
  --accent-line: rgba(198, 244, 50, 0.45);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --gold: #facc15;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --glow: 0.07;
}

/* ---------- Tokens: light ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f4;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2ee;
  --surface-3: #e6e6e1;
  --border: rgba(10, 10, 11, 0.08);
  --border-strong: rgba(10, 10, 11, 0.16);
  --text: #0a0a0b;
  --text-2: #55555c;
  --text-3: #8b8b93;
  --accent: #c6f432;
  --accent-hover: #b8e82a;
  --on-accent: #0a0a0b;
  --accent-text: #4a7c0a;
  --accent-soft: #f0fbd0;
  --accent-line: #a8d82a;
  --good: #16a34a;
  --good-soft: #dcfce7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --gold: #eab308;
  --overlay: rgba(10, 10, 11, 0.35);
  --shadow-sm: 0 1px 2px rgba(10, 10, 11, 0.06);
  --shadow: 0 1px 2px rgba(10, 10, 11, 0.05), 0 6px 20px rgba(10, 10, 11, 0.06);
  --shadow-lg: 0 24px 60px rgba(10, 10, 11, 0.16);
  --glow: 0;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f7f7f4; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #f2f2ee; --surface-3: #e6e6e1;
    --border: rgba(10, 10, 11, 0.08); --border-strong: rgba(10, 10, 11, 0.16);
    --text: #0a0a0b; --text-2: #55555c; --text-3: #8b8b93;
    --accent-hover: #b8e82a; --accent-text: #4a7c0a; --accent-soft: #f0fbd0; --accent-line: #a8d82a;
    --good: #16a34a; --good-soft: #dcfce7; --bad: #dc2626; --bad-soft: #fee2e2; --gold: #eab308;
    --overlay: rgba(10, 10, 11, 0.35);
    --shadow-sm: 0 1px 2px rgba(10, 10, 11, 0.06);
    --shadow: 0 1px 2px rgba(10, 10, 11, 0.05), 0 6px 20px rgba(10, 10, 11, 0.06);
    --shadow-lg: 0 24px 60px rgba(10, 10, 11, 0.16);
    --glow: 0;
  }
}

:root {
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --font: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -0.005em;
  overflow-x: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background-image: radial-gradient(900px 420px at 85% -120px, rgba(198, 244, 50, var(--glow)), transparent 70%);
  background-repeat: no-repeat;
  transition: background-color 0.25s, color 0.25s;
}
body.no-scroll { overflow: hidden; }
button, input, output { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

.only-light { display: none; }
:root[data-theme="light"] .only-light { display: block; }
:root[data-theme="light"] .only-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .only-light { display: block; }
  :root:not([data-theme="dark"]) .only-dark { display: none; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 16px; max-width: 1120px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.logo-mark svg { width: 16px; height: 16px; }
.top-actions { display: flex; gap: 6px; }
.icon-btn, .chip-btn {
  height: 36px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface); transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn { width: 36px; }
.chip-btn { padding: 0 11px; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.icon-btn:hover, .chip-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }

main { max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(132px + var(--safe-b)); }
.screen { animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Typography ---------- */
.hero { font-size: clamp(38px, 10.5vw, 72px); font-weight: 800; line-height: 1; letter-spacing: -0.045em; margin: 16px 0 14px; }
.hero em { font-style: normal; color: var(--text-3); }
.title { font-size: clamp(28px, 7vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 8px; }
.lead { color: var(--text-2); font-size: 16px; margin: 0 0 24px; max-width: 46ch; }
.eyebrow { margin: 0 0 6px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.muted-label { color: var(--text-3); font-size: 12px; font-weight: 500; }
h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Surfaces ---------- */
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Inputs ---------- */
input:not([type="range"]):not([type="checkbox"]) {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); outline: none; font-size: 16px; font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--text-3); }
input:not([type="range"]):not([type="checkbox"]):focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="range"] { width: 100%; accent-color: var(--accent-text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px;
  border-radius: var(--r); font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-soft:hover { background: var(--surface-2); }
.btn-dashed { width: 100%; margin-top: 12px; border: 1px dashed var(--border-strong); color: var(--text-2); background: transparent; }
.btn-dashed:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-xl { width: 100%; height: 56px; font-size: 16px; font-weight: 700; border-radius: var(--r-lg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled { background: var(--surface-3); color: var(--text-2); box-shadow: none; opacity: 1; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 32px; color: var(--text-2); font-weight: 500; font-size: 14px; margin: 0 0 12px -4px; padding-right: 8px; border-radius: var(--r-xs); }
.back:hover { color: var(--text); }
.link { color: var(--text-2); font-size: 13px; font-weight: 500; }
.link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #0a0a0b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.avatar-lg { width: 48px; height: 48px; font-size: 19px; background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); }

/* Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.seg button { min-height: 38px; padding: 0 6px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--text-2); line-height: 1.15; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-strong); }

/* ---------- Home ---------- */
.hero-block { padding: 8px 0 12px; }
.home-grid { display: grid; gap: 12px; }
.name-row { display: flex; align-items: center; gap: 12px; }
.universes { display: grid; gap: 10px; }
.universe {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease), border-color 0.15s, box-shadow 0.15s;
}
.u-icon { width: 48px; height: 48px; flex: none; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.u-icon svg { width: 22px; height: 22px; }
.u-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.u-text b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.u-text small { color: var(--text-2); font-size: 13px; }
.u-cta { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px; }
.u-cta svg { width: 15px; height: 15px; transition: transform 0.15s var(--ease); }
.u-soon { height: 24px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 99px; border: 1px solid var(--border); color: var(--text-3); font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.universe.is-live { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.universe.is-live .u-icon { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.universe.is-live:hover { transform: translateY(-2px); }
.universe.is-live:hover .u-cta svg { transform: translateX(3px); }
.universe.is-live:active { transform: scale(0.99); }
.universe:disabled { cursor: default; box-shadow: none; background: transparent; border-style: dashed; }
.universe:disabled .u-icon { background: transparent; color: var(--text-3); }
.universe:disabled .u-text b { color: var(--text-2); }
.universe:disabled .u-text small { color: var(--text-3); }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 1px; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border); background: var(--border); }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); }
.steps b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.steps small { color: var(--text-2); font-size: 13px; }
.step-n { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }

/* ---------- Music: create / join ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.big-choice {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-xl); text-align: left;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); transition: transform 0.12s var(--ease), background 0.15s;
}
.big-choice:hover { background: var(--accent-hover); }
.big-choice:active { transform: scale(0.98); }
.bc-icon { width: 44px; height: 44px; border-radius: var(--r); background: rgba(0, 0, 0, 0.1); display: grid; place-items: center; }
.bc-text { display: flex; flex-direction: column; }
.bc-text b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.bc-text small { opacity: 0.72; font-weight: 500; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.join { display: flex; gap: 8px; }
#join-code { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.5em; text-align: center; font-weight: 600; font-size: 20px; padding-left: 0.5em !important; }

/* ---------- Lobby ---------- */
.lobby { display: grid; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.room-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.room-code { font-family: var(--mono); font-weight: 700; font-size: 30px; letter-spacing: 0.18em; line-height: 1.15; margin-top: 2px; }
.players-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.players-head h3 { display: flex; align-items: center; gap: 8px; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.player { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 14px; max-width: 100%; }
.player .avatar { width: 30px; height: 30px; font-size: 12px; }
.player .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .tag { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-text); }
.player.me { cursor: pointer; border-color: var(--border-strong); background: var(--bg-elev); }
.player.me:hover { border-color: var(--accent-line); }
.player.me svg { width: 13px; height: 13px; color: var(--text-3); }

.setting { padding: 14px 0; border-top: 1px solid var(--border); }
.card-title + .setting { border-top: 0; padding-top: 12px; }
.setting-label { display: flex; flex-direction: column; margin-bottom: 10px; }
.setting-label b { font-size: 14px; font-weight: 600; }
.setting-label small { color: var(--text-3); font-size: 13px; }
.row-setting { display: flex; align-items: center; justify-content: space-between; }
.row-setting .setting-label { margin: 0; }
.stepper { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.stepper button { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); }
.stepper button:hover:not(:disabled) { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper svg { width: 16px; height: 16px; }
.stepper output { min-width: 44px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 17px; }

.empty { text-align: center; padding: 22px 12px 8px; }
.empty-art { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); border: 1px solid var(--border); }
.empty b { display: block; font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto; color: var(--text-2); font-size: 14px; max-width: 34ch; }
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sources:empty { display: none; }
.source { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.source:first-child { border-top: 0; padding-top: 0; }
.thumb { width: 46px; height: 46px; border-radius: var(--r-sm); flex: none; object-fit: cover; display: grid; place-items: center; font-size: 22px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.thumb svg { width: 20px; height: 20px; color: var(--text-3); }
.thumb.round { border-radius: 50%; }
.src-text { flex: 1; min-width: 0; }
.src-text b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-meta { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.src-meta svg { width: 13px; height: 13px; }
.remove { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-3); }
.remove:hover { background: var(--surface-2); color: var(--text); }
.remove svg { width: 15px; height: 15px; }
.guest .host-only, .guest .remove { display: none !important; }
.guest .seg, .guest .stepper { pointer-events: none; }
.guest .stepper button { visibility: hidden; }

/* Sticky action bar (mobile) */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dock > * { width: 100%; max-width: 480px; }
.waiting { color: var(--text-2); text-align: center; margin: 0; font-size: 14px; }

/* ---------- Sheets ---------- */
.sheet { --pad: 18px; position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); animation: fade 0.2s ease; }
.sheet-panel {
  position: relative; width: 100%; height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 22px 22px 0 0; border: 1px solid var(--border); border-bottom: 0;
  box-shadow: var(--shadow-lg); animation: up 0.3s var(--ease);
}
.sheet-panel::before { content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--border-strong); }
.sheet-small { height: auto; max-height: 92dvh; }
@keyframes up { from { transform: translateY(32px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 24px var(--pad) 10px; }
.sheet-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 10px var(--pad) 24px; overscroll-behavior: contain; }
.sheet-foot { padding: 14px var(--pad) calc(14px + var(--safe-b)); border-top: 1px solid var(--border); }
.foot-count { font-weight: 500; opacity: 0.7; margin-left: 2px; }

.searchbar { position: relative; margin: 6px var(--pad) 8px; }
.searchbar > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.searchbar input { padding-left: 42px !important; padding-right: 42px !important; }
.clear-search { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-3); }
.clear-search:hover { color: var(--text); }
.clear-search svg { width: 15px; height: 15px; }

.p-section { margin-top: 28px; }
.p-section:first-child { margin-top: 10px; }
.p-section h4 { margin: 0 0 12px; font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.hscroll {
  display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 8px;
  scroll-padding-inline: var(--pad); scrollbar-width: none;
}
.hscroll::after { content: ''; flex: none; width: 1px; } /* keeps the right padding when scrolled */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 10px; }
.hscroll::-webkit-scrollbar { display: none; }

/* Category card: playlist artwork + name underneath */
.tile {
  position: relative; min-width: 0; padding: 0; background: none; border: 0; color: var(--text);
  display: flex; flex-direction: column; gap: 7px; text-align: left; cursor: pointer;
  transition: transform 0.12s var(--ease);
}
.tile-art {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r);
  overflow: hidden; background: var(--surface-2); color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow 0.15s;
}
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-art > svg { width: 28px; height: 28px; }
.tile-name { font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile:hover .tile-art { box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-sm); }
.tile:active { transform: scale(0.97); }
.tile .tick { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); }
.tile .tick svg { width: 14px; height: 14px; }
.tile.on .tile-art { box-shadow: 0 0 0 3px var(--accent); }
.tile.on .tile-art img { opacity: 0.85; }
.tile.on .tick { display: grid; }
.tile.busy { opacity: 0.55; }

.artist-card { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.artist-card .pic { position: relative; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.artist-card img { width: 100%; height: 100%; object-fit: cover; }
.artist-card b { font-size: 13px; font-weight: 600; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.artist-card small { color: var(--text-3); font-size: 11px; }
.artist-card.on .pic { box-shadow: 0 0 0 3px var(--accent); }
.overlay { position: absolute; inset: 0; display: none; place-items: center; background: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--on-accent); }
.overlay svg { width: 26px; height: 26px; }
.on .overlay { display: grid; }
.busy .overlay { display: grid; background: var(--overlay); }
.busy .overlay svg { display: none; }
.busy .overlay::after { content: ''; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: var(--r); text-align: left; transition: background 0.12s; }
.list-item:hover { background: var(--surface-2); }
.li-text { flex: 1; min-width: 0; }
.list-item b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--text-3); font-size: 12px; }
.add-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--text-2); flex: none; }
.add-dot svg { width: 14px; height: 14px; }
.on .add-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.busy .add-dot { border: 2px solid var(--border-strong); border-top-color: var(--accent-text); animation: spin 0.8s linear infinite; }
.busy .add-dot svg { display: none; }
.official { color: var(--accent-text) !important; font-weight: 600; }

.import-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.ic-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.import-logos { display: flex; gap: 4px; }
.import-logos svg { width: 22px; height: 22px; }
.import-card p { margin: 0; color: var(--text-2); font-size: 13px; }
.no-results { color: var(--text-2); text-align: center; padding: 28px 8px; }

/* Settings sheet */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span, .switch-row > span { font-weight: 600; font-size: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background 0.2s; flex: none; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Game ---------- */
.game-main { display: flex; flex-direction: column; }
.game-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.round small { color: var(--text-3); font-size: 13px; }
.round b { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.game-tools { display: flex; align-items: center; gap: 10px; }
.stop-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stop-btn svg { width: 13px; height: 13px; }
.stop-btn:hover { color: var(--bad); border-color: var(--bad); }
.stop-btn.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.timer-num { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.timer-num.low { color: var(--bad); }
.timer { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
#timer-bar { height: 100%; width: 100%; border-radius: 99px; background: var(--accent); transform-origin: left; }
.timer.low #timer-bar { background: var(--bad); }

.strip { list-style: none; margin: 12px -16px 0; padding: 0 16px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip li { flex: none; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px 0 3px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: 13px; font-weight: 600; transition: border-color 0.2s, background 0.2s; }
.strip .avatar { width: 28px; height: 28px; font-size: 12px; font-family: var(--font); }
.gain { color: var(--good); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.answered { border-color: var(--accent-line) !important; }
.right { border-color: var(--good) !important; background: var(--good-soft) !important; }
.wrong { border-color: var(--bad) !important; background: var(--bad-soft) !important; }

.stage { position: relative; height: 210px; display: grid; place-items: center; margin: 16px 0 6px; }
.countdown { font-family: var(--mono); font-weight: 700; font-size: 104px; line-height: 1; color: var(--text); animation: beat 1s ease infinite; }
@keyframes beat { 0% { transform: scale(1.35); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.9); opacity: 0.35; } }

.vinyl {
  width: 172px; height: 172px; border-radius: 50%; position: relative;
  background: repeating-radial-gradient(circle, #111 0 1.5px, #1d1d20 2px 3.5px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), var(--shadow-lg);
}
.vinyl::before { content: ''; position: absolute; inset: 31%; border-radius: 50%; background: var(--accent); }
.vinyl::after { content: ''; position: absolute; inset: 47.5%; border-radius: 50%; background: #0a0a0b; }
.vinyl.spin { animation: spin 1.8s linear infinite; }
.vinyl.spin { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 0 10px var(--accent-soft), var(--shadow-lg); }
@keyframes spin { to { transform: rotate(360deg); } }

.reveal { display: flex; align-items: center; gap: 16px; width: 100%; animation: fade 0.35s ease; }
.reveal img { width: 116px; height: 116px; border-radius: var(--r-lg); object-fit: cover; flex: none; box-shadow: var(--shadow-lg); }
.reveal-text { min-width: 0; }
.reveal-title { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; line-height: 1.12; overflow-wrap: anywhere; }
.reveal-artist { color: var(--text-2); font-weight: 500; margin-top: 4px; }
.reveal-first { display: inline-flex; margin-top: 10px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }

.question { text-align: center; color: var(--text-2); font-weight: 500; margin: 6px 0 12px; min-height: 22px; }
.answers { display: grid; gap: 8px; }
.answer {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm);
  text-align: left; transition: transform 0.1s var(--ease), background 0.15s, border-color 0.15s, opacity 0.2s;
}
.answer .k { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; }
.answer .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.answer .t b { font-size: 15px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.answer .t small { color: var(--text-2); font-size: 13px; }
.answer:hover:not(:disabled) { border-color: var(--text-3); background: var(--bg-elev); }
.answer:active:not(:disabled) { transform: scale(0.985); }
.answer:disabled { cursor: default; }
.answer.picked { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.answer.picked .k { background: var(--text); color: var(--bg); border-color: var(--text); }
.answer.correct { border-color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 1px var(--good); }
.answer.correct .k { background: var(--good); color: #fff; border-color: var(--good); }
.answer.wrong-pick { border-color: var(--bad); background: var(--bad-soft); }
.answer.wrong-pick .k { background: var(--bad); color: #fff; border-color: var(--bad); }
.answer.dim { opacity: 0.45; }
.answer .who { display: flex; }
.answer .who .avatar { width: 24px; height: 24px; font-size: 10px; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.answers.placeholder .answer { background: transparent; border-style: dashed; box-shadow: none; }

.feedback { min-height: 30px; text-align: center; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; margin-top: 14px; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }

.scoreboard { display: none; }
#scoreboard, .ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); border: 1px solid transparent; }
.row:nth-child(odd) { background: var(--surface-2); }
.row .pos { width: 18px; text-align: center; color: var(--text-3); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.row .avatar { width: 28px; height: 28px; font-size: 12px; }
.row .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sc { font-family: var(--mono); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- End ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin: 32px 0 20px; }
.pcol { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 31%; max-width: 148px; }
.pcol .avatar { width: 52px; height: 52px; font-size: 20px; }
.pcol.p1 .avatar { width: 68px; height: 68px; font-size: 26px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.pname { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pscore { color: var(--text-2); font-family: var(--mono); font-size: 12px; }
.pblock { width: 100%; border-radius: var(--r) var(--r) 6px 6px; display: grid; place-items: start center; padding-top: 10px; font-family: var(--mono); font-weight: 700; font-size: 24px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.p1 .pblock { height: 136px; background: var(--accent); color: var(--on-accent); border-color: transparent; }
.p2 .pblock { height: 98px; }
.p3 .pblock { height: 70px; }
.ranking { max-width: 480px; margin: 0 auto; }

/* ---------- Stats ---------- */
.stats { max-width: 880px; margin: 32px auto 0; display: flex; flex-direction: column; gap: 28px; }
.stats-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hl { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.hl-icon { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.hl-label { color: var(--text-3); font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.hl-value { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.hl-value.muted { color: var(--text-3); }
.hl-who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.hl-who .avatar { width: 20px; height: 20px; font-size: 10px; }
.hl-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-sub { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.player-stats { display: grid; gap: 8px; }
.ps { padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.ps.me { border-color: var(--accent-line); }
.ps-head { display: flex; align-items: center; gap: 10px; }
.ps-head .pos { width: 18px; color: var(--text-3); font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: center; }
.ps-head .avatar { width: 30px; height: 30px; font-size: 12px; }
.ps-head b { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-head .sc { font-family: var(--mono); font-weight: 700; }
.ps-bar { height: 4px; border-radius: 99px; background: var(--surface-3); margin: 12px 0; overflow: hidden; }
.ps-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.ps-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0; }
.ps-grid div { min-width: 0; }
.ps-grid dt { color: var(--text-3); font-size: 10.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-grid dd { margin: 2px 0 0; font-family: var(--mono); font-size: 14px; font-weight: 600; }

.song-recap { list-style: none; margin: 0; padding: 0; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.song { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
.song:first-child { border-top: 0; }
.song-n { width: 18px; color: var(--text-3); font-family: var(--mono); font-size: 12px; text-align: center; flex: none; }
.song img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.song-text { flex: 1; min-width: 0; }
.song-text b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-text small { color: var(--text-2); font-size: 12px; }
.song-res { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.song-res small { color: var(--text-3); font-size: 11px; }
.song-first { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.song-first .avatar { width: 20px; height: 20px; font-size: 10px; }
.song-miss { color: var(--bad) !important; }

@media (min-width: 640px) {
  .highlights { grid-template-columns: repeat(4, 1fr); }
  .player-stats { grid-template-columns: 1fr 1fr; }
}


/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 400px; pointer-events: none; }
.toast { padding: 12px 14px; border-radius: var(--r); background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: drop 0.3s var(--ease); }
.toast.error { background: var(--bad); color: #fff; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* =========================================================
   Tablet and up
   ========================================================= */
@media (min-width: 640px) {
  main { padding: 28px 24px 140px; }
  .topbar-inner { padding: 0 24px; height: 64px; }
  .universes { grid-template-columns: 1fr 1fr; }
  .universes > .universe:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 120px; }
  .universe { flex-direction: column; align-items: flex-start; min-height: 172px; padding: 18px; }
  .u-icon { margin-bottom: auto; }
  .u-cta, .u-soon { position: absolute; top: 18px; right: 18px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .answers { grid-template-columns: 1fr 1fr; }
  .answers.n3 .answer:last-child { grid-column: 1 / -1; }
  .answer { min-height: 76px; padding: 12px 14px; }
  .stage { height: 250px; }
  .vinyl { width: 210px; height: 210px; }
  .reveal { justify-content: center; }
  .reveal img { width: 176px; height: 176px; }
  .reveal-title { font-size: 30px; }
  .sheet { --pad: 28px; align-items: center; padding: 24px; }
  .sheet-panel { max-width: 640px; height: min(760px, 88dvh); border-radius: 22px; border-bottom: 1px solid var(--border); }
  .sheet-panel::before { display: none; }
  .sheet-head { padding-top: 24px; }
  .sheet-small { height: auto; max-width: 440px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 12px; }
}

@media (min-width: 1000px) {
  .hero-block { padding: 24px 0 20px; }
  .home-grid { grid-template-columns: 320px 1fr; align-items: start; }
  .lobby { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .game { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
  .strip { display: none; }
  .scoreboard { display: block; align-self: start; position: sticky; top: 88px; }
  .scoreboard .card-title { margin-bottom: 12px; }
  .dock { position: static; background: none; backdrop-filter: none; border: 0; padding: 20px 0 0; }
  main { padding-bottom: 64px; }
}

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

/* ---------- Offline players ---------- */
.player.offline, .strip li.offline, .row.offline { opacity: 0.45; }
.player.offline .avatar, .strip li.offline .avatar, .row.offline .avatar { filter: grayscale(1); }

/* ---------- Reconnecting banner ---------- */
.reconnect { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); white-space: nowrap; }
.reconnect .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }

/* ---------- Live reactions ---------- */
.react-bar { display: flex; justify-content: center; gap: 4px; margin: 14px auto 0; flex-wrap: wrap; }
.react-bar button { width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; transition: transform 0.12s var(--ease), background 0.15s; -webkit-tap-highlight-color: transparent; }
.react-bar button:hover { background: var(--surface-2); }
.react-bar button:active { transform: scale(0.86); }
#screen-end .react-bar { margin: 20px auto 0; }
.reactions-layer { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; bottom: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: rise 2.6s var(--ease) forwards; }
.bubble .e { font-size: 34px; line-height: 1; filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.25)); }
.bubble .n { padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #111; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes rise {
  0% { transform: translate(0, 20px) scale(0.4); opacity: 0; }
  12% { transform: translate(0, 0) scale(1.1); opacity: 1; }
  25% { transform: translate(var(--sway), -40px) scale(1); }
  100% { transform: translate(calc(var(--sway) * -1), -280px) scale(0.9); opacity: 0; }
}
@media (min-width: 1000px) { .bubble { bottom: 60px; } }
@media (prefers-reduced-motion: reduce) { .bubble { animation-duration: 1.6s; } }

/* ---------- Game modes (lobby) ---------- */
.setting-first { border-top: 0; padding-top: 4px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modes button { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); text-align: left; color: var(--text); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.modes button svg { width: 20px; height: 20px; color: var(--text-3); }
.modes button b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.modes button small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; line-height: 1.3; }
.modes button:hover { border-color: var(--border-strong); }
.modes button.active { background: var(--bg-elev); border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.modes button.active svg { color: var(--accent-text); }
.guest .modes { pointer-events: none; }
.guest .modes button:not(.active) { opacity: 0.5; }
.modes button:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Seconds mode (game) ---------- */
#screen-game:not([data-mode="classic"]) .answers,
#screen-game:not([data-mode="seconds"]) .seconds,
#screen-game:not([data-mode="year"]) .year,
#screen-game:not([data-mode="mashup"]) .mash,
#screen-game[data-mode="classic"] .typed, #screen-game[data-mode="year"] .typed,
#screen-game[data-mode="seconds"] .typed-giveup { display: none; }
#screen-game[data-mode="seconds"] .stage, #screen-game[data-mode="mashup"] .stage { height: 150px; margin: 10px 0 4px; }
#screen-game[data-mode="seconds"] .vinyl, #screen-game[data-mode="mashup"] .vinyl { width: 132px; height: 132px; }
#screen-game[data-mode="seconds"] .reveal img, #screen-game[data-mode="mashup"] .reveal img { width: 96px; height: 96px; }
#screen-game[data-mode="seconds"] .countdown, #screen-game[data-mode="mashup"] .countdown { font-size: 88px; }
.seconds { display: flex; flex-direction: column; gap: 12px; }
.clips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.clips li { height: 30px; display: grid; place-items: center; border-radius: 9px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.clips li.open { color: var(--text); background: var(--bg-elev); border-color: var(--border-strong); }
.clips li.current { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.clips li.missed { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: transparent; text-decoration: line-through; }
.clips li.found { color: #fff; background: var(--good); border-color: transparent; }
.clip-bar { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: -4px; }
.clip-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.sec-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sec-actions .btn { min-height: 48px; }
.sec-play svg { width: 18px; height: 18px; }
#sec-skip { min-width: 92px; font-family: var(--mono); }
.sec-search { position: relative; }
.sec-field { margin: 0; }
.sec-field input { width: 100%; min-height: 50px; font-size: 16px; }
.suggest { list-style: none; margin: 6px 0 0; padding: 4px; max-height: min(320px, 42vh); overflow-y: auto; border-radius: var(--r); background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); position: absolute; left: 0; right: 0; top: 100%; z-index: 30; }
.suggest li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.suggest li.active, .suggest li:hover { background: var(--surface-2); }
.suggest img, .suggest .ph { width: 36px; height: 36px; border-radius: 7px; flex: none; object-fit: cover; background: var(--surface-2); }
.suggest .tx { min-width: 0; }
.suggest b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .empty { color: var(--text-3); font-size: 13px; justify-content: center; cursor: default; }
.suggest .empty:hover { background: none; }
.sec-guesses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sec-guesses li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--text-2); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.sec-guesses li svg { width: 14px; height: 14px; color: var(--bad); flex: none; }
.sec-guesses li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typed.done .sec-search, .typed.done .typed-giveup, .seconds.done #sec-skip { display: none; }
.seconds.done .sec-actions { grid-template-columns: 1fr; }
.strip .lvl { font-size: 11px; color: var(--text-3); }
.strip li.right .lvl { color: var(--good); }
.seconds.locked .sec-actions, .seconds.locked .sec-search { pointer-events: none; opacity: 0.5; }
.seconds.over .sec-actions { display: none; }
@media (max-width: 400px) { .react-bar { gap: 3px; } .react-bar button { width: 36px; height: 36px; font-size: 18px; } }

/* ---------- Invite card (Music screen) ---------- */
.play-main { width: 100%; gap: 10px; }
.play-main svg { width: 20px; height: 20px; }
.join .btn { min-width: 96px; }
.link-btn { align-self: center; padding: 6px 10px; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.invite { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.invite-code { flex: none; padding: 8px 10px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: 0.12em; }
.invite b { display: block; font-size: 15px; }
.invite small { color: var(--text-2); font-size: 13px; }

.invite-block { margin-top: 4px; }

/* ---------- Typed answers (seconds / mashup / cover) ---------- */
.typed { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.typed.locked-input .sec-field { opacity: 0.55; }
.typed-giveup { margin-top: -2px; }

/* ---------- Year ---------- */
.year { display: flex; flex-direction: column; gap: 10px; }
.year-value { align-self: center; font-family: var(--mono); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: -0.04em; color: var(--text); }
.year-row { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; }
.year-step { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.year-step svg { width: 20px; height: 20px; }
.year-step:active { transform: scale(0.96); }
#year-range { width: 100%; height: 36px; accent-color: var(--accent); cursor: pointer; }
.year-scale { display: flex; justify-content: space-between; margin: -6px 58px 0; color: var(--text-3); font-family: var(--mono); font-size: 11px; }
.year-lock { width: 100%; }
.year.locked .year-row, .year.locked .year-scale { opacity: 0.45; pointer-events: none; }
.year.locked .year-value { color: var(--accent-text); }
.year.over .year-row, .year.over .year-scale, .year.over .year-lock { display: none; }
.year-results { list-style: none; margin: 0; padding: 0; display: none; flex-direction: column; gap: 6px; }
.year.over .year-results { display: flex; }
.year-results li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.year-results .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.year-results .yg { font-family: var(--mono); font-weight: 700; }
.year-results .yd { color: var(--text-3); font-size: 12px; min-width: 74px; text-align: right; }
.year-results li.good .yd { color: var(--good); }
.year-results .pts { font-family: var(--mono); font-size: 12px; color: var(--accent-text); min-width: 54px; text-align: right; }

/* ---------- Mashup ---------- */
.mash { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mash-slot { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border-radius: var(--r); border: 1px dashed var(--border-strong); background: var(--surface-2); }
.mash-slot .q { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--text-3); font-weight: 800; font-size: 18px; }
.mash-slot img { width: 40px; height: 40px; flex: none; border-radius: 9px; object-fit: cover; }
.mash-slot .tx { min-width: 0; }
.mash-slot b { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mash-slot small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mash-slot.found { border-style: solid; border-color: transparent; background: color-mix(in srgb, var(--good) 14%, transparent); }
.mash-slot.revealed { border-style: solid; }

/* ---------- Blurry cover ---------- */
#screen-game[data-mode="cover"] .stage { height: 236px; }
.blur-box { position: relative; width: 220px; height: 220px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-lg); }
.blur-box img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); filter: blur(var(--blur, 36px)) saturate(1.1); user-select: none; -webkit-user-drag: none; pointer-events: none; }
.hint-chip { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }
.hint-chip.on { background: var(--accent); color: var(--on-accent); }
@media (min-width: 640px) { #screen-game[data-mode="cover"] .stage { height: 276px; } .blur-box { width: 260px; height: 260px; } }

/* ---------- Chat ---------- */
.chat-btn { position: relative; }
.chat-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--bg); }
.chat-panel { height: min(78dvh, 640px); max-width: 560px; }
@media (min-width: 640px) { #chat { align-items: center; } .chat-panel { border-radius: 22px; border-bottom: 1px solid var(--border); } }
.chat-body { display: flex; flex-direction: column; padding-top: 4px; }
.chat-list { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chat-list .empty { align-self: center; color: var(--text-3); font-size: 14px; padding: 24px 0; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg .avatar { width: 28px; height: 28px; font-size: 12px; flex: none; }
.msg .bub { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.msg .who { display: block; font-size: 12px; font-weight: 700; margin-bottom: 1px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .avatar { display: none; }
.msg.me .bub { background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.msg.me .who { display: none; }
.msg.cont .avatar { visibility: hidden; }
.msg.cont .who { display: none; }
.chat-form { display: grid; grid-template-columns: 1fr 48px; gap: 8px; }
.chat-form .input { min-height: 48px; font-size: 16px; }
.chat-send { min-height: 48px; padding: 0; }
.chat-send svg { width: 20px; height: 20px; }
.chat-peek { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 35; display: flex; align-items: center; gap: 8px; max-width: min(92vw, 420px); padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 14px; color: var(--text); animation: up 0.25s var(--ease); }
.chat-peek .avatar { width: 26px; height: 26px; font-size: 11px; flex: none; }
.chat-peek span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-peek b { font-weight: 700; }
body[data-screen="lobby"] .chat-peek { bottom: calc(100px + var(--safe-b)); }

/* ---------- Languages ---------- */
.lang-wrap { position: relative; }
.lang-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50; min-width: 180px; padding: 6px; border-radius: var(--r); background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px; animation: fade 0.15s ease; }
.lang-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text); text-align: start; }
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button.active { background: var(--accent-soft); color: var(--accent-text); }
.lang-menu small { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
#set-lang { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

/* Arabic: right to left */
[dir="rtl"] body, [dir="rtl"] .hero, [dir="rtl"] .title { letter-spacing: 0; }
[dir="rtl"] .back svg, [dir="rtl"] .u-cta svg, [dir="rtl"] .play-main svg, [dir="rtl"] .chat-send svg { transform: scaleX(-1); }
[dir="rtl"] .year-row, [dir="rtl"] .year-scale, [dir="rtl"] #year-range, [dir="rtl"] .room-code, [dir="rtl"] .clips, [dir="rtl"] .clip-bar { direction: ltr; }

/* ---------- Movies ---------- */
.force-hidden { display: none !important; }
.filter-hint { margin: -4px 0 12px; }
.filter-group { margin-top: 14px; }
.filter-group h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip svg { width: 14px; height: 14px; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.guest .chips { pointer-events: none; }
.guest .chip:not(.on) { opacity: 0.5; }
.credit { margin: 16px 0 0; font-size: 11px; line-height: 1.4; color: var(--text-3); }
.blur-box.poster { width: 150px; height: 225px; }
.blur-box.wide { width: 100%; max-width: 440px; height: auto; aspect-ratio: 16 / 9; }
.blur-box.wide img, .blur-box.poster img { transform: none; }
.blur-box.poster img { transform: scale(1.12); }
#screen-game[data-uni="movies"] .stage , #screen-game[data-uni="series"] .stage , #screen-game[data-uni="games"] .stage { height: 236px; }
#screen-game[data-uni="movies"][data-kind="year"] .stage , #screen-game[data-uni="series"][data-kind="year"] .stage , #screen-game[data-uni="games"][data-kind="year"] .stage { height: 200px; }
#screen-game[data-uni="movies"][data-kind="year"] .blur-box.poster , #screen-game[data-uni="series"][data-kind="year"] .blur-box.poster , #screen-game[data-uni="games"][data-kind="year"] .blur-box.poster { width: 133px; height: 200px; }
#screen-game[data-uni="movies"] .reveal img , #screen-game[data-uni="series"] .reveal img , #screen-game[data-uni="games"] .reveal img { width: 96px; height: 144px; }
@media (min-width: 640px) {
  #screen-game[data-uni="movies"] .stage , #screen-game[data-uni="series"] .stage , #screen-game[data-uni="games"] .stage { height: 260px; }
  .blur-box.poster { width: 173px; height: 260px; }
  #screen-game[data-uni="movies"] .reveal img , #screen-game[data-uni="series"] .reveal img , #screen-game[data-uni="games"] .reveal img { width: 150px; height: 225px; }
}
/* film types: poster tiles in horizontal rows */
.film-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -18px; padding: 4px 18px 6px; scroll-padding: 0 18px; scrollbar-width: none; }
.film-row::-webkit-scrollbar { display: none; }
.film-tile { flex: none; width: 92px; scroll-snap-align: start; }
.film-tile .tile-art { aspect-ratio: 2 / 3; height: auto; }
.film-tile .tile-name { font-size: 12px; }
.guest .film-row .tile:not(.on) { opacity: 0.5; }
.guest .film-row .tile { pointer-events: none; }
@media (min-width: 640px) { .film-tile { width: 104px; } }

/* ---------- Film scenes (video) ---------- */
/* The YouTube player is taller than the box: its title bar (top) and "more videos" bar (bottom) stay out of sight,
   and a shield on top catches taps so nobody can open the video page and read its title. */
.scene-box { position: relative; width: 100%; max-width: 440px; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.scene-frame { position: absolute; left: 0; right: 0; top: -70px; bottom: -70px; }
.scene-frame iframe, .scene-frame > div { width: 100%; height: 100%; border: 0; display: block; }
.scene-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-shield { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: #fff; font-weight: 600; font-size: 14px; background: #000; transition: background 0.15s; cursor: pointer; }
.scene-shield span:empty { display: none; }
.scene-shield span { background: rgba(0, 0, 0, 0.6); padding: 6px 12px; border-radius: 999px; }
.scene-box.live .scene-shield, .scene-box.seen .scene-shield { background: transparent; }
.scene-box.tap .scene-shield { pointer-events: none; background: rgba(0, 0, 0, 0.35); }
.scene-box.still .scene-shield { background: transparent; align-items: end; }
#screen-game[data-kind="scene"] .stage { height: auto; min-height: 200px; }

/* Actors: round photos in the same scrolling rows as the film types */
.actor-search { margin: 2px 0 8px; }
.actor-search .searchbar { margin: 0; }
.actor-tile .tile-art { aspect-ratio: 2 / 3; height: auto; }
.actor-tile .tile-art img { object-position: center 20%; }

/* Row arrows (mouse only) */
.row-wrap { position: relative; }
.row-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .row-nav { position: absolute; top: calc(4px + (92px * 1.5) / 2); transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
  .row-nav svg { width: 18px; height: 18px; }
  .row-nav.prev { inset-inline-start: -6px; }
  .row-nav.next { inset-inline-end: -6px; }
  .row-nav.next svg, [dir="rtl"] .row-nav.prev svg { transform: scaleX(-1); }
  [dir="rtl"] .row-nav.next svg { transform: none; }
  .row-wrap.can-prev .row-nav.prev, .row-wrap.can-next .row-nav.next { opacity: 0.92; pointer-events: auto; }
  .row-nav:hover { opacity: 1 !important; transform: translateY(-50%) scale(1.08); }
  .film-row { cursor: grab; }
  .film-row.dragging { cursor: grabbing; scroll-snap-type: none; }
  .film-row.dragging .tile { pointer-events: none; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 640px) {
  .row-nav { top: calc(4px + (104px * 1.5) / 2); }
}

/* Casting: the actors, one card each */
#screen-game[data-kind="casting"] .stage, #screen-game[data-kind="character"] .stage { height: auto; min-height: 150px; }
#screen-game[data-kind="casting"] .sec-play, #screen-game[data-kind="casting"] .clip-bar, #screen-game[data-kind="character"] .sec-play, #screen-game[data-kind="character"] .clip-bar { display: none; }
#screen-game[data-kind="casting"] .sec-actions, #screen-game[data-kind="character"] .sec-actions { justify-content: center; }
.cast { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: start; }
.cast li { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.cast img, .cast .ph { width: 100%; max-width: 92px; aspect-ratio: 2 / 3; border-radius: var(--r); object-fit: cover; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.cast .ph { display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--text-3); border: 1px dashed var(--border-strong); box-shadow: none; }
.cast li.on .ph { border-style: solid; color: var(--text-2); }
.cast .nm { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.cast li.new { animation: cast-in 0.45s var(--ease) both; }
@keyframes cast-in { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: none; } }
@media (min-width: 640px) { .cast { gap: 12px; } .cast .nm { font-size: 13px; } }

/* Higher or lower: two posters face to face */
#screen-game[data-kind="versus"] .reveal { display: none !important; }
#screen-game[data-kind="versus"] .stage { height: 96px; margin: 4px 0 0; }
#screen-game[data-kind="versus"] .stage:not(:has(.countdown:not(.hidden))) { height: 0; margin: 0; }
.answers.vs { position: relative; grid-template-columns: 1fr 1fr; gap: 12px; }
.answers.vs .answer { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; text-align: center; }
.answers.vs .answer .k { display: none; }
.answers.vs .answer .t { align-items: center; gap: 4px; }
.answers.vs .vs-poster { width: 100%; aspect-ratio: 2 / 3; max-height: 42vh; object-fit: cover; border-radius: var(--r); background: var(--surface-2); }
.answers.vs .answer .t b { font-size: 14px; }
.answers.vs .val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; min-height: 0; }
.answers.vs .val:empty { display: none; }
.answers.vs .answer.correct .val { color: var(--good); }
.answers.vs .answer .who { position: absolute; top: 14px; inset-inline-end: 14px; }
.answers.vs.placeholder .answer { min-height: 260px; }
.answers.vs::after { content: 'VS'; position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: 15px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); pointer-events: none; }
#screen-game[data-kind="casting"] .stage, #screen-game[data-kind="character"] .stage { gap: 16px; }
#screen-game[data-kind="casting"] .reveal img, #screen-game[data-kind="character"] .reveal img { width: 80px; height: 120px; }

/* Suggestions: guests can tap any choice to suggest it to the host */
.guest-only { display: none; }
.guest .guest-only { display: revert; }
.guest .modes, .guest .chips, .guest .film-row .tile { pointer-events: auto; }
.guest .modes button:not(.active), .guest .chip:not(.on), .guest .film-row .tile:not(.on) { opacity: 0.72; }
.guest .modes button:not(.active):hover, .guest .chip:not(.on):hover, .guest .film-row .tile:not(.on):hover { opacity: 1; }
.sugg { position: relative; opacity: 1 !important; }
.tile.sugg .tile-art, .artist-card.sugg .pic { outline: 2px dashed var(--accent); outline-offset: 2px; }
.chip.sugg, .modes button.sugg, .list-item.sugg { outline: 2px dashed var(--accent); outline-offset: 1px; }
.tile.sugg .tile-art::after, .modes button.sugg::after, .artist-card.sugg .pic::after {
  content: var(--sugg-label, '…'); position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; padding: 2px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700; background: var(--accent); color: var(--accent-ink, #111); box-shadow: var(--shadow-sm); white-space: nowrap; }
.modes button.sugg::after { top: -8px; inset-inline-start: auto; inset-inline-end: 8px; }
.sugg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sugg-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); animation: fade 0.3s ease; }
.sugg-item .thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--surface); }
.sugg-item .thumb.round { border-radius: 50%; }
.sugg-item .thumb svg { width: 20px; height: 20px; }
.sugg-item .src-text { flex: 1; min-width: 0; }
.sugg-item .src-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sugg-item .src-meta .avatar { width: 18px; height: 18px; font-size: 9px; }
.sg-btn { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.sg-btn svg { width: 18px; height: 18px; }
.sg-btn.yes { background: var(--good); border-color: var(--good); color: #fff; }
.sg-btn:hover { transform: scale(1.06); }
.sg-btn:disabled { opacity: 0.5; }

/* Video games: the cover in big pixels, drawn over the picture */
.blur-box .pix { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#screen-game[data-uni="games"] .blur-box img { filter: none; }
#screen-game[data-uni="games"][data-kind="hero"] .blur-box img { filter: blur(var(--blur, 36px)); object-fit: cover; }
#screen-game[data-kind="zoom"] .blur-box img { transform-origin: 50% 50%; will-change: transform; }

/* Streak: a flame from 5 right answers in a row */
.streak { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: 6px; padding: 0 6px 0 4px; height: 20px; border-radius: 99px;
  background: rgba(255, 122, 26, 0.14); color: #ff7a1a; font-family: var(--mono); font-size: 12px; font-weight: 700; vertical-align: middle; animation: streak-pop 0.4s ease-out; }
.streak svg { width: 13px; height: 13px; }
.strip .streak { margin-inline-start: 0; }
@keyframes streak-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Pause */
.pause-btn { padding: 0 10px; }
.pause-btn:hover { color: var(--text); border-color: var(--text-2); }
.pause-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pause-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 28px 20px 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.pause-card b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.pause-card small { color: var(--text-2); font-size: 14px; }
.pause-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent); color: #0a0a0b; animation: pause-pulse 1.6s ease-in-out infinite; }
.pause-icon svg { width: 28px; height: 28px; }
.pause-card .btn { width: 100%; margin-top: 8px; }
@keyframes pause-pulse { 50% { transform: scale(0.93); } }

/* Background music on/off */
.amb-btn { position: relative; padding: 0; width: 30px; justify-content: center; }
.amb-btn:hover { color: var(--text); border-color: var(--text-2); }
.amb-btn:not(.off) { color: var(--accent-text); border-color: var(--accent-line, var(--accent)); }
.amb-btn.off { opacity: 0.6; }
.amb-btn.off::after { content: ''; position: absolute; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }

/* Links to the legal page, under the home screen */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 28px 0 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.legal-links a { color: var(--text-3); font-size: 13px; text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.made-by { text-align: center; color: var(--text-3); font-size: 12px; margin: 0 0 8px; }
.made-by b { color: var(--text-2, var(--text)); font-weight: 600; }
.made-by .made-name { color: var(--text); font-weight: 600; text-decoration: none; }
.made-by .made-name:hover, .made-links a:hover { text-decoration: underline; }
.made-links { display: flex; justify-content: center; gap: 14px; margin: 0 0 12px; font-size: 12px; }
.made-links a { color: var(--text-3); text-decoration: none; }

/* Android app download (home footer; hidden in the app itself and on iPhone/iPad) */
.app-dl { display: flex; align-items: center; gap: 14px; margin: 28px 0 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.app-dl.hidden { display: none; }
.app-dl:hover { border-color: var(--accent-line); }
.app-dl:active { transform: scale(.99); }
.app-dl-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.app-dl-ic svg { width: 24px; height: 24px; }
.app-dl-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-dl-t b { font-size: 15px; font-weight: 700; }
.app-dl-t small { font-size: 13px; color: var(--text-3); }
.app-dl-go { flex: none; color: var(--text-3); }
.app-dl-go svg { width: 18px; height: 18px; }

/* Discord Activity: the room is the voice channel's, so no join-by-code */
.is-discord #music-actions .divider, .is-discord #music-actions .join { display: none; }

/* ---------- Short screens: Discord window, phones, landscape ---------- */
/* The picture shrinks with the screen height so the answers stay on screen without scrolling.
   --cap is the usual picture height, --room the space the rest of the game screen needs. */
#screen-game { --cap: 210px; --room: 530px; --stage: clamp(130px, calc(100dvh - var(--room)), var(--cap)); }
#screen-game[data-uni="movies"], #screen-game[data-uni="series"], #screen-game[data-uni="games"], #screen-game[data-mode="cover"] { --cap: 236px; }
#screen-game[data-uni="movies"][data-kind="year"], #screen-game[data-uni="series"][data-kind="year"], #screen-game[data-uni="games"][data-kind="year"] { --cap: 200px; }
@media (min-width: 640px) {
  #screen-game { --cap: 250px; --room: 390px; }
  #screen-game[data-uni="movies"], #screen-game[data-uni="series"], #screen-game[data-uni="games"] { --cap: 260px; }
  #screen-game[data-mode="cover"] { --cap: 276px; }
}
/* (the doubled id outranks the per-mode sizes above) */
#screen-game#screen-game:not([data-kind="versus"]):not([data-kind="casting"]):not([data-kind="character"]):not([data-kind="scene"]):not([data-mode="seconds"]):not([data-mode="mashup"]) .stage { height: var(--stage); }
#screen-game#screen-game .vinyl { width: min(210px, calc(var(--stage) - 40px)); height: min(210px, calc(var(--stage) - 40px)); }
#screen-game#screen-game .blur-box { width: calc(var(--stage) - 16px); height: calc(var(--stage) - 16px); }
#screen-game#screen-game .blur-box.poster { height: calc(var(--stage) * 0.96); width: calc(var(--stage) * 0.64); }
#screen-game#screen-game .blur-box.wide { width: 100%; height: auto; max-width: min(440px, calc((var(--stage) - 8px) * 16 / 9)); }
#screen-game#screen-game .reveal img { width: min(176px, calc(var(--stage) - 24px)); height: min(176px, calc(var(--stage) - 24px)); }
@media (max-width: 639px) { #screen-game#screen-game .reveal img { width: min(116px, calc(var(--stage) - 24px)); height: min(116px, calc(var(--stage) - 24px)); } }

/* Wide but short (Discord on a computer, phone in landscape): picture on the left, question and answers on the right */
@media (min-width: 640px) and (max-height: 560px) {
  main { padding-top: 12px; }
  #screen-game { --stage: clamp(140px, calc(100dvh - 190px), 420px); }
  #screen-game .game-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; row-gap: 0; align-items: start; }
  #screen-game .game-main > * { grid-column: 1 / -1; }
  #screen-game .game-main > .stage { grid-column: 1; grid-row: span 12; margin-top: 12px; }
  #screen-game .game-main > .stage ~ * { grid-column: 2; }
  #screen-game .game-main > .question { margin-top: 12px; }
  #screen-game .answers { grid-template-columns: 1fr; gap: 8px; }
  #screen-game .answers.n3 .answer:last-child { grid-column: auto; }
  #screen-game .answer { min-height: 0; padding: 9px 12px; }
}
@media (min-width: 640px) and (max-height: 560px) {
  .topbar-inner { height: 48px; }
  main { padding-top: 8px; }
  #screen-game .game-head { margin-bottom: 6px; }
  #screen-game .strip { margin-top: 6px; }
  #screen-game { --stage: clamp(130px, calc(100dvh - 150px), 420px); }
  #screen-game .question { margin: 8px 0 8px; }
  #screen-game .answers { gap: 6px; }
  #screen-game .answer { padding: 6px 10px; gap: 10px; }
  #screen-game .answer .k { width: 24px; height: 24px; font-size: 12px; }
  #screen-game .answer .t { flex-direction: row; align-items: baseline; gap: 8px; }
  #screen-game .answer .t b { font-size: 14px; }
  #screen-game .answer .t small { font-size: 12px; flex: none; }
}
/* Typed answer (no answer buttons): more room for the picture */
#screen-game:not([data-mode="classic"]) { --room: 400px; }
@media (min-width: 640px) { #screen-game:not([data-mode="classic"]) { --room: 300px; } }
@media (min-width: 640px) and (max-height: 560px) { #screen-game#screen-game { --stage: clamp(130px, calc(100dvh - 180px), 420px); } }
@media (max-width: 400px) { #screen-game .round small { display: none; } }

/* Discord: banner for the voice channel's room (instead of "Create a room") */
.dc-bar { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 14px 16px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.dc-bar.hidden { display: none; }
.dc-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #0a0a0b; }
.dc-ic svg { width: 22px; height: 22px; }
.dc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dc-t b { font-size: 15px; font-weight: 700; }
.dc-t small { font-size: 13px; color: var(--text-2); }
.dc-bar .btn { flex: none; }
.dc-bar .btn.hidden { display: none; }
.dc-has-room #music-actions { display: none; }

/* Category switch (lobby) */
.uni-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.uni-switch button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.uni-switch button svg { width: 20px; height: 20px; }
.uni-switch button span { max-width: 100%; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
@media (max-width: 420px) { .uni-switch { gap: 4px; } .uni-switch button { font-size: 11.5px; padding: 9px 2px; } }
.uni-switch button.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.uni-switch button.active svg { color: var(--accent-text); }
.uni-switch button:not(.active):hover { border-color: var(--accent-line); }
.guest .uni-switch button { pointer-events: none; }
.guest .uni-switch button:not(.active) { opacity: .45; }

/* ---------- Team mode ---------- */
:root { --team-red: #ff5c6c; --team-blue: #4c8dff; }
.teams-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 12px; }
.teams-bar.hidden { display: none; }
.teams-bar .tb { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.teams-bar .tb i, .team-score i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tb.t0 i, .ts.t0 i { background: var(--team-red); }
.tb.t1 i, .ts.t1 i { background: var(--team-blue); }
.tb-actions { margin-left: auto; display: flex; gap: 6px; }
.players .player.team-0 { border: 2px solid var(--team-red); background: color-mix(in srgb, var(--team-red) 12%, var(--surface)); }
.players .player.team-1 { border: 2px solid var(--team-blue); background: color-mix(in srgb, var(--team-blue) 12%, var(--surface)); }
.strip li.team-0 { border-color: color-mix(in srgb, var(--team-red) 55%, transparent); }
.strip li.team-1 { border-color: color-mix(in srgb, var(--team-blue) 55%, transparent); }
.scoreboard .row.team-0 .avatar { box-shadow: 0 0 0 2px var(--team-red); }
.scoreboard .row.team-1 .avatar { box-shadow: 0 0 0 2px var(--team-blue); }
.team-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.team-score.hidden { display: none; }
.team-score .ts { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.team-score .ts b { margin-left: auto; font-family: var(--mono); font-size: 16px; }
.team-score .ts.t0.lead { border-color: var(--team-red); }
.team-score .ts.t1.lead { border-color: var(--team-blue); }
.team-result { text-align: center; margin: 4px 0 18px; padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.team-result.hidden { display: none; }
.team-result b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.team-result.win-0 { border-color: var(--team-red); }
.team-result.win-0 b { color: var(--team-red); }
.team-result.win-1 { border-color: var(--team-blue); }
.team-result.win-1 b { color: var(--team-blue); }
.tr-scores { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.tr-scores .t0 { color: var(--team-red); }
.tr-scores .t1 { color: var(--team-blue); }
/* Discord-only buttons */
.dc-only { display: none !important; }
.is-discord .dc-only { display: inline-flex !important; }
