/* ───────────────────────────────────────────────
   Sapira Web — Aurora Glass player
   ─────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  font-family: "Outfit", system-ui, sans-serif;
  background: #04050a;
  color: #f5f3ff;

  --bg: #04050a;
  --surface-1: #0a0c16;
  --surface-2: #111421;
  --surface-3: #1a1e2e;

  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --border-3: rgba(255, 255, 255, 0.22);

  --text: #f5f3ff;
  --text-dim: #b4b8cc;
  --text-faint: #6b7080;

  --accent: #abc9ff;
  --accent-rgb: 171, 201, 255;
  --accent-2: #93c5fd;
  --accent-2-rgb: 147, 197, 253;
  --art: #243469;
  --wash: #292448;

  --radius-sm: 0.55rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.6rem;

  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 3.85rem;
  --container: 78rem;
}

[data-theme="violet"] {
  --accent: #e3b4ff;
  --accent-rgb: 227, 180, 255;
  --accent-2: #d8b4fe;
  --accent-2-rgb: 216, 180, 254;
  --art: #43265d;
  --wash: #382049;
}
[data-theme="emerald"] {
  --accent: #83f2ca;
  --accent-rgb: 131, 242, 202;
  --accent-2: #5eead4;
  --accent-2-rgb: 94, 234, 212;
  --art: #194739;
  --wash: #163a33;
}
[data-theme="amber"] {
  --accent: #ffd18c;
  --accent-rgb: 255, 209, 140;
  --accent-2: #fde047;
  --accent-2-rgb: 253, 224, 71;
  --art: #513819;
  --wash: #422c1a;
}
[data-theme="monochrome"] {
  --accent: #e1e7ef;
  --accent-rgb: 225, 231, 239;
  --accent-2: #fff;
  --accent-2-rgb: 255, 255, 255;
  --art: #343941;
  --wash: #282d36;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      ellipse 1400px 900px at 83% -10%,
      var(--wash),
      transparent 65%
    ),
    var(--bg);
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
}
::selection {
  background: rgba(var(--accent-rgb), 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
@media (max-width: 768px), (pointer: coarse) {
  .grain-overlay {
    display: none;
  }
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px)) 0.55rem
    max(1rem, env(safe-area-inset-left, 0px));
  min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  height: auto;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: rgba(4, 5, 10, 0.72);
  border-bottom: 1px solid var(--border);
}
@media (pointer: coarse) and (max-width: 640px) {
  #btn-shortcuts-help {
    display: none;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--text);
}
.brand img {
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.35));
  transition: filter 0.3s var(--ease-out);
}
.brand:hover img {
  filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.65));
}
.brand-name {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-sub {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 0.82rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill-btn {
  padding: 0.5rem 0.85rem;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.pill-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-3);
}

/* Theme picker */
.theme-picker {
  position: relative;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.7rem;
  z-index: 2;
}
.theme-picker summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-height: 34px;
  list-style: none;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0.65rem;
}
.theme-picker summary::-webkit-details-marker {
  display: none;
}
.theme-picker[open] {
  border-color: var(--accent);
}
.theme-chevron {
  width: 0.43rem;
  height: 0.43rem;
  border: solid var(--accent);
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s;
}
.theme-picker[open] .theme-chevron {
  transform: translateY(2px) rotate(225deg);
}
.theme-swatch {
  display: inline-block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--swatch, var(--accent)), #10162b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.theme-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  width: 12.25rem;
  margin: 0;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.theme-options label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.theme-options label:hover,
.theme-options label:has(input:checked) {
  background: rgba(255, 255, 255, 0.06);
}
.theme-options input {
  margin: 0;
  accent-color: var(--accent);
}
[data-color="sapphire"] {
  --swatch: #abc9ff;
}
[data-color="violet"] {
  --swatch: #e3b4ff;
}
[data-color="emerald"] {
  --swatch: #83f2ca;
}
[data-color="amber"] {
  --swatch: #ffd18c;
}
[data-color="monochrome"] {
  --swatch: #e1e7ef;
}
@media (max-width: 380px) {
  #current-theme {
    display: none;
  }
}

/* ─── Page heading ─── */
.player-shell {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
  padding: 1.5rem env(safe-area-inset-right, 0px)
    calc(3rem + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
}
.page-heading {
  margin-bottom: 1.35rem;
}
.page-heading h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.85rem, 3.5vw, 2.65rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-heading .intro {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  max-width: 42rem;
}

/* ─── Workspace ─── */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ─── Player ─── */
.player {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.15),
    0 20px 60px -20px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

/* ─── Stage ─── */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: var(--surface-1);
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse 60% 70% at 50% 40%,
      rgba(var(--accent-rgb), 0.12),
      transparent 65%
    ),
    radial-gradient(
      ellipse 90% 60% at 50% 110%,
      rgba(var(--accent-rgb), 0.08),
      transparent 60%
    ),
    linear-gradient(180deg, #06070e, #080a13);
  pointer-events: none;
}
.stage.is-empty::before {
  background:
    radial-gradient(
      ellipse 55% 65% at 50% 42%,
      rgba(var(--accent-rgb), 0.16),
      transparent 65%
    ),
    radial-gradient(
      ellipse 80% 55% at 50% 110%,
      rgba(var(--accent-rgb), 0.09),
      transparent 60%
    ),
    linear-gradient(180deg, #06070e, #080a13);
}
.stage.is-dragging {
  outline: 2px solid var(--accent);
  outline-offset: -6px;
}
/* Photo mode — adaptive stage */
.stage.has-photo {
  aspect-ratio: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  min-height: 240px;
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 45%,
      rgba(var(--accent-rgb), 0.06),
      transparent 70%
    ),
    linear-gradient(180deg, #06070e, #080a13);
}

/* Media elements */
#photo-preview {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 65vh;
  object-fit: contain;
  background: #000;
}
.stage.has-audio {
  aspect-ratio: 2;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}
.stage.has-audio video {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Audio stage — wrapper with canvas + disc */
.audio-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(10rem, 30vw, 18rem);
  aspect-ratio: 1;
  --logo-scale: 1;
  --glow: 0.15;
}

.audio-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--accent-rgb), 0.55),
    rgba(var(--accent-rgb), 0.15) 45%,
    transparent 70%
  );
  filter: blur(40px);
  opacity: var(--glow, 0.15);
  pointer-events: none;
  z-index: 0;
  transform: scale(var(--logo-scale, 1));
  transition:
    opacity 0.15s linear,
    transform 0.1s linear;
  will-change: opacity, transform;
}

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

.audio-disc {
  position: relative;
  z-index: 2;
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.12),
      transparent 55%
    ),
    linear-gradient(145deg, var(--surface-3), var(--surface-1));
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.12),
    0 0 80px rgba(var(--accent-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: scale(var(--logo-scale, 1));
  transition: transform 0.1s linear;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
  will-change: transform;
}

.audio-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(var(--accent-rgb), 0.3) 22%,
    transparent 44%,
    rgba(var(--accent-2-rgb), 0.3) 66%,
    transparent 88%
  );
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: audio-spin 16s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.audio-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at center,
    rgba(var(--accent-rgb), 0.3),
    transparent 65%
  );
  opacity: var(--glow, 0.15);
  mix-blend-mode: screen;
  transition: opacity 0.15s linear;
  pointer-events: none;
  z-index: 0;
}

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

.audio-disc img {
  position: relative;
  z-index: 1;
  width: 65%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.7));
  transition: opacity 0.3s;
}

.audio-disc img.cover-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: none;
}

@media (max-width: 500px) {
  .audio-art {
    width: clamp(9rem, 40vw, 12rem);
  }
}

/* ═══════════════════════════════════════════════
   SAPIRA COMPLETE — Lyrics · EQ · Waveform · Playlist
   ═══════════════════════════════════════════════ */

/* ─── Icon pills ─── */
.icon-pill {
  padding: 0.5rem 0.7rem;
  min-width: 34px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ─── Playback tools ─── */
.playback-tools {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  min-height: 34px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.tool-btn svg {
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out);
}
.tool-btn:hover svg {
  transform: scale(1.1);
}
.tool-btn[aria-pressed="true"] svg {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.55));
}
.tool-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-3);
}
.tool-btn[aria-pressed="true"] {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.speed-control > svg {
  flex-shrink: 0;
  opacity: 0.75;
}
.speed-control select {
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 0.1rem;
  cursor: pointer;
  outline: none;
}
.speed-control select option {
  background: var(--surface-2);
  color: var(--text);
}

/* ─── Lyrics panel (Refined Editorial Sanctuary) ─── */
.stage.has-audio {
  position: relative;
}
.stage.has-audio .audio-art {
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out),
    filter 0.45s var(--ease-out);
}
.stage.has-lyrics .stage-top-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out);
}
.stage.has-audio.has-lyrics .audio-art {
  opacity: 0.16;
  filter: blur(18px) saturate(1.25);
  transform: scale(1.04);
  pointer-events: none;
}

.lyrics-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(
      ellipse 80% 70% at 50% 50%,
      rgba(6, 8, 16, 0.72),
      rgba(4, 5, 10, 0.88)
    );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lyrics-in 0.32s var(--ease-out);
  isolation: isolate;
}
@keyframes lyrics-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lyrics-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem 0.2rem;
  flex-shrink: 0;
  z-index: 3;
}
.lyrics-bar-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.lyrics-offset-group {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}
.lyrics-mini-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition:
    color 0.15s,
    background 0.15s;
}
.lyrics-mini-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.lyrics-offset-val {
  padding: 0 0.38rem;
  height: 22px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s;
}
.lyrics-offset-val.is-shifted,
.lyrics-offset-val:hover {
  color: var(--accent);
}

.lyrics-lrc-btn {
  height: 28px;
  padding: 0 0.68rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 500;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.lyrics-lrc-btn:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.09);
}

/* Keep .lyrics-close working both in modals (absolute) and inside #lyrics-panel (flex) */
.lyrics-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  font-size: 1.3rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
  z-index: 2;
}
.lyrics-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  transform: rotate(90deg);
}
#lyrics-panel .lyrics-close {
  position: static;
  width: 30px;
  height: 30px;
  font-size: 1.18rem;
  flex-shrink: 0;
}

.lyrics-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 12%,
    #000 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 12%,
    #000 86%,
    transparent 100%
  );
}
.lyrics-viewport::-webkit-scrollbar {
  width: 4px;
}
.lyrics-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}

