/* ===== fluid.css ===== */
/* Punjabi Rewind — Neon Noir ink playground.
   Cosmic gradient backdrop, floating particle dust, neon glass panels,
   glowing dock, animated gradient type, and shimmering interactions. */

:root {
  color-scheme: dark;
  --ink: #eef2f4;
  --ink-dim: #b8c4d0;
  --ink-faint: #7a8a9c;
  --line: rgba(180, 210, 200, .1);
  --line-soft: rgba(180, 210, 200, .05);
  --glass: rgba(8, 14, 22, .82);
  --glass-soft: rgba(12, 20, 30, .7);
  /* Every mint/amber tint in this file derives from these two channels, so a
     palette swap repaints the chrome and the ink together — one room, one
     colour story. */
  --accent-rgb: 0, 255, 163;
  --warm-rgb: 255, 167, 38;
  --glass-border: rgba(var(--accent-rgb), .12);
  --accent: rgb(var(--accent-rgb));
  --accent-dim: #00cc82;
  --accent-glow: rgba(var(--accent-rgb), .35);
  --accent-soft: rgba(var(--accent-rgb), .08);
  --accent-strong: #00ffb8;
  --accent-ink: #0a1a12;
  --warm: rgb(var(--warm-rgb));
  --warm-glow: rgba(var(--warm-rgb), .3);
  /* Transitions were written as var(--transition) 22 times while the property
     itself was never defined — every one of them silently fell back to 0s. */
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
  --shadow: 0 8px 40px rgba(0, 0, 0, .5), 0 0 1px rgba(var(--accent-rgb), .1);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, .6), 0 0 2px rgba(var(--accent-rgb), .15);
  --font-display: 'Chakra Petch', sans-serif;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Sans Mono', ui-monospace, SFMono-Regular, monospace;
}

/* Registered colour channels so a palette swap (or a new album-art glow)
   cross-fades instead of snapping — every tint in the room interpolates
   over .7s. Browsers without @property keep the instant swap, as before. */
@property --accent-rgb { syntax: '<number>#'; inherits: true; initial-value: 0, 255, 163; }
@property --warm-rgb { syntax: '<number>#'; inherits: true; initial-value: 255, 167, 38; }
@property --art-rgb { syntax: '<number>#'; inherits: true; initial-value: 0, 255, 163; }
:root { transition: --accent-rgb .7s ease, --warm-rgb .7s ease, --art-rgb .7s ease; }

/* ═══════════════════════════════════════════════════════════════
   COLOUR STORIES — one per ink palette, set from the track
   ═══════════════════════════════════════════════════════════════ */
[data-palette="aurora"] {
  --accent-rgb: 0, 255, 163;
  --accent-dim: #00cc82;
  --accent-strong: #00ffb8;
  --warm-rgb: 255, 61, 138;
}
[data-palette="ember"] {
  --accent-rgb: 255, 167, 38;
  --accent-dim: #f57c00;
  --accent-strong: #ffc457;
  --warm-rgb: 255, 59, 47;
}
[data-palette="lagoon"] {
  --accent-rgb: 34, 211, 238;
  --accent-dim: #0891b2;
  --accent-strong: #67e8f9;
  --warm-rgb: 63, 124, 255;
}
[data-palette="prism"] {
  --accent-rgb: 38, 230, 102;
  --accent-dim: #12b855;
  --accent-strong: #5cff8f;
  --warm-rgb: 255, 47, 122;
}
/* Festival stories — saffron & harvest green for Vaisakhi, lamps & night
   purple for Diwali. They repaint the chrome and the ink together. */
