/* ============================================================
   DESIGN SYSTEM — mentese music  (shared look with games.mentese.ch)
   ============================================================ */

:root {
  /* Spotify-style palette */
  --bg:          #121212;
  --surface:     #181818;
  --surface-2:   #1f1f1f;
  --surface-3:   #2a2a2a;

  --accent:      #1ed760;
  --accent-glow: rgba(30, 215, 96, 0.22);
  --accent-dim:  rgba(30, 215, 96, 0.12);
  --coral:       #f15e6c;

  --text:        #ffffff;
  --text-muted:  #b3b3b3;
  --text-faint:  #6a6a6a;
  --border:      rgba(255, 255, 255, 0.07);
  --border-mid:  rgba(255, 255, 255, 0.12);

  /* guess states */
  --correct: var(--accent);
  --wrong:   var(--coral);
  --skip:    rgba(255, 255, 255, 0.28);

  --font-display: 'Unbounded', sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius:      16px;
  --radius-lg:   24px;
  --radius-full: 999px;

  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --out:      cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      220ms;
  --dur-slow: 380ms;

  --gutter: 20px;
  --appbar-h: 64px;
}

/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; touch-action: manipulation; color-scheme: dark; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(30, 215, 96, 0.06) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; }
input { font-family: inherit; border: none; outline: none; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   APP SHELL
   ============================================================ */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---- App bar ---- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  margin: 0 calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  background: rgba(18, 18, 18, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
body[data-screen="game"] .appbar { border-bottom-color: var(--border); }

.appbar-left, .appbar-right { display: flex; align-items: center; gap: 8px; min-width: 40px; }

.game-label {
  flex: 1;
  min-width: 0;
  margin: 0 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-screen="menu"] .back-btn,
body[data-screen="menu"] .game-label { display: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--spring), background var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: rgba(30, 215, 96, 0.4); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.9); transition-duration: 80ms; }

/* ---- Logo ---- */

.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-word {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.logo-word--accent { color: var(--accent); text-shadow: 0 0 30px rgba(30, 215, 96, 0.5); }

.tagline { font-size: 13px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.02em; margin-top: 10px; }

/* ============================================================
   SCREENS
   ============================================================ */

.screens { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }

body[data-screen="menu"] #menu { animation: slideInLeft var(--dur-slow) var(--out) both; }
body[data-screen="game"] #game { animation: slideInRight var(--dur-slow) var(--out) both; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 28px 0 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ============================================================
   MENU
   ============================================================ */

.hero { padding: 24px 0 8px; }
.hero .logo-word { font-size: 34px; }

.menu > * { animation: fadeIn var(--dur-slow) var(--out) both; }
.menu > :nth-child(2) { animation-delay: 40ms; }
.menu > :nth-child(3) { animation-delay: 80ms; }
.menu > :nth-child(4) { animation-delay: 120ms; }
.menu > :nth-child(5) { animation-delay: 160ms; }
.menu > :nth-child(6) { animation-delay: 200ms; }

/* ---- Daily card ---- */

.daily-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  text-align: left;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 90% 120% at 0% 0%, rgba(30, 215, 96, 0.09) 0%, transparent 60%),
    var(--surface);
  border: 1px solid rgba(30, 215, 96, 0.22);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.daily-card:hover, .daily-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 40px var(--accent-glow);
  outline: none;
}
.daily-card:active { transform: scale(0.97); transition-duration: 100ms; }

.daily-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.daily-eq { display: flex; align-items: flex-end; gap: 4px; height: 26px; }
.daily-eq i {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: var(--bg);
  transform-origin: bottom;
  animation: eq 1s ease-in-out infinite alternate;
}
.daily-eq i:nth-child(1) { animation-delay: -0.2s; }
.daily-eq i:nth-child(2) { animation-delay: -0.7s; animation-duration: 0.8s; }
.daily-eq i:nth-child(3) { animation-delay: -0.4s; animation-duration: 1.2s; }
.daily-eq i:nth-child(4) { animation-delay: -0.9s; animation-duration: 0.9s; }