.lyrics-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.72rem;
  width: min(100%, 40rem);
  margin-inline: auto;
  padding: 15% clamp(1rem, 4.5vw, 2.75rem) 24%;
}
.lyrics-list.is-plain-mode {
  gap: 0.58rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.lyrics-interlude {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    height 0.3s var(--ease-out),
    opacity 0.3s var(--ease-out),
    margin 0.3s var(--ease-out);
}
.lyrics-interlude.is-active {
  height: 18px;
  opacity: 0.9;
  margin-bottom: 0.35rem;
}
.lyrics-interlude i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: interlude-dot 1.2s ease-in-out infinite;
}
.lyrics-interlude i:nth-child(2) {
  animation-delay: 0.2s;
}
.lyrics-interlude i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes interlude-dot {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.lyrics-line {
  position: relative;
  width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.08rem, 2vw, 1.46rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: rgba(245, 243, 255, 0.28);
  text-align: center;
  padding: 0.28rem 2.4rem;
  border-radius: 0.55rem;
  transform-origin: center center;
  transition:
    color 0.32s var(--ease-out),
    transform 0.36s var(--ease-out),
    background 0.18s,
    text-shadow 0.32s var(--ease-out);
}
.lyrics-line.near {
  color: rgba(245, 243, 255, 0.54);
}
.lyrics-line.past {
  color: rgba(245, 243, 255, 0.18);
}
.lyrics-line.active {
  color: #fff;
  transform: scale(1.045);
  text-shadow: 0 2px 26px rgba(var(--accent-rgb), 0.42);
}
.lyrics-line.is-plain {
  color: rgba(245, 243, 255, 0.84);
  padding-inline: 0.75rem;
}
.lyrics-line.is-seekable {
  cursor: pointer;
}
.lyrics-line.is-seekable:hover {
  color: rgba(245, 243, 255, 0.9);
  background: rgba(255, 255, 255, 0.035);
}
.lyrics-line.is-seekable::after {
  content: attr(data-time);
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.64rem;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.16s;
}
@media (hover: hover) {
  .lyrics-line.is-seekable:hover::after {
    opacity: 0.78;
  }
}

.lyrics-resync-pill {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(10, 13, 24, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  animation: lyrics-in 0.2s var(--ease-out);
}
.lyrics-resync-pill:hover {
  background: rgba(var(--accent-rgb), 0.16);
}
.stage:has(.karaoke-hud:not([hidden])) .lyrics-viewport {
  padding-bottom: 3.6rem;
}
.stage:has(.karaoke-hud:not([hidden])) .lyrics-resync-pill {
  bottom: 4.1rem;
}

.lyrics-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.2rem 1rem;
}
.lyrics-empty-upload {
  height: 32px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.lyrics-empty-upload:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.09);
}

.lyrics-message {
  margin: 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.95rem;
  font-style: italic;
  font-family: var(--font-display);
}
.lyrics-message.lyrics-loading {
  color: var(--accent);
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}
.lyrics-message.lyrics-loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: ellipsis 1.4s steps(4, end) infinite;
}
@keyframes ellipsis {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

/* ─── EQ panel ─── */
.eq-panel {
  flex: 1 1 100%;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.04),
    transparent
  );
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.35rem;
}
.eq-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.eq-presets button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 500;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.eq-presets button svg {
  flex-shrink: 0;
  opacity: 0.72;
  transition:
    opacity 0.2s,
    transform 0.25s var(--ease-out),
    filter 0.2s;
}
.eq-presets button:hover svg {
  opacity: 1;
  transform: scale(1.1);
}
.eq-presets button.active svg {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.6));
}
.eq-presets button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}
.eq-presets button.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.eq-bands {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  align-items: end;
}
.eq-bands label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-faint);
}
.eq-bands input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 96px;
  padding: 0;
  margin: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-writing-mode: vertical-lr;
}
.eq-bands input[type="range"]::-webkit-slider-runnable-track {
  width: 3px;
  height: 100%;
  background: linear-gradient(
    0deg,
    var(--accent) 0%,
    var(--accent-2) var(--eq-fill, 50%),
    rgba(255, 255, 255, 0.1) var(--eq-fill, 50%),
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: 2px;
}
.eq-bands input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
  cursor: pointer;
}
@media (pointer: coarse) {
  .eq-bands input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-left: -7.5px;
  }
  .eq-bands input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
}
.eq-bands input[type="range"]::-moz-range-track {
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  border: none;
}
.eq-bands input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  cursor: pointer;
}
.eq-bands output {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}
.eq-bands label > span {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

@media (max-width: 500px) {
  .eq-bands input[type="range"] {
    height: 76px;
  }
  .eq-presets button {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
}

/* ─── Waveform ─── */
.seek-wrap {
  position: relative;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
}
.waveform-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 4px;
}
#seek {
  position: relative;
  z-index: 1;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  height: 32px;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
#seek:disabled {
  cursor: not-allowed;
}

/* Show native track only when no waveform */
.seek-wrap:not(.has-waveform) #seek {
  opacity: 1;
}
.seek-wrap:not(.has-waveform) .waveform-canvas {
  display: none;
}

/* ─── Queue actions ─── */
.queue-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.92rem;
  display: grid;
  place-items: center;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.icon-btn:hover:not(:disabled) {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── Shortcuts modal ─── */
.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: modal-fade 0.25s var(--ease-out);
}
@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.shortcuts-content {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.6rem;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  animation: modal-slide 0.3s var(--ease-out);
}
@keyframes modal-slide {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.shortcuts-header h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  transition: background 0.15s;
}
.shortcut-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.shortcut-label {
  font-size: 0.88rem;
  color: var(--text-dim);
}
.shortcut-keys {
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.shortcut-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 0.5rem;
  border-radius: 6px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.09),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  letter-spacing: 0;
}
.shortcut-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}
.shortcuts-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-faint);
  text-align: center;
}

/* ─── Mobile lyrics ─── */
@media (max-width: 700px) {
  .lyrics-panel {
    background: rgba(4, 5, 10, 0.9);
  }
  .lyrics-top-bar {
    padding: 0.45rem 0.55rem 0.15rem;
  }
  .lyrics-list {
    gap: 0.58rem;
    padding: 16% 0.85rem 24%;
  }
  .lyrics-line {
    font-size: clamp(1.02rem, 4.4vw, 1.2rem);
    padding: 0.22rem 0.65rem;
  }
  .lyrics-line.active {
    transform: scale(1.03);
  }
}

/* ─── URL input + Radio ─── */
.url-input-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.url-input-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  min-height: 38px;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
.url-input-row input::placeholder {
  color: var(--text-faint);
}
.url-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}
.url-input-row button {
  padding: 0.5rem 0.9rem;
  min-height: 38px;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.url-input-row button:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}

.radio-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  min-height: 42px;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.radio-btn:hover {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}

/* Radio modal */
.radio-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(4, 5, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: modal-fade 0.25s var(--ease-out);
}
.radio-content {
  width: min(680px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.5rem;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  animation: modal-slide 0.3s var(--ease-out);
}
.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.radio-header h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.radio-search-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.radio-search-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  min-height: 40px;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.radio-search-row input::placeholder {
  color: var(--text-faint);
}
.radio-search-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.radio-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 0.25rem;
}
.radio-list::-webkit-scrollbar {
  width: 6px;
}
.radio-list::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}

.radio-station-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.radio-station-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-2);
}
.radio-station-favicon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 0.9rem;
}
.radio-station-favicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.radio-station-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.radio-station-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radio-station-meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radio-station-play {
  padding: 0.35rem 0.8rem;
  min-height: 30px;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #0a0c16;
  font-size: 0.74rem;
  font-weight: 600;
  border: none;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.radio-station-row:hover .radio-station-play {
  opacity: 1;
}
.radio-station-play:hover {
  transform: scale(1.05);
}
@media (pointer: coarse) {
  .radio-station-play {
    opacity: 1;
  }
}

.radio-loading,
.radio-empty,
.radio-error {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-faint);
  margin: 0;
}
.radio-loading {
  color: var(--accent);
}
.radio-loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: ellipsis 1.4s steps(4, end) infinite;
}
.radio-error {
  color: #ff8f8f;
}

/* ═══════════════════════════════════════════════════════
   PHASE 1 — Toast · Sleep · A-B loop · Recent · Session
   ═══════════════════════════════════════════════════════ */

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(420px, 90vw);
}
.toast {
  pointer-events: auto;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(20, 22, 34, 0.95);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  border: 1px solid var(--border-2);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform 0.3s var(--ease-out),
    opacity 0.3s var(--ease-out);
  max-width: 100%;
  text-align: center;
}
.toast.toast-in {
  transform: translateY(0);
  opacity: 1;
}
.toast.toast-out {
  transform: translateY(-8px);
  opacity: 0;
}
.toast-info {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}
.toast-success {
  border-color: rgba(131, 242, 202, 0.35);
  color: #83f2ca;
}
.toast-warn {
  border-color: rgba(255, 209, 140, 0.35);
  color: #ffd18c;
}
.toast-error {
  border-color: rgba(255, 143, 143, 0.4);
  color: #ff8f8f;
}

/* ─── Sleep timer ─── */
.sleep-wrap {
  position: relative;
  display: inline-flex;
}
#btn-sleep {
  font-variant-numeric: tabular-nums;
}
#btn-sleep.active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
}
#btn-sleep.active svg {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6));
}
.sleep-menu {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  min-width: 8rem;
  padding: 0.35rem;
  border-radius: 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sleep-menu button {
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
}
.sleep-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.sleep-menu button.cancel {
  color: #ff8f8f;
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-radius: 0 0 0.5rem 0.5rem;
}
.sleep-menu button.cancel:hover {
  background: rgba(255, 143, 143, 0.08);
}

/* ─── A-B loop button ─── */
#btn-loop[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
}
#btn-loop[aria-pressed="true"] svg {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.65));
}

/* ─── Session banner ─── */
.session-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      135deg,
      rgba(var(--accent-rgb), 0.1),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 8px 28px -8px rgba(var(--accent-rgb), 0.25);
  animation: session-in 0.4s var(--ease-out);
}
@keyframes session-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.session-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  min-width: 0;
  flex: 1;
  font-size: 0.88rem;
}
.session-label {
  color: var(--text-dim);
}
.session-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.session-position {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.session-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.session-actions button {
  padding: 0.5rem 0.85rem;
  min-height: 34px;
  border-radius: 0.55rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.session-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-3);
}
.session-actions button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c16;
  border-color: transparent;
  font-weight: 600;
}
.session-actions button.primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.5),
    0 6px 18px -4px rgba(var(--accent-rgb), 0.55);
}

@media (max-width: 500px) {
  .session-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .session-actions {
    width: 100%;
  }
  .session-actions button {
    flex: 1;
  }

  .sleep-menu {
    left: auto;
    right: 0;
  }
}

