/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:     #1DB954;
  --green-dim: #17903f;
  --bg:        #090b10;
  --bg2:       #0f1117;
  --bg3:       #161b26;
  --bg4:       #1e2535;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8eaf0;
  --text2:     #8b92a8;
  --text3:     #555e75;
  --red:       #ff3344;
  --blue:      #4fc3f7;
  --gold:      #ffd166;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --font:      'Inter', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Views ────────────────────────────────────────────────────────────────── */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; flex-direction: column; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button { cursor: pointer; border: none; font-family: var(--font); transition: all .18s ease; }

.btn-primary {
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: .88rem;
  padding: 10px 22px;
  border-radius: 100px;
  letter-spacing: .02em;
}
.btn-primary:hover { background: #1ed760; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: .88rem;
  padding: 10px 22px;
  border-radius: 100px;
}
.btn-outline:hover { border-color: rgba(255,255,255,.25); background: var(--bg3); }

.btn-ghost-sm {
  background: transparent;
  color: var(--text2);
  font-size: .82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid transparent;
}
.btn-ghost-sm:hover { background: var(--bg3); color: var(--text); border-color: var(--border); }

.btn-spotify {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: 100%;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 100px;
  letter-spacing: .02em;
}
.btn-spotify:hover { background: #1ed760; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29,185,84,.35); }

.btn-danger {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 22px;
  border-radius: 100px;
}
.btn-danger:hover { background: #ff1f31; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 16px; }
.alert-error { background: rgba(255,51,68,.12); border: 1px solid rgba(255,51,68,.3); color: #ff8088; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bg4);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner.large { width: 48px; height: 48px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badge ────────────────────────────────────────────────────────────────── */
.badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* LOGIN                                                                     */
/* ══════════════════════════════════════════════════════════════════════════ */
#view-login { justify-content: center; align-items: center; position: relative; }

.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(29,185,84,.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(79,195,247,.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 24px; }

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.04);
  text-align: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -.02em;
}
.login-logo svg { width: 28px; height: 28px; }

.login-card h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -.03em; }
.login-sub { color: var(--text2); font-size: .9rem; margin-bottom: 28px; line-height: 1.5; }

.login-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}
.lf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text2);
}
.lf-item span:first-child { font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* NAVBAR                                                                    */
/* ══════════════════════════════════════════════════════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(9,11,16,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.01em;
}

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
#nav-name { font-size: .83rem; font-weight: 600; color: var(--text2); }

.btn-dmx-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
}
.btn-dmx-panel:hover { border-color: rgba(255,255,255,.2); color: var(--text); }

/* DMX dot indicator */
.dmx-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  transition: background .3s;
}
.dmx-dot.off      { background: var(--text3); }
.dmx-dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.dmx-dot.error    { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ══════════════════════════════════════════════════════════════════════════ */
/* DASHBOARD                                                                 */
/* ══════════════════════════════════════════════════════════════════════════ */
#view-dashboard { display: flex; flex-direction: column; }

.dashboard-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.db-hero { margin-bottom: 36px; }
.db-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--text2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.db-hero p { color: var(--text2); font-size: .95rem; }

/* URL Card */
.url-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.url-card-icon { font-size: 1.5rem; margin-top: 2px; }
.url-card-content { flex: 1; }
.url-card-content h3 { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.url-card-content p { font-size: .82rem; color: var(--text2); margin-bottom: 14px; }
.url-input-row { display: flex; gap: 10px; }
.input-url {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color .18s;
}
.input-url::placeholder { color: var(--text3); }
.input-url:focus { border-color: rgba(29,185,84,.5); }

/* Settings Bar */
.settings-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 36px;
}
.settings-group { display: flex; align-items: center; gap: 10px; }
.settings-label { font-size: .78rem; font-weight: 600; color: var(--text2); white-space: nowrap; }

.segmented {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  color: var(--text2);
  font-size: .78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 100px;
  border: none;
  transition: all .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg4); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* Section head */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 1.1rem; font-weight: 700; }

/* Loading / Error states */
.loading-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text2);
  font-size: .9rem;
}
.error-state span:first-child { font-size: 2rem; }