.daily-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.daily-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.daily-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.daily-status { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.daily-arrow { flex-shrink: 0; color: var(--accent); display: flex; opacity: 0.85; transition: transform var(--dur) var(--spring); }
.daily-card:hover .daily-arrow { transform: translateX(3px); }

/* ---- Mix card ---- */

.mix-card { padding: 20px; display: grid; gap: 24px; }
.field { display: grid; gap: 12px; }
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.field-val { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease);
}
.chip:hover { border-color: var(--border-mid); color: var(--text); }
.chip:active { transform: scale(0.93); transition-duration: 80ms; }
.chip small {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
}
.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: 0 4px 18px var(--accent-glow);
}
.chip.on small { background: rgba(18, 18, 18, 0.12); }

/* round picker: 10 / 20 / 30 */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.segmented button {
  height: 36px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--spring);
}
.segmented button:hover { color: var(--text); }
.segmented button:active { transform: scale(0.94); transition-duration: 80ms; }
.segmented button.on { background: var(--accent); color: var(--bg); box-shadow: 0 4px 18px var(--accent-glow); }

/* genres that can only be played alone sit after a divider */
.chips-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--border-mid); }
.chip.solo:not(.on) { border-style: dashed; border-color: rgba(30, 215, 96, 0.4); color: var(--text); }
.field-hint {
  margin-top: -2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  animation: fadeIn var(--dur) var(--out);
}

/* Two-handle range slider: two range inputs stacked on one track */
.range { position: relative; height: 28px; --thumb: 24px; }
.range-track { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--surface-3); }
.range-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px rgba(30, 215, 96, 0.35); }
.range input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.range input:focus-visible { outline: none; }
.range input::-webkit-slider-runnable-track { background: none; }
.range input::-moz-range-track { background: none; }
.range input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: grab;
  width: var(--thumb); height: var(--thumb); border-radius: 50%;
  background: var(--accent); border: 5px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(30, 215, 96, 0.5), 0 2px 12px rgba(30, 215, 96, 0.35);
  transition: transform var(--dur) var(--spring);
}
.range input:active::-webkit-slider-thumb { transform: scale(1.15); cursor: grabbing; }
.range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.range input::-moz-range-thumb {
  pointer-events: auto; cursor: grab;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 5px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(30, 215, 96, 0.5), 0 2px 12px rgba(30, 215, 96, 0.35);
}
.range-ends { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-faint); margin-top: -4px; }

#btn-start { margin-top: 4px; }

.foot {
  margin-top: auto;
  padding: 40px 0 calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: var(--radius-full);
  padding: 0 24px;
  height: 54px;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 150ms;
}
.btn:hover::after { opacity: 1; }
.btn:active::after { opacity: 0; }
.btn:active { transform: scale(0.95) !important; transition-duration: 80ms; }

.btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 4px 24px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 6px 32px rgba(30, 215, 96, 0.4); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-mid); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.3; pointer-events: none; box-shadow: none; }

/* ============================================================
   GAME
   The game screen is exactly one screen tall (no page scroll):
   app bar + [points board] + stage (flexes) + dock. The equalizer is the
   flexible part: it grows into spare height and shrinks to nothing on short
   screens. Phones: board is a compact strip on top. ≥860px: two columns.
   ============================================================ */

body[data-screen="game"] .app { height: 100dvh; min-height: 0; }
body[data-screen="game"] .screens { min-height: 0; overflow: auto; } /* fallback only, layout is sized to fit */

.game { min-height: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.game-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.game-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---- Stage (left panel) ---- */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow: hidden;
}
.stage > :not(.stage-glow) { position: relative; }
.stage-glow {
  position: absolute;
  inset: -60px;
  background: var(--cover, none) center / cover no-repeat;
  filter: blur(54px) saturate(1.6);
  opacity: 0;
  pointer-events: none;
  transition: none; /* no fade-out: the next song's cover must never show through */
}
.stage-glow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, var(--surface) 75%); }
.stage.won .stage-glow { opacity: 0.32; transition: opacity 900ms var(--ease); }