/* ─── Recently played ─── */
.recent-section {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
  padding: 0;
  overflow: hidden;
}
.recent-section summary {
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  list-style: none;
  position: relative;
  transition:
    background 0.15s,
    color 0.15s;
}
.recent-section summary::-webkit-details-marker {
  display: none;
}
.recent-section summary:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.recent-section summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.25s var(--ease-out);
}
.recent-section[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.35rem 0.55rem;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.recent-list::-webkit-scrollbar {
  width: 5px;
}
.recent-list::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 40px;
}
.recent-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.recent-name {
  font-size: 0.82rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.recent-item:hover .recent-name {
  color: var(--text);
}
.recent-meta {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.recent-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .session-banner {
    animation: none;
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════
   PHASE 2 — Photo Pro: Zoom · Pan · Filters · Slideshow
   ═══════════════════════════════════════════════════════ */

/* ─── Zoom wrapper ─── */
.photo-zoom-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 72vh;
  overflow: hidden;
  border-radius: var(--radius-md);
  user-select: none;
  touch-action: pan-y;
  cursor: zoom-in;
  --zoom: 1;
  --pan-x: 0px;
  --pan-y: 0px;
}
.photo-zoom-wrap.is-zoomed {
  touch-action: none;
  cursor: grab;
}
.photo-zoom-wrap.is-panning {
  cursor: grabbing;
}

#photo-preview {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px))
    scale(var(--zoom, 1));
  transform-origin: center center;
  transition: transform 0.2s var(--ease-out);
  will-change: transform;
}
.photo-zoom-wrap.is-zoomed #photo-preview,
.photo-zoom-wrap.is-panning #photo-preview {
  transition: none;
}

#photo-before {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, -50%)
    translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center center;
  transition:
    opacity 0.15s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.photo-zoom-wrap.is-before #photo-before {
  opacity: 1;
}
.photo-zoom-wrap.is-before::after {
  content: "BEFORE";
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 4;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.photo-zoom-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-2);
  color: var(--text-faint);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
  z-index: 2;
}
.photo-zoom-wrap.is-zoomed .photo-zoom-hint,
.photo-zoom-wrap.is-before .photo-zoom-hint {
  opacity: 0;
}
@media (pointer: coarse) {
  .photo-zoom-hint {
    font-size: 0.68rem;
    padding: 0.3rem 0.65rem;
  }
}

/* ─── Filters fieldset ─── */
.photo-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem 0.8rem;
  align-items: start;
}
.photo-filters legend {
  grid-column: 1 / -1;
}
.photo-filters .photo-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.78rem;
}

/* ─── Slideshow ─── */
#slideshow-toggle.active,
#slideshow-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c16;
  border-color: transparent;
  font-weight: 600;
}
#slideshow-toggle.active span,
#slideshow-toggle[aria-pressed="true"] span {
  font-weight: 600;
}

@media (max-width: 500px) {
  .photo-filters {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-zoom-hint {
    font-size: 0.65rem;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .lyrics-panel {
    animation: none;
  }
  .shortcuts-content {
    animation: none;
  }
  .lyrics-close:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-disc::before {
    animation: none;
    opacity: 0.2;
  }
  .audio-disc,
  .audio-glow {
    transition: none;
  }
}

/* Empty state */
.empty {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding: 2rem 1rem;
  text-align: center;
}
.empty-prism {
  filter: drop-shadow(0 0 28px rgba(var(--accent-rgb), 0.5));
  animation: prism-float 5s ease-in-out infinite;
}
@keyframes prism-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}
.empty .primary {
  padding: 0.85rem 1.6rem;
  min-height: 46px;
  min-width: 10rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c16;
  border: none;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.5),
    0 8px 32px -8px rgba(var(--accent-rgb), 0.65);
  transition:
    transform 0.2s,
    box-shadow 0.25s;
}
.empty .primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.7),
    0 16px 44px -8px rgba(var(--accent-rgb), 0.8);
}
.drop-hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}
@media (pointer: coarse) {
  .drop-hint {
    display: none;
  }
}
@media (max-width: 480px) {
  .empty-prism {
    width: 56px;
    height: 56px;
  }
  .empty {
    gap: 0.65rem;
    padding: 1.25rem 0.5rem;
  }
}

/* ─── Transport ─── */
.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-top: 1px solid var(--border);
}
.player:has(.stage.has-audio) .transport {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--art) 30%, var(--surface-1)),
    var(--surface-1) 90%
  );
}

.track-info {
  flex: 1 1 100%;
  min-width: 0;
}
#current-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}
#artist {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--text-dim);
}
#photo-dimensions {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
#status {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--accent);
}
#status:empty {
  display: none;
}

.audio-timeline #elapsed,
.audio-timeline #duration {
  font-weight: 500;
  min-width: 2.4rem;
  text-align: center;
}
.audio-timeline #duration {
  text-align: left;
}
.audio-timeline.is-live-stream #seek {
  cursor: default;
  opacity: 0.78;
}
.audio-timeline.is-live-stream .seek-wrap.has-waveform #seek {
  opacity: 0;
}
.audio-timeline.is-live-stream .seek-wrap.has-waveform .waveform-canvas {
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.18);
}
.audio-timeline.is-live-stream #seek::-webkit-slider-thumb {
  opacity: 0;
  transform: scale(0);
}
.audio-timeline.is-live-stream #seek::-moz-range-thumb {
  opacity: 0;
  width: 0;
  height: 0;
  border: none;
}
.audio-timeline.is-live-stream #duration {
  color: #fb7185;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Custom range slider */
#seek {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  --seek-progress: 0%;
}
#seek:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

#seek::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent-2) var(--seek-progress),
    rgba(255, 255, 255, 0.1) var(--seek-progress),
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: 2px;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  margin-top: -5px;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
  transition: transform 0.15s var(--ease-spring);
}
#seek:hover::-webkit-slider-thumb {
  transform: scale(1.15);
}
#seek:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.4);
}

#seek::-moz-range-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  border: none;
}
#seek::-moz-range-progress {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}
#seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  cursor: pointer;
}

.audio-timeline {
  position: relative;
  z-index: 8;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.audio-timeline .seek-wrap {
  flex: 1 1 0%;
  min-width: 0;
}
.audio-timeline #elapsed,
.audio-timeline #duration {
  flex-shrink: 0;
  font-weight: 500;
  min-width: 2.4rem;
  text-align: center;
}
.audio-timeline #duration {
  text-align: left;
}

/* ─── Volume ─── */
.volume-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.volume-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.volume-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-3);
}
.volume-btn.muted {
  color: #ff8f8f;
  border-color: rgba(255, 143, 143, 0.35);
  background: rgba(255, 143, 143, 0.06);
}

.volume-icon {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask-size: 15px 15px;
  mask-size: 15px 15px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  /* Default: high volume */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05A4.47 4.47 0 0 0 16.5 12zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05A4.47 4.47 0 0 0 16.5 12zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E");
}
.volume-btn.low .volume-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05A4.47 4.47 0 0 0 16.5 12z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05A4.47 4.47 0 0 0 16.5 12z'/%3E%3C/svg%3E");
}
.volume-btn.muted .volume-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 0 0 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 0 0 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/%3E%3C/svg%3E");
}

#volume {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(56px, 12vw, 96px);
  height: 20px;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --vol-progress: 100%;
}

#volume::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent-2) var(--vol-progress),
    rgba(255, 255, 255, 0.1) var(--vol-progress),
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: 2px;
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  margin-top: -4px;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
  transition: transform 0.15s var(--ease-spring);
}
#volume:hover::-webkit-slider-thumb {
  transform: scale(1.15);
}

#volume::-moz-range-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  border: none;
}
#volume::-moz-range-progress {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}
#volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  cursor: pointer;
}

/* Resume */
.resume {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
}
.resume button {
  padding: 0.5rem 0.85rem;
  min-height: 36px;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.resume button:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-3);
}
#resume-play {
  background: var(--accent);
  color: #0a0c16;
  border-color: transparent;
  font-weight: 600;
}
#resume-play:hover {
  background: var(--accent-2);
}

/* Skip controls */
.skip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex: 1 1 100%;
  padding-top: 0.35rem;
}
.stage.is-empty ~ .transport .skip {
  display: none;
}

.skip-btn {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease-spring),
    box-shadow 0.2s;
}
.skip-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-3);
  transform: scale(1.05);
}
.skip-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.skip-btn::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
#previous::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 6h2v12H6zM20 6v12l-9-6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 6h2v12H6zM20 6v12l-9-6z'/%3E%3C/svg%3E");
}
#next::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 6h2v12h-2zM4 6l9 6-9 6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 6h2v12h-2zM4 6l9 6-9 6z'/%3E%3C/svg%3E");
}

.playback-button {
  padding: 0.9rem 2rem;
  min-height: 52px;
  min-width: 7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c16;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.5),
    0 4px 16px rgba(var(--accent-rgb), 0.4);
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.25s;
}
.playback-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.7),
    0 10px 28px rgba(var(--accent-rgb), 0.55);
}
.playback-button:active:not(:disabled) {
  transform: translateY(0);
}
.playback-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}

/* ─── Photo tools ─── */
.photo-tools {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.photo-group {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  margin: 0;
  min-width: 0;
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}
.photo-group legend {
  color: var(--text-faint);
  padding-inline: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.photo-actions button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.photo-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-3);
}
.photo-actions button span[aria-hidden] {
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
}
.photo-actions button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}
.photo-group label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.photo-group select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 0.55rem;
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.photo-slider input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.photo-slider output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 500;
}
.photo-group > button {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.photo-group > button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-3);
}
#photo-save {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0c16;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.4);
}
#photo-save:hover {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.65),
    0 6px 16px -4px rgba(var(--accent-rgb), 0.5);
}

/* ─── Subtitle tools ─── */
.subtitle-tools {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.subtitle-tools button {
  padding: 0.5rem 0.85rem;
  min-height: 36px;
  border-radius: 0.55rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.subtitle-tools button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-3);
}
#subtitle-offset {
  padding: 0.35rem 0.65rem;
  min-height: 30px;
  border-radius: 0.5rem;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* ─── Queue ─── */
.queue {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  padding: 1.1rem;
  min-width: 0;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    0 12px 32px -16px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.queue-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.queue-title h2 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.02rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.queue-count {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  min-width: 1.5rem;
  padding: 0.16rem 0.42rem;
  text-align: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.clear-btn {
  padding: 0.4rem 0.8rem;
  min-height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-dim);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.clear-btn:hover:not(:disabled) {
  color: #ff8f8f;
  border-color: rgba(255, 143, 143, 0.4);
  background: rgba(255, 143, 143, 0.06);
}
.clear-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.add-files {
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 46px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px dashed var(--border-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}
.add-files:hover {
  border-color: var(--accent);
  border-style: dashed;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
}

.queue-modes {
  display: flex;
  gap: 0.4rem;
}
.queue-modes button {
  flex: 1;
  padding: 0.5rem 0.7rem;
  min-height: 36px;
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.queue-modes button:hover {
  color: var(--text);
  border-color: var(--border-3);
  background: rgba(255, 255, 255, 0.06);
}
.queue-modes button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

#queue-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.5;
  text-align: center;
  padding: 0.5rem 0;
}

#tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 26rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
#tracks::-webkit-scrollbar {
  width: 6px;
}
#tracks::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}
#tracks li {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) repeat(3, 30px);
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem;
  border-radius: 0.55rem;
  transition:
    background 0.15s,
    opacity 0.15s;
}
#tracks li:hover {
  background: rgba(255, 255, 255, 0.025);
}
#tracks .track-button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: start;
  overflow-wrap: anywhere;
  min-height: 40px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
  position: relative;
}
#tracks .track-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
#tracks .track-button[aria-current="true"] {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--accent);
  font-weight: 500;
  padding-left: 1.4rem;
}
#tracks .track-button[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 50%;
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
  box-shadow: 0 0 8px var(--accent);
}