/* Playlists Grid */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  group: true;
}
.playlist-card:hover {
  border-color: rgba(29,185,84,.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(29,185,84,.1);
}

.pc-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg3);
  display: block;
}
.pc-cover-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.pc-body { padding: 12px; }
.pc-name {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-meta { font-size: .72rem; color: var(--text3); }

.pc-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.playlist-card:hover .pc-play-overlay { opacity: 1; }
.pc-play-btn {
  width: 52px; height: 52px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(29,185,84,.5);
  transform: scale(.85);
  transition: transform .2s;
}
.playlist-card:hover .pc-play-btn { transform: scale(1); }

/* ══════════════════════════════════════════════════════════════════════════ */
/* QUIZ                                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */
#view-quiz { background: var(--bg); align-items: center; justify-content: flex-start; }

.quiz-wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.quiz-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}
.score-pill-label { font-size: .72rem; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.score-pill-val { font-size: 1rem; font-weight: 800; color: var(--green); min-width: 28px; text-align: right; transition: transform .2s; }
.score-pill-val.bump { transform: scale(1.4); }

/* Progress */
.quiz-progress-area { margin-bottom: 28px; }
.qp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
#q-counter { font-size: .82rem; font-weight: 600; color: var(--text2); }

/* Timer circle */
.timer-circle {
  position: relative;
  width: 44px; height: 44px;
}
.timer-circle svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.tc-bg { fill: none; stroke: var(--bg4); stroke-width: 3; }
.tc-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .5s;
}
.tc-fill.warning { stroke: var(--gold); }
.tc-fill.danger  { stroke: var(--red); }
#timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--text);
}

.prog-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .4s ease; }

/* Quiz loading */
.quiz-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text2);
}

/* Album Stage */
.album-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  gap: 12px;
  position: relative;
}

.album-art {
  width: 180px; height: 180px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--bg3);
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  border: 1px solid var(--border);
}
.album-hidden {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
}
#album-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.album-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.album-track-info { text-align: center; width: 100%; }
.ati-title { font-size: .78rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.ati-artist { font-size: .72rem; color: rgba(255,255,255,.7); }

/* Sound wave animation */
.sound-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}
.sound-wave span {
  display: block;
  width: 3px;
  background: var(--green);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}
.sound-wave span:nth-child(1) { animation-delay: 0s;    height: 8px; }
.sound-wave span:nth-child(2) { animation-delay: .15s;  height: 16px; }
.sound-wave span:nth-child(3) { animation-delay: .3s;   height: 22px; }
.sound-wave span:nth-child(4) { animation-delay: .45s;  height: 14px; }
.sound-wave span:nth-child(5) { animation-delay: .6s;   height: 20px; }
.sound-wave span:nth-child(6) { animation-delay: .75s;  height: 10px; }
.sound-wave span:nth-child(7) { animation-delay: .9s;   height: 18px; }
.sound-wave.paused span { animation-play-state: paused; height: 4px !important; }
@keyframes wave {
  0%,100% { transform: scaleY(1); }
  50% { transform: scaleY(.3); }
}

.now-playing-label { font-size: .72rem; color: var(--text3); font-weight: 500; }

