/* ================================================================
   STUDIO 54 — design tokens & base styles
   black + gold + hot pink, mirror-ball glow, disco vibes
   ================================================================ */

:root {
  /* Palette — Studio 54 default */
  --bg-0: #08040a;          /* deepest — outside */
  --bg-1: #110810;          /* main canvas */
  --bg-2: #1a0c17;          /* cards / panels */
  --bg-3: #25131f;          /* hover / elevated */
  --bg-4: #321a2a;          /* hi-light */

  --line: #2a1622;
  --line-strong: #3d2233;

  --ink: #f7ecd6;           /* warm parchment white */
  --ink-2: #d6c7ac;
  --ink-3: #8a7d6b;
  --ink-4: #5a4e44;

  --gold: #f5c14b;
  --gold-bright: #ffd76a;
  --gold-deep: #c8932e;
  --gold-glow: rgba(245, 193, 75, 0.45);

  --pink: #ff3d9a;
  --pink-bright: #ff66b3;
  --pink-deep: #c4216f;
  --pink-glow: rgba(255, 61, 154, 0.45);

  --chrome: #e8dfc8;
  --chrome-dim: #b8ad95;

  /* Sizing */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --r-pill: 999px;

  --sb-w: 248px;       /* sidebar */
  --queue-w: 320px;
  --player-h: 92px;
  --topbar-h: 64px;

  /* Type */
  --f-display: "Big Shoulders Display", "Bowlby One", Impact, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, 0.85);
  --shadow-gold: 0 0 40px -10px var(--gold-glow);
  --shadow-pink: 0 0 40px -10px var(--pink-glow);
}

/* alt palette: "Cosmic" — magenta + cyan + chrome */
.theme-cosmic {
  --gold: #d8c4ff;
  --gold-bright: #ecdcff;
  --gold-deep: #9d7fd6;
  --gold-glow: rgba(216, 196, 255, 0.5);
  --pink: #ff5cc1;
  --pink-bright: #ff8fd4;
  --pink-deep: #c12a8e;
  --pink-glow: rgba(255, 92, 193, 0.5);
  --bg-1: #08071a;
  --bg-2: #110c25;
  --bg-3: #1a1432;
  --bg-4: #251c44;
  --line: #1f1736;
  --line-strong: #2c2148;
}

/* alt palette: "Velvet" — burgundy + cream + brass */
.theme-velvet {
  --gold: #e8b870;
  --gold-bright: #f4cd8c;
  --gold-deep: #b88a48;
  --gold-glow: rgba(232, 184, 112, 0.4);
  --pink: #e84d4d;
  --pink-bright: #f37070;
  --pink-deep: #a82d2d;
  --pink-glow: rgba(232, 77, 77, 0.35);
  --bg-1: #14080a;
  --bg-2: #1f0d10;
  --bg-3: #2c1418;
  --bg-4: #3a1d22;
}

/* ============================ Reset ============================ */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  background: var(--bg-0);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); background-clip: padding-box; }

/* ============================ Display helpers ============================ */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: 0.005em;
  line-height: 0.92;
  text-transform: uppercase;
}
.display-pink { color: var(--pink); }
.display-gold { color: var(--gold); }
.shine {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 38%, var(--gold-deep) 62%, var(--gold-bright) 100%);
  background-size: 100% 220%;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 100%; }
}

/* ============================ Shell ============================ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  height: 100vh;
  background: var(--bg-0);
  gap: 8px;
  padding: 8px 8px 0;
}
.app.queue-open { grid-template-columns: var(--sb-w) 1fr var(--queue-w); }

/* ============================ Sidebar ============================ */
.sb {
  background: var(--bg-1);
  border-radius: var(--r-lg);
  padding: 22px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  position: relative;
}
.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.sb-logo-mark {
  width: 36px; height: 36px;
  position: relative;
  flex: 0 0 36px;
}
.sb-logo-text {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
}
.sb-logo-text em {
  color: var(--pink);
  font-style: normal;
}

.sb-section { display: flex; flex-direction: column; gap: 2px; }
.sb-section-label {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
  padding: 8px 12px 4px;
  text-transform: uppercase;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sb-item:where(:hover) { background: var(--bg-3); color: var(--ink); }
.sb-item.active {
  background: linear-gradient(90deg, rgba(255,61,154,0.15), rgba(245,193,75,0.06));
  color: var(--ink);
}
.sb-item.active::before {
  content: "";
  width: 3px; height: 18px;
  background: var(--pink);
  border-radius: 999px;
  margin-left: -7px;
  margin-right: 4px;
  box-shadow: 0 0 12px var(--pink);
}
.sb-item svg { flex: 0 0 18px; }

.sb-playlists {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-playlist {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-3);
}
.sb-playlist .swatch {
  width: 28px; height: 28px;
  border-radius: 4px;
  flex: 0 0 28px;
  overflow: hidden;
  position: relative;
}

/* ============================ Main column ============================ */
.main {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 380px);
  border-radius: var(--r-lg);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.main-inner { padding: 24px 36px 80px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 36px;
  background: linear-gradient(180deg, var(--bg-2) 60%, rgba(0,0,0,0));
  backdrop-filter: blur(12px);
}
.topbar-nav { display: flex; gap: 8px; }
.topbar-nav button {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--bg-0);
  display: grid; place-items: center;
  color: var(--ink-2);
}