#tracks .queue-action {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  line-height: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  opacity: 0;
  transition:
    opacity 0.15s,
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
#tracks li:hover .queue-action {
  opacity: 1;
}
#tracks .queue-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--border-2);
}
#tracks .queue-action:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
#tracks li:hover .queue-action:disabled {
  opacity: 0.2;
}
@media (pointer: coarse) {
  #tracks li {
    grid-template-columns: 22px minmax(0, 1fr) repeat(3, 36px);
    gap: 0.2rem;
  }
  #tracks .queue-action {
    width: 36px;
    height: 36px;
    min-height: 36px;
    opacity: 0.72;
  }
  #tracks li:hover .queue-action {
    opacity: 0.95;
  }
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .player-shell {
    padding-top: 1rem;
  }
  .queue {
    order: 2;
  }
}

@media (max-width: 768px), (pointer: coarse) {
  .url-input-row input,
  .radio-search-row input,
  .photo-group select,
  .speed-control select,
  .party-room-row input,
  .party-signal-box {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .page-heading {
    margin-bottom: 0.95rem;
  }
  .page-heading .intro {
    font-size: 0.88rem;
  }
  .radio-modal,
  .shortcuts-modal {
    align-items: end;
    padding: 0;
  }
  .radio-content,
  .shortcuts-content {
    width: 100%;
    max-height: 86dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    padding: 1.2rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  .player-shell {
    width: calc(100% - 1.5rem);
  }
  .player,
  .queue {
    border-radius: var(--radius-lg);
  }
  .transport {
    padding: 0.9rem 0.85rem 1.05rem;
    gap: 0.7rem;
  }
  .audio-timeline {
    flex-wrap: wrap;
    row-gap: 0.45rem;
    column-gap: 0.45rem;
  }
  .audio-timeline .seek-wrap {
    flex: 1 1 calc(100% - 7.5rem);
  }
  .audio-timeline .viz-toggle-btn {
    margin-left: auto;
  }
  .audio-timeline .viz-toggle-btn[hidden] + .volume-control {
    margin-left: auto;
  }
  #volume {
    width: 108px;
  }
  .playback-tools {
    gap: 0.4rem;
  }
  .tool-btn,
  .speed-control {
    min-height: 38px;
  }
  .skip {
    gap: 0.65rem;
  }
  .skip-btn {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }
  .playback-button {
    min-height: 50px;
    min-width: 6.75rem;
    padding: 0.8rem 1.75rem;
  }
  .stage.has-audio {
    aspect-ratio: 4 / 3;
    min-height: 220px;
  }
  .audio-art {
    width: clamp(10.5rem, 52vw, 14rem);
  }
  .empty-prism {
    width: 52px;
    height: 52px;
  }
  .empty {
    gap: 0.6rem;
  }
  .empty .primary {
    min-width: 9.5rem;
    padding: 0.78rem 1.35rem;
  }
  .photo-tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .photo-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ─── Format badge ─── */
.track-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.track-title-row #current-title {
  margin: 0;
}

.format-badge {
  --badge-color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.5rem;
  min-height: 18px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--badge-color) 32%, transparent);
  color: var(--badge-color);
  background: color-mix(in srgb, var(--badge-color) 10%, transparent);
  text-transform: uppercase;
  user-select: none;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

/* Queue: row layout for badge + text */
#tracks .track-button {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-align: start;
}
#tracks .track-text {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
#tracks .track-button .format-badge {
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   PRO & FUN FEATURES — Ambient · Seek Thumb · Drag · Vinyl · Party · Karaoke
   ═══════════════════════════════════════════════════════════════════════ */

/* Ambient swatch & Header Party button */
[data-color="ambient"] .swatch-ambient,
html[data-theme="ambient"] .current-swatch {
  background: conic-gradient(
    from 45deg,
    #f5d0fe,
    #93c5fd,
    #83f2ca,
    #ffd18c,
    #f5d0fe
  );
}
.party-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.party-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition:
    background 0.25s,
    box-shadow 0.25s;
}
.party-pill.is-live {
  border-color: rgba(131, 242, 202, 0.45);
  color: #83f2ca;
}
.party-pill.is-live .party-dot {
  background: #83f2ca;
  box-shadow: 0 0 10px #83f2ca;
}
@media (max-width: 420px) {
  .header-controls {
    gap: 0.35rem;
  }
  .pill-btn {
    padding: 0.45rem 0.65rem;
  }
}

/* BPM badge */
.bpm-badge {
  --badge-color: #83f2ca;
}

/* Spectrogram toggle button */
.viz-toggle-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.12);
}

/* Video click cursor */
.stage.has-video video:not([controls]) {
  cursor: pointer;
}

/* Screenshot shutter flash */
.shutter-flash {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.shutter-flash.flash-run {
  animation: camera-flash 0.36s var(--ease-out);
}
@keyframes camera-flash {
  0% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
  }
}

/* Seek preview thumbnail & time tooltip */
.seek-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.55rem;
  border-radius: 0.55rem;
  background: rgba(8, 10, 18, 0.94);
  border: 1px solid var(--border-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
}
.seek-preview.is-video-thumb {
  padding: 0.32rem;
  border-radius: 0.65rem;
}
#seek-thumb-canvas {
  display: block;
  width: 154px;
  height: auto;
  border-radius: 0.4rem;
  background: #000;
}
#seek-preview-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Bookmark timeline pins & sidebar rows */
.bookmark-pins {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.bookmark-pin {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 10px;
  padding: 0;
  margin: 0;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  pointer-events: auto;
  cursor: pointer;
}
.bookmark-pin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.75);
}
.bookmark-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 6px;
  transform: translateX(-50%) rotate(45deg);
  background: #fbbf24;
  border-radius: 1px;
}
#bookmarks-section summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.bookmark-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.bookmark-jump {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.bookmark-time-pill {
  padding: 0.14rem 0.42rem;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fbbf24;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  flex-shrink: 0;
}
.bookmark-row.is-current .recent-name {
  color: var(--text);
  font-weight: 500;
}
.bookmark-del {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.bookmark-del:hover {
  color: #ff8f8f;
  background: rgba(255, 143, 143, 0.08);
}

/* Queue Drag-and-drop & DJ modes */
.dj-modes {
  margin-top: -0.25rem;
}
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  opacity: 0.45;
  transition:
    opacity 0.15s,
    color 0.15s;
}
#tracks li:hover .drag-handle {
  opacity: 0.85;
  color: var(--text-dim);
}
.drag-handle:active {
  cursor: grabbing;
}
#tracks li.is-dragging-row {
  opacity: 0.48;
  background: rgba(var(--accent-rgb), 0.08);
}
#tracks li.drop-before::after,
#tracks li.drop-after::after {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  border-radius: 2px;
  pointer-events: none;
}
#tracks li.drop-before::after {
  top: -2px;
}
#tracks li.drop-after::after {
  bottom: -2px;
}

/* Vinyl Visualizer & Tonearm */
.stage-mode-btn {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 500;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.stage-mode-btn:hover,
.stage-mode-btn.is-active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
}
.stage-mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.vinyl-spindle {
  display: none;
}
#audio-art.is-vinyl .audio-disc {
  width: 66%;
  background:
    radial-gradient(circle at center, #0e111b 0 21%, transparent 21.5%),
    repeating-radial-gradient(
      circle at center,
      #090b12 0px,
      #090b12 2px,
      #161a29 3px,
      #07080e 4.5px
    );
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.75),
    0 0 50px rgba(var(--accent-rgb), 0.2);
  transform: scale(var(--logo-scale, 1)) rotate(var(--vinyl-deg, 0deg));
  transition: none;
}
#audio-art.is-vinyl .audio-disc::before {
  animation: none;
  opacity: 0.32;
}
#audio-art.is-vinyl .audio-disc img,
#audio-art.is-vinyl .audio-disc img.cover-image {
  width: 42%;
  height: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  filter: none;
}
#audio-art.is-vinyl .vinyl-spindle {
  display: block;
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #04050a;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  z-index: 3;
  pointer-events: none;
}
.vinyl-tonearm {
  position: absolute;
  top: -2%;
  right: -6%;
  width: 42%;
  height: auto;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
  transform-origin: 76.67% 14%;
  transform: rotate(var(--arm-deg, -18deg));
  transition: transform 0.4s var(--ease-out);
}

/* Karaoke Pitch Scoring HUD */
.karaoke-hud {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.65rem;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(8, 10, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.karaoke-note-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.6rem;
}
.karaoke-kicker {
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  font-weight: 600;
}
.karaoke-note-box strong {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--accent);
}
.karaoke-meter-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.karaoke-meter-bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.karaoke-target-zone {
  position: absolute;
  left: 36%;
  width: 28%;
  top: 0;
  bottom: 0;
  background: rgba(131, 242, 202, 0.28);
  border-inline: 1px solid rgba(131, 242, 202, 0.6);
}
.karaoke-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: left 0.08s linear;
}
.karaoke-feedback {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #83f2ca;
  text-align: center;
}
.karaoke-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}
.karaoke-score-box strong {
  font-size: 0.9rem;
  color: var(--text);
}
.karaoke-score-box span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
}
.karaoke-stop {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.karaoke-stop:hover {
  color: #ff8f8f;
  border-color: rgba(255, 143, 143, 0.4);
}
.stage:has(.karaoke-hud:not([hidden])) .lyrics-panel {
  padding-bottom: 4.2rem;
}

/* Party Mode Modal */
.party-content {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.party-content .shortcuts-header {
  margin-bottom: 0.2rem;
}
.party-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.party-card {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.party-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.party-card-head strong {
  font-size: 0.86rem;
  font-weight: 500;
}
.party-room-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.party-room-row input {
  flex: 1;
  min-width: 0;
  padding: 0.48rem 0.7rem;
  min-height: 36px;
  border-radius: 0.5rem;
  border: 1px solid var(--border-2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
.party-status-badge {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-2);
  color: var(--text-faint);
  white-space: nowrap;
}
.party-status-badge.is-live {
  background: rgba(131, 242, 202, 0.12);
  border-color: rgba(131, 242, 202, 0.4);
  color: #83f2ca;
}
.party-p2p-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.party-p2p-actions button,
.party-copy-row button {
  flex: 1 1 auto;
  padding: 0.48rem 0.75rem;
  min-height: 36px;
  border-radius: 0.5rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}
.party-p2p-actions button:hover,
.party-copy-row button:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}
.party-signal-box {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  resize: vertical;
}
.party-copy-row {
  display: flex;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════
   STUDIO DSP · CINEMA VIDEO PRO · FOLDER & COMMAND PALETTE (⌘K)
   ═══════════════════════════════════════════════════════════════════════ */

/* GPU Ambilight Video Wrapper & Halo */
.player-wrap {
  position: relative;
  isolation: isolate;
  min-width: 0;
}
.ambilight-video-canvas {
  position: absolute;
  inset: -3.5%;
  width: 107%;
  height: 107%;
  z-index: -1;
  border-radius: var(--radius-xl);
  filter: blur(54px) saturate(185%);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
@media (max-width: 640px) {
  .ambilight-video-canvas {
    inset: -1%;
    width: 102%;
    height: 102%;
    filter: blur(34px) saturate(175%);
    opacity: 0.6;
  }
}

/* Header ⌘K button */
.cmd-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}
@media (pointer: coarse) and (max-width: 520px) {
  #btn-cmd-palette {
    display: none;
  }
}

/* 0–200% Volume Boost indicator */
.volume-pct {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-faint);
  min-width: 2.35rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.volume-pct.is-boost {
  color: #ffd18c;
  font-weight: 600;
}
#volume.is-boost::-webkit-slider-thumb {
  background: #ffd18c;
  box-shadow: 0 0 0 3px rgba(255, 209, 140, 0.28);
}
#volume.is-boost::-moz-range-thumb {
  background: #ffd18c;
}

/* Studio DSP Bar inside EQ panel */
.studio-dsp-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.dsp-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}
.dsp-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 0.3rem;
  min-width: 4.8rem;
}
.dsp-chip {
  padding: 0.34rem 0.72rem;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 500;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.dsp-chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}