/* Question */
.question-area {}
.q-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--green);
  margin-bottom: 10px;
}
.q-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.choice-btn {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}
.choice-btn:hover:not(:disabled) {
  border-color: rgba(29,185,84,.5);
  background: var(--bg3);
  transform: translateY(-1px);
}
.choice-btn .choice-key {
  min-width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text2);
  flex-shrink: 0;
}
.choice-btn.correct {
  background: rgba(0,255,100,.1);
  border-color: #00ff66;
  color: #00ff66;
}
.choice-btn.correct .choice-key { background: #00ff66; color: #000; }
.choice-btn.wrong {
  background: rgba(255,51,68,.1);
  border-color: var(--red);
  color: var(--red);
}
.choice-btn.wrong .choice-key { background: var(--red); color: #fff; }
.choice-btn.dim { opacity: .35; }
.choice-btn:disabled { cursor: default; }

/* Feedback Banner */
.feedback-banner {
  margin-top: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.fb-icon { font-size: 1.6rem; }
.fb-body { flex: 1; }
.fb-main { font-size: .95rem; font-weight: 700; margin-bottom: 2px; }
.fb-sub { font-size: .78rem; color: var(--text2); }
.fb-points { font-size: 1.1rem; font-weight: 800; color: var(--green); }

.feedback-banner.correct { border-color: rgba(0,255,100,.25); background: rgba(0,255,100,.06); }
.feedback-banner.wrong   { border-color: rgba(255,51,68,.25);  background: rgba(255,51,68,.06);  }

/* ══════════════════════════════════════════════════════════════════════════ */
/* RESULTS                                                                   */
/* ══════════════════════════════════════════════════════════════════════════ */
#view-results { justify-content: center; align-items: center; }

.results-wrap {
  width: 100%;
  max-width: 520px;
  padding: 24px;
}

.results-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: zoomIn .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes zoomIn { from { opacity:0; transform:scale(.9); } to { opacity:1; transform:scale(1); } }

.results-emoji { font-size: 3.5rem; margin-bottom: 16px; }
.results-headline {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 28px;
}

.results-big-score { margin-bottom: 28px; }
.rbs-val { font-size: 4rem; font-weight: 900; color: var(--green); letter-spacing: -.04em; line-height: 1; }
.rbs-label { font-size: .85rem; color: var(--text2); font-weight: 600; margin-top: 4px; }

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.rs-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.rs-val { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.rs-label { font-size: .72rem; font-weight: 600; color: var(--text2); }
.rs-correct .rs-val { color: #00ff66; }
.rs-wrong .rs-val   { color: var(--red); }
.rs-acc .rs-val     { color: var(--blue); }

/* Results history */
.results-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 4px;
}
.results-history::-webkit-scrollbar { width: 4px; }
.results-history::-webkit-scrollbar-track { background: var(--bg3); border-radius: 2px; }
.results-history::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

.rh-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .78rem;
  text-align: left;
}
.rh-icon { font-size: .95rem; flex-shrink: 0; }
.rh-track { flex: 1; min-width: 0; }
.rh-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-artist { color: var(--text2); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-pts { font-weight: 700; color: var(--green); white-space: nowrap; }
.rh-item.wrong .rh-pts { color: var(--red); }

.results-btns { display: flex; flex-direction: column; gap: 10px; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* MODE SELECT MODAL                                                         */
/* ══════════════════════════════════════════════════════════════════════════ */
.mode-select-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 820px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: zoomIn .25s cubic-bezier(.34,1.56,.64,1);
  margin: auto;
  overflow: hidden;
}

/* Header */
.ms-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.ms-header-text { flex: 1; min-width: 0; }
.ms-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg4); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
}
.ms-close-btn:hover { background: var(--bg); color: var(--text); }

/* Two-column body */
.ms-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}
.ms-left {
  padding: 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ms-right {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ms-section-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 2px;
}

/* Player count buttons */
.ms-mode-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ms-mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font);
  text-align: left;
}
.ms-mode-btn:hover { background: var(--bg4); border-color: var(--text3); }
.ms-mode-num {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900; flex-shrink: 0;
  border: 2px solid;
}
.ms-mode-label { font-size: .88rem; font-weight: 700; color: var(--text); }

