/* ─── CSS Variables (overridden per scene) ─────────────────────────────────── */
:root {
  --accent:      #f4a261;
  --accent-dim:  rgba(244,162,97,0.18);
  --glow:        rgba(244,162,97,0.35);
  --glass-bg:    rgba(255,255,255,0.07);
  --glass-border:rgba(255,255,255,0.14);
  --text:        #ffffff;
  --text-muted:  rgba(255,255,255,0.55);
  --radius:      14px;
  --trans:       0.45s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Syne', sans-serif;
  color: var(--text);
  background: #000;
  user-select: none;
}

/* ─── Layout Grid ───────────────────────────────────────────────────────────── */
body {
  display: grid;
  grid-template-columns: 90px 1fr 220px;
  grid-template-rows: 56px 1fr 88px;
  grid-template-areas:
    "header  header  header"
    "scenes  main    mixer"
    "player  player  player";
  position: relative;
  z-index: 1;
}

/* ─── Glassmorphism ─────────────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.top-bar {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0;
  z-index: 100;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark {
  font-size: 22px; color: var(--accent);
  animation: spin-slow 12s linear infinite;
  display: inline-block;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.logo-text {
  font-size: 15px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
}

.participants-wrap {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

.participants-label {
  font-size: 9px; letter-spacing: 0.15em; font-weight: 700;
  color: var(--text-muted); font-family: 'DM Mono', monospace;
}

.participants { display: flex; gap: -6px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  margin-left: -6px;
  box-shadow: 0 0 8px var(--glow);
  transition: transform var(--trans);
}
.avatar:hover { transform: translateY(-3px); z-index: 10; }
.avatar:first-child { margin-left: 0; }
.avatar-placeholder { background: rgba(255,255,255,0.1); }

.spotify-status { display: flex; align-items: center; gap: 10px; margin-left: 20px; }

.focus-timer {
  position: relative;
}

.focus-timer-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 126px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: all var(--trans);
}

.focus-timer-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.focus-timer.open .focus-timer-toggle {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(0,0,0,0.18);
}

.focus-timer-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.05;
}

.focus-timer-label {
  font-size: 8px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.focus-timer-chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.focus-timer-live {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  background: transparent;
  opacity: 0.45;
  transition: all var(--trans);
}

.focus-timer.active .focus-timer-live {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--glow);
  opacity: 1;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.focus-timer-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 258px;
  padding: 14px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  z-index: 260;
  transition: opacity var(--trans), transform var(--trans);
}

.focus-timer.open .focus-timer-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.focus-timer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.focus-timer-panel-title,
.focus-timer-panel-status,
.focus-timer-meta {
  font-family: 'DM Mono', monospace;
}

.focus-timer-panel-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.focus-timer-panel-status {
  font-size: 10px;
  color: var(--accent);
}

.focus-timer-display {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.focus-timer-presets,
.focus-timer-actions {
  display: flex;
  gap: 8px;
}

.focus-preset-btn,
.focus-action-btn {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  transition: all var(--trans);
}

.focus-preset-btn {
  padding: 7px 0;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.08em;
}

.focus-action-btn {
  padding: 8px 0;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
}

.focus-preset-btn:hover,
.focus-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.focus-preset-btn.active,
.focus-action-btn.primary {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.focus-action-btn.primary:hover {
  background: var(--accent);
  color: #000;
}

.focus-preset-btn:disabled,
.focus-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.focus-timer-meta {
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}

.btn-connect {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 50px;
  border: 1.5px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent); font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all var(--trans); letter-spacing: 0.03em;
}
.btn-connect:hover {
  background: var(--accent); color: #000;
  box-shadow: 0 0 18px var(--glow);
}

.btn-hud-toggle {
  border-style: dashed;
  border-width: 1px;
  border-color: var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.btn-hud-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

body.hud-minimal .top-bar,
body.hud-minimal .scene-panel,
body.hud-minimal .main-content,
body.hud-minimal .mixer-panel {
  opacity: 0;
  pointer-events: none;
}

body.hud-minimal .player-bar {
  z-index: 200;
}

.hud-restore-dash {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  box-shadow: 0 0 10px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  cursor: pointer;
  transition: all var(--trans);
}

.hud-restore-dash:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

body.hud-minimal .hud-restore-dash {
  opacity: 1;
  pointer-events: auto;
}

.now-playing-mini {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-family: 'DM Mono', monospace;
  color: var(--text-muted);
}
.np-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ─── Scene Panel (left) ────────────────────────────────────────────────────── */
.scene-panel {
  grid-area: scenes;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 6px;
  overflow-y: auto; scrollbar-width: none;
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  z-index: 50;
}
.scene-panel::-webkit-scrollbar { display: none; }