.dsp-chip.active,
.dsp-chip[aria-pressed="true"] {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.42);
}

/* Video Pro Controls Panel */
.video-pro-panel {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}
.video-pro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.video-pro-sliders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.video-pro-sliders label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}
.video-pro-sliders input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
@media (max-width: 560px) {
  .video-pro-sliders {
    grid-template-columns: minmax(0, 1fr);
  }
  .dsp-label {
    flex: 1 0 100%;
    margin-bottom: 0.1rem;
  }
}

/* Open Files + Open Folder side-by-side & Queue Search Filter */
.open-files-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.open-files-row .add-files {
  padding: 0.7rem 0.65rem;
  font-size: 0.84rem;
}
.queue-filter-wrap input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  min-height: 36px;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
.queue-filter-wrap input::placeholder {
  color: var(--text-faint);
}
.queue-filter-wrap input:focus {
  outline: none;
  border-color: var(--accent);
}
@media (max-width: 768px), (pointer: coarse) {
  .queue-filter-wrap input {
    font-size: 1rem;
  }
}

/* Command Palette (⌘K) */
.cmd-modal {
  align-items: start;
  padding-top: min(12vh, 5.5rem);
}
.cmd-content {
  width: min(540px, 100%);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-2);
}
.cmd-input-wrap:focus-within {
  border-color: var(--accent);
}
.cmd-search-icon {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}
#cmd-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
}
#cmd-input::placeholder {
  color: var(--text-faint);
}
.cmd-results {
  max-height: min(54vh, 22rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cmd-group-label {
  padding: 0.5rem 0.6rem 0.2rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  min-height: 40px;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  font-size: 0.85rem;
  transition:
    background 0.12s,
    color 0.12s;
}
.cmd-item:hover,
.cmd-item.is-active {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}
.cmd-item-icon {
  width: 1.25rem;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}
.cmd-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmd-item-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .cmd-modal {
    align-items: end;
    padding-top: 0;
  }
}

/* Fallback Compact Mini-Player Mode (Safari / Firefox) */
body.is-compact-mini .page-heading,
body.is-compact-mini .queue {
  display: none;
}
body.is-compact-mini .workspace {
  grid-template-columns: minmax(0, 28rem);
  justify-content: center;
}
body.is-compact-mini .stage.has-audio {
  aspect-ratio: 16 / 7;
  min-height: 140px;
}

/* ═══════════════════════════════════════════════════════════════════════
   STAGE ARTWORKS GALLERY & TACTILE MICRO-INTERACTIONS (v17)
   Prism · Vinyl · Studio Cassette · Master Reel · Optical CD · Aurora
   ═══════════════════════════════════════════════════════════════════════ */

.stage.has-audio {
  perspective: 980px;
  padding-top: clamp(3.1rem, 5.2vw, 3.7rem);
  padding-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

/* ─── Stage Top Gallery Dock & Sliding Spring Pill ─── */
.stage-top-bar {
  position: absolute;
  top: 0.62rem;
  left: 0.65rem;
  right: 0.65rem;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  pointer-events: none;
}

.stage-art-dock {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(7, 9, 17, 0.78);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 28px -10px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.stage-art-dock::-webkit-scrollbar {
  display: none;
}

.stage-dock-pill {
  position: absolute;
  top: 0.22rem;
  bottom: 0.22rem;
  left: 0;
  width: var(--pill-w, 64px);
  transform: translateX(var(--pill-x, 3px));
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.24),
    rgba(var(--accent-2-rgb), 0.12)
  );
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), 0.45);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.36s var(--ease-spring),
    width 0.28s var(--ease-out);
}

.stage-art-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.3rem 0.62rem;
  min-height: 27px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.71rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color 0.2s,
    transform 0.2s var(--ease-out);
}
.stage-art-tab svg {
  flex-shrink: 0;
  opacity: 0.78;
  transition:
    transform 0.28s var(--ease-spring),
    opacity 0.2s;
}
.stage-art-tab:hover {
  color: var(--text);
}
.stage-art-tab:hover svg {
  opacity: 1;
  transform: scale(1.12);
}
.stage-art-tab.is-active {
  color: var(--accent);
  font-weight: 600;
}
.stage-art-tab.is-active svg {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.55));
}

.stage-sub-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
  flex-shrink: 0;
}

.stage-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.3rem 0.64rem;
  min-height: 29px;
  border-radius: 999px;
  background: rgba(7, 9, 17, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.24s var(--ease-spring);
}
.stage-sub-pill:hover,
.stage-sub-pill.is-active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.12);
}
.stage-sub-pill.is-pop {
  animation: pill-spring-pop 0.32s var(--ease-spring);
}
@keyframes pill-spring-pop {
  0% {
    transform: scale(0.9);
  }
  55% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* ─── Stage Ripples & Scrub HUD ─── */
.stage-ripple-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.sonic-ripple {
  position: absolute;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.45);
  animation: sonic-ripple-out 0.68s var(--ease-out) forwards;
}
@keyframes sonic-ripple-out {
  0% {
    transform: scale(0.4);
    opacity: 0.92;
  }
  100% {
    transform: scale(7.5);
    opacity: 0;
  }
}

.stage-scrub-hud {
  position: absolute;
  bottom: 0.72rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.stage-scrub-delta {
  color: var(--accent);
  font-weight: 600;
}

/* ─── 3D Magnetic Stage Tilt & Deck Morph Choreography ─── */
#audio-art {
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
#audio-art.is-scrubbing {
  cursor: grabbing;
}
#audio-art.is-switching-deck {
  animation: deck-switch-morph 0.38s var(--ease-out);
}
@keyframes deck-switch-morph {
  0% {
    opacity: 0.32;
    transform: scale(0.92) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    filter: blur(0);
  }
}

/* Moving glass glare across circular discs & studio decks */
.disc-specular-glare,
.deck-specular-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 35%),
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.04) 36%,
    transparent 65%
  );
  mix-blend-mode: screen;
}

/* Idle breathing halo when audio is loaded & paused */
body:not(.is-playing) .stage.has-audio .audio-glow {
  animation: idle-halo-breathe 4.6s ease-in-out infinite;
}
@keyframes idle-halo-breathe {
  0%,
  100% {
    opacity: 0.14;
    transform: scale(0.97);
  }
  50% {
    opacity: 0.28;
    transform: scale(1.04);
  }
}

/* ─── Upgraded Vinyl Grooves & Stylus Glow ─── */
.vinyl-grooves-sheen,
.cd-rainbow-sheen {
  display: none;
}
#audio-art.is-vinyl .vinyl-grooves-sheen {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: conic-gradient(
    from 25deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.14) 24deg,
    transparent 52deg,
    transparent 180deg,
    rgba(var(--accent-rgb), 0.16) 206deg,
    transparent 236deg,
    transparent 360deg
  );
  transform: rotate(calc(-1 * var(--vinyl-deg, 0deg)));
  mix-blend-mode: screen;
}
.vinyl-stylus-glow {
  opacity: 0;
  transition: opacity 0.3s;
}
.vinyl-tonearm.is-tracking .vinyl-stylus-glow {
  opacity: 0.95;
  filter: drop-shadow(0 0 6px var(--accent));
}

/* ─── Deck 5: Optical Iridescent Compact Disc ─── */
#audio-art.is-cd .audio-disc {
  width: 66%;
  background:
    radial-gradient(circle at center, #05070e 0 11%, rgba(225, 234, 250, 0.22) 11.4% 21%, #cfd8ea 21.5% 23%, #1b2030 23.5%),
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), #131726 70%);
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.72),
    0 0 46px rgba(var(--accent-rgb), 0.24),
    inset 0 0 0 3px rgba(255, 255, 255, 0.1);
  transform: scale(var(--logo-scale, 1)) rotate(var(--vinyl-deg, 0deg));
  transition: none;
}
#audio-art.is-cd .audio-disc::before {
  animation: none;
  opacity: 0.22;
}
#audio-art.is-cd .cd-rainbow-sheen {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  background: conic-gradient(
    from 15deg,
    transparent 0deg,
    rgba(56, 189, 248, 0.36) 24deg,
    rgba(168, 85, 247, 0.38) 44deg,
    rgba(244, 114, 182, 0.32) 62deg,
    rgba(250, 204, 21, 0.26) 80deg,
    rgba(52, 211, 153, 0.3) 98deg,
    transparent 128deg,
    transparent 180deg,
    rgba(56, 189, 248, 0.34) 204deg,
    rgba(192, 132, 252, 0.38) 226deg,
    rgba(251, 146, 60, 0.28) 248deg,
    rgba(52, 211, 153, 0.3) 270deg,
    transparent 304deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 0 21%, #000 22% 98%, transparent 99%);
  mask-image: radial-gradient(circle, transparent 0 21%, #000 22% 98%, transparent 99%);
  transform: rotate(calc(-1 * var(--vinyl-deg, 0deg) + (var(--glare-x, 50) * 0.4deg)));
  mix-blend-mode: screen;
}
#audio-art.is-cd .audio-disc img,
#audio-art.is-cd .audio-disc img.cover-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.36;
  filter: contrast(1.08) saturate(1.15);
  -webkit-mask-image: radial-gradient(circle, transparent 0 22%, #000 23%);
  mask-image: radial-gradient(circle, transparent 0 22%, #000 23%);
}
#audio-art.is-cd .vinyl-spindle {
  display: block;
  position: absolute;
  width: 21%;
  height: 21%;
  border-radius: 50%;
  background: radial-gradient(circle, #05070e 0 46%, rgba(255, 255, 255, 0.22) 48% 66%, rgba(16, 20, 32, 0.82) 68% 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  z-index: 3;
  pointer-events: none;
}

.cd-laser-sled {
  position: absolute;
  bottom: 18%;
  left: 50%;
  width: 24%;
  height: 10px;
  transform: rotate(38deg);
  transform-origin: 0% 50%;
  z-index: 1;
  pointer-events: none;
}
.cd-laser-rail {
  position: absolute;
  inset: 3px 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}
.cd-laser-lens {
  position: absolute;
  top: 50%;
  left: calc(28% + var(--laser-pos, 0%) * 0.64);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #67e8f9;
  box-shadow:
    0 0 12px rgba(103, 232, 249, var(--laser-glow, 0.65)),
    0 0 24px rgba(var(--accent-rgb), 0.8);
  z-index: 3;
}

/* ─── Deck 3: Studio Chrome CrO₂ Cassette Deck ─── */
#audio-art[data-deck="cassette"],
#audio-art[data-deck="reel"] {
  width: min(92%, 23.5rem);
  aspect-ratio: 1.56 / 1;
}