.search-input {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px 10px 40px;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.15s;
}
.search-input input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
.search-input input::placeholder { color: var(--ink-4); }
.search-input svg { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--bg-0);
  border-radius: 999px;
  cursor: pointer;
}
.user-chip .avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--gold));
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--bg-0);
}

/* ============================ Sections ============================ */
.section { margin-bottom: 40px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
}
.section-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.005em;
  line-height: 1;
  text-transform: uppercase;
}
.section-title em {
  font-style: normal;
  color: var(--pink);
}
.section-more {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  cursor: pointer;
}

/* ============================ Album grid ============================ */
.grid-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px;
}
.grid-albums.dense { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }

.album-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.album-card .cover {
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.album-card .play-fab {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--pink);
  display: grid; place-items: center;
  color: var(--bg-0);
  box-shadow: 0 8px 24px -4px var(--pink-glow);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.2s, transform 0.2s;
}

.album-card .title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-card .meta {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================ Hero (album page) ============================ */
.hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding: 32px 36px 24px;
  align-items: end;
  position: relative;
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--hero-tint, rgba(120, 30, 80, 0.8)) 0%, rgba(8, 4, 10, 0.85) 60%, var(--bg-1) 100%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-cover {
  width: 280px; height: 280px;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9);
}
.hero-meta { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.hero-eyebrow {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.hero-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.hero-line .dot { width: 4px; height: 4px; border-radius: 999px; background: var(--ink-3); }
.hero-line strong { font-weight: 700; color: var(--ink); }

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 36px 28px;
  position: relative;
  z-index: 1;
}
.btn-play {
  width: 60px; height: 60px;
  border-radius: 999px;
  background: var(--pink);
  display: grid; place-items: center;
  color: var(--bg-0);
  box-shadow: 0 10px 30px -8px var(--pink-glow), 0 0 0 0 var(--pink-glow);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 999px;
  color: var(--ink-2);
  display: grid; place-items: center;
}
.btn-icon.active { color: var(--pink); }
.btn-ghost {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}
.btn-ghost.on { color: var(--bg-0); background: var(--gold); border-color: var(--gold); }

/* ============================ Tracklist ============================ */
.tracklist {
  padding: 12px 24px 24px;
}
.tracklist-head {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 60px 80px;
  gap: 16px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.track {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 60px 80px;
  gap: 16px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  align-items: center;
  cursor: pointer;
  transition: background 0.12s;
}
.track.playing { color: var(--pink); }
.track.playing .track-num,
.track.playing .track-title,
.track.playing .track-meta { color: var(--pink); }

.track-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: end center;
}
.track-num .icon { display: none; color: var(--ink); }
.track.playing .track-num .num { display: none; }
.track.playing .track-num .bars { display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.track.playing .track-num .bars { height: 14px; }
.track.playing .track-num .bars span {
  display: block;
  width: 2px;
  background: var(--pink);
  border-radius: 1px;
  animation: bars 0.9s ease-in-out infinite;
}
.track.playing .track-num .bars span:nth-child(1) { animation-delay: 0.0s; height: 60%; }
.track.playing .track-num .bars span:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.track.playing .track-num .bars span:nth-child(3) { animation-delay: 0.4s; height: 40%; }
.track.playing .track-num .bars span:nth-child(4) { animation-delay: 0.1s; height: 80%; }
@keyframes bars {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.3); }
}