.stage-top { display: flex; gap: 14px; align-items: center; }

.cover {
  position: relative;
  flex-shrink: 0;
  width: clamp(76px, 13dvh, 150px);
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #555;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.07), transparent 60%),
    linear-gradient(145deg, #333, #232323);
  box-shadow: inset 0 0 0 1px var(--border), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.cover-ph { transition: opacity var(--dur) var(--ease); }
.stage.running .cover-ph { animation: coverPulse 1.6s ease-in-out infinite; }
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1) blur(6px);
  transform: scale(1.08);
  transition: none; /* fade only on reveal (below), never when the next song starts */
}
.cover img:not([src]) { visibility: hidden; }
.cover.revealed img { opacity: 1; filter: none; transform: none; transition: opacity 600ms var(--ease), filter 900ms var(--ease), transform 900ms var(--out); }
.cover.revealed { box-shadow: 0 0 0 2px var(--accent), 0 12px 40px rgba(30, 215, 96, 0.35); }
.cover.lost img { opacity: 0.85; filter: grayscale(1); transform: none; transition: opacity 600ms var(--ease), transform 900ms var(--out); }
.cover.revealed .cover-ph, .cover.lost .cover-ph { opacity: 0; }
.cover.pop { animation: coverFlip 700ms var(--spring); }

/* during the round */
.stage-meta { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 8px 10px; }
.meta { display: grid; gap: 1px; min-width: 0; }
.meta-k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); white-space: nowrap; }
.meta-v { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta-v.accent { color: var(--accent); text-shadow: 0 0 22px rgba(30, 215, 96, 0.35); }
.timer { color: var(--text-muted); }
.stage.running .timer { color: var(--text); }
.meta-hint { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); line-height: 1.3; }

/* after the round: the answer takes the meta's place */
.stage-reveal { display: none; flex: 1; min-width: 0; }
.stage.done .stage-meta { display: none; }
.stage.done .stage-reveal { display: grid; gap: 2px; align-content: center; animation: fadeIn var(--dur-slow) var(--out) both; }
.result-head { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--coral); }
.stage.won .result-head { color: var(--accent); }
.reveal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reveal-artist { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-points { margin-top: 2px; font-family: var(--font-display); font-size: 20px; font-weight: 900; letter-spacing: -0.03em; color: var(--accent); }
.stage.done:not(.won) .result-points { color: var(--text-faint); }

/* ---- Equalizer (flexible filler) ---- */

.eq {
  flex: 3 1 0;
  min-height: 0;
  max-height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  padding: 0 2px;
  overflow: hidden;
}
.eq i {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--surface-3);
  transform-origin: bottom;
  transform: scaleY(0.25);
  animation: eq 0.9s ease-in-out infinite alternate;
  animation-play-state: paused;
  transition: background var(--dur) var(--ease);
}
.eq i:nth-child(2n)  { animation-duration: 0.7s; animation-delay: -0.3s; }
.eq i:nth-child(3n)  { animation-duration: 1.1s; animation-delay: -0.6s; }
.eq i:nth-child(5n)  { animation-duration: 0.8s; animation-delay: -0.15s; }
.eq i:nth-child(7n)  { animation-duration: 1.3s; animation-delay: -0.9s; }
.eq i:nth-child(4n+1){ animation-delay: -0.45s; }
.player:has(.play.playing) .eq i { animation-play-state: running; background: var(--accent); }
.player:has(.play.playing) .eq { filter: drop-shadow(0 0 8px rgba(30, 215, 96, 0.35)); }

/* ---- Clip bar ---- */

