/* =========================================================================
   Soundstage — a private listening room
   ========================================================================= */

:root {
  --bg:        #08070c;
  --bg-2:      #0e0d15;
  --panel:     rgba(255,255,255,.045);
  --panel-2:   rgba(255,255,255,.075);
  --line:      rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.06);
  --text:      #f2f0f7;
  --muted:     #a7a2b8;
  --dim:       #746e88;

  /* Accent is re-tinted from the current album art at runtime. */
  --accent:    #8b6cff;
  --accent-2:  #34d8c4;
  --accent-ink:#0a0812;

  --radius:    18px;
  --radius-sm: 11px;
  --shadow:    0 24px 60px rgba(0,0,0,.55);
  --ease:      cubic-bezier(.22,.9,.28,1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor;
      stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------- backdrop --- */

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }

.backdrop-img {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  filter: blur(70px) saturate(160%) brightness(.55);
  transform: scale(1.18);
  opacity: 0;
  transition: opacity .9s var(--ease), background-image .3s linear;
}
.backdrop-img.on { opacity: .85; }

.backdrop-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, rgba(8,7,12,.55) 0%, rgba(8,7,12,.82) 55%, rgba(8,7,12,.95) 100%);
}

/* -------------------------------------------------------------- gate --- */

.gate {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(400px, 100%);
  padding: 34px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.028));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.gate-logo {
  display: block;
  width: 100%; height: auto; max-width: 340px;
  margin: 0 auto 18px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
}

@keyframes bounce { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.gate-title { margin: 0; font-size: 26px; letter-spacing: -.02em; text-align: center; }
.gate-sub   { margin: 6px 0 22px; text-align: center; color: var(--muted); font-size: 14px; }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 20px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.tab {
  padding: 9px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 550;
  transition: background .2s, color .2s;
}
.tab.is-active { background: var(--panel-2); color: var(--text); }
.tab:hover:not(.is-active) { color: var(--text); }

.gate-form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 550; letter-spacing: .01em; }

.field input {
  width: 100%; padding: 12px 14px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  background: rgba(0,0,0,.42);
}

.hint { margin: -4px 0 0; font-size: 12.5px; color: var(--dim); }

.form-error {
  margin: 0; padding: 10px 12px;
  background: rgba(255,90,110,.12);
  border: 1px solid rgba(255,90,110,.3);
  border-radius: var(--radius-sm);
  color: #ffb3bf; font-size: 13.5px;
}

.btn-primary {
  margin-top: 4px; padding: 13px;
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 700; font-size: 14.5px; letter-spacing: .01em;
  transition: transform .15s var(--ease), filter .2s, opacity .2s;
}
.btn-primary:hover  { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.985); }
.btn-primary[disabled] { opacity: .55; cursor: progress; }

/* --------------------------------------------------------------- app --- */

.app {
  position: relative; z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;       /* banner, toolbar, content */
  grid-template-columns: minmax(0, 1fr);   /* never widen past the viewport */
  overflow: hidden;
}

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8,7,12,.5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}

/* Artwork banner across the full width of the page. */
.banner {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(104px, 17vh, 200px);
  overflow: hidden;
  background: #0f0f0f;
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
}

/* The motion banner is 1736x240 with a flat #0f0f0f background. Matching that
   colour on the container means "contain" letterboxes invisibly — so the whole
   design is always visible, uncropped, at every window width. */
.banner-video {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;   /* let clicks reach the link underneath */
}

/* No scrim over this one — the video fills the full height, so a fade would
   dim the lower half of the design itself. The matching background and the
   hairline border below are enough separation. */

/* Genre dropdown in the header */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.genre-select-wrap {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center;
}
.genre-select-wrap .caret {
  position: absolute; right: 10px;
  width: 14px; height: 14px;
  color: var(--dim); pointer-events: none;
}

#genreSelect {
  appearance: none; -webkit-appearance: none;
  max-width: 190px;
  padding: 8px 30px 8px 14px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: background .2s, border-color .2s, color .2s;
}
#genreSelect:hover { background: rgba(255,255,255,.09); }
#genreSelect:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
/* Filled-in look while a genre is actually selected */
#genreSelect.is-filtering {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent;
}
#genreSelect.is-filtering + .caret { color: var(--accent-ink); }