.track-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-info .mini-cover {
  width: 36px; height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 36px;
}
.track-title-wrap { min-width: 0; }
.track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-artist {
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-meta {
  font-size: 13px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-quality {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid var(--gold-deep);
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  text-transform: uppercase;
}
.track-quality-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.track-time {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.track-time > span {
  min-width: 36px;
  text-align: right;
}

/* ============================ Now playing bar ============================ */
.player {
  grid-column: 1 / -1;
  background: var(--bg-1);
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 2fr) minmax(260px, 1fr);
  align-items: center;
  padding: 12px 22px;
  gap: 24px;
  position: relative;
  z-index: 20;
}
.player-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.player-cover {
  width: 60px; height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 60px;
  cursor: pointer;
  box-shadow: 0 6px 18px -4px rgba(0,0,0,0.6);
}
.player-track { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.player-track-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-track-artist {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-track-album {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-track-album svg { flex-shrink: 0; color: var(--ink-4); }
.player-track-album span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.player-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.player-progress > span:first-child { min-width: 36px; text-align: right; }
.player-progress > span:last-child { min-width: 36px; text-align: left; }
.player-controls { display: flex; gap: 14px; align-items: center; }
.player-controls button {
  color: var(--ink-2);
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 999px;
}
.player-controls .play-big {
  width: 38px; height: 38px;
  background: var(--ink);
  color: var(--bg-0);
}
.player-controls .active { color: var(--pink); }

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  border-radius: 999px;
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--gold-glow);
  opacity: 0;
  transition: opacity 0.15s;
}

.player-right { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.quality-pill {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.quality-pill.master { color: var(--pink); border-color: var(--pink); }

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
}

/* Volume control with click-to-reveal popover (Tidal style) */
.volume-control {
  position: relative;
  display: flex;
  align-items: center;
}
.volume-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 16px 14px 12px;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 30;
  width: 44px;
  animation: volPop 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes volPop {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.volume-popover input[type="range"],
.volume-popover .vol-slider-wrap input[type="range"] {
  /* Reset any inherited vertical styles */
  writing-mode: unset;
  direction: ltr;
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--gold);
  background: transparent;
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
}
.vol-slider-wrap {
  width: 14px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.vol-slider-wrap input[type="range"] {
  position: absolute;
  width: 120px;
  height: 14px;
  transform: rotate(-90deg);
  cursor: pointer;
}
.vol-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  width: 100%;
}
.vol-slider-wrap input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
}
.vol-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  background: var(--ink);
  border-radius: 999px;
  border: 0;
  margin-top: -4px;
  box-shadow: 0 0 0 0 var(--gold-glow);
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.vol-slider-wrap input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px var(--gold-glow);
}
.vol-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--ink);
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.volume-popover .vol-num {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-family: var(--f-display);
}
.volume-popover::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  margin-left: -5px;
  width: 10px; height: 10px;
  background: var(--bg-2);
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
@keyframes volPop {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* old single-keyframe was here; replaced above */

/* ============================================================
   Range / volume sliders — consistent everywhere
   ============================================================ */
input[type="range"].slider,
.volume input[type="range"],
.fp-vol input[type="range"],
.dfp-volume input[type="range"],
.mfp-volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 18px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
input[type="range"].slider::-webkit-slider-runnable-track,
.volume input[type="range"]::-webkit-slider-runnable-track,
.fp-vol input[type="range"]::-webkit-slider-runnable-track,
.dfp-volume input[type="range"]::-webkit-slider-runnable-track,
.mfp-volume input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
}
input[type="range"].slider::-moz-range-track,
.volume input[type="range"]::-moz-range-track,
.fp-vol input[type="range"]::-moz-range-track,
.dfp-volume input[type="range"]::-moz-range-track,
.mfp-volume input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
}
input[type="range"].slider::-webkit-slider-thumb,
.volume input[type="range"]::-webkit-slider-thumb,
.fp-vol input[type="range"]::-webkit-slider-thumb,
.dfp-volume input[type="range"]::-webkit-slider-thumb,
.mfp-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  background: var(--ink);
  border-radius: 999px;
  margin-top: -4px;
  border: 0;
  box-shadow: 0 0 0 0 var(--gold-glow);
  transition: box-shadow 0.15s, transform 0.15s;
}
input[type="range"].slider::-moz-range-thumb,
.volume input[type="range"]::-moz-range-thumb,
.fp-vol input[type="range"]::-moz-range-thumb,
.dfp-volume input[type="range"]::-moz-range-thumb,
.mfp-volume input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--ink);
  border-radius: 999px;
  border: 0;
}
input[type="range"].slider:hover::-webkit-slider-thumb,
.volume input[type="range"]:hover::-webkit-slider-thumb,
.fp-vol input[type="range"]:hover::-webkit-slider-thumb,
.dfp-volume input[type="range"]:hover::-webkit-slider-thumb,
.mfp-volume input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px var(--gold-glow);
}

.volume input[type="range"] {
  width: 90px;
}

/* Volume control wrapper used in full-screen player too */
.fp-vol {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  justify-content: flex-end;
}
.fp-vol input[type="range"] {
  width: 110px;
}
.fp-vol-fill {
  position: relative;
  flex: 1;
  max-width: 130px;
  height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}