[data-palette="vaisakhi"] {
  --accent-rgb: 255, 153, 51;
  --accent-dim: #e07b00;
  --accent-strong: #ffc069;
  --warm-rgb: 5, 166, 78;
}
[data-palette="diwali"] {
  --accent-rgb: 168, 85, 247;
  --accent-dim: #7c3aed;
  --accent-strong: #c4b5fd;
  --warm-rgb: 250, 204, 21;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #050a0f;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, select, input { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
a { color: var(--accent); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 12px var(--accent-glow);
}
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   COSMIC BACKGROUND — the backdrop the ink canvas paints over. It
   breathes only when the canvas is gone (body.no-webgl), so the live
   page never pays for a full-screen blur animation nobody can see.
   ═══════════════════════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(var(--accent-rgb), .07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(var(--warm-rgb), .05) 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 80%, rgba(100, 60, 255, .04) 0%, transparent 70%);
  filter: blur(48px) saturate(1.4);
}
@keyframes cosmicDrift {
  0% { transform: translate(0, 0) scale(1); opacity: .8; }
  33% { transform: translate(-3%, 2%) scale(1.05); opacity: 1; }
  66% { transform: translate(2%, -3%) scale(.95); opacity: .9; }
  100% { transform: translate(-1%, 1%) scale(1.02); opacity: 1; }
}

/* Floating particle dust — decorative, and the first thing the Soft glow
   switch turns off. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(var(--accent-rgb), .3), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, .2), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(var(--accent-rgb), .15), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(var(--warm-rgb), .2), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, .15), transparent),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(var(--accent-rgb), .1), transparent),
    radial-gradient(1px 1px at 60% 50%, rgba(255, 255, 255, .12), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(var(--accent-rgb), .2), transparent),
    radial-gradient(1px 1px at 40% 90%, rgba(var(--warm-rgb), .12), transparent),
    radial-gradient(1.5px 1.5px at 25% 45%, rgba(255, 255, 255, .1), transparent),
    radial-gradient(1px 1px at 55% 30%, rgba(var(--accent-rgb), .15), transparent),
    radial-gradient(1px 1px at 75% 65%, rgba(255, 255, 255, .1), transparent);
  animation: particleDrift 45s linear infinite;
}
body.no-dust::after { display: none; }
@keyframes particleDrift {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-30px) translateX(15px); }
  50% { transform: translateY(-15px) translateX(-10px); }
  75% { transform: translateY(-40px) translateX(20px); }
  100% { transform: translateY(0) translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   CANVAS
   ═══════════════════════════════════════════════════════════════ */
#fluid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   VIGNETTE — darkens the frame so the ink and the chrome both read
   ═══════════════════════════════════════════════════════════════ */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 125% 105% at 50% 45%, transparent 52%, rgba(2, 6, 10, .5) 100%);
}
/* Beat flash — a breath of accent light at the frame edges on each detected
   beat. The .beat class is re-armed from the audio-reactive tick. */
.vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 118% 100% at 50% 50%, transparent 58%, rgba(var(--accent-rgb), .16) 100%);
  opacity: 0;
}
.vignette.beat::after { animation: beatFlash .55s ease-out; }
@keyframes beatFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   GLASS — frosted panes with a lit top edge
   ═══════════════════════════════════════════════════════════════ */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  /* The top highlight is what makes a pane read as glass; the inset is
     cheap, always visible, and survives the panel's own opaque fill. */
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(12px) saturate(1.35);
  -webkit-backdrop-filter: blur(12px) saturate(1.35);
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass:hover {
  border-color: rgba(var(--accent-rgb), .24);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 22px var(--accent-soft);
}
/* Polish pass: a hairline sheen from the top edge and a whisper of film
   grain over every pane. Decorative only — pointer-transparent and clipped
   to the pane's own radius. Round buttons keep their own ::before glow. */
.glass:not(.round-button)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 30%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════════════════════════
   SKIP LINK
   ═══════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0f151d;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}
.skip-link:focus { left: 16px; top: 16px; }

/* ═══════════════════════════════════════════════════════════════
   BRAND — animated gradient title
   ═══════════════════════════════════════════════════════════════ */
.brand {
  position: fixed;
  top: 34px;
  left: 38px;
  pointer-events: none;
  user-select: none;
  max-width: 44vw;
  z-index: 20;
}
.eyebrow {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .35em;
  color: var(--accent);
  text-transform: uppercase;
  opacity: .85;
  text-shadow: 0 0 10px var(--accent-glow);
}
.brand h1 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  letter-spacing: -.06em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, #00ffd5 30%, var(--warm) 60%, var(--accent) 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 16s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), .2));
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* A breath of light through the wordmark on every track change — the class
   is re-armed from rewind.js so the pulse restarts cleanly. */