/* The dropdown list itself is drawn by the OS, so force readable colors. */
#genreSelect option { background: #14121c; color: #f2f0f7; }

.search {
  flex: 1; max-width: 420px; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line-soft); border-radius: 999px;
  transition: border-color .2s, background .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: rgba(255,255,255,.08); }
.search svg { width: 16px; height: 16px; color: var(--dim); flex-shrink: 0; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 34px; height: 34px; padding: 8px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
#whoName { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--dim); font-size: 13px; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.2);
  white-space: nowrap;
}
.link-btn:hover { color: var(--text); }

.layout {
  min-height: 0; min-width: 0;
  display: grid; grid-template-columns: 320px minmax(0, 1fr) 380px;
}

/* ------------------------------------------------------------ lyrics --- */

.lyrics {
  min-height: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(10,9,15,.45);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.lyrics-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 8px;
}
.lyrics-title {
  margin: 0; flex: 1;
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--dim);
}
.lyrics-close { display: none; }

.lyrics-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 4px 20px 28px;
  font-size: 14.5px; line-height: 1.85;
  color: var(--muted);
  white-space: pre-wrap; word-wrap: break-word;
  scrollbar-width: thin;
}
.lyrics-body::-webkit-scrollbar { width: 9px; }
.lyrics-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}

/* One line per timestamped entry, so the current one can be lit up. */
.lyric-line {
  display: block;
  padding: 1px 0;
  color: var(--dim);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.lyric-line.is-now {
  color: var(--text); font-weight: 600;
  transform: translateX(3px);
}
.lyric-line.is-past { color: rgba(255,255,255,.22); }

.lyrics-empty {
  padding: 30px 4px; text-align: center;
  color: var(--dim); font-size: 13.5px; line-height: 1.7;
}

.lyrics-editor { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }

#lyricsText {
  width: 100%; min-height: 260px; flex: 1;
  padding: 12px 14px;
  background: rgba(0,0,0,.34);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 14px; line-height: 1.65;
  resize: vertical;
}
#lyricsText:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.lyrics-hint { margin: 0; font-size: 12px; color: var(--dim); min-height: 1em; }
.lyrics-actions { display: flex; gap: 8px; justify-content: flex-end; }

.btn-small {
  padding: 8px 16px; border: 0; border-radius: 9px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-size: 13.5px; font-weight: 650;
}
.btn-small:hover { filter: brightness(1.08); }
.btn-small[disabled] { opacity: .55; cursor: progress; }

.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13.5px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); background: var(--panel); }

/* --------------------------------------------------------- equalizer --- */

.eq-panel {
  width: min(320px, 100%);
  margin-top: 4px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(18,16,26,.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: rise .22s var(--ease) both;
}

.eq-row {
  display: grid; grid-template-columns: 46px 1fr 34px;
  align-items: center; gap: 10px;
  margin-bottom: 9px;
}
.eq-label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.eq-val {
  font-size: 12px; color: var(--dim); text-align: right;
  font-variant-numeric: tabular-nums;
}

.eq-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 16px; background: transparent; cursor: pointer;
}
.eq-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.14));
}
.eq-slider::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.14); }
.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; margin-top: -4.5px;
  background: var(--accent); border: 2px solid #fff; border-radius: 50%;
}
.eq-slider::-moz-range-thumb {
  width: 13px; height: 13px;
  background: var(--accent); border: 2px solid #fff; border-radius: 50%;
}
.eq-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 99px; }

.eq-foot { display: flex; justify-content: center; padding-top: 6px; }
.eq-presets { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }

.eq-preset {
  padding: 5px 11px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: transparent; color: var(--dim);
  font-size: 12px; font-weight: 550; cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.eq-preset:hover { color: var(--text); background: var(--panel-2); }
.eq-preset.is-active {
  background: var(--text); color: var(--bg); border-color: transparent;
}

/* ------------------------------------------------------------- stage --- */

.stage {
  min-height: 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.2vh, 22px);
  padding: clamp(14px, 3vh, 30px) 26px;
  overflow: hidden;
}

.viz-wrap {
  position: relative;
  width: min(74vh, 100%, 520px);
  aspect-ratio: 1;
  display: grid; place-items: center;
  flex-shrink: 1; min-height: 0;
}