/* ============================ Queue panel ============================ */
.queue {
  background: var(--bg-1);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  overflow-y: auto;
}
.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.queue-head h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.queue-section-label {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
  text-transform: uppercase;
  font-weight: 800;
  margin: 16px 0 8px;
}
.queue-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.queue-item .mini-cover { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 4px; overflow: hidden; }
.queue-item .info { min-width: 0; flex: 1; }
.queue-item .t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .a { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item.current .t { color: var(--pink); }

/* ============================ Full-screen player ============================ */
/* ============================ Lyrics ============================ */
.lyrics {
  height: 100%;
  overflow-y: auto;
  padding: 60px 30px;
  position: relative;
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  scroll-behavior: smooth;
}
.lyrics::-webkit-scrollbar { display: none; }
.lyric-line {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  color: var(--ink-4);
  padding: 10px 0;
  cursor: pointer;
  text-wrap: balance;
}
.lyric-line.past { color: var(--ink-4); opacity: 0.4; }
.lyric-line.upcoming { color: var(--ink-3); opacity: 0.7; }
.lyric-line.current {
  color: var(--gold-bright);
  text-shadow: 0 0 24px var(--gold-glow);
  /* Smooth ramp UP on becoming current, but snap-down handled below */
  transition: color 0.2s ease-out, text-shadow 0.2s ease-out;
}
/* Past/upcoming lines have NO transition — they snap immediately when the
   current marker moves, so the previous line doesn't appear "still
   highlighted" while it fades. */
.lyric-line.past,
.lyric-line.upcoming { transition: none; }

.lyric-line.instrumental {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
}
.lyric-line.instrumental .dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--gold);
  opacity: 0.4;
  animation: instr 1.2s ease-in-out infinite;
}
.lyric-line.instrumental.current .dot { opacity: 1; box-shadow: 0 0 12px var(--gold); }
.lyric-line.instrumental .dot:nth-child(2) { animation-delay: 0.2s; }
.lyric-line.instrumental .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes instr {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ============================ Quality menu ============================ */
.qmenu-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  animation: fadeIn 0.2s;
}
.qmenu {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow-pop);
}
.qmenu h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 24px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.qmenu .sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.qmenu-options { display: flex; flex-direction: column; gap: 8px; }
.qmenu-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: var(--bg-1);
  transition: all 0.15s;
}
.qmenu-opt.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(245,193,75,0.1), transparent);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.qmenu-opt.master.active { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }
.qmenu-opt .left { display: flex; flex-direction: column; gap: 4px; }
.qmenu-opt .name { font-family: var(--f-display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 0.005em; }
.qmenu-opt.master .name { color: var(--pink); }
.qmenu-opt .desc { font-size: 12px; color: var(--ink-3); }
.qmenu-opt .right {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================ Login ============================ */
.login {
  position: fixed; inset: 0;
  background: var(--bg-0);
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 999;
}
.login::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at 25% 30%, var(--pink-glow), transparent 50%),
    radial-gradient(ellipse at 75% 70%, var(--gold-glow), transparent 50%);
  filter: blur(60px);
  animation: bgPulse 14s ease-in-out infinite;
}
.login::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(247,236,214,0.04) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, rgba(247,236,214,0.04) 0 1px, transparent 1px 80px);
  pointer-events: none;
}
@keyframes bgPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(8deg); }
}
.login-card {
  position: relative;
  z-index: 2;
  width: 440px;
  max-width: 90vw;
  padding: 48px 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.login-mark {
  width: 80px; height: 80px;
  margin-bottom: 4px;
}
.login-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin: 0;
}
.login-title em { color: var(--pink); font-style: normal; }
.login-sub {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin: 0;
}
.login-form {
  margin-top: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 15px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.login-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 6px var(--gold-glow);
}
.login-input::placeholder { color: var(--ink-4); letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.login-input.error { border-color: var(--pink); box-shadow: 0 0 0 6px var(--pink-glow); animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.login-btn {
  background: var(--pink);
  color: var(--bg-0);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 16px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 36px -10px var(--pink-glow);
  transition: all 0.2s;
}
.login-hint {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 8px;
}
.login-hint code {
  color: var(--gold);
  font-family: var(--f-mono);
  letter-spacing: 0;
}

/* Mirror ball animation for logo */
.mirrorball {
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, #fff, var(--chrome-dim) 35%, #2a1a26 90%);
  box-shadow:
    inset -4px -6px 12px rgba(0,0,0,0.4),
    0 0 20px var(--pink-glow);
}
.mirrorball::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(255,255,255,0.08) 5px 5.5px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(0,0,0,0.15) 5px 5.5px);
  border-radius: inherit;
  animation: ballSpin 18s linear infinite;
}
@keyframes ballSpin {
  from { background-position: 0 0; }
  to { background-position: 80px 0; }
}
.mirrorball.spinning::after {
  content: "";
  position: absolute;
  inset: 8%;
  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.6), transparent 30%),
    radial-gradient(circle at 70% 60%, var(--pink-glow), transparent 40%);
  border-radius: 999px;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ============================ Recently played row ============================ */
.row-played {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 -36px;
  padding-left: 36px;
  padding-right: 36px;
  scrollbar-width: thin;
}
.row-played::-webkit-scrollbar { height: 6px; }
.played-card {
  flex: 0 0 220px;
  background: var(--bg-3);
  border-radius: var(--r-md);
  padding: 8px 14px 8px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
}
.played-card .mini-cover { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 6px; overflow: hidden; }
.played-card .t { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.played-card .a { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.played-card .play-mini {
  position: absolute;
  right: 14px;
  bottom: 50%;
  transform: translateY(50%);
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--pink);
  display: grid; place-items: center;
  color: var(--bg-0);
  opacity: 0;
  transition: opacity 0.15s;
}

/* ============================ Playlist headers ============================ */
.playlist-hero { padding: 30px 36px 20px; }

/* ============================ Pills / chips ============================ */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink-2);
  cursor: pointer;
  border: 1px solid transparent;
}
.chip.on { background: var(--gold); color: var(--bg-0); }
.chip.pink.on { background: var(--pink); }

/* ============================ Search results ============================ */
.search-results { display: flex; flex-direction: column; gap: 24px; }
.search-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--ink-3);
}
.search-empty h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 38px;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 6px;
}

/* ============================ Utility ============================ */
.spacer { flex: 1; }
.hidden { display: none !important; }

/* spinning mirror ball on app intro */
.disc-spin { animation: discSpin 20s linear infinite; transform-origin: center; }
@keyframes discSpin { to { transform: rotate(360deg); } }