.brand h1.pulse { animation: gradientShift 16s ease-in-out infinite, brandPulse 1s ease-out; }
@keyframes brandPulse {
  0% { filter: drop-shadow(0 0 34px rgba(var(--accent-rgb), .6)) drop-shadow(0 0 14px rgba(var(--warm-rgb), .45)); }
  100% { filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), .2)); }
}
.subtitle {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: .04em;
  font-weight: 400;
  position: relative;
}
.subtitle::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  vertical-align: middle;
  margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   TOP-RIGHT: status + glowing round buttons
   ═══════════════════════════════════════════════════════════════ */
.top-right {
  position: fixed;
  top: 28px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 30;
}
.status {
  display: flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .05);
  border: 1px solid rgba(var(--accent-rgb), .1);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  box-shadow: 0 0 8px var(--accent-glow);
}
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); transform: scale(1); }
  50% { box-shadow: 0 0 12px var(--accent-glow), 0 0 24px rgba(var(--accent-rgb), .2); transform: scale(1.2); }
}
.dot.live { background: var(--warm); box-shadow: 0 0 8px var(--warm-glow); animation: warmPulse 1.6s ease-in-out infinite; }
@keyframes warmPulse {
  0%, 100% { box-shadow: 0 0 4px var(--warm-glow); transform: scale(1); }
  50% { box-shadow: 0 0 12px var(--warm-glow), 0 0 24px rgba(var(--warm-rgb), .2); transform: scale(1.3); }
}
.round-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), .06);
  border: 1px solid rgba(var(--accent-rgb), .12);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.round-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}
.round-button:hover {
  background: rgba(var(--accent-rgb), .12);
  border-color: rgba(var(--accent-rgb), .3);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.08);
}
.round-button:hover::before { opacity: 1; }
.round-button:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════
   NOW-PLAYING PILL
   ═══════════════════════════════════════════════════════════════ */
.now-pill {
  position: fixed;
  top: 82px;
  right: 30px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  max-width: min(300px, 42vw);
  background: linear-gradient(135deg, rgba(var(--art-rgb, var(--accent-rgb)), .1), rgba(8, 14, 22, .85));
  border: 1px solid rgba(var(--art-rgb, var(--accent-rgb)), .22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4), inset 0 0 20px rgba(var(--art-rgb, var(--accent-rgb)), .04);
  animation: pillGlow 3s ease-in-out infinite;
}
@keyframes pillGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, .4), inset 0 0 20px rgba(var(--art-rgb, var(--accent-rgb)), .04); }
  50% { box-shadow: 0 4px 25px rgba(0, 0, 0, .4), 0 0 16px rgba(var(--art-rgb, var(--accent-rgb)), .12), inset 0 0 20px rgba(var(--art-rgb, var(--accent-rgb)), .06); }
}
.now-pill .now-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--art-rgb, var(--accent-rgb)));
  flex: none;
  box-shadow: 0 0 6px rgba(var(--art-rgb, var(--accent-rgb)), .4);
  animation: neonPulse 2s ease-in-out infinite;
}
.now-pill .now-text {
  font-size: 11px;
  color: #d7dee6;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-pill .now-text strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-pill .now-text em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}

/* ═══════════════════════════════════════════════════════════════
   CONTROL PANEL
   ═══════════════════════════════════════════════════════════════ */
.panel {
  position: fixed;
  top: 140px;
  right: 30px;
  width: 272px;
  border-radius: 16px;
  padding: 22px;
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  z-index: 25;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(8, 14, 22, .88), rgba(5, 10, 16, .92));
  border-left: 2px solid rgba(var(--accent-rgb), .08);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent-dim);
}
.mini {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: .1em;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), .05);
  border: 1px solid rgba(var(--accent-rgb), .08);
}
.control { display: block; margin-top: 18px; }
.label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 10px;
  color: var(--ink-dim);
  font-weight: 500;
}
.output { color: var(--accent); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 11px; font-weight: 600; }
input[type=range] { display: block; width: 100%; margin: 0; height: 14px; accent-color: var(--accent); cursor: pointer; }
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
  transition: transform .15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.3); }