.panel-label {
  font-size: 8px; letter-spacing: 0.18em; font-weight: 700;
  color: var(--text-muted); font-family: 'DM Mono', monospace;
  text-align: center; padding: 4px 0 8px;
}

.scene-btn {
  width: 100%; aspect-ratio: 1;
  border-radius: 10px; border: 1.5px solid transparent;
  background: rgba(255,255,255,0.05);
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  transition: all var(--trans); position: relative; overflow: hidden;
}
.scene-btn:hover {
  background: var(--accent-dim);
  border-color: var(--glass-border);
  transform: scale(1.05);
}
.scene-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--glow);
}
.scene-btn .s-emoji { font-size: 20px; }
.scene-btn .s-label {
  font-size: 7px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  line-height: 1;
}
.scene-btn.active .s-label { color: var(--accent); }

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  grid-area: main;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 32px 24px 24px;
  position: relative; z-index: 10;
}

.scene-hero { text-align: center; }

.scene-emoji {
  font-size: 52px;
  display: block; margin-bottom: 8px;
  filter: drop-shadow(0 0 20px var(--glow));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scene-name {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800; line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 30px var(--glow);
}

.scene-tagline {
  margin-top: 6px; font-size: 13px;
  color: var(--text-muted); letter-spacing: 0.04em;
  font-family: 'DM Mono', monospace;
}

/* ─── Vote Card ─────────────────────────────────────────────────────────────── */
.vote-card {
  width: 100%; max-width: 480px; border-radius: var(--radius);
  padding: 16px 20px;
}

.vote-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--text-muted); font-family: 'DM Mono', monospace;
  margin-bottom: 14px;
}
.vote-icon { font-size: 14px; }

.vote-options { display: flex; flex-direction: column; gap: 8px; }

.jam-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.room-chip {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
}

.nickname-input {
  flex: 1;
  min-width: 80px;
  max-width: 140px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  outline: none;
  transition: all 0.2s ease;
}

.nickname-input::placeholder {
  color: var(--text-muted);
}

.nickname-input:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--glow);
}

.jam-host-btn {
  margin-left: auto;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 5px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--trans);
}

.jam-share-btn {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 5px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--trans);
}

.jam-share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.jam-host-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.lofi-radio {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 10px;
  margin-bottom: 10px;
}

.lofi-radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.lofi-radio-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.lofi-radio-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

.lofi-radio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lofi-radio-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--trans);
}

.lofi-radio-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.lofi-radio-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.lofi-radio.discord-limited .lofi-radio-subtitle {
  color: #ffd166;
}

.lofi-radio.discord-limited .lofi-radio-btn {
  display: none;
}

.btn-disconnect-spotify {
  border: 1px solid rgba(255,100,100,0.6);
  background: rgba(255,100,100,0.1);
  color: #ff6464;
  border-radius: 50px;
  padding: 7px 14px;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
  letter-spacing: 0.03em;
  display: none;
}

.btn-disconnect-spotify:hover {
  background: rgba(255,100,100,0.25);
  border-color: #ff6464;
}

.btn-disconnect-spotify.show {
  display: flex;
  align-items: center;
  gap: 7px;
}

.jam-search {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.jam-search-mode {
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  flex-shrink: 0;
}

.jam-mode-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 8px 9px;
  cursor: pointer;
  transition: all var(--trans);
}

.jam-mode-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.jam-mode-btn.active {
  color: #000;
  background: var(--accent);
}