.deck-cassette {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 1.05rem;
  padding: 0.72rem 0.85rem 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  background:
    linear-gradient(160deg, rgba(32, 38, 58, 0.94), rgba(11, 14, 24, 0.97)),
    #0c0f1b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 22px 50px -14px rgba(0, 0, 0, 0.85),
    0 0 42px -10px rgba(var(--accent-rgb), 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 6px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.cassette-screw {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #66708c, #1c2030);
  border: 1px solid rgba(0, 0, 0, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  z-index: 3;
}
.cassette-screw.s-tl { top: 0.42rem; left: 0.45rem; }
.cassette-screw.s-tr { top: 0.42rem; right: 0.45rem; }
.cassette-screw.s-bl { bottom: 0.42rem; left: 0.45rem; }
.cassette-screw.s-br { bottom: 0.42rem; right: 0.45rem; }

.cassette-label-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.38rem 0.55rem;
  margin-inline: 0.32rem;
  border-radius: 0.55rem;
  background:
    linear-gradient(
      90deg,
      rgba(var(--accent-rgb), 0.16),
      rgba(255, 255, 255, 0.04) 48%,
      rgba(var(--accent-2-rgb), 0.12)
    ),
    rgba(8, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cassette-stamp-wrap {
  width: 34px;
  height: 34px;
  border-radius: 0.38rem;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}
.cassette-stamp-wrap img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}
.cassette-stamp-wrap img.is-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cassette-meta-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.04rem;
}
.cassette-kicker {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.9;
}
.cassette-track-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.98rem;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cassette-track-sub {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cassette-side-badge {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: #080a14;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cassette-window {
  flex: 1;
  min-height: 0;
  margin-inline: 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), 0.1), rgba(4, 5, 10, 0.92) 75%),
    #05070e;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.85);
  display: grid;
  grid-template-columns: 1fr minmax(4.5rem, 1.15fr) 1fr;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
}

.cassette-spool {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 4.8rem;
  justify-self: center;
  display: grid;
  place-items: center;
}
.cassette-tape-pack {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    #1c1618 0px,
    #1c1618 2px,
    #2b2226 3px,
    #120e10 4px
  );
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(var(--pack-scale, 0.72));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}
.cassette-hub {
  position: relative;
  z-index: 2;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  background: radial-gradient(circle, #070912 0 38%, #dce3f2 40% 68%, #94a3b8 70% 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  transform: rotate(var(--hub-deg, 0deg));
}
.cassette-hub i {
  position: absolute;
  left: 50%;
  top: 6%;
  bottom: 6%;
  width: 2.5px;
  margin-left: -1.25px;
  background: #0b0e1a;
  border-radius: 1px;
}
.cassette-hub i:nth-child(2) { transform: rotate(60deg); }
.cassette-hub i:nth-child(3) { transform: rotate(120deg); }

.cassette-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.cassette-scale-ticks {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--text-faint);
}
.cassette-scale-bar {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.cassette-scale-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}
.cassette-vu-leds {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}
.cassette-vu-leds i {
  width: 6px;
  height: 5px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.08s, box-shadow 0.08s;
}
.cassette-vu-leds i.is-on {
  background: #83f2ca;
  box-shadow: 0 0 6px rgba(131, 242, 202, 0.7);
}
.cassette-vu-leds i.is-hot {
  background: #fbbf24;
  box-shadow: 0 0 7px rgba(251, 191, 36, 0.8);
}

.cassette-head-bridge {
  position: relative;
  height: 1.35rem;
  margin-inline: 2.1rem;
  border-radius: 0.45rem 0.45rem 0.2rem 0.2rem;
  background: linear-gradient(180deg, rgba(22, 26, 40, 0.95), rgba(10, 12, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cassette-magnetic-tape {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b2d2f, rgba(var(--accent-rgb), 0.65), #3b2d2f);
}
.cassette-head-assembly {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(3px);
  transition: transform 0.28s var(--ease-spring);
}
.cassette-head-assembly.is-engaged {
  transform: translateY(-2px);
}
.cassette-roller {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e2436;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.cassette-read-head {
  width: 16px;
  height: 9px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), #475569);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.55);
}

/* ─── Deck 4: Master Studio Open-Reel (1/4" Nagra / Studer) ─── */
.deck-reel {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 1.1rem;
  padding: 0.55rem 0.8rem 0.55rem;
  display: grid;
  grid-template-rows: 1fr auto auto;
  background:
    radial-gradient(circle at 50% 25%, rgba(var(--accent-rgb), 0.1), transparent 65%),
    linear-gradient(180deg, #161a29, #0a0d17);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 22px 52px -14px rgba(0, 0, 0, 0.88),
    0 0 42px -10px rgba(var(--accent-rgb), 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.reel-platter-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.75rem;
  min-height: 0;
}

.nab-reel-unit {
  position: relative;
  height: 100%;
  aspect-ratio: 1;
  max-height: 6.4rem;
  display: grid;
  place-items: center;
}
.nab-tape-pack {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: radial-gradient(circle, #120e10 30%, #2a2023 68%, #161113 100%);
  transform: scale(var(--pack-scale, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.nab-flange {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(226, 232, 244, 0.34),
    rgba(100, 116, 139, 0.22) 60deg,
    rgba(241, 245, 249, 0.42) 120deg,
    rgba(71, 85, 105, 0.24) 180deg,
    rgba(226, 232, 244, 0.38) 240deg,
    rgba(100, 116, 139, 0.2) 300deg,
    rgba(226, 232, 244, 0.34)
  );
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.55);
  transform: rotate(var(--reel-deg, 0deg));
  display: grid;
  place-items: center;
}
.nab-slot {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 15%;
  height: 28%;
  margin-left: -7.5%;
  border-radius: 99px;
  background: rgba(8, 10, 18, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform-origin: 50% 142%;
}
.nab-slot.sl-2 { transform: rotate(120deg); }
.nab-slot.sl-3 { transform: rotate(240deg); }

.nab-center-hub {
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent), #1e293b 82%);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45);
}

.reel-tape-svg {
  width: 100%;
  height: 2.1rem;
  margin-top: -0.35rem;
  pointer-events: none;
}

.reel-bridge {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0.2rem;
}

.vu-meter-box {
  position: relative;
  padding: 0.26rem 0.45rem 0.2rem;
  border-radius: 0.45rem;
  background: linear-gradient(180deg, #2a241c, #171410);
  border: 1px solid rgba(255, 214, 153, 0.28);
  box-shadow:
    inset 0 0 16px rgba(251, 191, 36, 0.16),
    inset 0 2px 6px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.vu-scale {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: rgba(254, 243, 199, 0.72);
}
.vu-scale .vu-hot {
  color: #f87171;
  font-weight: 700;
}
.vu-dial {
  position: relative;
  width: 100%;
  height: 1.15rem;
  overflow: hidden;
}
.vu-arc {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 3px;
  height: 2.1rem;
  border-radius: 50%;
  border-top: 1.5px solid rgba(254, 243, 199, 0.35);
}
.vu-needle {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 1.8px;
  height: 1.25rem;
  margin-left: -0.9px;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.75);
  transform-origin: 50% 100%;
  transform: rotate(var(--vu-deg, -40deg));
  border-radius: 2px;
}
.vu-ch {
  font-family: var(--font-mono);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  color: rgba(254, 243, 199, 0.55);
  margin-top: 1px;
}

.reel-head-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  padding-inline: 0.25rem;
}
.reel-peak-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.reel-peak-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3f1d24;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.08s, box-shadow 0.08s;
}
.reel-peak-led.is-hot {
  background: #fb7185;
  box-shadow: 0 0 9px #fb7185;
}
.reel-head-badge strong {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
}
.reel-sub-tag {
  font-family: var(--font-mono);
  font-size: 0.44rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

/* ─── Deck 6: Full-Stage Generative Aurora Sculpture ─── */
#audio-art[data-deck="aurora"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform: none;
}
#audio-art[data-deck="aurora"] .audio-glow {
  display: none;
}
.aurora-canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLAYER-WIDE MICRO-INTERACTIONS & MINI-ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════ */

/* 1. Breathing Play Aura & Tactile Button Springs */
body.is-playing #play:not(:disabled) {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.72),
    0 8px 28px rgba(var(--accent-rgb), 0.46),
    0 0 42px -6px rgba(var(--accent-2-rgb), 0.35);
}

.micro-play-pop {
  animation: micro-play-spring 0.34s var(--ease-spring);
}
@keyframes micro-play-spring {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.micro-nudge-left {
  animation: micro-nudge-l 0.28s var(--ease-spring);
}
@keyframes micro-nudge-l {
  0% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(-4px) scale(0.95);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

.micro-nudge-right {
  animation: micro-nudge-r 0.28s var(--ease-spring);
}
@keyframes micro-nudge-r {
  0% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(4px) scale(0.95);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

.micro-pop {
  animation: micro-btn-pop 0.24s var(--ease-spring);
}
@keyframes micro-btn-pop {
  0% {
    transform: scale(0.93);
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* 2. Staggered Track Metadata Reveal */
.track-info.is-revealing #current-title {
  animation: meta-slide-up 0.32s var(--ease-out) both;
}
.track-info.is-revealing #artist {
  animation: meta-slide-up 0.36s 0.05s var(--ease-out) both;
}
.track-info.is-revealing .format-badge {
  animation: meta-badge-pop 0.3s 0.03s var(--ease-spring) both;
}
@keyframes meta-slide-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes meta-badge-pop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 3. Live 3-Bar Equalizer in Active Queue Row & Hover Glide */
#tracks li {
  transition:
    transform 0.18s var(--ease-out),
    background 0.18s;
}
#tracks li:hover {
  transform: translateX(2px);
}

.queue-eq-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  width: 12px;
  height: 13px;
  margin-top: 2px;
  flex-shrink: 0;
}
#tracks .track-button[aria-current="true"] .queue-eq-bars {
  display: inline-flex;
}
.queue-eq-bars i {
  flex: 1;
  height: 32%;
  border-radius: 1.5px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.55);
  transition: height 0.2s var(--ease-out);
}
body.is-playing #tracks .track-button[aria-current="true"] .queue-eq-bars i:nth-child(1) {
  animation: queue-eq-1 0.68s ease-in-out infinite alternate;
}
body.is-playing #tracks .track-button[aria-current="true"] .queue-eq-bars i:nth-child(2) {
  animation: queue-eq-2 0.52s 0.12s ease-in-out infinite alternate;
}
body.is-playing #tracks .track-button[aria-current="true"] .queue-eq-bars i:nth-child(3) {
  animation: queue-eq-3 0.76s 0.22s ease-in-out infinite alternate;
}
@keyframes queue-eq-1 {
  0% { height: 26%; }
  100% { height: 96%; }
}
@keyframes queue-eq-2 {
  0% { height: 42%; }
  100% { height: 100%; }
}
@keyframes queue-eq-3 {
  0% { height: 22%; }
  100% { height: 84%; }
}