/* glow text under hero */
.glow-pink { text-shadow: 0 0 30px var(--pink-glow); }
.glow-gold { text-shadow: 0 0 30px var(--gold-glow); }

/* Tracklist hover: show heart action */
.track .track-meta { display: flex; align-items: center; gap: 8px; }
.track .heart {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  opacity: 0;
  color: var(--ink-3);
  flex: 0 0 24px;
  transition: opacity 0.15s, color 0.15s;
}
.track .heart.on { opacity: 1; color: var(--pink); }

/* ============================================================
   Hover effects — only on devices that actually hover
   (prevents tap-sticking on mobile)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .album-card:hover .cover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-pop), 0 0 0 1px var(--gold-glow);
  }
  .album-card:hover .play-fab { opacity: 1; transform: translateY(0) scale(1); }
  .album-card .play-fab:hover { background: var(--pink-bright); transform: scale(1.08); }

  .track:hover { background: var(--bg-3); }
  .track:hover .track-num .num { display: none; }
  .track:hover .track-num .icon { display: grid; }
  .track:hover .heart { opacity: 1; }
  .track .heart:hover { color: var(--pink); }

  .played-card:hover { background: var(--bg-4); }
  .played-card:hover .play-mini { opacity: 1; }

  .queue-item:hover { background: var(--bg-3); }

  .topbar-nav button:hover { color: var(--ink); }
  .user-chip:hover { background: var(--bg-3); }
  .sb-playlist:hover { background: var(--bg-3); color: var(--ink-2); }

  .btn-icon:hover { color: var(--ink); background: var(--bg-3); }
  .btn-ghost:hover { color: var(--gold); border-color: var(--gold); }
  .btn-play:hover { transform: scale(1.06); box-shadow: 0 16px 40px -8px var(--pink-glow), 0 0 0 8px rgba(255,61,154,0.1); }
  .section-more:hover { color: var(--gold); }
  .chip:hover { background: var(--bg-4); }

  .player-controls button:hover { color: var(--ink); }
  .player-controls .play-big:hover {
    background: var(--gold);
    transform: scale(1.05);
    box-shadow: 0 0 24px -4px var(--gold-glow);
  }
  .progress-bar:hover .progress-fill::after { opacity: 1; }
  .progress-bar:hover .progress-fill { background: linear-gradient(90deg, var(--pink-bright), var(--gold-bright)); }
  .quality-pill:hover { background: var(--gold); color: var(--bg-0); }
  .quality-pill.master:hover { background: var(--pink); color: var(--bg-0); }
  .lyric-line:hover { color: var(--ink-2); }
  .qmenu-opt:hover { border-color: var(--gold); }
  .login-btn:hover { background: var(--pink-bright); transform: translateY(-1px); box-shadow: 0 16px 44px -8px var(--pink-glow); }
}

/* hover-disabled fallbacks for touch — play-fab always visible on touch */
@media (hover: none), (pointer: coarse) {
  .album-card .play-fab { opacity: 1; transform: none; }
  .track .heart { opacity: 1; }
  .played-card .play-mini { opacity: 1; }
  /* track row's hidden play icon stays hidden; the row is tappable */
}
.mobile-nav,
.mobile-mini,
.mobile-header,
.sb-drawer-backdrop { display: none; }