.viz { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.art {
  position: relative;
  width: 52%; aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #1b1826, #121019);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.09),
    0 30px 70px rgba(0,0,0,.6),
    0 0 90px -18px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.art.playing { transform: scale(1.028); }

.art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.art-blank { display: grid; place-items: center; width: 100%; height: 100%; padding: 26%; color: rgba(255,255,255,.14); }
.art-blank svg { stroke-width: 1.2; }

.meta { text-align: center; max-width: 560px; }
.track-title {
  margin: 0; font-size: clamp(19px, 2.6vw, 25px); font-weight: 700;
  letter-spacing: -.02em; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-sub {
  margin: 4px 0 0; color: var(--muted); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.genre-pills {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px; margin-top: 10px;
}

.genre-pill {
  padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  text-transform: lowercase;
  cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.genre-pill:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--text);
}

/* scrubber */
.scrub {
  width: min(560px, 100%);
  display: flex; align-items: center; gap: 12px;
}
.time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; width: 40px; }
.time:last-child { text-align: right; }

.bar {
  position: relative; flex: 1; height: 16px;
  display: flex; align-items: center; cursor: pointer;
  touch-action: none;
}
.bar::before {
  content: ''; position: absolute; inset-inline: 0; height: 5px;
  background: rgba(255,255,255,.12); border-radius: 99px;
}
.bar-buffer {
  position: absolute; left: 0; height: 5px; width: 0;
  background: rgba(255,255,255,.1); border-radius: 99px;
}
.bar-fill {
  position: absolute; left: 0; height: 5px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 99px;
}
.bar-knob {
  position: absolute; right: 0; top: 50%;
  width: 12px; height: 12px; margin-right: -6px;
  transform: translateY(-50%) scale(0);
  background: #fff; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
  transition: transform .18s var(--ease);
}
.bar:hover .bar-knob, .bar:focus-visible .bar-knob { transform: translateY(-50%) scale(1); }
.bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 99px; }

/* transport */
.controls { display: flex; align-items: center; gap: clamp(6px, 1.6vw, 14px); }

.ctl {
  width: 44px; height: 44px; padding: 11px;
  position: relative;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .2s, background .2s, transform .15s var(--ease);
}
.ctl:hover  { color: var(--text); background: var(--panel-2); }
.ctl:active { transform: scale(.92); }
.ctl[aria-pressed="true"] { color: var(--accent); }
.ctl.small { width: 36px; height: 36px; padding: 9px; }
.ctl.small[aria-pressed="true"] svg { fill: currentColor; }

.ctl-play {
  width: 62px; height: 62px; padding: 19px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.ctl-play:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.1); }

.badge {
  position: absolute; top: 5px; right: 5px;
  min-width: 14px; height: 14px; padding: 0 3px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 7px; font-size: 9px; font-weight: 800;
}

.extras { display: flex; align-items: center; gap: 12px; }

.volume { display: flex; align-items: center; gap: 6px; }

.vol {
  width: 92px; height: 16px;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
.vol::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.14); }
.vol::-moz-range-track             { height: 4px; border-radius: 99px; background: rgba(255,255,255,.14); }
.vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -3.5px;
  background: #fff; border-radius: 50%; border: 0;
}
.vol::-moz-range-thumb { width: 11px; height: 11px; background: #fff; border-radius: 50%; border: 0; }
.vol:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 99px; }

/* ----------------------------------------------------------- library --- */

.library {
  min-height: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line-soft);
  background: rgba(10,9,15,.58);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}

.lib-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}

.filters { display: flex; gap: 6px; flex: 1; min-width: 0; }

/* Genres get their own row that scrolls sideways, so the main filters
   above them can never be pushed out of reach. */
.genre-row {
  display: flex; gap: 6px;
  padding: 0 16px 2px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 16px;
}
.genre-row::-webkit-scrollbar { display: none; }

.chip-genre { color: var(--dim); flex: 0 0 auto; }
.chip-genre.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}

.chip {
  padding: 6px 13px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 550; cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); }
.chip.is-active {
  background: var(--text); color: var(--bg); border-color: transparent;
}

.lib-close { display: none; }

.lib-count { margin: 0; padding: 0 18px 8px; font-size: 12px; color: var(--dim); }

.lib-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 22px; scrollbar-gutter: stable; }