input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
  border: none;
}
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), .15);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), .04);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
}
select:hover { border-color: rgba(var(--accent-rgb), .3); }
select:focus { border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); outline: none; }
select option { background: #0a1018; color: var(--ink); }
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-dim);
}
input[type=checkbox] { width: 32px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .15), transparent); margin: 18px 0 0; }
.reactive-controls {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(var(--accent-rgb), .08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reactive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 500;
}
.mic-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), .15);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-weight: 500;
  transition: all var(--transition);
}
.mic-btn:hover { color: var(--accent); border-color: var(--accent); }
.mic-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-glow);
}
.sens-row {
  display: grid;
  grid-template-columns: 40px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-dim);
  margin: 0;
  cursor: pointer;
}
.sens-row output { text-align: right; color: var(--accent); font-weight: 600; }
.panel-note {
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.7;
  margin: 16px 0 0;
}
.panel-note kbd {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(var(--accent-rgb), .15);
  background: rgba(var(--accent-rgb), .04);
  color: var(--accent-dim);
}

/* ═══════════════════════════════════════════════════════════════
   LIBRARY PANEL
   ═══════════════════════════════════════════════════════════════ */
.library {
  position: fixed;
  top: 140px;
  left: 38px;
  width: 322px;
  border-radius: 16px;
  padding: 18px 6px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100dvh - 380px);
  min-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 25;
  border-right: 2px solid rgba(var(--accent-rgb), .08);
  background: linear-gradient(180deg, rgba(8, 14, 22, .88), rgba(5, 10, 16, .92));
}
.library[hidden] { display: none !important; }
.library-head { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
.library-head h2 { margin: 0; font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--accent-dim); }
.library-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), .04);
  border: 1px solid rgba(var(--accent-rgb), .1);
  transition: all var(--transition);
}
.library-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  background: rgba(var(--accent-rgb), .06);
}
.library-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.library-search input::placeholder { color: var(--ink-faint); }
.library-search span { color: var(--accent); font-size: 11px; }
.library-search button { color: var(--ink-faint); font-size: 14px; line-height: 1; padding: 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding-right: 10px; }
.chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), .1);
  background: rgba(var(--accent-rgb), .03);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--ink-dim);
  transition: all var(--transition);
}
.chip:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), .25); background: rgba(var(--accent-rgb), .06); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 0 10px var(--accent-glow);
}
.track-list {
  list-style: none;
  margin: 0;
  padding: 0 10px 0 0;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
  overscroll-behavior: contain;
}
.track-row { display: flex; align-items: center; gap: 2px; }
.track {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.track:hover {
  background: rgba(var(--accent-rgb), .06);
  border-color: rgba(var(--accent-rgb), .08);
  transform: translateX(2px);
}
.track.is-playing {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .1), transparent);
  border-color: rgba(var(--accent-rgb), .15);
}
/* Real artwork per row, the position number as its badge and a play
   triangle on hover — the library finally shows what the songs look like. */
.track .art {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .2), rgba(var(--warm-rgb), .16));
  border: 1px solid rgba(255, 255, 255, .07);
}
.track .art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .68;
  transition: opacity var(--transition), transform .35s ease;
}
.track:hover .art img, .track.is-playing .art img { opacity: 1; transform: scale(1.08); }
.track .art::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 2;
  opacity: 0;
  transform: translate(-42%, -50%) scale(.8);
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .9));
  transition: opacity var(--transition), transform var(--transition);
}
.track:hover .art::after, .track:focus-visible .art::after { opacity: 1; transform: translate(-42%, -50%) scale(1); }
.track .num {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #dfe8ee;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(3, 7, 11, .6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  transition: opacity var(--transition);
}
.track:hover .num { opacity: 0; }
.track.is-playing .num { color: var(--accent); }
.track.is-playing .art { border-color: rgba(var(--accent-rgb), .35); box-shadow: 0 0 10px var(--accent-soft); }
.track .meta { flex: 1; min-width: 0; }
.track .meta strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track .meta span {
  display: block;
  font-size: 10px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-row .fav {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-faint);
  transition: all var(--transition);
}
.track-row .fav:hover {
  color: #ffd166;
  background: rgba(255, 209, 102, .1);
  transform: scale(1.15);
}
.track-row .fav[aria-pressed="true"] { color: #ffd166; background: rgba(255, 209, 102, .1); }

.library-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 10px;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 500;
}
.library-foot button {
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  transition: all var(--transition);
}
.library-foot button:hover { color: var(--accent-strong); background: rgba(var(--accent-rgb), .1); box-shadow: 0 0 8px var(--accent-glow); }