@media (max-width: 768px) {
  /* Hide the desktop full-screen player; MobileFullPlayer is rendered instead */
  .dfp { display: none !important; }

  :root {
    --sb-w: 0;
    --queue-w: 0;
    --player-h: 0;
    --topbar-h: 56px;
  }
  body { overflow: hidden; }

  /* ---------- shell ---------- */
  .app, .app.queue-open {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100dvh;
    padding: 0;
    gap: 0;
  }
  .sb { display: none; }
  .queue { display: none; }
  .player { display: none; }   /* desktop bar hidden — mini player used instead */

  .main {
    border-radius: 0;
    background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 320px);
    padding-bottom: calc(140px + env(safe-area-inset-bottom));
  }
  .main-inner { padding: 8px 16px 80px; }

  /* ---------- top bar ---------- */
  .topbar {
    height: var(--topbar-h);
    padding: 10px 12px;
    gap: 8px;
    background: linear-gradient(180deg, var(--bg-2) 50%, rgba(0,0,0,0));
  }
  .topbar-nav { display: none; }
  .topbar-right .btn-ghost { display: none; }
  .topbar-right .user-chip { padding: 4px; }
  .topbar-right .user-chip span { display: none; }
  .topbar .search-input {
    max-width: none;
  }
  .topbar .search-input input {
    padding: 9px 14px 9px 38px;
    font-size: 13px;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
  }
  .mobile-header .logo .mark {
    width: 28px; height: 28px;
  }
  .mobile-header .logo .text {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.005em;
    text-transform: uppercase;
  }
  .mobile-header .logo .text em { color: var(--pink); font-style: normal; }

  /* ---------- sections ---------- */
  .section { margin-bottom: 28px; }
  .section-head { margin-bottom: 12px; }
  .section-title { font-size: 26px; }

  /* ---------- hero (album / playlist) ---------- */
  .hero {
    grid-template-columns: 1fr;
    padding: 16px 16px 12px;
    gap: 14px;
    text-align: left;
  }
  .hero-cover {
    width: 55vw;
    height: 55vw;
    max-width: 240px;
    max-height: 240px;
    margin: 0 auto;
  }
  .hero-meta { padding-bottom: 0; align-items: flex-start; text-align: center; }
  .hero-meta { text-align: center; align-items: center; }
  .hero-title { font-size: clamp(32px, 9vw, 52px); text-align: center; }
  .hero-line { justify-content: center; font-size: 12px; }
  .hero-actions { padding: 8px 12px 16px; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .hero-actions .btn-ghost { display: none; }
  .btn-play { width: 56px; height: 56px; }

  /* ---------- track list ---------- */
  .tracklist { padding: 8px 4px 16px; }
  .tracklist-head { display: none; }
  .track {
    grid-template-columns: 32px 1fr auto;
    gap: 12px;
    padding: 8px 8px;
  }
  .track > *:nth-child(3),  /* plays / album column */
  .track > *:nth-child(4) { /* quality column */
    display: none;
  }
  .track-info .mini-cover { width: 44px; height: 44px; flex: 0 0 44px; }
  .track .heart { display: none; }      /* tap-and-hold elsewhere */
  .track-num { font-size: 13px; }

  /* ---------- album grids ---------- */
  .grid-albums {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .grid-albums.dense {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .album-card .play-fab { opacity: 1; transform: none; width: 38px; height: 38px; right: 8px; bottom: 8px; }
  .album-card .title { font-size: 13px; }
  .album-card .meta { font-size: 11px; }

  /* ---------- recently played row ---------- */
  .row-played { margin: 0 -16px; padding: 0 16px 8px; }
  .played-card { flex: 0 0 200px; }

  /* ---------- chip row ---------- */
  .chip-row { gap: 6px; margin-bottom: 14px; }
  .chip { padding: 6px 10px; font-size: 10px; }

  /* ---------- mobile mini-player ---------- */
  .mobile-mini {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    height: 60px;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.7);
    z-index: 30;
    overflow: hidden;
    cursor: pointer;
  }
  .mobile-mini .mm-cover {
    width: 44px; height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex: 0 0 44px;
  }
  .mobile-mini .mm-info { flex: 1; min-width: 0; }
  .mobile-mini .mm-t {
    font-size: 13px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ink);
  }
  .mobile-mini .mm-a {
    font-size: 11px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mobile-mini .mm-controls { display: flex; gap: 6px; align-items: center; }
  .mobile-mini .mm-btn {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    color: var(--ink-2);
  }
  .mobile-mini .mm-btn.heart.on { color: var(--pink); }
  .mobile-mini .mm-play {
    width: 36px; height: 36px;
    background: var(--ink);
    color: var(--bg-0);
    border-radius: 999px;
    display: grid; place-items: center;
  }
  .mobile-mini .mm-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--line-strong);
  }
  .mobile-mini .mm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pink), var(--gold));
  }
  .mobile-mini.empty { opacity: 0.55; pointer-events: none; }

  /* ---------- mobile bottom nav ---------- */
  .mobile-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(8,4,10,0.92);
    backdrop-filter: blur(20px);
    display: flex;
    border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 25;
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--ink-3);
    font-size: 10px;
    font-family: var(--f-display);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.15s;
  }
  .mobile-nav-item.active { color: var(--pink); }
  .mobile-nav-item.active svg { filter: drop-shadow(0 0 10px var(--pink-glow)); }

  /* ---------- sidebar drawer (slides over) ---------- */
  .sb-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    animation: fadeIn 0.2s;
  }
  .sb.drawer-open {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 84vw;
    max-width: 320px;
    border-radius: 0;
    z-index: 51;
    animation: slideIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
  }
  @keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
  }

  /* ---------- full-screen player (mobile) — Apple-Music-style ---------- */
  /* The DESKTOP .fp-backdrop is never rendered on mobile; we render <MobileFullPlayer /> instead. */

  /* ---------- quality menu ---------- */
  .qmenu {
    width: calc(100vw - 24px);
    max-width: none;
    padding: 20px;
  }
  .qmenu-opt { padding: 12px 14px; }
  .qmenu-opt .name { font-size: 16px; }

  /* ---------- search empty / browse tiles ---------- */
  .search-empty { padding: 40px 20px; }
  .search-empty h2 { font-size: 28px; }

  /* ---------- login ---------- */
  .login-title { font-size: clamp(48px, 14vw, 64px); }
  .login-card {
    width: calc(100vw - 32px);
    padding: 36px 24px 28px;
  }
  .login-mark { width: 64px; height: 64px; }
}

/* desktop-only: hide mobile shell pieces */
@media (min-width: 769px) {
  .mobile-nav,
  .mobile-mini,
  .mobile-header,
  .sb-drawer-backdrop,
  .fp-tabs { display: none !important; }
}

/* ============================================================
   Full-screen player (DESKTOP, Tidal-style layout)
   .dfp = "desktop full player"
   ============================================================ */
