/* =========================================================
   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);
  --tile-l: 17%;
  --tile-s: 32%;
  --tile-text: 88%;
  --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);
  --tile-l: 92%;
  --tile-s: 70%;
  --tile-text: 18%;
  --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);
    --tile-l: 92%; --tile-s: 70%; --tile-text: 18%; --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.round { border-radius: 50%; }
.thumb.tint { background: hsl(var(--h) var(--tile-s) var(--tile-l)); }
.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(140px, 1fr)); gap: 10px; }
.hscroll::-webkit-scrollbar { display: none; }

.tile {
  position: relative; min-width: 0; height: 88px; padding: 12px 13px; border-radius: var(--r);
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  background: hsl(var(--h) var(--tile-s) var(--tile-l)); color: hsl(var(--h) 30% var(--tile-text));
  border: 1px solid transparent; font-weight: 600; font-size: 13px; line-height: 1.2;
  transition: transform 0.12s var(--ease), border-color 0.15s, box-shadow 0.15s;
}
.tile .te { font-size: 22px; line-height: 1; }
.tile:hover { border-color: hsl(var(--h) 40% 50% / 0.5); }
.tile:active { transform: scale(0.97); }
.tile .tick { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--on-accent); }
.tile .tick svg { width: 13px; height: 13px; }
.tile.on { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile.on .tick { display: grid; }
.tile.busy { opacity: 0.6; }

.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; }
  .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(132px, 1fr)); }
  .tile { height: 92px; }
}

@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; }
}