/* Playlist */
.playlist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), .04);
  border: 1px solid rgba(var(--accent-rgb), .1);
  font-size: 10.5px;
  color: var(--ink-dim);
  transition: all var(--transition);
}
.playlist-row:focus-within { border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.playlist-row span { flex: none; letter-spacing: .06em; text-transform: uppercase; font-size: 9.5px; color: var(--accent); font-family: var(--font-display); font-weight: 500; }
.playlist-row select { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 12px; outline: none; padding: 0; }
.playlist-row select option { background: #0a1018; }
.playlist-row button {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: 0 0 8px var(--accent-glow);
}
.playlist-row button:hover { background: var(--accent-strong); box-shadow: 0 0 16px var(--accent-glow); transform: scale(1.05); }

/* Radio */
.radio {
  margin-right: 10px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--warm-rgb), .04), rgba(var(--accent-rgb), .02));
  border: 1px solid rgba(var(--warm-rgb), .1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-margin: 10px;
  transition: all var(--transition);
}
.radio.flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 30px var(--accent-soft);
  animation: radioFlash 1.2s ease-out;
}
@keyframes radioFlash {
  0% { box-shadow: 0 0 0 4px var(--accent-glow), 0 0 40px rgba(var(--accent-rgb), .2); }
  100% { box-shadow: 0 0 0 2px var(--accent-glow), 0 0 30px var(--accent-soft); }
}
.radio-head { display: flex; align-items: center; justify-content: space-between; }
.radio-head strong {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warm);
}
.radio-status {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-weight: 500;
}
.radio-status.live { color: var(--warm); animation: warmPulse 1.6s ease-in-out infinite; }
.radio-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--warm-rgb), .08), rgba(var(--accent-rgb), .04));
  border: 1px solid rgba(var(--warm-rgb), .15);
  text-align: left;
  width: 100%;
  transition: all var(--transition);
}
.radio-main:hover {
  background: linear-gradient(135deg, rgba(var(--warm-rgb), .12), rgba(var(--accent-rgb), .06));
  border-color: rgba(var(--warm-rgb), .25);
  box-shadow: 0 0 12px var(--warm-glow);
}
.radio-main[aria-pressed="true"] {
  background: var(--warm);
  border-color: var(--warm);
  color: var(--accent-ink);
  box-shadow: 0 0 20px var(--warm-glow);
}
.radio-main[aria-pressed="true"] .radio-text em { color: rgba(10, 10, 10, .7); }
#dialGlyph {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--warm), rgba(var(--warm-rgb), .4));
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 0 10px var(--warm-glow);
}
.radio-text { flex: 1; min-width: 0; }
.radio-text strong { display: block; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-text em { display: block; font-style: normal; font-size: 10px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.radio-presets button {
  flex: 1 1 0;
  min-width: 50px;
  padding: 6px 5px;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), .1);
  background: rgba(var(--accent-rgb), .03);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-dim);
  transition: all var(--transition);
}
.radio-presets button:hover { color: #fff; border-color: rgba(var(--accent-rgb), .25); background: rgba(var(--accent-rgb), .06); }
.radio-presets button.active {
  background: linear-gradient(135deg, var(--warm), rgba(var(--warm-rgb), .6));
  border-color: var(--warm);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 0 10px var(--warm-glow);
}
.empty-note { font-size: 10.5px; color: var(--ink-faint); padding: 10px 0; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   BOTTOM: hint + glowing dock
   ═══════════════════════════════════════════════════════════════ */
.bottom {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 25;
}
.hint {
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
  opacity: .7;
}
.dock {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 14px;
  gap: 2px;
  background: linear-gradient(135deg, rgba(8, 14, 22, .9), rgba(12, 20, 30, .85));
  border: 1px solid rgba(var(--accent-rgb), .12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .5), inset 0 0 1px rgba(var(--accent-rgb), .1);
}
.dock button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-dim);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.dock button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all var(--transition);
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--accent-glow);
}
.dock button:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .06);
  box-shadow: 0 0 12px var(--accent-soft);
}
.dock button:hover::after { width: 60%; }
.dock button:active { transform: scale(0.96); }
.dock button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.dock button.primary:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 4px 20px var(--accent-glow);
}
.dock button.primary::after { background: var(--accent-ink); }
.dock-separator { width: 1px; height: 20px; background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), .15), transparent); margin: 0 3px; }