.dfp {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-0);
  display: grid;
  grid-template-rows: 64px 1fr 116px;
  animation: fpIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
@keyframes fpIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.dfp-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, var(--pink-glow), transparent 65%),
    radial-gradient(ellipse 70% 60% at 80% 70%, var(--gold-glow), transparent 65%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.dfp > *:not(.dfp-bg) { position: relative; z-index: 1; }

/* ----- Top bar ----- */
.dfp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.dfp-artist-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 18px 4px 4px;
  background: var(--bg-2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}
.dfp-artist-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--bg-0);
}

.dfp-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.dfp-pill {
  background: var(--bg-2);
  color: var(--ink-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.dfp-pill.ghost { opacity: 0.55; }
.dfp-pill.on {
  background: var(--ink);
  color: var(--bg-0);
}
.dfp-pill:disabled { opacity: 0.3; cursor: not-allowed; }
.dfp-icon {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
  margin-left: 2px;
}

/* ----- Main area ----- */
.dfp-main {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px 60px 20px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.dfp-cover-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
}
.dfp-cover {
  aspect-ratio: 1 / 1;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 40px 100px -20px rgba(0,0,0,0.92),
    0 0 80px -30px var(--pink-glow);
}
/* When lyrics are visible — two columns, cover left, lyrics right */
.dfp.with-lyrics .dfp-main {
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 24px 48px 20px;
}
.dfp.with-lyrics .dfp-cover-wrap {
  justify-content: flex-end;
}
.dfp.with-lyrics .dfp-cover {
  width: auto;
  height: 100%;
  max-width: 100%;
}

/* ----- Lyrics column ----- */
.dfp-lyrics-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 640px;
  overflow: hidden;
}
.dfp-lyrics-wrap .lyrics {
  padding: 40px 12px;
  height: 100%;
}
.dfp-lyrics-wrap .lyric-line {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 30px);
  text-transform: none;
  letter-spacing: -0.005em;
  line-height: 1.22;
  padding: 8px 0;
  color: var(--ink-4);
}
.dfp-lyrics-wrap .lyric-line.current {
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: var(--ink);
  text-shadow: none;
  transform: none;
  filter: none;
}
.dfp-lyrics-wrap .lyric-line.past { opacity: 0.45; }
.dfp-lyrics-wrap .lyric-line.upcoming { opacity: 0.6; }

