/* Tokens live in themes.css (Bright default + Dark / Holiday / …) */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--fg);
  font-family: var(--font);
  background: var(--bg);
  transition: background-color var(--transition), color var(--transition);
}

body { padding-bottom: 110px; }

.atmosphere {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 8% -5%, var(--atm-1), transparent 55%),
    radial-gradient(800px 480px at 92% 0%, var(--atm-2), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, var(--atm-3), transparent 55%),
    var(--bg);
}
.atmosphere::after {
  content: "";
  position: absolute; inset: 0;
  opacity: var(--noise-opacity, 0.03);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; cursor: pointer; }
button, a, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code {
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--code-bg);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app-shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 1.4rem 1.1rem;
  background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bot));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1.1rem;
  backdrop-filter: blur(16px);
}

.sidebar-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--fg);
}
.nav-toggle:hover { background: var(--surface-hover); border-color: var(--accent); }
.nav-link.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--fg);
}

.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  filter: drop-shadow(0 0 14px var(--brand-glow));
}
.brand-text {
  font-family: var(--display);
  font-size: 1.2rem; line-height: 1.05; letter-spacing: 0.02em;
}
.brand-text em { font-style: normal; color: var(--accent); }

.search { position: relative; }
.search-ico {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.search input:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; overflow: auto; }
.nav-label {
  margin: 1rem 0 0.35rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.nav-link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.58rem 0.8rem;
  border-radius: 12px;
  color: var(--muted);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-link:hover, .nav-link:focus-visible {
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  outline: none;
}
.nav-link:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.sidebar-user {
  display: flex; gap: 0.7rem; align-items: center;
  padding: 0.7rem; border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: var(--accent-ink); font-weight: 700;
}
.sidebar-user strong { display: block; font-size: 0.9rem; }
.sidebar-foot { margin: 0; font-size: 0.72rem; color: var(--muted); }

.main { padding: 2rem 2.4rem 3rem; max-width: 1280px; }

.hero-stage {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
  min-height: min(52vh, 420px);
}
.brand-hero {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.brand-hero em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(245, 197, 24, 0.35);
}
.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.lede {
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
  font-size: 1.05rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.hero-visual {
  position: relative; height: 280px;
  display: grid; place-items: center;
}
.orbit {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  border: 1px dashed rgba(124, 108, 255, 0.45);
  animation: spin 28s linear infinite;
}
.vinyl {
  width: 180px; height: 180px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f5c518 0 14%, #1a1228 15% 18%, #2a1a44 19% 55%, #0a0814 56%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 3px, rgba(255,255,255,0.04) 3px 4px);
  box-shadow: 0 0 60px rgba(124, 108, 255, 0.35), var(--shadow);
  animation: spin 12s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.section { margin-bottom: 2rem; }
.section-head { margin-bottom: 1.25rem; }
.section-head h1, .section-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}

.channel-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.channel-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 197, 24, 0.4);
  box-shadow: 0 28px 70px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,197,24,0.15);
}
.channel-art {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #3b1d63, #1a0b2e 60%, #4a2a12);
  background-size: cover; background-position: center;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.channel-card:hover .channel-art { transform: scale(1.02); }
.channel-art, .channel-card:hover .channel-art {
  transition: transform 320ms ease;
}
.play-fab {
  position: absolute; right: 12px; bottom: 12px;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 8px 24px rgba(245,197,24,0.35);
}
.channel-card:hover .play-fab { opacity: 1; transform: translateY(0); }
.art-fallback {
  font-family: var(--display); font-size: 3rem; color: rgba(255,255,255,0.75);
}
.channel-body { padding: 1rem 1.05rem 1.2rem; }
.channel-body h2, .channel-body h3 {
  margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 600;
}
.channel-body p {
  margin: 0 0 0.75rem; color: var(--muted); font-size: 0.88rem;
  line-height: 1.4; min-height: 2.5em;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span {
  font-size: 0.7rem; padding: 0.22rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}

.empty {
  grid-column: 1 / -1; padding: 3rem;
  border: 1px dashed var(--border); border-radius: var(--radius);
  text-align: center; color: var(--muted);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--border);
  background: transparent; color: var(--fg);
  border-radius: 999px; padding: 0.62rem 1.2rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); font-weight: 600;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.player {
  position: fixed; left: 272px; right: 0; bottom: 0; z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(180deg, var(--player-wash, transparent), var(--player-bg) 42%);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 -12px 40px var(--player-glow, transparent);
  animation: slideUp 280ms ease;
}
.player.has-palette {
  border-top-color: color-mix(in srgb, var(--player-glow, var(--border)) 55%, var(--border));
}
.player[hidden] { display: none !important; }
.player-rail {
  height: 4px;
  width: 100%;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
}
.player-rail::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: var(--player-buffered, 0%);
  background: rgba(255,255,255,0.18);
  pointer-events: none;
}
.player-rail i {
  position: relative;
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--player-glow, var(--secondary)), var(--accent));
  transition: width 80ms linear;
  z-index: 1;
}
.player-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.25rem 0.9rem;
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 981px) {
  .player-body {
    grid-template-columns: auto minmax(280px, 1.2fr) auto;
    gap: 1.25rem;
    padding: 0.85rem 1.5rem 1rem;
  }
  .player-cover-wrap, .player-cover { width: 72px; height: 72px; }
  .player-cover { border-radius: 14px; }
  .player-meta strong { font-size: 1.05rem; }
  .player-controls { gap: 0.4rem; }
  #btn-prev { display: inline-grid !important; }
}
.player-cover-wrap { cursor: pointer; }
.player-more { display: inline-grid; }
.player-tools-sheet {
  display: none;
  padding: 0.65rem 1rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  animation: playerSheetIn 180ms ease;
}
.player.tools-open .player-tools-sheet {
  display: block;
}
.player.tools-open .player-tools-sheet[hidden] {
  display: block;
}
.player-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.player-tools-head strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.player-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.55rem 0.45rem;
  align-items: stretch;
}
.player-tools-grid > .icon-btn {
  width: auto;
  min-width: 64px;
  height: auto;
  min-height: 64px;
  border-radius: 16px;
  padding: 0.45rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
}
.player-tools-grid > .icon-btn .tool-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--fg) 75%, var(--muted));
  line-height: 1.1;
}
.player-tools-grid > .icon-btn.is-on .tool-label {
  color: var(--accent);
}
.player-tools-grid .eco-meter {
  grid-column: span 2;
  min-width: 0;
  max-width: none;
  justify-content: center;
}
.player-tools-grid .hub-coins {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-radius: 16px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 0.85rem;
}
@keyframes playerSheetIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .player-tools-sheet { animation: none; }
}
.icon-btn.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.icon-btn.is-on .ico-heart { color: #e11d48; filter: drop-shadow(0 0 8px rgba(225, 29, 72, 0.45)); }
#btn-queue-hit { position: relative; }
.queue-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--fg);
  display: grid; place-items: center;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.icon-btn:hover { border-color: var(--accent); transform: scale(1.05); }