/* ═══════════════════════════════════════════════════════════════
   BOTTOM-LEFT: now playing + slogan
   ═══════════════════════════════════════════════════════════════ */
.left-bottom {
  position: fixed;
  left: 38px;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 25;
  max-width: min(400px, 38vw);
}
.now {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 14, 22, .88), rgba(12, 20, 30, .8));
  /* Album-art glow: --art-rgb is sampled from the playing track's cover and
     cross-fades (registered @property); the accent is the fallback. */
  border: 1px solid rgba(var(--art-rgb, var(--accent-rgb)), .2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 28px rgba(var(--art-rgb, var(--accent-rgb)), .13);
  transition: all var(--transition);
}
.now:hover { border-color: rgba(var(--art-rgb, var(--accent-rgb)), .38); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 30px rgba(var(--art-rgb, var(--accent-rgb)), .22); }
.cover {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .25), rgba(var(--warm-rgb), .2));
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #0c1418;
  padding: 0;
  box-shadow: 0 0 14px rgba(var(--art-rgb, var(--accent-rgb)), .45);
  transition: all var(--transition);
}
.cover:hover { box-shadow: 0 0 22px rgba(var(--art-rgb, var(--accent-rgb)), .6); transform: scale(1.05); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-meta { min-width: 0; flex: 1; }
.now-meta strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-meta span { display: block; font-size: 10px; color: var(--ink-faint); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transport { display: flex; align-items: center; gap: 2px; flex: none; }
.transport button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-dim);
  transition: all var(--transition);
}
.transport button:hover { background: rgba(var(--accent-rgb), .08); color: var(--accent); }
.transport button.play {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.transport button.play:hover { box-shadow: 0 4px 20px var(--accent-glow); transform: scale(1.08); }
.transport button[aria-pressed="true"] { color: var(--accent); }
/* Seekable progress: a slim 3px line that grows a 10px hit area, a buffered
   lane behind the playhead, a knob on hover and a time tooltip above. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  cursor: pointer;
  border-radius: 0 0 14px 14px;
  touch-action: none;
}
.progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .06);
  border-radius: 0 0 14px 14px;
  transition: height var(--transition);
}
.progress:hover::before, .progress.scrubbing::before, .progress:focus-visible::before { height: 6px; }
.progress b, .progress i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  pointer-events: none;
  transition: height var(--transition);
}
.progress:hover b, .progress:hover i,
.progress.scrubbing b, .progress.scrubbing i,
.progress:focus-visible b, .progress:focus-visible i { height: 6px; }
.progress b { background: rgba(255, 255, 255, .14); transition: width .5s linear, height var(--transition); }
.progress i {
  background: linear-gradient(90deg, var(--accent), var(--warm));
  box-shadow: 0 0 6px var(--accent-glow);
  transition: width .25s linear, height var(--transition);
}
/* Scrub knob riding the playhead. */
.progress i::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translateY(-50%) scale(0);
  transition: transform var(--transition);
}
.progress:hover i::after, .progress.scrubbing i::after, .progress:focus-visible i::after {
  transform: translateY(-50%) scale(1);
}
/* Shimmer across the lane while YouTube buffers. */
.progress.loading::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: bufferShimmer 1.1s linear infinite;
  pointer-events: none;
}
@keyframes bufferShimmer {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}
.progress:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.progress-tip {
  position: absolute;
  bottom: 13px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(8, 14, 22, .94);
  border: 1px solid rgba(var(--accent-rgb), .25);
  color: var(--ink);
  font-size: 10px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}