.ms-1p.selected { border-color: #1db954; background: rgba(29,185,84,.08); }
.ms-2p.selected { border-color: #4f87ff; background: rgba(79,135,255,.08); }
.ms-3p.selected { border-color: #a855f7; background: rgba(168,85,247,.08); }
.ms-4p.selected { border-color: #fb923c; background: rgba(251,146,60,.08); }

/* Name inputs */
.ms-names { display: flex; flex-direction: column; gap: 8px; }
.ms-name-row { display: flex; align-items: center; gap: 8px; }
.ms-name-key {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; flex-shrink: 0;
  border: 2px solid;
}
.ms-name-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: .88rem;
  outline: none; transition: border-color .2s; font-family: var(--font);
}
.ms-name-input:focus { border-color: var(--green); }

/* Phone / QR box */
.ms-phone-join {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ms-room-badge {
  font-family: monospace; font-size: .85rem; font-weight: 700;
  color: var(--green); background: rgba(29,185,84,.1);
  border: 1px solid rgba(29,185,84,.3); border-radius: 8px;
  padding: 5px 12px; letter-spacing: .05em; width: 100%; text-align: center;
}
.ms-qr {
  width: 130px; height: 130px; border-radius: 10px;
  display: block;
}
.ms-phone-url-wrap { display: flex; align-items: center; gap: 6px; width: 100%; }
.ms-phone-url {
  flex: 1; font-size: .68rem; color: var(--text2); font-family: monospace;
  background: var(--bg); padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ms-phone-copy {
  padding: 5px 10px; font-size: .72rem; border-radius: 6px; flex-shrink: 0;
  background: var(--bg4); border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; transition: color .15s; font-family: var(--font);
}
.ms-phone-copy:hover { color: var(--green); border-color: var(--green); }
.ms-phone-hint { font-size: .68rem; color: var(--text3); text-align: center; }

/* Settings */
.ms-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ms-setting-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}

/* Start button */
.ms-start-btn {
  margin-top: auto; width: 100%; padding: 13px;
  border-radius: 12px; background: var(--green);
  color: #000; font-weight: 800; font-size: .95rem;
  border: none; cursor: pointer; transition: opacity .2s;
  font-family: var(--font);
}
.ms-start-btn:hover { opacity: .85; }

/* Playlist info */
.ms-cover {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.ms-cover-placeholder {
  width: 52px; height: 52px;
  border-radius: 8px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.ms-pl-name { font-size: .95rem; font-weight: 700; margin-bottom: 2px; }
.ms-pl-sub  { font-size: .78rem; color: var(--text2); }



/* station-status for right-aligned (player 2) */
.station-status-r { text-align: right; }
.station-body-r   { text-align: right; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* DISCOVER / PUBLIC PLAYLISTS                                               */
/* ══════════════════════════════════════════════════════════════════════════ */
.discover-section { margin-bottom: 40px; }

.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text2);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.cat-tab:hover { border-color: rgba(255,255,255,.2); color: var(--text); }
.cat-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.cat-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.cat-grid { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* PLAYER STATIONS (2P)                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */
.player-stations {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}

.station-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--text3);
  flex-shrink: 0;
  width: 28px;
}

.player-station {
  flex: 1;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  background: var(--bg2);
  position: relative;
  overflow: hidden;
}
.player-station::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .3s;
}

/* Player 1 = blue, Player 2 = amber */
#station-p1 { --pc: #3b82f6; --pc-bg: rgba(59,130,246,.08); --pc-glow: rgba(59,130,246,.35); }
#station-p2 { --pc: #f59e0b; --pc-bg: rgba(245,158,11,.08);  --pc-glow: rgba(245,158,11,.35);  flex-direction: row-reverse; }
#station-p2 .station-body { text-align: right; }
#station-p2 .station-status { text-align: right; }

.player-station.idle     { border-color: var(--border); }
.player-station.waiting  { border-color: var(--pc); background: var(--pc-bg); box-shadow: 0 0 24px var(--pc-glow); animation: stationPulse 1.2s ease-in-out infinite; }
.player-station.buzzed   { border-color: var(--pc); background: var(--pc-bg); box-shadow: 0 0 32px var(--pc-glow); }
.player-station.correct  { border-color: #00ff66; background: rgba(0,255,100,.08); box-shadow: 0 0 32px rgba(0,255,100,.3); }
.player-station.wrong    { border-color: var(--red); background: rgba(255,51,68,.08); box-shadow: 0 0 24px rgba(255,51,68,.3); }
.player-station.dimmed   { opacity: .35; }

@keyframes stationPulse {
  0%,100% { box-shadow: 0 0 16px var(--pc-glow); }
  50%      { box-shadow: 0 0 36px var(--pc-glow); }
}

.station-key-wrap {
  flex-shrink: 0;
}
.station-key {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text2);
  transition: all .2s;
  font-family: monospace;
}
.player-station.buzzed  .station-key,
.player-station.waiting .station-key { background: var(--pc); border-color: var(--pc); color: #000; }
.player-station.correct .station-key { background: #00ff66; border-color: #00ff66; color: #000; }
.player-station.wrong   .station-key { background: var(--red); border-color: var(--red); color: #fff; }

.station-body { flex: 1; min-width: 0; }
.station-name {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 2px;
}
.player-station.buzzed  .station-name,
.player-station.waiting .station-name { color: var(--pc); }
.player-station.correct .station-name { color: #00ff66; }
.player-station.wrong   .station-name { color: var(--red); }

.station-score {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
  transition: transform .2s;
}
.station-score.bump { transform: scale(1.4); }

.station-status {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text3);
  margin-top: 4px;
  min-height: 16px;
  transition: color .2s;
}
.player-station.waiting .station-status { color: var(--pc); }
.player-station.buzzed  .station-status { color: var(--pc); font-weight: 700; }
.player-station.correct .station-status { color: #00ff66; font-weight: 700; }
.player-station.wrong   .station-status { color: var(--red); font-weight: 700; }

/* Buzz ripple effect */
@keyframes buzzRipple {
  0%   { transform: scale(0); opacity: .6; }
  100% { transform: scale(3); opacity: 0; }
}
.station-ripple {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--pc);
  pointer-events: none;
  animation: buzzRipple .5s ease-out forwards;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 2-PLAYER MODE                                                             */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Two-player score display in topbar */
.score-2p {
  display: flex;
  gap: 8px;
}

.p-score-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px 5px 8px;
  transition: border-color .25s, box-shadow .25s;
}
.p-score-pill.p1 { --pc: #3b82f6; }
.p-score-pill.p2 { --pc: #f59e0b; }
.p-score-pill.active {
  border-color: var(--pc);
  box-shadow: 0 0 16px color-mix(in srgb, var(--pc) 40%, transparent);
}

.p-key-badge {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: var(--pc);
  border: 1px solid var(--pc);
  flex-shrink: 0;
}
.p-score-pill.p1 .p-key-badge { background: rgba(59,130,246,.15); }
.p-score-pill.p2 .p-key-badge { background: rgba(245,158,11,.15); }

.p-name {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text2);
}
.p-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  min-width: 28px;
  text-align: right;
  transition: transform .2s;
}
.p-val.bump { transform: scale(1.5); }

/* Buzz Banner */
.buzz-banner {
  margin: -16px 0 18px;
  border-radius: var(--radius);
  overflow: hidden;
  animation: slideDown .2s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.buzz-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-weight: 700;
}
.buzz-inner.p1-buzz { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); }
.buzz-inner.p2-buzz { background: rgba(245,158,11,.15);  border: 1px solid rgba(245,158,11,.4);  }

.buzz-key {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 900;
  flex-shrink: 0;
}
.p1-buzz .buzz-key { background: rgba(59,130,246,.3); color: #93c5fd; border: 1px solid #3b82f6; }
.p2-buzz .buzz-key { background: rgba(245,158,11,.3);  color: #fcd34d; border: 1px solid #f59e0b; }

.buzz-text { font-size: .9rem; }
.p1-buzz .buzz-text { color: #93c5fd; }
.p2-buzz .buzz-text { color: #fcd34d; }

/* Waiting for buzz hint (shown below choices in 2P mode) */
.buzz-hint {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 18px;
}
.buzz-hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text2);
  font-weight: 600;
}
.bh-key {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
}
.bh-key.p1 { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid #3b82f6; }
.bh-key.p2 { background: rgba(245,158,11,.15);  color: #fcd34d; border: 1px solid #f59e0b; }

/* Choice button locked to a specific player */
.choice-btn.p1-active { border-color: #3b82f6; }
.choice-btn.p2-active { border-color: #f59e0b; }

/* 2P Results */
.results-2p {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.r2p-card {
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.r2p-card.p1 { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); }
.r2p-card.p2 { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.3);  }
.r2p-key { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.r2p-card.p1 .r2p-key { color: #93c5fd; }
.r2p-card.p2 .r2p-key { color: #fcd34d; }
.r2p-score { font-size: 2.2rem; font-weight: 900; margin-bottom: 4px; }
.r2p-wins { font-size: .78rem; color: var(--text2); }
.r2p-crown { font-size: 1.5rem; margin-bottom: 4px; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* DMX PANEL                                                                 */
/* ══════════════════════════════════════════════════════════════════════════ */
.dmx-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: slideInRight .25s ease;
}
@keyframes slideInRight { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

.dmx-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
}
.dmx-panel-hd span { display: flex; align-items: center; gap: 6px; }
.dmx-panel-hd button { background: none; border: none; color: var(--text2); font-size: 1.1rem; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.dmx-panel-hd button:hover { background: var(--bg3); color: var(--text); }

.dmx-panel-body { padding: 14px; }

.dmx-ws-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: 12px;
}

.dmx-manual-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.dmx-btn {
  font-size: .75rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.dmx-btn:hover { transform: translateY(-1px); }
.dmx-btn.idle     { border-color: rgba(29,185,84,.3); }
.dmx-btn.question { border-color: rgba(79,195,247,.3); }
.dmx-btn.correct  { border-color: rgba(0,255,100,.3); color: #00ff66; }
.dmx-btn.wrong    { border-color: rgba(255,51,68,.3);  color: var(--red); }
.dmx-btn.gameover { border-color: rgba(255,153,0,.3); color: var(--gold); }

.dmx-log-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 6px; }
.dmx-log {
  height: 120px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: .68rem;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  color: var(--text2);
}
.dmx-log::-webkit-scrollbar { width: 3px; }
.dmx-log::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
.dmx-log-entry { margin-bottom: 2px; }
.dmx-log-entry .dle-event { color: var(--green); }
.dmx-log-entry .dle-time  { color: var(--text3); }

/* ══════════════════════════════════════════════════════════════════════════ */
/* DIALOG                                                                    */
/* ══════════════════════════════════════════════════════════════════════════ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.dialog h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.dialog p  { font-size: .85rem; color: var(--text2); margin-bottom: 24px; }
.dialog-btns { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* Flash overlay for DMX feedback                                            */
/* ── Blind Mode Free-Text Input ──────────────────────────────────────────── */
.blind-input-wrap {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; background: var(--bg3); border-radius: var(--radius);
  border: 1px solid var(--border); transition: opacity .2s;
}
.blind-input-wrap.waiting-for-buzz { opacity: .35; pointer-events: none; }

.blind-hint {
  font-size: .85rem; color: var(--text2); font-weight: 500;
  text-align: center; letter-spacing: .03em;
}

.blind-input-row {
  display: flex; gap: 10px;
}

.blind-text-input {
  flex: 1; background: var(--bg4); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: var(--text); font-size: 1rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.blind-text-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,185,84,.15);
}
.blind-text-input:disabled { opacity: .5; }
.blind-text-input.shake {
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.blind-submit-btn {
  background: var(--green); color: #000; font-weight: 700;
  border: none; border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: opacity .2s, transform .1s;
}
.blind-submit-btn:hover:not(:disabled) { opacity: .85; }
.blind-submit-btn:active:not(:disabled) { transform: scale(.97); }
.blind-submit-btn:disabled { opacity: .4; cursor: not-allowed; }

.blind-tolerance {
  font-size: .78rem; color: var(--text3); text-align: center;
  transition: color .3s;
}

.blind-mic-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--bg4); border: 1.5px solid var(--border);
  color: var(--text2); cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .2s, border-color .2s, color .2s;
}
.blind-mic-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.blind-mic-btn:disabled { opacity: .3; cursor: not-allowed; }
.blind-mic-btn.recording {
  background: rgba(255,51,68,.15); border-color: var(--red); color: var(--red);
  animation: mic-pulse 1s ease-in-out infinite;
}
.blind-mic-btn.loading {
  background: rgba(29,185,84,.1); border-color: var(--green); color: var(--green);
  animation: mic-spin 1s linear infinite;
  cursor: wait;
}
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,51,68,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255,51,68,0); }
}
@keyframes mic-spin {
  0%   { opacity: 1; }
  50%  { opacity: .4; }
  100% { opacity: 1; }
}
.blind-mic-label {
  font-size: .75rem; color: var(--text3); text-align: center;
  transition: color .2s; letter-spacing: .02em;
}

/* ── New Game Modes UI ────────────────────────────────────────────────────── */

/* Streak bar */
.streak-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 16px; margin: 0 auto 4px;
  background: rgba(255,180,0,.08); border: 1px solid rgba(255,180,0,.2);
  border-radius: 999px; font-size: .85rem; width: fit-content;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.streak-bar.active { opacity: 1; }
.streak-count { font-weight: 800; font-size: 1rem; color: #ffd166; }
.streak-label { color: var(--text2); font-size: .78rem; }
.streak-mult  {
  background: #ffd166; color: #000; font-weight: 800; font-size: .75rem;
  padding: 2px 7px; border-radius: 999px;
}

/* Lives bar */
.lives-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 5px 14px; margin: 0 auto 4px;
  background: rgba(255,50,80,.07); border: 1px solid rgba(255,50,80,.2);
  border-radius: 999px; font-size: .85rem; width: fit-content;
}
.lives-label  { color: var(--text2); font-size: .78rem; }
.lives-hearts { font-size: 1rem; letter-spacing: 2px; }

/* Mode badge */
.mode-badge {
  position: absolute; top: -10px; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 3px 10px;
  font-size: .75rem; font-weight: 700; color: var(--text2);
  pointer-events: none;
}

/* Blind placeholder */
.blind-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.03); border-radius: inherit;
  z-index: 1;
}
.blind-icon { font-size: 3rem; }
.blind-text { color: var(--text2); font-size: .85rem; font-weight: 600; letter-spacing: .05em; }

/* Floating points pop */
.points-pop {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 40%; pointer-events: none; z-index: 99;
  font-size: 1.4rem; font-weight: 800; color: #ffd166;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
  animation: points-rise .9s ease-out forwards;
}
.points-pop.good { color: #4ade80; }
.points-pop.epic { color: #f97316; font-size: 1.8rem; }
@keyframes points-rise {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(-40px) scale(1.15); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-70px) scale(.9); }
}

/* Game mode segmented (4 options needs smaller text) */
.ms-setting-game-mode .seg-btn { font-size: .78rem; padding: 6px 8px; }

/* ══════════════════════════════════════════════════════════════════════════ */
.flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  opacity: 0;
  transition: opacity .15s;
}
.flash-overlay.active { opacity: .15; transition: opacity 0s; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* Scrollbar global                                                          */
/* ══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* Responsive                                                                */
/* ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .navbar { padding: 0 16px; }
  .dashboard-main { padding: 24px 16px 60px; }
  .playlists-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .choices { grid-template-columns: 1fr; }
  .quiz-wrap { padding: 0 16px 48px; }
  .settings-bar { gap: 14px; }
  .url-input-row { flex-direction: column; }
  .dmx-panel { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .login-card { padding: 28px 20px; }
}


/* Hosting and four-player improvements */
.playback-status{color:var(--text2);font-size:.85rem;padding:12px 24px;margin:0;text-align:center}
.score-2p{flex-wrap:wrap;gap:8px}.player-stations{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
button.player-station{font:inherit;color:inherit;text-align:left;cursor:pointer;background:var(--bg2,#16191f)}
.station-body{display:flex;flex-direction:column}.station-status{font-size:.75rem}
.p3{--pc:#a855f7}.p4{--pc:#fb923c}.lives-bar{flex-wrap:wrap;gap:16px}
.r2p-card.p3{background:rgba(168,85,247,.1);border:1px solid rgba(168,85,247,.3)}
.r2p-card.p4{background:rgba(251,146,60,.1);border:1px solid rgba(251,146,60,.3)}
.r2p-card.p3 .r2p-key{color:#d8b4fe}.r2p-card.p4 .r2p-key{color:#fdba74}
#station-p3{--pc:#a855f7;--pc-bg:rgba(168,85,247,.08);--pc-glow:rgba(168,85,247,.35)}
#station-p4{--pc:#fb923c;--pc-bg:rgba(251,146,60,.08);--pc-glow:rgba(251,146,60,.35)}
.results-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.results-2p{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.game-error{border:1px solid #9c503a;border-radius:16px;padding:20px;margin:20px 0;background:#351d1b;color:#ffd7c9}
.game-error button{margin:8px 8px 0 0}.choice-btn:focus-visible,.player-station:focus-visible{outline:3px solid #fff;outline-offset:3px}
@media(max-width:600px){.player-stations,.results-2p{grid-template-columns:1fr}.results-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.quiz-topbar{flex-wrap:wrap}.score-2p{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.flash-overlay{display:none!important}}