.bar { position: relative; flex-shrink: 0; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-unlocked { position: absolute; inset: 0 auto 0 0; background: var(--surface-3); transition: width var(--dur-slow) var(--out); }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); box-shadow: 0 0 12px rgba(30, 215, 96, 0.6); border-radius: 0 3px 3px 0; }
.bar-marks { position: absolute; inset: 0; pointer-events: none; }
.bar-marks i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--surface); }
.bar-times { display: flex; justify-content: space-between; margin-top: -4px; font-size: 11px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- Clip parts: one compact tile per try ---- */

.segs { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; flex-shrink: 0; }
.segs li {
  height: 48px;
  min-width: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.segs b { font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 1.1; }
.segs small { font-size: 10px; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums; line-height: 1.2; }
.segs li.open b { color: var(--text-muted); }
.segs li.active { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 18px rgba(30, 215, 96, 0.18); }
.segs li.active b, .segs li.active small { color: var(--accent); }
.segs li.unused { opacity: 0.35; }
.segs li:not(.open) small { font-size: 13px; }
.segs li.skip { background: var(--surface-3); }
.segs li.skip b, .segs li.skip small { color: var(--text-muted); }
.segs li.wrong { background: rgba(241, 94, 108, 0.14); border-color: rgba(241, 94, 108, 0.4); }
.segs li.wrong small { color: var(--coral); }
.segs li.correct { background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 20px var(--accent-glow); }
.segs li.correct b, .segs li.correct small { color: var(--bg); }
.segs li.pop { animation: popIn var(--dur-slow) var(--spring) both; }
.segs li.wrong.pop { animation: popIn var(--dur-slow) var(--spring) both, nudge 420ms var(--ease) 120ms; }

.feedback {
  flex-shrink: 0;
  height: 18px;
  margin-top: -2px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feedback.wrong { color: var(--coral); }
.feedback span { font-weight: 800; }

/* ---- Play row ---- */

.player-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; flex: 1 0 auto; } /* volume | play | (empty, keeps play centred); takes spare height */

.play {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 6px 30px rgba(30, 215, 96, 0.3);
  transition: transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease);
}
.play:hover { transform: scale(1.04); box-shadow: 0 8px 40px rgba(30, 215, 96, 0.45); }
.play:active { transform: scale(0.92); transition-duration: 80ms; }
.play::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
.play.playing::before { animation: ripple 1.4s var(--out) infinite; }
.play .i-stop { display: none; }
.play.playing .i-play { display: none; }
.play.playing .i-stop { display: block; }
.play svg { width: 42%; height: 42%; animation: popIn var(--dur) var(--spring); }
.play .i-play { margin-left: 4%; } /* optical centring of the triangle */

.volume { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.volume input {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 2px;
  background: var(--surface-3);
  cursor: pointer;
}
.volume input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); }
.volume input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); }

/* ---- Dock: search + Skip/Guess, or the result ---- */

.dock { flex-shrink: 0; display: grid; gap: 10px; }
.dock .btn { height: 52px; }

.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 18px; color: var(--text-muted); pointer-events: none; transition: color var(--dur) var(--ease); }
#guess-input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 46px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  font-size: 16px; /* 16px stops iOS zoom on focus */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#guess-input::placeholder { color: var(--text-faint); }
#guess-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.search:focus-within > svg { color: var(--accent); }

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  list-style: none;
  padding: 6px;
  max-height: min(360px, 50dvh);
  overflow-y: auto;
  background: rgba(32, 32, 32, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: sheetUp var(--dur) var(--out);
  transform-origin: bottom;
}
.suggestions li { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; border-radius: 12px; cursor: pointer; }
.sug-cover { flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.sug-cover img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade var(--dur) var(--ease); }
.sug-text { min-width: 0; display: grid; gap: 1px; }
.sug-text b, .sug-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-text b { font-size: 14px; font-weight: 700; }
.sug-text small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.suggestions li.hl, .suggestions li:hover { background: rgba(255, 255, 255, 0.07); }
.suggestions li.none { padding: 11px 12px; cursor: default; color: var(--text-muted); background: none; font-size: 14px; font-weight: 500; }
.suggestions mark { background: none; color: var(--accent); }

.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; min-width: 0; padding: 0 16px; }