.footer {
  color: var(--ink-faint);
  font-size: 9.5px;
  letter-spacing: .14em;
  pointer-events: none;
  padding-left: 2px;
  font-family: var(--font-display);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   VIDEO STAGE
   ═══════════════════════════════════════════════════════════════ */
.video-slot {
  position: fixed;
  right: 30px;
  bottom: 68px;
  width: 340px;
  height: 190px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  z-index: 35;
  border: 1px solid rgba(var(--accent-rgb), .1);
  /* The panel stays mounted: display:none gave it no pre-transition state,
     so the .3s transition could never run and it popped in instead of
     sliding. visibility (discrete) collapses to hidden only after the fade. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.965);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.4, 0, .2, 1), visibility .3s;
}
.video-slot iframe, #ytStage { width: 100%; height: 100%; border: 0; display: block; }
.video-slot.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  border-color: rgba(var(--accent-rgb), .2);
  box-shadow: 0 0 30px var(--accent-soft), 0 30px 80px rgba(0, 0, 0, .6);
}

/* ═══════════════════════════════════════════════════════════════
   ERROR OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.error {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 28px;
  width: min(450px, 88vw);
  border-radius: 16px;
  line-height: 1.6;
  z-index: 50;
  background: linear-gradient(135deg, rgba(8, 14, 22, .95), rgba(5, 10, 16, .98));
  border: 1px solid rgba(255, 100, 100, .2);
  box-shadow: 0 0 40px rgba(255, 100, 100, .08), var(--shadow-lg);
}
.error h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #ff6b6b;
  margin: 0 0 8px;
}
.error p { font-size: 12.5px; color: var(--ink-dim); margin: 0 0 16px; }
.error-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.error button {
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  transition: all var(--transition);
}
.error button:hover { box-shadow: 0 0 16px var(--accent-glow); transform: translateY(-1px); }
.error .ghost { background: rgba(255, 255, 255, .07); color: var(--ink); }
.error .ghost:hover { background: rgba(255, 255, 255, .1); }

/* ═══════════════════════════════════════════════════════════════
   INTRO
   ═══════════════════════════════════════════════════════════════ */
.intro {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: min(400px, 90vw);
  max-height: 85dvh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 26px;
  z-index: 45;
  opacity: 0;
  transition: opacity .4s ease, transform .4s cubic-bezier(.4, 0, .2, 1);
  background: linear-gradient(135deg, rgba(8, 14, 22, .95), rgba(5, 10, 16, .98));
  border: 1px solid rgba(var(--accent-rgb), .15);
  box-shadow: 0 0 40px var(--accent-soft), var(--shadow-lg);
}
.intro.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.intro h2 {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro ol { margin: 0 0 18px; padding-left: 18px; font-size: 12px; line-height: 1.9; color: var(--ink-dim); }
.intro ol strong { color: var(--ink); font-weight: 600; }
.intro button {
  padding: 10px 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--accent-glow);
  transition: all var(--transition);
}
.intro button:hover { box-shadow: 0 4px 20px var(--accent-glow); transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  right: 30px;
  bottom: 68px;
  z-index: 45;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  max-width: min(320px, 78vw);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .1), rgba(8, 14, 22, .9));
  border: 1px solid rgba(var(--accent-rgb), .15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.toast a { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS — presses, ripple, track-change text swap
   ═══════════════════════════════════════════════════════════════ */
.transport button:active, .chip:active, .radio-presets button:active,
.track-row .fav:active, .playlist-row button:active, .library-foot button:active,
.intro button:active, .mic-btn:active { transform: scale(.92); }

/* Ripple inside the round play button (span injected from rewind.js). */
.transport button.play { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  transform: scale(0);
  animation: rippleSpread .55s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleSpread { to { transform: scale(2.6); opacity: 0; } }

/* Now-playing text crossfades + slides on every track change; the .swap
   class is re-armed from rewind.js. */
.now-meta.swap strong, .now-meta.swap span,
.now-pill.swap .now-text strong, .now-pill.swap .now-text em {
  animation: nowSwap .38s cubic-bezier(.4, 0, .2, 1);
}
@keyframes nowSwap {
  0% { opacity: 0; transform: translateY(7px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   FALLBACK BEAUTY
   ═══════════════════════════════════════════════════════════════ */
body.no-webgl::before {
  filter: blur(60px) saturate(1.5);
  animation: cosmicDrift 10s ease-in-out infinite alternate;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1120px) { .library { width: 292px; } }

@media (max-width: 860px) {
  .brand { left: 16px; top: 16px; right: 108px; }
  .brand h1 { font-size: 32px; }
  .eyebrow { font-size: 8px; letter-spacing: .2em; }
  .subtitle { font-size: 10px; }
  .top-right { top: 16px; right: 12px; gap: 8px; }
  .status { display: none; }
  .round-button { width: 38px; height: 38px; }
  .now-pill { top: 60px; right: 12px; max-width: 50vw; }
  .panel, .library {
    left: 10px;
    right: 10px;
    width: auto;
    top: 148px;
    bottom: 220px;
    max-height: none;
    min-height: 0;
    z-index: 30;
  }
  .library { border-right: none; }
  .panel { border-left: none; }
  .library > * { flex: none; }
  .library > .track-list { flex: none; overflow: visible; max-height: none; min-height: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chip { flex: none; }
  .radio { padding: 10px; gap: 8px; }
  .radio-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; overflow: visible; }
  .radio-presets button { min-width: 0; width: 100%; padding: 8px 5px; font-size: 10px; }
  .left-bottom { left: 10px; right: 10px; bottom: 120px; max-width: none; }
  .now { padding: 8px 10px 8px 8px; gap: 8px; }
  .cover { width: 40px; height: 40px; border-radius: 8px; }
  .transport button { width: 28px; height: 28px; }
  .transport button.play { width: 34px; height: 34px; }
  .footer { display: none; }
  .hint { display: none; }
  .bottom { bottom: 10px; gap: 0; }
  .dock button { padding: 0 10px; min-height: 38px; }
  .dock button span { display: none; }
  .dock { gap: 4px; }
  .video-slot { width: min(320px, calc(100vw - 20px)); right: 10px; bottom: 228px; }
  .toast { right: 10px; left: 10px; bottom: 228px; max-width: none; }
}

@media (max-width: 380px) {
  .eyebrow { font-size: 7px; letter-spacing: .14em; }
  .brand h1 { font-size: 28px; }
  .panel, .library { top: 138px; }
}

@media (max-height: 620px) {
  .brand { top: 18px; }
  .top-right { top: 16px; }
  .now-pill { display: none; }
  .panel { top: 76px; max-height: calc(100dvh - 160px); }
  .library { top: 140px; max-height: calc(100dvh - 226px); overflow-y: auto; }
  .bottom { bottom: 10px; gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOTION PREFERENCES
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, body.no-webgl::before { animation: none; }
  .dot, .dot.live { animation: none; }
  .brand h1, .brand h1.pulse { animation: none; -webkit-text-fill-color: var(--accent); }
  .now-pill { animation: none; }
  .hint { opacity: .8; }
  .radio.flash { animation: none; }
  .toast, .video-slot, .intro { transition: none; }
  .radio-status.live { animation: none; }
  .vignette.beat::after { animation: none; }
  .ripple { display: none; }
  .progress.loading::after { animation: none; }
  .now-meta.swap strong, .now-meta.swap span,
  .now-pill.swap .now-text strong, .now-pill.swap .now-text em { animation: none; }
  :root { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════
   HIDE CHROME
   ═══════════════════════════════════════════════════════════════ */
body.hide-chrome .brand,
body.hide-chrome .top-right,
body.hide-chrome .now-pill,
body.hide-chrome .library,
body.hide-chrome .panel,
body.hide-chrome .left-bottom,
body.hide-chrome .bottom {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR GLOBAL
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .15); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