.icon-btn.play {
  width: 52px; height: 52px;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff));
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent);
  position: relative;
}
.icon-btn.play:hover { transform: scale(1.06); }
.icon-btn.play.is-playing {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent),
    0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.icon-btn.play .play-ico {
  display: grid;
  place-items: center;
  line-height: 0;
  position: relative;
  width: 28px;
  height: 28px;
}
.icon-btn.play .play-ico svg {
  grid-area: 1 / 1;
  display: block;
}
/* Mutual exclusion: only one glyph visible */
.icon-btn.play .ico-pause { display: none !important; }
.icon-btn.play.is-playing .ico-play { display: none !important; }
.icon-btn.play.is-playing .ico-pause { display: block !important; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden],
svg[hidden] {
  display: none !important;
}
.lyric-snap {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 1.25rem;
}
.lyric-snap[hidden] { display: none !important; }
.lyric-snap-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(8px);
  animation: fadeIn 220ms ease;
}
.lyric-snap-panel {
  position: relative; z-index: 1;
  width: min(920px, 100%);
  max-height: min(86vh, 720px);
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: snapIn 280ms cubic-bezier(.2,.8,.2,1);
}
@keyframes snapIn {
  from { transform: translateY(18px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lyric-snap-art {
  min-height: 240px;
  background: linear-gradient(145deg, var(--cover-grad-a), var(--cover-grad-b));
  background-size: cover; background-position: center;
}
.lyric-snap-body {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1rem 1.1rem 1.15rem; min-height: 0;
}
.lyric-snap-head {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: start;
}
.lyric-snap-head strong { display: block; font-size: 1.05rem; }
.lyric-snap #lyric-snap-viewport {
  flex: 1; min-height: 220px; max-height: 48vh; overflow: auto;
}
.whm-toast {
  position: fixed; left: 50%; bottom: 5.5rem; z-index: 90;
  transform: translateX(-50%) translateY(12px);
  padding: 0.55rem 1rem; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--fg); font-size: 0.85rem; opacity: 0; pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.whm-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
body.lyric-snap-open { overflow: hidden; }
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.hub-coins {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent, #3b82f6) 18%, transparent);
  border: 1px solid var(--border); color: var(--fg);
  white-space: nowrap;
}
.karaoke-panel {
  display: grid; gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, #0a1628);
}
.karaoke-panel[hidden] { display: none !important; }
#karaoke-graph {
  width: 100%; height: 110px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
}
.karaoke-row {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: center;
}
.karaoke-live { margin: 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.karaoke-score {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.55rem 0.7rem; border-radius: 12px;
  background: color-mix(in srgb, #22c55e 16%, transparent);
}
.karaoke-score strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.karaoke-legend { font-size: 0.75rem; margin: 0; }
.karaoke-legend .lg-track::before,
.karaoke-legend .lg-you::before {
  content: ""; display: inline-block; width: 10px; height: 3px;
  margin-right: 0.25rem; vertical-align: middle; border-radius: 2px;
}
.karaoke-legend .lg-track::before { background: rgb(120, 180, 255); }
.karaoke-legend .lg-you::before { background: rgb(255, 170, 90); }
#btn-sleep.is-on { color: var(--accent, #3b82f6); }
.fx-toggles { display: inline-flex; gap: 0.2rem; align-items: center; }
.player-tools-grid .fx-toggles {
  display: contents;
}
.player-tools-grid .fx-btn {
  width: auto !important;
  min-width: 64px;
  height: auto !important;
  min-height: 64px;
  border-radius: 16px;
  padding: 0.45rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.fx-btn {
  font-size: 0.68rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 2rem;
}
.fx-btn.is-on, .fx-btn[aria-pressed="true"] {
  color: var(--accent, #3b82f6);
  background: color-mix(in srgb, var(--accent, #3b82f6) 16%, transparent);
}

.trivia-pop {
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center; padding: 1rem;
}
.trivia-pop[hidden] { display: none !important; }
.trivia-pop-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 8, 14, 0.5);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms ease;
}
.trivia-card {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 110px 1fr;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  animation: snapIn 260ms cubic-bezier(.2,.8,.2,1);
}
.trivia-art {
  min-height: 160px;
  background: linear-gradient(145deg, var(--cover-grad-a), var(--cover-grad-b));
  background-size: cover; background-position: center;
}
.trivia-body {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 0.9rem 1rem 1rem;
}
.trivia-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.trivia-body .eyebrow {
  margin: 0; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.68rem; color: var(--accent, #3b82f6); font-weight: 600;
}
.trivia-options { display: grid; gap: 0.4rem; }
.trivia-opt {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--fg); cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}
.trivia-opt:hover:not(:disabled) {
  border-color: var(--accent, #3b82f6);
  transform: translateY(-1px);
}
.trivia-opt.is-correct {
  border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 18%, transparent);
}
.trivia-opt.is-wrong {
  border-color: #f43f5e;
  background: color-mix(in srgb, #f43f5e 14%, transparent);
}
.trivia-pop.is-result .trivia-opt:not(.is-correct):not(.is-wrong) { opacity: 0.55; }

@media (max-width: 640px) {
  .trivia-card { grid-template-columns: 1fr; }
  .trivia-art { min-height: 120px; }
}

.player-cover-wrap { position: relative; width: 64px; height: 64px; }
.player-cover {
  width: 64px; height: 64px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cover-grad-a), var(--cover-grad-b));
  background-size: cover; background-position: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.eq {
  position: absolute; right: -6px; bottom: -4px;
  display: flex; gap: 2px; align-items: flex-end; height: 14px;
  padding: 2px 4px; border-radius: 6px;
  background: rgba(0,0,0,0.55);
}
.eq i {
  display: block; width: 3px; background: var(--accent); border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite;
}
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 80%; animation-delay: 0.15s; }
.eq i:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.eq i:nth-child(4) { height: 70%; animation-delay: 0.45s; }
.eq.paused i { animation: none; height: 30%; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.player-center { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.player-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; align-items: baseline; min-width: 0; }
.player-meta strong, .player-meta span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.muted { color: var(--muted); font-size: 0.85rem; }
.player-progress {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.55rem; align-items: center;
  font-size: 0.72rem; color: var(--muted);
}
.player-progress input[type="range"], .vol input[type="range"] {
  width: 100%; accent-color: var(--accent); cursor: pointer;
}
.player-controls { display: flex; gap: 0.35rem; align-items: center; }
.vol { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); width: 110px; }

.listen-panel { max-width: 980px; }
.back {
  color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem;
  margin-bottom: 1rem;
}
.back:hover { color: var(--accent); }
.listen-card.immersive {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 2rem;
  background: linear-gradient(145deg, var(--listen-grad-a), var(--listen-grad-b));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.listen-art-wrap { position: relative; }
.listen-art {
  aspect-ratio: 1; border-radius: var(--radius);
  background: linear-gradient(145deg, #3b1d63, #1a0b2e);
  background-size: cover; background-position: center;
  position: relative; z-index: 1;
  animation: artIn 480ms ease;
}
.listen-glow {
  position: absolute; inset: 12% -8% -8% 12%;
  background: radial-gradient(circle, rgba(124,108,255,0.45), transparent 65%);
  filter: blur(28px); z-index: 0;
}
@keyframes artIn {
  from { opacity: 0; transform: scale(0.94) rotate(-2deg); }
  to { opacity: 1; transform: none; }
}
.listen-actions { display: flex; gap: 0.6rem; margin-top: 1.4rem; flex-wrap: wrap; }
.hint { margin-top: 1rem; }

.legal-doc h2 { margin-top: 1.5rem; font-size: 1.15rem; }
.legal-doc ul { color: var(--muted); line-height: 1.6; }
.legal-doc a { color: var(--accent); text-decoration: underline; }
.rights-check {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.65rem !important;
  color: var(--muted);
  font-size: 0.88rem !important;
}
.rights-check input { width: auto; margin-top: 0.2rem; }
.rights-check a { color: var(--accent); }

.form-panel { max-width: 760px; }
.form-panel.narrow { max-width: 440px; }
.stack-form {
  display: flex; flex-direction: column; gap: 0.85rem;
  margin: 1.5rem 0 2rem; padding: 1.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stack-form h2 { margin: 0; font-size: 1.1rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.stack-form input, .stack-form textarea, .stack-form select {
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.28);
  color: var(--fg);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}
.form-msg { color: var(--accent); }
.form-msg.is-err { color: #e57373; }
.form-msg.is-ok { color: var(--accent); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* —— Auth / login —— */
body.auth-page .player { display: none !important; }
body.auth-page .sidebar-foot { display: none; }
body.auth-page .main { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 2rem); padding: 1.5rem 1rem 3rem; }
.auth-stage {
  position: relative;
  width: min(440px, 100%);
  margin: 0 auto;
}
.auth-visual {
  position: absolute;
  inset: -18% -28% auto;
  height: 220px;
  pointer-events: none;
  z-index: 0;
}
.auth-visual-glow {
  position: absolute;
  inset: 10% 15%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
  filter: blur(28px);
  animation: auth-pulse 6s ease-in-out infinite;
}
.auth-visual-ring {
  position: absolute;
  left: 50%; top: 40%;
  width: 160px; height: 160px;
  margin: -80px 0 0 -80px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0.55;
  animation: auth-spin 22s linear infinite;
}
@keyframes auth-pulse {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.12); opacity: 1; }
}
@keyframes auth-spin {
  to { transform: rotate(360deg); }
}
.auth-panel { position: relative; z-index: 1; }
.auth-brand {
  font-size: clamp(2.1rem, 5vw, 2.75rem);
  margin: 0.15rem 0 0.5rem;
  line-height: 1.05;
}
.auth-lede { margin: 0 0 1.25rem; max-width: 34ch; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.auth-tab.is-active {
  background: var(--accent);
  color: #0a0a0a;
}
.auth-form { margin: 0; }
.auth-form[hidden] { display: none !important; }
.auth-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.field-with-action {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0.35rem;
}
.field-with-action input { width: 100%; }
.field-action {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.field-action:hover { color: var(--fg); border-color: var(--accent); }
.demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.demo-label { color: var(--muted); font-size: 0.82rem; margin-right: 0.15rem; }
.demo-chip { cursor: pointer; font: inherit; background: transparent; }
.hint { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.78rem; }
.pwd-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-top: 0.45rem;
}
.pwd-meter i {
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
  display: block;
}
.pwd-meter i.on { background: var(--accent); }
.pwd-meter[data-score="1"] i.on { background: #e57373; }
.pwd-meter[data-score="2"] i.on { background: #ffb74d; }
.pwd-meter[data-score="3"] i.on,
.pwd-meter[data-score="4"] i.on { background: var(--accent); }
.stack-form button.btn:disabled { opacity: 0.65; cursor: wait; }

.split-lists {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem;
}
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.plain-list li {
  padding: 0.75rem 0.9rem; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
.share-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.share-card {
  display: grid; grid-template-columns: 64px 1fr; gap: 0.85rem;
  padding: 0.85rem; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 12px;
}
.share-thumb {
  width: 64px; height: 64px; border-radius: 10px;
  background: linear-gradient(135deg, #3b1d63, #f5c518);
  background-size: cover; background-position: center;
}
.whm-dialog {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); color: var(--fg);
  padding: 0; max-width: 420px; width: calc(100% - 2rem);
}
.whm-dialog::backdrop { background: rgba(0,0,0,0.65); }
.whm-dialog .stack-form { margin: 0; border: 0; }

.discover-stack { display: flex; flex-direction: column; gap: 2rem; }
.rail-title {
  font-family: var(--display); font-size: 1.35rem; margin: 0 0 0.85rem; font-weight: 400;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(245,197,24,0.06); }
.track-row {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 0.85rem; align-items: center;
  padding: 0.55rem 0.35rem; border-radius: 12px;
  transition: background var(--transition);
}
.track-row:hover { background: rgba(255,255,255,0.04); }
.track-thumb {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, #3b1d63, #7c6cff);
  background-size: cover; background-position: center;
}
.skeleton-grid {
  height: 180px; border-radius: var(--radius);
  background: linear-gradient(90deg, #14101f, #1c1730, #14101f);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.lyrics-box {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}
.lyrics-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.lyrics-modes { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.lyrics-lang {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border, #2a2438);
  color: inherit;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
}
.lyrics-lang-label { font-size: 0.75rem; opacity: 0.7; }
.lyrics-meta { font-size: 0.75rem; margin: 0.35rem 0 0; min-height: 1em; }
.page-narrow { max-width: 32rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.settings-card {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border, #2a2438);
  border-radius: 1rem;
  background: rgba(255,255,255,.03);
}
.settings-card select {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border, #2a2438);
  color: inherit;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
}
.chip-btn {
  border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.78rem;
  cursor: pointer;
}
.chip-btn.active, .chip-btn:hover {
  border-color: var(--accent); color: var(--accent);
}
.lyrics-viewport {
  max-height: 240px; overflow: auto;
  padding: 0.5rem 0.25rem;
  scroll-behavior: smooth;
}
.lyrics-line {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  color: var(--muted);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
  cursor: pointer;
}
.lyrics-line.active {
  color: var(--fg);
  background: rgba(245, 197, 24, 0.12);
  transform: scale(1.02);
  font-weight: 600;
}
.lyrics-word {
  display: inline;
  color: var(--muted);
  transition: color 120ms ease;
}
.lyrics-word.active {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(245, 197, 24, 0.45);
}
.lyrics-full {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
    gap: 0.85rem;
  }
  .nav-toggle { display: inline-flex; }
  /* Keep brand bar compact so Focus/home content is visible without scrolling past a tall nav. */
  .sidebar:not(.is-nav-open) .search,
  .sidebar:not(.is-nav-open) .nav,
  .sidebar:not(.is-nav-open) .sidebar-user,
  .sidebar:not(.is-nav-open) .whm-house-ad--sidebar,
  .sidebar:not(.is-nav-open) .sidebar-foot {
    display: none;
  }
  .player { left: 0; }
  .player-body {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .player-cover-wrap, .player-cover { width: 52px; height: 52px; }
  .player-cover {
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  }
  .player-rail { height: 3px; }
  .player-progress { display: none; } /* rail replaces seek on compact mobile */
  .player-meta { flex-direction: column; gap: 0.15rem; }
  .player-meta strong {
    font-size: 0.95rem;
    font-weight: 700;
    max-width: 46vw;
    letter-spacing: -0.01em;
  }
  .player-meta #player-artist {
    font-size: 0.78rem;
    color: var(--muted);
    max-width: 46vw;
  }
  .player-meta #player-channel { display: none; }
  .player-controls {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
    max-width: none;
  }
  .player-controls .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--fg) 6%, transparent);
    border-color: transparent;
    flex-shrink: 0;
  }
  .player-controls .icon-btn.play {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
  .player-controls .vol-core {
    display: none;
  }
  .player-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }
  .player.tools-open .player-body {
    /* keep single row — tools live in sheet above */
  }
  html.whm-mobile-web .player {
    margin: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0; bottom: 0;
    width: auto;
    border-radius: 22px 22px 18px 18px;
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    overflow: hidden;
    box-shadow:
      0 -4px 28px var(--player-glow, rgba(0,0,0,0.25)),
      0 12px 32px rgba(0,0,0,0.28);
  }
  html.whm-mobile-web .player-rail {
    border-radius: 22px 22px 0 0;
  }
  .lyric-snap-panel { grid-template-columns: 1fr; max-height: 90vh; }
  .lyric-snap-art { min-height: 140px; }
  .listen-card.immersive, .hero-stage, .split-lists { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .desktop-queue-panel {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 50vh !important;
    border-radius: 18px 18px 14px 14px !important;
  }
}

@media (min-width: 981px) {
  .player-controls {
    flex-shrink: 0;
    gap: 0.3rem;
  }
  .player-controls .icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .player-controls .icon-btn.play {
    width: 48px;
    height: 48px;
  }
  .player-controls .vol-core {
    display: inline-flex;
    width: 96px;
    margin-left: 0.15rem;
  }
  .player-tools-sheet {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .player-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    max-width: 720px;
    margin-left: auto;
  }
}

/* UI language switcher (sidebar) */
.lang-switch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.85rem 0.75rem;
}
.lang-switch select {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft, var(--bg-elevated));
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
}

/* Free-tier house ad — sidebar / Settings (never above mini player) */
.whm-house-ad {
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--secondary) 18%, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
}
.whm-house-ad--inline { margin: 0.15rem 0 0.35rem; }
.whm-house-ad--sidebar {
  margin: 0.35rem 0.85rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
}
.whm-house-ad[hidden] { display: none !important; }
.whm-house-ad-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.whm-house-ad-link:hover { text-decoration: underline; }
/* Kill legacy floating bar above player if any leftover DOM appears */
#whm-house-ad {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Eco-Streaming: kill decorative motion + show carbon meter */
body.eco-mode *,
body.eco-mode *::before,
body.eco-mode *::after {
  animation: none !important;
  transition: none !important;
}
body.eco-mode .eq { display: none; }
body.eco-mode .icon-btn:hover { transform: none; }
body.eco-mode #btn-eco.is-on {
  border-color: #3ddc97;
  color: #3ddc97;
  background: rgba(61, 220, 151, 0.12);
}
.eco-meter {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 108px;
  max-width: 140px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(26, 61, 50, 0.75);
  border: 1px solid rgba(61, 220, 151, 0.35);
  color: #3ddc97;
  font-size: 0.65rem;
  line-height: 1.2;
}
.eco-meter-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eco-meter-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.eco-meter-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #3ddc97;
  border-radius: inherit;
}
#btn-eco.is-on {
  border-color: #3ddc97;
  color: #3ddc97;
}

#btn-wave.is-on {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.25);
}

.wave-continue-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 6.2rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 18, 32, 0.96), rgba(40, 28, 12, 0.94));
  color: var(--fg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: waveFabIn 380ms cubic-bezier(.2,.8,.2,1);
}
.wave-continue-fab[hidden] { display: none !important; }
.wave-continue-fab.is-nearby {
  border-color: #3ddc97;
  box-shadow: 0 12px 40px rgba(61, 220, 151, 0.22);
}
.wave-continue-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.wave-continue-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.wave-continue-copy strong {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.wave-continue-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
@keyframes waveFabIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 640px) {
  .wave-continue-fab { bottom: 7.5rem; right: 0.75rem; left: 0.75rem; max-width: none; }
}