/* ─── Responsive Stage Artworks & Dock on Mobile (incl. 360px S23) ─── */
@media (max-width: 680px) {
  .stage-top-bar {
    top: 0.48rem;
    left: 0.48rem;
    right: 0.48rem;
    gap: 0.3rem;
  }
  .stage-art-tab {
    padding: 0.28rem 0.5rem;
    font-size: 0.68rem;
  }
  .stage-art-tab:not(.is-active) span {
    display: none;
  }
  .stage-sub-pill {
    padding: 0.26rem 0.5rem;
    font-size: 0.63rem;
    min-height: 27px;
  }
  .stage.has-audio {
    padding-top: 2.85rem;
    min-height: 250px;
  }
  #audio-art[data-deck="cassette"],
  #audio-art[data-deck="reel"] {
    width: min(96%, 20.5rem);
  }
  .cassette-window {
    margin-inline: 0.25rem;
    padding: 0.28rem 0.5rem;
  }
  .cassette-head-bridge {
    margin-inline: 1.25rem;
  }
  .cassette-track-title {
    font-size: 0.86rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   PUBLIC RADIO HUB — ROMÂNIA 🇷🇴 & ITALIA 🇮🇹 (v18)
   ═══════════════════════════════════════════════════════════════════════ */

/* Live Radio Transport Badge & Official Broadcaster Link */
.live-radio-badge {
  --badge-color: #fb7185;
  gap: 0.32rem;
  padding-inline: 0.52rem;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 8px #fb7185;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.42;
    transform: scale(0.84);
  }
}

.live-station-site {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.live-station-site:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.08);
}

/* Sidebar Quick RO · IT Tuner Strip */
.radio-quick-strip {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.38rem;
  margin-top: -0.25rem;
}
.radio-country-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 35px;
  padding: 0.35rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 500;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.2s var(--ease-out);
}
.radio-country-quick:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.08);
  transform: translateY(-1px);
}
.radio-fav-quick {
  padding-inline: 0.68rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.flag-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.05rem;
  padding-inline: 0.22rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.flag-badge.flag-ro,
[data-open-radio="RO"] .flag-badge {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.72) 0 33%, rgba(234, 179, 8, 0.72) 33% 66%, rgba(220, 38, 38, 0.72) 66% 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.flag-badge.flag-it,
[data-open-radio="IT"] .flag-badge {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.75) 0 33%, rgba(255, 255, 255, 0.45) 33% 66%, rgba(220, 38, 38, 0.75) 66% 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

/* Radio Modal Upgraded Layout */
.radio-content {
  width: min(760px, 100%);
  max-height: 88vh;
}
.radio-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.radio-subtitle {
  font-size: 0.76rem;
  color: var(--text-faint);
}

.radio-country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-bottom: 0.75rem;
}
.radio-country-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.85rem;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.radio-country-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}
.radio-country-tab.is-active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.13);
  font-weight: 600;
}
.radio-tab-count {
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.radio-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.radio-filter-bar .radio-search-row {
  margin-bottom: 0;
}

.radio-genre-chips {
  display: flex;
  gap: 0.32rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.radio-genre-chips::-webkit-scrollbar {
  display: none;
}
.radio-genre-chip {
  padding: 0.28rem 0.68rem;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-faint);
  font-size: 0.73rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.radio-genre-chip:hover {
  color: var(--text);
  border-color: var(--border-2);
}
.radio-genre-chip.is-active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.11);
}

.radio-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.2rem;
}
.radio-scroll-body .radio-list {
  flex: none;
  overflow: visible;
  padding-right: 0;
}

.radio-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Curated Official Broadcaster Cards */
.radio-curated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.5rem;
}
.radio-preset-card {
  --preset-color: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  padding: 0.68rem 0.78rem;
  border-radius: 0.72rem;
  border: 1px solid var(--border-2);
  background:
    radial-gradient(
      circle at 100% 0%,
      color-mix(in srgb, var(--preset-color) 14%, transparent),
      transparent 65%
    ),
    rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s,
    background 0.2s;
}
.radio-preset-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--preset-color) 48%, var(--border-2));
  background:
    radial-gradient(
      circle at 100% 0%,
      color-mix(in srgb, var(--preset-color) 22%, transparent),
      transparent 70%
    ),
    rgba(255, 255, 255, 0.045);
}
.radio-preset-card.is-playing-station,
.radio-station-row.is-playing-station {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
}

.radio-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.radio-preset-badge {
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--preset-color);
  background: color-mix(in srgb, var(--preset-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--preset-color) 34%, transparent);
}
.radio-preset-actions,
.radio-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}
.radio-preset-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.radio-preset-sub {
  font-size: 0.7rem;
  color: var(--text-faint);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-site-icon,
.radio-star-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.radio-site-icon:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.radio-star-btn:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.radio-star-btn.is-starred {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
}

.radio-legal-note {
  margin: 0.7rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.69rem;
  line-height: 1.45;
  color: var(--text-faint);
}

@media (max-width: 768px) {
  #radio-search {
    font-size: 1rem;
  }
}
@media (max-width: 520px) {
  .radio-curated-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .radio-preset-card {
    padding: 0.58rem 0.62rem;
  }
  .radio-preset-name {
    font-size: 0.8rem;
  }
  .radio-country-tab {
    padding: 0.36rem 0.68rem;
    font-size: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   OPTIONAL GOOGLE SIGN-IN & CLOUD SYNC (v21)
   ═══════════════════════════════════════════════════════════════════════ */

.account-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding-inline: 0.68rem;
}
.account-pill.is-signed-in {
  padding-left: 0.38rem;
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.08);
}
.account-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}
.account-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  flex-shrink: 0;
}
.account-sync-dot.is-online {
  background: #83f2ca;
  box-shadow: 0 0 8px #83f2ca;
}

@media (max-width: 620px) {
  .account-label {
    display: none;
  }
  .account-pill {
    padding-inline: 0.55rem;
  }
  .account-pill.is-signed-in {
    padding-inline: 0.38rem;
  }
}

.auth-content {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.auth-content .shortcuts-header {
  margin-bottom: 0;
}
.auth-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.auth-optional-tag {
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #83f2ca;
  background: rgba(131, 242, 202, 0.11);
  border: 1px solid rgba(131, 242, 202, 0.32);
}

.auth-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.auth-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.google-signin-btn {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 0.68rem;
  background: #ffffff;
  color: #111421;
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.65);
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.18s;
}
.google-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.75);
}
.google-signin-btn:active {
  transform: translateY(0) scale(0.99);
}

.auth-perks {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.auth-perks li::marker {
  color: var(--accent);
}

.auth-client-config {
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}
.auth-client-config summary {
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-faint);
  user-select: none;
  transition: color 0.15s;
}
.auth-client-config summary:hover {
  color: var(--accent);
}
.auth-config-help {
  margin: 0.5rem 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-faint);
}
.auth-config-row {
  display: flex;
  gap: 0.4rem;
}
.auth-config-row input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.auth-config-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-config-row button {
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  border-radius: 0.5rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}
.auth-config-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Signed-in Profile View */
.auth-profile-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.auth-user-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(var(--accent-rgb), 0.45);
  flex-shrink: 0;
}
.auth-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.auth-user-meta strong {
  font-size: 0.94rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-user-meta span {
  font-size: 0.76rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-sync-summary {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.auth-profile-actions {
  display: flex;
  gap: 0.5rem;
}
.auth-profile-actions button {
  flex: 1;
  min-height: 38px;
  padding: 0.5rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.auth-profile-actions button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #080a14;
  border: none;
}
.auth-profile-actions button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
}
.auth-profile-actions button.secondary:hover {
  color: #ff8f8f;
  border-color: rgba(255, 143, 143, 0.4);
}

/* Portable Offline Backup Row */
.auth-backup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.auth-backup-label {
  font-size: 0.76rem;
  color: var(--text-faint);
}
.auth-backup-btns {
  display: inline-flex;
  gap: 0.38rem;
}
.auth-backup-btns button {
  min-height: 30px;
  padding: 0.3rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}
.auth-backup-btns button:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.38);
}