/* ----- Bottom strip ----- */
.dfp-bottom {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(360px, 1.6fr) minmax(220px, 1.3fr);
  align-items: center;
  gap: 16px;
  padding: 14px 22px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  overflow: hidden;
}
.dfp-track-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dfp-track-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dfp-track-artist {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dfp-track-album {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dfp-track-album svg { flex-shrink: 0; color: var(--ink-4); }

.dfp-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dfp-control-row {
  display: flex;
  align-items: center;
  gap: 22px;
}
.dfp-ctl {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.dfp-ctl.active { color: var(--pink); }
.dfp-ctl-play {
  width: 44px; height: 44px;
  background: var(--ink);
  color: var(--bg-0);
  border-radius: 999px;
  display: grid; place-items: center;
  transition: background 0.15s, transform 0.15s, box-shadow 0.2s;
}

.dfp-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 640px;
}
.dfp-progress .progress-bar {
  flex: 1;
  height: 4px;
}
.dfp-time {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.dfp-time:last-child { text-align: right; }

.dfp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.dfp-actions .dfp-icon {
  background: transparent;
  margin-left: 0;
  width: 32px;
  height: 32px;
}
.dfp-actions .dfp-icon.active { color: var(--pink); }
.dfp-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  color: var(--ink-3);
}
.dfp-volume input[type="range"] {
  width: 80px;
  height: 18px;
}
.dfp-quality {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 5px 10px;
  border-radius: 5px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.dfp-quality.master {
  color: var(--pink);
  border-color: var(--pink);
}

@media (hover: hover) and (pointer: fine) {
  .dfp-pill:hover { background: var(--bg-3); color: var(--ink); }
  .dfp-pill.on:hover { background: var(--ink); color: var(--bg-0); }
  .dfp-icon:hover { background: var(--bg-3); color: var(--ink); }
  .dfp-artist-chip:hover { background: var(--bg-3); }
  .dfp-ctl:hover { color: var(--ink); }
  .dfp-ctl-play:hover { transform: scale(1.06); box-shadow: 0 0 24px -4px var(--gold-glow); background: var(--gold); }
  .dfp-quality:hover { background: var(--gold); color: var(--bg-0); }
  .dfp-quality.master:hover { background: var(--pink); color: var(--bg-0); }
}

/* Admin drag-drop zone ------------------------------------------------------- */
.admin-drop {
  border: 2px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(245, 193, 75, 0.04);
  padding: 56px 22px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.admin-drop:hover { border-color: var(--gold); background: rgba(245,193,75,0.08); }
.admin-drop.dragover {
  border-color: var(--pink);
  background: rgba(255,61,154,0.08);
  transform: scale(1.005);
}

/* Queue overlay inside full-screen player ------------------------------------ */
.dfp-queue {
  position: absolute;
  top: 64px;
  right: 0;
  bottom: 116px;
  width: 360px;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  border-top-left-radius: 14px;
  box-shadow: -20px 0 60px -20px rgba(0,0,0,0.6);
  z-index: 5;
  animation: dfpQueueIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dfp-queue .queue {
  background: transparent;
  border-radius: 0;
  padding: 22px 18px;
  flex: 1;
  min-height: 0;
}
.dfp.with-queue .dfp-main { padding-right: 380px; }
@keyframes dfpQueueIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* tablet refinement */
@media (max-width: 1100px) and (min-width: 769px) {
  :root { --sb-w: 220px; --queue-w: 280px; }
  .main-inner { padding: 20px 24px 60px; }
  .grid-albums { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
}

/* ============================================================
   Mobile full-screen player (Apple Music–style)
   Rendered only on mobile via React; styles only apply ≤ 768px.
   ============================================================ */
@media (max-width: 768px) {
  .mfp {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg-0);
    display: flex;
    flex-direction: column;
    padding: 0 22px env(safe-area-inset-bottom);
    overflow: hidden;
    animation: fpIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .mfp::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 50% at 30% 20%, var(--pink-glow), transparent 65%),
      radial-gradient(ellipse 70% 50% at 80% 80%, var(--gold-glow), transparent 65%);
    opacity: 0.55;
    pointer-events: none;
    z-index: -1;
  }

  .mfp-handle-row {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
  }
  .mfp-handle-btn {
    color: var(--ink-3);
    padding: 6px 22px;
    border-radius: 999px;
  }
  .mfp-handle-btn:active { color: var(--ink); }

  .mfp-eyebrow {
    text-align: center;
    padding: 4px 0 14px;
  }
  .mfp-eyebrow-label {
    font-family: var(--f-display);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 4px;
  }
  .mfp-eyebrow-title {
    font-size: 13px;
    color: var(--ink-2);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Content area: cover or lyrics */
  .mfp-content {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0 14px;
  }
  .mfp-cover {
    width: min(100%, 70vh);
    aspect-ratio: 1 / 1;
    max-width: 380px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
      0 30px 80px -20px rgba(0,0,0,0.95),
      0 0 60px -20px var(--pink-glow);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center;
  }
  .mfp-cover.paused { transform: scale(0.82); }
  .mfp-cover.playing { transform: scale(1); }

  .mfp-lyrics {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .mfp-lyrics .lyrics {
    padding: 24px 4px;
  }
  .mfp-lyrics .lyric-line {
    font-size: 24px;
    padding: 8px 0;
  }

  .mfp-queue-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 8px 0;
  }
  .mfp-section-h {
    font-family: var(--f-display);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-4);
    font-weight: 800;
    margin: 0 0 10px;
  }
  .mfp-queue-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 4px;
    border-radius: 8px;
    cursor: pointer;
  }
  .mfp-queue-item:active { background: var(--bg-3); }
  .mfp-queue-item .mini-cover {
    width: 44px; height: 44px;
    flex: 0 0 44px;
    border-radius: 6px;
    overflow: hidden;
  }
  .mfp-q-t {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mfp-q-a {
    font-size: 12px;
    color: var(--ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Title row */
  .mfp-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 14px;
  }
  .mfp-title-meta { flex: 1; min-width: 0; }
  .mfp-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: 26px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mfp-artist {
    font-size: 14px;
    color: var(--pink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mfp-heart {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    color: var(--ink-3);
    flex-shrink: 0;
    border-radius: 999px;
  }
  .mfp-heart.on { color: var(--pink); }
  .mfp-heart:active { background: var(--bg-3); }

  /* Progress */
  .mfp-progress { padding: 4px 0 12px; }
  .mfp-progress .progress-bar { height: 5px; }
  .mfp-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
  }

  /* Transport controls */
  .mfp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    padding: 4px 0 14px;
  }
  .mfp-ctl-side {
    color: var(--ink);
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 999px;
  }
  .mfp-ctl-side:active { background: var(--bg-3); transform: scale(0.94); }
  .mfp-ctl-main {
    width: 72px; height: 72px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg-0);
    display: grid;
    place-items: center;
    box-shadow:
      0 10px 30px -8px rgba(0,0,0,0.6),
      0 0 0 0 var(--gold-glow);
    transition: box-shadow 0.2s, transform 0.15s;
  }
  .mfp-ctl-main:active {
    transform: scale(0.94);
    box-shadow: 0 6px 20px -8px rgba(0,0,0,0.6), 0 0 0 8px rgba(245,193,75,0.18);
  }

  /* Volume */
  .mfp-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px 16px;
  }
  .mfp-volume input[type="range"] { flex: 1; }

  /* Bottom action row */
  .mfp-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 14px;
    gap: 12px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
  }
  .mfp-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-3);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color 0.15s, background 0.15s;
  }
  .mfp-action:active { background: var(--bg-3); }
  .mfp-action.on { color: var(--gold); background: rgba(245,193,75,0.1); }
  .mfp-action.master .mfp-q-pill { color: var(--pink); border-color: var(--pink); }

  .mfp-q-pill {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
  }
}