.jam-search-input {
  flex: 1;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  outline: none;
}

.jam-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.jam-search-btn {
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--trans);
}

.jam-search-btn:hover {
  background: var(--accent);
  color: #000;
}

.jam-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.jam-result {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.03);
}

.jam-result-art {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}

.jam-result-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jam-result-meta {
  min-width: 0;
  flex: 1;
}

.jam-result-name {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-result-artist {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-result-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
}

.jam-result-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.jam-result-btn:disabled {
  opacity: 0.55;
  cursor: default;
  border-color: var(--glass-border);
  color: var(--text-muted);
}

.vote-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  cursor: pointer; transition: all var(--trans);
}
.vote-option:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.vote-option.voted {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow);
}
.vote-option .vo-art {
  width: 36px; height: 36px; border-radius: 6px;
  background: rgba(255,255,255,0.1); overflow: hidden; flex-shrink: 0;
}
.vote-option .vo-art img { width: 100%; height: 100%; object-fit: cover; }
.vote-option .vo-info { flex: 1; min-width: 0; }
.vote-option .vo-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vote-option .vo-artist {
  font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace;
}
.vote-option .vo-count {
  font-size: 13px; font-weight: 700; color: var(--accent);
  font-family: 'DM Mono', monospace; flex-shrink: 0;
}
.vote-bar {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: var(--accent); border-radius: 0 0 10px 10px;
  transition: width 0.5s ease;
}

.vote-empty {
  font-size: 12px; color: var(--text-muted); text-align: center;
  padding: 16px 0; font-family: 'DM Mono', monospace;
}

.vote-footer {
  margin-top: 12px; font-size: 10px; color: var(--text-muted);
  font-family: 'DM Mono', monospace; text-align: right; letter-spacing: 0.06em;
}

.queue-section {
  margin-top: 10px;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.queue-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-count {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.03);
}

.queue-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-kind {
  font-size: 9px;
  line-height: 1;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--accent-dim);
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.queue-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
}

.queue-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.jam-result-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-modal {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 260;
  transition: opacity var(--trans);
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.search-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: min(760px, calc(100vw - 28px));
  max-height: min(78vh, 760px);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(16, 22, 34, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--trans);
}

.search-modal.open .search-modal-card {
  transform: translate(-50%, -50%) scale(1);
}

.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
}

.search-modal-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-family: 'DM Mono', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
}

.search-modal-close {
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.search-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-modal-results {
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Mixer Panel (right) ───────────────────────────────────────────────────── */
.mixer-panel {
  grid-area: mixer;
  display: flex; flex-direction: column;
  padding: 14px 14px 10px;
  border-left: 1px solid var(--glass-border);
  border-radius: 0;
  z-index: 50;
  gap: 8px;
}

.mixer-channels { display: flex; flex-direction: column; gap: 12px; flex: 1; }

.channel {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  transition: border-color var(--trans);
}
.channel.active { border-color: var(--accent); }

.channel-top {
  display: flex; align-items: center; justify-content: space-between;
}

.channel-info { display: flex; align-items: center; gap: 7px; }
.channel-icon { font-size: 16px; }
.channel-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
}

/* Toggle Switch */
.toggle {
  position: relative; width: 32px; height: 17px; cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  width: 100%; height: 100%; border-radius: 50px;
  background: rgba(255,255,255,0.12);
  transition: background var(--trans);
}
.toggle input:checked ~ .toggle-track {
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: white; transition: transform var(--trans);
  pointer-events: none;
}
.toggle input:checked ~ .toggle-track ~ .toggle-thumb {
  transform: translateX(15px);
}

/* Volume slider (ambient) */
.channel-slider {
  -webkit-appearance: none;
  width: 100%; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.12);
  outline: none; cursor: pointer;
}
.channel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
  cursor: pointer;
}
.channel-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: none;
}

.mixer-footer {
  display: flex; gap: 8px; padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}