/* result version of the dock: same height as search + buttons */
.result { animation: fadeIn var(--dur-slow) var(--out) both; }
.breakdown-row { min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.breakdown { display: contents; }
.breakdown span {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.breakdown b { color: var(--text); margin-left: 2px; }
.breakdown .neg b, .breakdown span.neg { color: var(--coral); }
.breakdown .mult b { color: var(--accent); }
.reveal-link {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}
.reveal-link:hover { background: rgba(30, 215, 96, 0.2); }

.actions .btn-icon { flex: 0 0 52px; padding: 0; }
.btn-icon .i-stop { display: none; }
.btn-icon.playing .i-play { display: none; }
.btn-icon.playing .i-stop { display: block; }
.btn-icon.playing { border-color: var(--accent); color: var(--accent); }
/* label only when the preview button is alone in the row (daily: no "Next song") */
.btn-icon .btn-label { display: none; }
.actions .btn-icon:has(~ #btn-next[hidden]) { flex: 1; padding: 0 16px; }
.btn-icon:has(~ #btn-next[hidden]) .btn-label { display: inline; }

.countdown { margin-top: -2px; text-align: center; color: var(--text-muted); font-size: 12px; }
.countdown strong { font-family: var(--font-display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ---- Points board ---- */

.board { order: -1; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 10px 14px; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board .section-label { margin: 0; }
.score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(30, 215, 96, 0.35);
  font-variant-numeric: tabular-nums;
}
.score.bump { animation: scoreBump 600ms var(--spring); }
.score-sub { display: grid; justify-items: end; gap: 2px; font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.board-head { display: none; align-items: center; justify-content: space-between; }
.count { min-width: 24px; padding: 2px 8px; border-radius: var(--radius-full); background: var(--surface-3); font-size: 12px; font-weight: 700; text-align: center; }

/* phones: a sideways strip of covers + points */
.correct-list { list-style: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-height: 0; }
.correct-list::-webkit-scrollbar { display: none; }
.correct-list li {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.correct-list li.new { animation: rowIn var(--dur-slow) var(--spring) both; border-color: rgba(30, 215, 96, 0.45); }
/* missed songs: red, cover in grey */
.correct-list li.missed { background: rgba(241, 94, 108, 0.07); border-color: rgba(241, 94, 108, 0.3); }
.correct-list li.missed .thumb img { filter: grayscale(1); opacity: 0.7; }
.correct-list li.missed .c-pts b { color: var(--coral); }
.correct-list li.empty { padding: 4px 2px; border: 0; background: none; color: var(--text-faint); font-size: 12px; }
.thumb { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-text { display: none; min-width: 0; }
.c-text b, .c-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-text b { font-size: 14px; font-weight: 700; }
.c-text small, .c-pts small { font-size: 12px; color: var(--text-muted); }
.c-pts { flex-shrink: 0; display: grid; justify-items: end; gap: 1px; }
.c-pts b { font-family: var(--font-display); font-size: 12px; color: var(--accent); }
.c-pts small { display: none; }

/* ============================================================
   SHEETS (modals)
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 5, 8, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade var(--dur) var(--ease) both;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 14px 22px calc(24px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  animation: sheetUp var(--dur-slow) var(--out) both;
}
.modal.closing { animation: fade var(--dur) var(--ease) reverse both; }
.modal.closing .sheet { animation: sheetDown var(--dur) var(--ease) both; }

.sheet-handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 18px; }
.sheet-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-2);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--spring);
}
.sheet-x:hover { color: var(--text); }
.sheet-x:active { transform: scale(0.88); }

.sheet h2 { font-family: var(--font-display); font-size: 20px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 20px; }
.sheet .section-label { margin-top: 26px; }
.sheet > .btn { margin-top: 24px; }

.howto { list-style: none; display: grid; gap: 14px; }
.howto li { display: flex; gap: 14px; align-items: center; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, 0.82); }
.howto strong { color: var(--text); }
.howto b {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 14px;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.sq { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 6px; }
.sq.correct { background: var(--correct); }
.sq.wrong   { background: var(--wrong); }
.sq.skip    { background: var(--skip); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-grid > div {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 14px 4px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.stats-grid strong { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stats-grid span { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* game over */
.end-sheet { text-align: center; }
.end-sheet .section-label { margin: 4px 0 6px; }
.sheet .end-score { font-size: 56px; animation: scoreBump 700ms var(--spring) 150ms both; }
.end-sub { margin: 6px 0 22px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.end-grid { grid-template-columns: repeat(3, 1fr); }
.end-sheet .actions { margin-top: 22px; }

.dist { display: grid; gap: 7px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-row > span { width: 14px; text-align: right; font-weight: 700; color: var(--text-muted); }
.dist-bar {
  min-width: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  text-align: right;
  font-weight: 700;
  background: var(--surface-3);
  transform-origin: left;
  animation: growX 600ms var(--out) both;
}
.dist-row:nth-child(2) .dist-bar { animation-delay: 40ms; }
.dist-row:nth-child(3) .dist-bar { animation-delay: 80ms; }
.dist-row:nth-child(4) .dist-bar { animation-delay: 120ms; }
.dist-row:nth-child(5) .dist-bar { animation-delay: 160ms; }
.dist-row:nth-child(6) .dist-bar { animation-delay: 200ms; }
.dist-row:nth-child(7) .dist-bar { animation-delay: 240ms; }
.dist-row.cur .dist-bar { background: var(--accent); color: var(--bg); box-shadow: 0 4px 18px var(--accent-glow); }

/* ---- Toast ---- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--appbar-h) + env(safe-area-inset-top) + 10px);
  z-index: 30;
  max-width: calc(100% - 40px);
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: toastIn var(--dur-slow) var(--spring) both;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { transform: scale(0.4); opacity: 0; } 65% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes popCard { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0.3; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes eq { from { transform: scaleY(0.15); } to { transform: scaleY(1); } }
@keyframes ripple { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes sheetDown { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(40px); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -14px) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes coverPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes coverFlip { 0% { transform: perspective(600px) rotateY(0); } 45% { transform: perspective(600px) rotateY(90deg) scale(0.95); } 100% { transform: perspective(600px) rotateY(0); } }
@keyframes scoreBump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes growX { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 370px) {
  :root { --gutter: 16px; }
  .hero .logo-word { font-size: 28px; }
  .stats-grid strong { font-size: 18px; }
  .volume input { width: 56px; }
  .segs { gap: 4px; }
}

@media (min-width: 600px) {
  .app { max-width: 560px; }
  .hero { padding-top: 40px; }
  .hero .logo-word { font-size: 40px; }
  .tagline { font-size: 14px; }

  /* sheets become centered dialogs */
  .modal { align-items: center; padding: 24px; }
  .sheet { max-width: 440px; border-radius: 28px; border-bottom: 1px solid var(--border-mid); padding-bottom: 24px; animation-name: popCard; }
  .sheet-handle { visibility: hidden; height: 0; margin-bottom: 8px; }
  .modal.closing .sheet { animation: fade var(--dur) var(--ease) reverse both; }
}

/* Side by side: left = stage + dock, right = points board (full height, list scrolls inside) */
@media (min-width: 860px) {
  body[data-screen="game"] .app { max-width: 1080px; }
  .game { padding: 20px 0 24px; }
  .game-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 20px; }
  .game-main { min-height: 0; }

  .board { order: 0; padding: 20px; gap: 0; }
  .board-top { display: block; }
  .board .section-label { margin-bottom: 4px; }
  .score { font-size: 44px; }
  .score-sub { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 13px; }
  .board-head { display: flex; margin: 20px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
  .correct-list { flex: 1; flex-direction: column; overflow: hidden auto; gap: 8px; }
  .correct-list li { gap: 12px; padding: 8px 12px 8px 8px; border-radius: 14px; }
  .correct-list li.empty { justify-content: center; padding: 26px 12px; border: 1px dashed var(--border-mid); border-radius: 14px; font-size: 13px; text-align: center; }
  .thumb { width: 44px; height: 44px; border-radius: 10px; }
  .c-text { display: grid; flex: 1; gap: 1px; }
  .c-pts small { display: block; }
  .c-pts b { font-size: 13px; }

  .stage { padding: 20px; gap: 12px; }
  .cover { width: clamp(96px, 17dvh, 168px); }
  .meta-v { font-size: 26px; }
  .reveal-title { font-size: 20px; }
  .result-points { font-size: 26px; }
  .segs li { height: 56px; }
  .segs b { font-size: 15px; }
  .segs small { font-size: 11px; }
  /* tall desktop screens: bars and play button grow with the height instead of leaving gaps */
  .play { width: clamp(80px, 10dvh, 112px); height: clamp(80px, 10dvh, 112px); }
  .eq { max-height: 32dvh; }
}

/* Short screens (small phones, browser bars): tighten everything */
@media (max-height: 760px) {
  .game { padding-top: 8px; }
  .game-grid, .game-main { gap: 8px; }
  .stage { padding: 12px 14px; gap: 8px; }
  .cover { width: 72px; border-radius: 14px; }
  .meta-v { font-size: 18px; }
  .meta-hint { font-size: 11px; }
  .reveal-title { font-size: 14px; -webkit-line-clamp: 1; }
  .result-points { font-size: 17px; }
  .segs li { height: 42px; border-radius: 10px; }
  .play { width: 60px; height: 60px; }
  .dock { gap: 8px; }
  .dock .btn, #guess-input { height: 46px; }
  .breakdown-row { min-height: 46px; }
  .actions .btn-icon { flex-basis: 46px; }
}
@media (max-height: 640px) {
  .eq, .meta-hint, .bar-times, .countdown { display: none; }
  .cover { width: 60px; }
}
@media (max-height: 760px) and (max-width: 859px) {
  .board { padding: 8px 12px; gap: 6px; }
  .score { font-size: 22px; }
}
@media (max-height: 640px) and (max-width: 859px) {
  .board .section-label, .correct-list li.empty { display: none; }
}


@media (min-width: 960px) {
  body {
    background-image:
      radial-gradient(ellipse 70% 55% at 5% 0%,    rgba(30, 215, 96, 0.07) 0%, transparent 55%),
      radial-gradient(ellipse 55% 45% at 95% 100%, rgba(241, 94, 108, 0.05) 0%, transparent 55%),
      radial-gradient(ellipse 40% 30% at 50% 50%,  rgba(30, 215, 96, 0.02) 0%, transparent 60%);
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: -1;
  }
  .appbar { background: rgba(18, 18, 18, 0.5); }
  .hero { padding-top: 56px; }
  .hero .logo-word { font-size: 48px; }
}


/* ============================================================
   ACCOUNTS & LEADERBOARD
   ============================================================ */

/* account + leaderboard only in the menu's app bar (the game bar needs the room for its title) */
body[data-screen="game"] .menu-only { display: none; }
.account-btn { position: relative; }
.avatar-letter { display: none; }
.account-btn.signed-in { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.account-btn.signed-in svg { display: none; }
.account-btn.signed-in .avatar-letter { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 900; }

.avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}
.avatar-lg { width: 52px; height: 52px; font-size: 20px; background: var(--accent); color: var(--bg); }

/* forms */
.auth, #delete-form { display: grid; gap: 12px; }
.auth .segmented { margin-bottom: 4px; }
.input-field { display: grid; gap: 6px; }
.input-field span { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.input-field input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  font-size: 16px; /* no iOS zoom */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.form-hint { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.form-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(241, 94, 108, 0.1);
  border: 1px solid rgba(241, 94, 108, 0.35);
  color: var(--coral);
  font-size: 13px;
  font-weight: 600;
}
.btn-danger { background: var(--coral); color: var(--bg); }

/* profile */
.profile { display: grid; gap: 16px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 900; }
.profile-head small { font-size: 13px; color: var(--text-muted); }
.danger { border-top: 1px solid var(--border); padding-top: 14px; }
.danger summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-faint); list-style: none; }
.danger summary::-webkit-details-marker { display: none; }
.danger summary:hover { color: var(--coral); }
.danger[open] summary { color: var(--coral); margin-bottom: 12px; }

/* leaderboard */
.board-mode { display: grid; gap: 10px; margin-top: 12px; }
.segmented-sm button { height: 30px; font-size: 12px; }
.board-note { margin: 14px 2px 8px; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.lb { list-style: none; display: grid; align-content: start; gap: 6px; min-height: 120px; transition: opacity var(--dur) var(--ease); }
.lb.loading { opacity: 0.4; }
.lb li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  animation: rowIn var(--dur-slow) var(--out) both;
}
.lb li.me { border-color: rgba(30, 215, 96, 0.5); background: rgba(30, 215, 96, 0.08); }
.lb li.me .avatar { background: var(--accent); color: var(--bg); }
.lb-rank { width: 28px; text-align: center; font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text-muted); }
.lb-name { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lb-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { font-size: 12px; color: var(--text-muted); }
.lb-score { font-family: var(--font-display); font-size: 14px; color: var(--accent); }
.lb li.lb-gap { justify-content: center; padding: 0; background: none; border: 0; color: var(--text-faint); letter-spacing: 0.3em; }
.lb li.lb-empty { justify-content: center; padding: 28px 12px; background: none; border: 1px dashed var(--border-mid); color: var(--text-muted); font-size: 14px; }
#board-signin { margin-top: 16px; }

/* game over: rank on the leaderboard */
.end-rank {
  margin: -10px auto 18px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  animation: popIn var(--dur-slow) var(--spring) both;
}
.end-rank:hover { background: rgba(30, 215, 96, 0.2); }

/* waiting for the server to start a game */
body.busy #btn-daily, body.busy #btn-start, body.busy #btn-again { opacity: 0.6; pointer-events: none; }
/* song list couldn't be loaded */
.form-error.fatal { margin-top: 40px; font-size: 15px; }
#board-hint { margin: -6px 0 14px; }
/* ============================================================
   MULTIPLAYER
   ============================================================ */

/* menu card */
.multi-card { gap: 14px; }
.multi-card .field-hint { margin: -4px 0 0; }
.join-row { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.code-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.code-input::placeholder { color: var(--text-faint); letter-spacing: 0.2em; }
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.join-row .btn { height: 52px; padding: 0 26px; }

/* lobby screen */
body[data-screen="lobby"] #lobby { animation: slideInRight var(--dur-slow) var(--out) both; }
.lobby { padding-bottom: 32px; }
.lobby-head { margin-top: 20px; padding: 22px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.lobby-head .section-label { margin: 0; }
.lobby-code {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-right: -0.18em; /* letter-spacing adds space after the last letter */
  color: var(--accent);
  text-shadow: 0 0 30px rgba(30, 215, 96, 0.4);
}
.lobby-head .btn { height: 42px; padding: 0 20px; font-size: 13px; }
.lobby-settings { margin-top: 14px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.lobby .lb { min-height: 0; }
.lobby-actions { display: grid; gap: 12px; margin-top: 22px; }
.lobby-actions .field-hint { text-align: center; margin: 0; }

/* live ranking on the game screen */
.avatar-thumb { display: grid; place-items: center; font-family: var(--font-display); font-size: 12px; font-weight: 900; color: var(--text); }
.correct-list li.player.me { border-color: rgba(30, 215, 96, 0.5); background: rgba(30, 215, 96, 0.08); }
.correct-list li.player.me .avatar-thumb { background: var(--accent); color: var(--bg); }
.correct-list li.player.away { opacity: 0.5; }
.correct-list li.player.missed .c-pts b { color: var(--text); }.multi-card { grid-template-columns: minmax(0, 1fr); } /* inputs can't push the card wider than the screen */
.multi-card .input-field input, .code-input { width: 100%; }
/* phones (compact strip): show each player's name, not just the initial */
.correct-list li.player .c-text { display: grid; }
.correct-list li.player .c-text small { display: none; }
.correct-list li.player .c-text b { font-size: 12px; max-width: 90px; }
@media (min-width: 860px) {
  .correct-list li.player .c-text small { display: block; }
  .correct-list li.player .c-text b { font-size: 14px; max-width: none; }
}
.lobby .lb-rank:empty { display: none; } /* ranks only after a game */