@media (max-width: 768px) {
  .auth-config-row input {
    font-size: 1rem;
  }
}
@media (max-width: 600px) {
  .auth-modal {
    align-items: end;
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE · RADIO BOTTOM SHEET & PLAYER REFINEMENTS (v26)
   ═══════════════════════════════════════════════════════════════════════ */

/* Touch: no grey tap flash, crisp press feedback instead of hover lifts */
.radio-modal,
.transport,
.stage-art-dock,
#tracks {
  -webkit-tap-highlight-color: transparent;
}
.audio-timeline {
  font-variant-numeric: tabular-nums;
}
@media (hover: none) {
  .radio-preset-card:hover,
  .radio-country-quick:hover {
    transform: none;
  }
  .radio-station-row:hover {
    background: transparent;
    border-color: transparent;
  }
  .radio-preset-card:active,
  .radio-station-row:active {
    transform: scale(0.975);
    background: rgba(var(--accent-rgb), 0.08);
    transition-duration: 0.08s;
  }
  .skip-btn:active:not(:disabled),
  .playback-button:active,
  .tool-btn:active,
  .radio-country-tab:active,
  .radio-genre-chip:active,
  .radio-star-btn:active,
  .radio-site-icon:active,
  .radio-station-play:active {
    transform: scale(0.92);
    transition: transform 0.08s;
  }
}

@media (max-width: 600px) {
  /* ── Sheet chrome ── */
  html.radio-sheet-open,
  html.radio-sheet-open body {
    overflow: hidden;
    overscroll-behavior: none;
  }
  .radio-modal {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .radio-content {
    height: 90dvh;
    max-height: 90dvh;
    padding-top: 1.55rem;
    transform: translateY(var(--sheet-drag, 0px));
    transition: transform 0.32s var(--ease-out);
    animation: radio-sheet-up 0.36s var(--ease-out);
    box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, 0.9);
    will-change: transform;
  }
  .radio-content.is-dragging {
    transition: none;
  }
  .radio-content::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: 50%;
    width: 2.6rem;
    height: 4px;
    margin-left: -1.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
  }
  .radio-header {
    margin-bottom: 0.75rem;
    touch-action: none;
  }
  .radio-header h2 {
    font-size: 1.25rem;
  }
  .radio-subtitle {
    font-size: 0.7rem;
  }
  #radio-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
  }

  /* ── Country tabs: one swipeable row ── */
  .radio-country-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    margin: 0 -1rem 0.6rem;
    padding: 0 1rem 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1.5rem), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1.5rem), transparent);
  }
  .radio-country-tabs::-webkit-scrollbar {
    display: none;
  }
  .radio-country-tab {
    flex: none;
    scroll-snap-align: start;
    min-height: 38px;
  }

  /* ── Search + genres ── */
  .radio-filter-bar {
    gap: 0.5rem;
    margin-bottom: 0.6rem;
  }
  .radio-search-row input {
    min-height: 44px;
    border-radius: 0.75rem;
    padding-inline: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
  }
  .radio-genre-chips {
    margin: 0 -1rem;
    padding: 0 1rem 2px;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1.5rem), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1.5rem), transparent);
  }
  .radio-genre-chip {
    min-height: 34px;
    padding-inline: 0.85rem;
    scroll-snap-align: start;
  }

  /* ── Scroll body ── */
  .radio-scroll-body {
    gap: 0.85rem;
    padding-right: 0;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 0.6rem, #000 calc(100% - 1.2rem), transparent);
    mask-image: linear-gradient(180deg, transparent 0, #000 0.6rem, #000 calc(100% - 1.2rem), transparent);
  }
  .radio-section-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -0.25rem 0.45rem;
    padding: 0.45rem 0.25rem;
    background: linear-gradient(180deg, var(--surface-2) 70%, transparent);
  }

  /* ── Curated cards ── */
  .radio-curated-grid {
    gap: 0.45rem;
  }
  .radio-preset-card {
    min-height: 86px;
    border-radius: 0.85rem;
  }
  .radio-preset-sub {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .radio-site-icon,
  .radio-star-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  /* ── Directory rows: list-cell style ── */
  .radio-list {
    gap: 0;
  }
  .radio-station-row {
    min-height: 60px;
    gap: 0.75rem;
    padding: 0.55rem 0.4rem;
    border-radius: 0.7rem;
    position: relative;
    transition:
      transform 0.15s var(--ease-out),
      background 0.15s;
  }
  .radio-station-row + .radio-station-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 3.6rem;
    right: 0.4rem;
    height: 1px;
    background: var(--border);
  }
  .radio-station-favicon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
  .radio-station-name {
    font-size: 0.92rem;
  }
  .radio-station-meta {
    font-size: 0.72rem;
  }
  .radio-row-actions {
    gap: 0.2rem;
  }
  .radio-station-play {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), 0.9);
  }
  .radio-station-row.is-playing-station {
    background: rgba(var(--accent-rgb), 0.1);
  }
  .radio-station-row.is-playing-station::after {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
  }
  .radio-station-row.is-playing-station .radio-station-play {
    animation: radio-now-pulse 1.6s ease-in-out infinite;
  }
  .radio-legal-note {
    font-size: 0.66rem;
  }

  /* ── Sidebar quick strip ── */
  .radio-quick-strip {
    gap: 0.45rem;
  }
  .radio-country-quick {
    min-height: 42px;
    border-radius: 0.7rem;
  }
}

@media (max-width: 360px) {
  .radio-curated-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .radio-preset-card {
    min-height: 0;
  }
}

@keyframes radio-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes radio-now-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0);
  }
}

/* ── Player on phones ── */
@media (max-width: 560px) {
  .player-shell {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .stage-art-dock {
    flex: 0 1 auto;
    min-width: 0;
    scroll-snap-type: x proximity;
  }
  .stage-art-dock > button {
    min-height: 32px;
    scroll-snap-align: center;
  }
  .stage.has-audio {
    padding: 3.1rem 0.65rem 0.85rem;
    min-height: 256px;
  }
  .audio-art {
    width: clamp(9.75rem, 48vw, 13rem);
  }
  .playback-button {
    box-shadow: 0 10px 26px -12px rgba(var(--accent-rgb), 0.85);
  }
  .audio-timeline .seek-wrap {
    min-height: 36px;
  }
  .live-station-site {
    min-height: 28px;
    padding-inline: 0.65rem;
  }
  #tracks li {
    min-height: 52px;
  }
}

/* Phones in landscape: keep transport visible without scrolling */
@media (orientation: landscape) and (max-height: 500px) {
  .stage.has-audio {
    aspect-ratio: auto;
    height: 62dvh;
    min-height: 0;
  }
  .audio-art {
    width: clamp(7rem, 34dvh, 11rem);
  }
  .radio-content {
    max-height: 94dvh;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   OVERLAP FIXES (v27) — header, stage dock & live badges never collide
   ═══════════════════════════════════════════════════════════════════════ */
.site-header .brand {
  flex-shrink: 0;
  min-width: 0;
}
.site-header .header-controls {
  min-width: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
}
.site-header .header-controls > * {
  flex-shrink: 0;
}
.theme-picker summary #current-theme {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-top-bar .stage-art-dock {
  flex: 0 1 auto;
  min-width: 0;
}

/* Radio streams: the "● LIVE · RO" badge replaces the generic format badge */
.live-radio-badge:not([hidden]) ~ #format-badge {
  display: none;
}
.track-title-row #current-title {
  min-width: 0;
}

@media (max-width: 680px) {
  #btn-shortcuts-help,
  #btn-cmd-palette {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 0.45rem;
    padding-inline: max(0.75rem, env(safe-area-inset-left, 0px));
  }
  .brand-sub {
    display: none;
  }
  .header-controls {
    gap: 0.35rem;
  }
  .site-header .pill-btn {
    padding: 0.42rem 0.62rem;
  }
  .theme-picker summary {
    padding: 0.42rem 0.58rem;
    gap: 0.38rem;
  }
}

@media (max-width: 560px) {
  /* Swatch-only theme trigger keeps the header clean with room to spare */
  #current-theme {
    display: none;
  }
  .theme-options {
    inset-inline-start: 0;
    inset-inline-end: auto;
    max-width: calc(100vw - 1.5rem);
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .site-header .party-pill {
    padding-inline: 0.58rem;
    font-size: 0.74rem;
    gap: 0.32rem;
  }
  .site-header .account-pill {
    padding-inline: 0.5rem;
  }
  .track-title-row {
    gap: 0.4rem;
  }
  .track-title-row #current-title {
    flex: 1 1 100%;
    order: 5;
  }
  .live-station-site {
    order: 4;
    margin-left: auto;
  }
}

@media (max-width: 360px) {
  .site-header .party-pill {
    font-size: 0;
    gap: 0;
    padding-inline: 0.52rem;
  }
  .site-header .party-pill::after {
    content: "♫";
    font-size: 0.8rem;
    line-height: 1;
    margin-left: 0.25rem;
  }
}

@media (max-width: 330px) {
  .brand-name {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   AMBIENT FULLSCREEN HI-FI DECK MODE & SHARE SUB-PILL (v28)
   ═══════════════════════════════════════════════════════════════════════ */
.stage-icon-sub-pill {
  padding-inline: 0.5rem;
}

@media (max-width: 680px) {
  #btn-ambient-deck span {
    display: none;
  }
  #btn-ambient-deck {
    padding-inline: 0.5rem;
  }
}

body.is-ambient-deck {
  overflow: hidden;
}
body.is-ambient-deck .site-header,
body.is-ambient-deck .page-heading,
body.is-ambient-deck .queue,
body.is-ambient-deck .transport {
  display: none !important;
}
body.is-ambient-deck .player-shell,
body.is-ambient-deck .player-grid,
body.is-ambient-deck .player {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
}
body.is-ambient-deck #stage {
  position: fixed;
  inset: 0;
  z-index: 88;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  padding: 4.5rem 1.5rem 6.2rem;
  background:
    radial-gradient(circle at 50% 44%, rgba(var(--accent-rgb), 0.14), transparent 62%),
    #03040a;
}
body.is-ambient-deck #audio-art:not([data-deck="aurora"]):not([data-deck="cassette"]):not([data-deck="reel"]) {
  width: min(68vmin, 27rem);
}
body.is-ambient-deck #audio-art[data-deck="cassette"],
body.is-ambient-deck #audio-art[data-deck="reel"] {
  width: min(88vw, 33rem);
}
body.is-ambient-deck .stage-top-bar {
  top: max(1rem, env(safe-area-inset-top, 0px));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(94vw, 720px);
  transition: opacity 0.35s var(--ease-out);
}

.ambient-deck-hud {
  position: absolute;
  left: 50%;
  bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(92vw, 600px);
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 52px -14px rgba(0, 0, 0, 0.9);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.ambient-deck-hud[hidden] {
  display: none !important;
}
.ambient-clock {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-inline: 0.35rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ambient-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}
.ambient-meta strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ambient-meta span {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ambient-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex-shrink: 0;
}
.ambient-ctrl-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.ambient-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.ambient-ctrl-btn.is-primary {
  background: var(--accent);
  color: #070912;
  border-color: transparent;
  font-weight: 700;
}

body.is-ambient-deck.ambient-cursor-idle #stage {
  cursor: none;
}
body.is-ambient-deck.ambient-cursor-idle .stage-top-bar,
body.is-ambient-deck.ambient-cursor-idle .ambient-deck-hud {
  opacity: 0.14;
}
body.is-ambient-deck .stage-top-bar:hover,
body.is-ambient-deck .ambient-deck-hud:hover {
  opacity: 1 !important;
}

@media (max-width: 520px) {
  .ambient-deck-hud {
    gap: 0.6rem;
    padding: 0.52rem 0.72rem;
  }
  .ambient-clock {
    font-size: 0.78rem;
  }
  .ambient-meta strong {
    font-size: 0.92rem;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .audio-art::before {
    animation: none;
    opacity: 0.2;
  }
  .empty-prism {
    animation: none;
  }
  .audio-art img,
  .audio-art::after {
    transform: none;
  }
}