.btn-all-off, .btn-all-on {
  flex: 1; padding: 7px 0; border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted); font-family: 'Syne', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  cursor: pointer; transition: all var(--trans);
}
.btn-all-on:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.btn-all-off:hover { background: rgba(255,100,100,0.1); border-color: rgba(255,100,100,0.4); color: #ff6464; }

/* ─── Player Bar ────────────────────────────────────────────────────────────── */
.player-bar {
  grid-area: player;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  border-top: 1px solid var(--glass-border);
  border-radius: 0;
  z-index: 100;
}

.track-section { display: flex; align-items: center; gap: 12px; width: 240px; flex-shrink: 0; }

.track-art {
  width: 52px; height: 52px; border-radius: 8px;
  background: var(--accent-dim); overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
}
.track-art img { width: 100%; height: 100%; object-fit: cover; }
.art-default { font-size: 22px; opacity: 0.4; }

.track-meta { min-width: 0; }
.track-name {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-artist {
  font-size: 11px; color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.controls-section { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.ctrl-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.07);
  color: var(--text); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--trans);
}
.ctrl-btn:hover { background: var(--accent-dim); color: var(--accent); }

.ctrl-play {
  width: 48px; height: 48px;
  background: var(--accent); color: #000;
  box-shadow: 0 0 18px var(--glow);
}
.ctrl-play:hover { transform: scale(1.08); }

.progress-section {
  flex: 1; display: flex; align-items: center; gap: 10px;
}

.time-label {
  font-size: 10px; color: var(--text-muted);
  font-family: 'DM Mono', monospace; flex-shrink: 0; min-width: 30px;
}

.progress-track {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.12); cursor: pointer; position: relative;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: var(--accent);
  width: 0%; transition: width 0.5s linear;
  box-shadow: 0 0 8px var(--glow);
}

.volume-section {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; color: var(--text-muted);
}

.volume-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.vol-slider {
  -webkit-appearance: none; width: 80px; height: 3px;
  border-radius: 2px; background: rgba(255,255,255,0.12); cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px;
  border-radius: 50%; background: var(--text); cursor: pointer;
}

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,20,0.9); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px); border-radius: 50px;
  padding: 10px 22px; font-size: 13px; font-family: 'DM Mono', monospace;
  color: var(--text); opacity: 0; pointer-events: none;
  transition: all 0.3s ease; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Scene Color Themes ────────────────────────────────────────────────────── */