.lib-list::-webkit-scrollbar { width: 9px; }
.lib-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
.lib-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); background-clip: content-box; }

.group-head {
  position: sticky; top: 0; z-index: 2;
  margin: 14px 0 4px; padding: 7px 8px;
  background: rgba(10,9,15,.92);
  backdrop-filter: blur(10px);
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.row {
  display: grid; grid-template-columns: 38px 1fr auto auto;
  align-items: center; gap: 11px;
  width: 100%; padding: 7px 8px;
  border: 0; border-radius: 11px;
  background: transparent; text-align: left; cursor: pointer;
  transition: background .15s;
}
.row:hover { background: var(--panel); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row.is-current { background: var(--panel-2); }

.row-art {
  width: 38px; height: 38px; border-radius: 7px; overflow: hidden;
  background: linear-gradient(145deg, #1d1a28, #131119);
  display: grid; place-items: center; flex-shrink: 0;
  position: relative;
}
.row-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-art .ph { width: 16px; height: 16px; color: rgba(255,255,255,.18); }

.eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.eq i {
  width: 2.5px; border-radius: 2px; background: var(--accent);
  animation: bounce .9s var(--ease) infinite;
}
.eq i:nth-child(1) { height: 45%; }
.eq i:nth-child(2) { height: 100%; animation-delay: .15s; }
.eq i:nth-child(3) { height: 65%; animation-delay: .3s; }
.eq.paused i { animation-play-state: paused; }

.row-text { min-width: 0; display: grid; gap: 1px; }
.row-title {
  display: block; font-size: 14px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row.is-current .row-title { color: var(--accent); }
.row-sub {
  display: block; font-size: 12.5px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.row-fav {
  width: 28px; height: 28px; padding: 6px;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--dim); cursor: pointer; opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}
.row:hover .row-fav, .row-fav.on { opacity: 1; }
.row-fav:hover { background: var(--panel-2); color: var(--text); }
.row-fav.on { color: var(--accent); }
.row-fav.on svg { fill: currentColor; }

.row-time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

.lib-empty { padding: 34px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.lib-empty p { margin: 0 0 8px; }
.lib-empty code {
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255,255,255,.08); font-size: 12.5px;
}

/* ------------------------------------------------------------- toast --- */

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 50;
  transform: translate(-50%, 14px);
  padding: 11px 18px;
  background: rgba(24,22,32,.96);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------- responsive --- */

/* Below this the three-column layout squeezes the player too hard, so the
   lyrics become a panel that slides in from the left instead. */
@media (max-width: 1359px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; }

  .lyrics {
    position: fixed; inset: 0 auto 0 0; z-index: 41;
    width: min(360px, 88vw);
    border-right: 1px solid var(--line);
    background: rgba(9,8,13,.98);
    transform: translateX(-102%);
    transition: transform .34s var(--ease);
    padding-top: env(safe-area-inset-top);
  }
  .lyrics.open { transform: translateX(0); }
  .lyrics-close { display: grid; }
}

@media (min-width: 1360px) {
  #btnLyrics { display: none; }
}

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .lyrics { width: min(400px, 92vw); }

  .library {
    position: fixed; inset: 0; z-index: 40;
    border-left: 0;
    background: rgba(9,8,13,.97);
    transform: translateX(100%);
    transition: transform .34s var(--ease);
    padding-top: env(safe-area-inset-top);
  }
  .library.open { transform: translateX(0); }
  .lib-close { display: grid; }

  .stage { padding-bottom: 26px; }
  .viz-wrap { width: min(60vh, 86vw); }
}

@media (min-width: 1021px) {
  #btnLibrary { display: none; }
}

@media (max-width: 560px) {
  .topbar { padding: 10px 12px; gap: 10px; }
  .who span { display: none; }
  #genreSelect { max-width: 118px; }
  .banner { height: clamp(64px, 10vh, 96px); }
  .search { max-width: none; }
  .stage { padding: 12px 16px 22px; gap: 12px; }
  .viz-wrap { width: min(52vh, 90vw); }
  .extras { gap: 8px; }
  .vol { width: 70px; }
  .controls { gap: 4px; }
}

@media (max-height: 620px) {
  .viz-wrap { width: min(46vh, 80vw); }
  .extras { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