.scene-beach    { --accent:#f4a261; --accent-dim:rgba(244,162,97,.15); --glow:rgba(244,162,97,.35); --glass-bg:rgba(255,255,255,.07); }
.scene-rain     { --accent:#4cc9f0; --accent-dim:rgba(76,201,240,.15); --glow:rgba(76,201,240,.35); --glass-bg:rgba(30,50,80,.25); }
.scene-traffic  { --accent:#ff6b6b; --accent-dim:rgba(255,107,107,.15); --glow:rgba(255,107,107,.35); --glass-bg:rgba(10,0,30,.35); }
.scene-cafe     { --accent:#e76f51; --accent-dim:rgba(231,111,81,.15); --glow:rgba(231,111,81,.35); --glass-bg:rgba(40,15,5,.35); }
.scene-forest   { --accent:#95d5b2; --accent-dim:rgba(149,213,178,.15); --glow:rgba(149,213,178,.35); --glass-bg:rgba(0,30,15,.3); }
.scene-nightsky { --accent:#c77dff; --accent-dim:rgba(199,125,255,.15); --glow:rgba(199,125,255,.35); --glass-bg:rgba(10,0,30,.4); }

/* ─── Transitions on scene switch ──────────────────────────────────────────── */
body { transition: --accent var(--trans); }
.scene-bg { transition: opacity 0.6s ease; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

/* ─── Responsive: Tablet ───────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  body {
    grid-template-columns: 78px 1fr 190px;
  }

  .main-content {
    padding: 24px 16px 18px;
  }

  .vote-card {
    max-width: 440px;
    padding: 14px 16px;
  }

  .player-bar {
    gap: 14px;
    padding: 0 14px;
  }

  .track-section {
    width: 210px;
  }

  .mixer-panel {
    padding: 12px 10px 10px;
  }
}

/* ─── Responsive: Small Tablet ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  body {
    grid-template-columns: 70px 1fr 166px;
    grid-template-rows: 56px 1fr 96px;
  }

  .scene-name {
    font-size: clamp(24px, 5vw, 34px);
  }

  .mixer-panel {
    padding: 10px 8px;
  }

  .channel {
    padding: 8px 9px;
  }

  .track-section {
    width: 180px;
  }

  .vol-slider {
    width: 64px;
  }
}

/* ─── Responsive: Phone ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto auto auto auto;
    grid-template-areas:
      "header"
      "scenes"
      "main"
      "mixer"
      "player";
  }

  .top-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 10px;
    min-height: 56px;
    padding: 0 10px;
    flex-wrap: wrap;
  }

  .logo-text {
    font-size: 13px;
  }

  .participants-wrap {
    gap: 6px;
  }

  .spotify-status {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-bottom: 8px;
  }

  .focus-timer-panel {
    right: 0;
  }

  .scene-panel {
    border-right: 0;
    border-bottom: 1px solid var(--glass-border);
    padding: 8px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
  }

  .scene-list {
    display: flex;
    gap: 8px;
    width: max-content;
  }

  .panel-label {
    padding: 0;
    min-width: 42px;
  }

  .scene-btn {
    width: 70px;
    min-width: 70px;
    aspect-ratio: 1;
  }

  .main-content {
    align-items: stretch;
    padding: 16px 10px;
    gap: 14px;
  }

  .scene-hero {
    margin-bottom: 8px;
  }

  .scene-emoji {
    font-size: 42px;
  }

  .scene-name {
    font-size: 30px;
  }

  .vote-card {
    max-width: none;
    width: 100%;
    padding: 12px;
  }

  .jam-toolbar {
    flex-wrap: wrap;
  }

  .jam-host-btn {
    margin-left: 0;
  }

  .mixer-panel {
    border-left: 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    border-radius: 0;
    padding: 12px 10px;
    gap: 10px;
  }

  .mixer-channels {
    gap: 8px;
  }

  .player-bar {
    position: sticky;
    bottom: 0;
    gap: 10px;
    padding: 10px;
    align-items: center;
    flex-wrap: wrap;
  }

  .track-section {
    width: 100%;
    order: 1;
  }

  .controls-section {
    order: 2;
  }

  .progress-section {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
  }

  .volume-section {
    order: 4;
    margin-left: auto;
  }

  .toast {
    bottom: 86px;
    width: calc(100% - 24px);
    text-align: center;
  }
}

/* ─── Responsive: Small Phone ──────────────────────────────────────────────── */
@media (max-width: 560px) {
  .participants-label {
    display: none;
  }

  .participants {
    transform: scale(0.9);
    transform-origin: right center;
  }

  .btn-connect {
    padding: 6px 9px;
    font-size: 11px;
  }

  .focus-timer-toggle {
    min-width: 112px;
    padding: 6px 9px;
  }

  .focus-timer-label {
    display: none;
  }

  .focus-timer-chip {
    font-size: 11px;
  }

  .focus-timer-panel {
    width: min(258px, calc(100vw - 24px));
    right: -8px;
  }

  .scene-btn {
    width: 62px;
    min-width: 62px;
  }

  .scene-btn .s-emoji {
    font-size: 18px;
  }

  .scene-btn .s-label {
    font-size: 6px;
  }

  .jam-search {
    flex-direction: column;
  }

  .jam-search-mode {
    width: 100%;
  }

  .jam-mode-btn {
    flex: 1;
    text-align: center;
  }

  .jam-search-btn {
    width: 100%;
  }

  .vote-option {
    gap: 8px;
    padding: 8px 10px;
  }

  .vote-option .vo-art {
    width: 30px;
    height: 30px;
  }

  .vote-option .vo-name {
    font-size: 12px;
  }

  .vote-option .vo-artist {
    font-size: 10px;
  }

  .ctrl-btn {
    width: 34px;
    height: 34px;
  }

  .ctrl-play {
    width: 42px;
    height: 42px;
  }

  .track-name {
    font-size: 13px;
  }

  .track-artist {
    font-size: 10px;
  }
}
