* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  min-height: 100svh;
  /* Ambient wash behind the glass — full background per theme via body.theme-* */
  --bg-a: rgba(0, 0, 0, 0.05);
  --bg-b: rgba(0, 0, 0, 0.04);
  --bg-base: #ffffff;
  background:
    radial-gradient(1100px 700px at 22% 18%, var(--bg-a), transparent 62%),
    radial-gradient(900px 650px at 80% 82%, var(--bg-b), transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
  /* Default (grey) theme tokens — inherited by everything */
  --tile-a: rgba(240, 240, 245, 0.95);
  --tile-b: rgba(222, 222, 229, 0.95);
  --ink: #1d1d1f;
  --muted: #707078;
  --track: rgba(0, 0, 0, 0.12);
  --hover: rgba(0, 0, 0, 0.06);
  --play-bg: rgba(0, 0, 0, 0.05);
  --edge: rgba(0, 0, 0, 0.08);
  --swatch-border: rgba(0, 0, 0, 0.25);
  --swatch-ring: #1d1d1f;
  --sheen: rgba(255, 255, 255, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Page background per theme — deep complementary ambience for the dark themes */
body.theme-blue {
  --bg-base: #0c1522;
  --bg-a: rgba(45, 115, 190, 0.3);
  --bg-b: rgba(10, 32, 58, 0.42);
}

body.theme-green {
  --bg-base: #0e1709;
  --bg-a: rgba(110, 165, 40, 0.26);
  --bg-b: rgba(18, 38, 8, 0.45);
}

body.theme-pink {
  --bg-base: #190d14;
  --bg-a: rgba(205, 90, 130, 0.28);
  --bg-b: rgba(56, 16, 36, 0.45);
}

/* App shell: theme overrides live here (defaults inherited from body) */
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: fit-content;
  /* Center on both axes; auto margins collapse to 0 when the content is
     taller than the viewport so it stays reachable on small screens. */
  margin: auto;
}

/* Panels row */
.panels {
  display: flex;
  align-items: stretch;
  gap: 28px;
}


.tile {
  position: relative;
  overflow: hidden;
  --tile-size: 360px;
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--edge);
  backdrop-filter: blur(var(--panel-blur, 20px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--panel-blur, 20px)) saturate(180%);
  box-shadow:
    0 18px 40px -8px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 var(--sheen);
}

/* iPod color themes (dark) */
.app.theme-blue {
  --tile-a: #16283c;
  --tile-b: #0e1a2a;
  --ink: #9fc9ec;
  --muted: #6d87a3;
  --track: rgba(159, 201, 236, 0.18);
  --hover: rgba(255, 255, 255, 0.1);
  --play-bg: rgba(255, 255, 255, 0.08);
  --edge: rgba(255, 255, 255, 0.12);
  --swatch-border: rgba(255, 255, 255, 0.4);
  --swatch-ring: rgba(255, 255, 255, 0.95);
  --sheen: rgba(255, 255, 255, 0.14);
}

.app.theme-green {
  --tile-a: #1b2612;
  --tile-b: #111a0a;
  --ink: #bfdf92;
  --muted: #8aa273;
  --track: rgba(191, 223, 146, 0.18);
  --hover: rgba(255, 255, 255, 0.1);
  --play-bg: rgba(255, 255, 255, 0.08);
  --edge: rgba(255, 255, 255, 0.12);
  --swatch-border: rgba(255, 255, 255, 0.4);
  --swatch-ring: rgba(255, 255, 255, 0.95);
  --sheen: rgba(255, 255, 255, 0.14);
}

.app.theme-pink {
  --tile-a: #2c1620;
  --tile-b: #1c0e15;
  --ink: #f2b6c8;
  --muted: #b28a98;
  --track: rgba(242, 182, 200, 0.18);
  --hover: rgba(255, 255, 255, 0.1);
  --play-bg: rgba(255, 255, 255, 0.08);
  --edge: rgba(255, 255, 255, 0.12);
  --swatch-border: rgba(255, 255, 255, 0.4);
  --swatch-ring: rgba(255, 255, 255, 0.95);
  --sheen: rgba(255, 255, 255, 0.14);
}

/* Color swatches (inside .looks, which handles alignment) */
.swatches {
  display: flex;
  gap: 10px;
}

/* Branding, bottom-right of the page — modern, adaptive to any theme */
.branding {
  position: fixed;
  right: 28px;
  bottom: 22px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #ffffff;
  mix-blend-mode: difference;
  opacity: 0.8;
  z-index: 5;
  user-select: none;
  pointer-events: none;
}

.swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--swatch-border);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch:focus-visible {
  outline: 2px solid var(--swatch-ring);
  outline-offset: 2px;
}

.swatch[aria-pressed="true"] {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--swatch-ring);
}

.swatch--grey {
  background: #e6e6eb;
}

.swatch--blue {
  background: #1d5f9e;
}

.swatch--green {
  background: #4c7a18;
}

.swatch--pink {
  background: #b3486c;
}

/* Vinyl: half above the tile, clipped; only the bottom half-round shows */
/* Disc with a slide-out/slide-in motion for track changes (like a tray).
   The `translate` property slides it without touching the spin transform. */
.vinyl {
  position: absolute;
  top: -50%;
  left: -1%;
  width: 102%;
  aspect-ratio: 1;
  border-radius: 50%;
  /* Default: CD back image (assets/cd-back.jpg). Silver fallback if missing. */
  background:
    url("assets/cd-back.jpg") center / cover no-repeat,
    radial-gradient(circle at 50% 50%, #eef1f6 0%, #c6ccd6 30%, #98a0ae 60%, #d6dbe3 100%);
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 40px rgba(0, 0, 0, 0.28);
  animation: spin 40s linear infinite;
  animation-play-state: paused;
  will-change: transform, translate;
  cursor: pointer;
  transition: translate 550ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Mask: real hole, glassy clear ring, solid art, glassy rim with edge */
  -webkit-mask: radial-gradient(circle at 50% 50%,
    transparent 0 6%,
    rgba(0, 0, 0, 0.15) 6.3%,
    rgba(0, 0, 0, 0.15) 13.4%,
    #000 13.8%,
    #000 94%,
    rgba(0, 0, 0, 0.45) 95%,
    rgba(0, 0, 0, 0.45) 100%);
  mask: radial-gradient(circle at 50% 50%,
    transparent 0 6%,
    rgba(0, 0, 0, 0.15) 6.3%,
    rgba(0, 0, 0, 0.15) 13.4%,
    #000 13.8%,
    #000 94%,
    rgba(0, 0, 0, 0.45) 95%,
    rgba(0, 0, 0, 0.45) 100%);
}

/* The album art layer — masked so art stays out of the hole/ring/rim */
.art-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  opacity: 1;
  transition: opacity 0.2s ease;
  -webkit-mask: radial-gradient(circle at 50% 50%,
    transparent 0 13.4%,
    #000 13.8%,
    #000 94%,
    transparent 95%);
  mask: radial-gradient(circle at 50% 50%,
    transparent 0 13.4%,
    #000 13.8%,
    #000 94%,
    transparent 95%);
}

/* Iridescent ring over the clear zone — branding palette arced around the disc */
.vinyl::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    #f77da0,
    #f7c873 25%,
    #7fd6b0 50%,
    #6fb7e8 75%,
    #b39df2,
    #f77da0
  );
  -webkit-mask: radial-gradient(circle at 50% 50%,
    transparent 0 5.8%,
    #000 6.6%,
    #000 15.2%,
    transparent 16.2%);
  mask: radial-gradient(circle at 50% 50%,
    transparent 0 5.8%,
    #000 6.6%,
    #000 15.2%,
    transparent 16.2%);
  opacity: 0.6;
}

/* Expand/collapse arrow (full-art view) */
.expand-arrow {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.expand-arrow svg {
  width: 16px;
  height: 16px;
}

.tile.is-expanded .expand-arrow {
  opacity: 1;
  pointer-events: auto;
}

/* Expand affordance — a subtle "maximize" cue that appears on the disc's
   lower rim when hovered/focused, hinting the full-art view is clickable.
   Purely decorative: clicks pass through to the disc itself. */
.expand-hint {
  position: absolute;
  left: 50%;
  top: calc(var(--tile-size) * 0.5 - 17px);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.expand-hint svg {
  width: 16px;
  height: 16px;
}

.vinyl:hover ~ .expand-hint,
.vinyl:focus-visible ~ .expand-hint {
  opacity: 1;
}

.tile.is-expanded .expand-hint {
  opacity: 0;
}

/* "Playing on <device>" pill when playback is transferred elsewhere */
.device-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  max-width: calc(100% - 24px);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.expand-arrow:hover {
  background: rgba(10, 12, 18, 0.55);
}

.expand-arrow:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.vinyl:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  border-radius: 50%;
}

/* Full-art layer: square cover that fills the tile when expanded */
.art-full {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  opacity: 0;
  translate: 0 -26px;
  transition: opacity 0.35s ease, translate 0.35s ease;
  pointer-events: none;
}

.tile.is-expanded .art-full {
  opacity: 1;
  translate: 0 0;
  /* Once the full art is in, the whole surface is a collapse target */
  cursor: pointer;
  pointer-events: auto;
}

/* Empty-state presentation when the full art opens with no track */
.art-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.tile.is-expanded.is-empty .art-empty {
  display: flex;
}

.art-empty-mark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}

.art-empty-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* CD fades out once the full art takes over */
.vinyl.art-out {
  opacity: 0;
}

/* The iridescent ring's conic arcs read as odd rotating lines on the
   bare (no-art) disc — hide the ring while there's no track */
.tile.is-empty .vinyl::before {
  display: none;
}

/* The black center hole. (A previous “edge glint” rule also targeted
   .vinyl::after and its rim mask leaked into this rule, turning the hole
   into a thin ring and causing rendering artifacts while the disc spun.
   The glint rule was removed; the glassy rim comes from the vinyl's own
   mask + hairline shadow.) */
.vinyl::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 38%, #2b2b31, #0a0a0c 70%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.tile.is-playing .vinyl {
  animation-play-state: running;
}

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

@media (prefers-reduced-motion: reduce) {
  .vinyl {
    animation: none;
  }
}

/* ---- Bottom details ---- */
.bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--tile-size) * 0.5556);
  padding: 0 26px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 0.3s ease;
}

/* Full-art view: fade the details out */
.tile.is-expanded .bottom {
  opacity: 0;
  pointer-events: none;
}

/* Track info */
.artist {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--muted);
  cursor: pointer;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.artist:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.artist:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.song {
  margin: 3px 0 0;
  max-width: 100%;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seeker */
.seeker {
  position: relative;
  width: 46%;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--track);
  cursor: pointer;
  touch-action: none;
}

.seeker-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--ink);
}

/* Draggable thumb — appears on hover / while dragging */
.seeker-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.seeker:hover .seeker-thumb,
.seeker.dragging .seeker-thumb {
  opacity: 1;
}

/* Timer below the seeker: current / total */
.time-row {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Transport buttons */
.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.ctl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ctl svg {
  width: 22px;
  height: 22px;
}

.ctl:hover {
  background: var(--hover);
}

.ctl:active {
  transform: scale(0.92);
}

.ctl:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.ctl--play {
  width: 44px;
  height: 44px;
  background: var(--play-bg);
  color: var(--ink);
  box-shadow: none;
}

.ctl--play:hover {
  background: var(--hover);
}

.ctl--play svg {
  width: 24px;
  height: 24px;
}

.ctl--play .ic--pause {
  display: none;
}

.ctl--play.is-playing .ic--play {
  display: none;
}

.ctl--play.is-playing .ic--pause {
  display: block;
}

/* ---- Browse panel ---- */
.browse {
  display: flex;
  flex-direction: column;
  width: 400px;
  height: 360px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--edge);
  backdrop-filter: blur(var(--panel-blur, 20px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--panel-blur, 20px)) saturate(180%);
  box-shadow:
    0 18px 40px -8px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 var(--sheen);
  overflow: hidden;
}

.browse-head {
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.browse-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.search {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--hover);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.search::placeholder {
  color: var(--muted);
}

.search:focus {
  border-color: var(--ink);
}

.tracklist {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 14px;
}

.track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.track:hover {
  background: var(--hover);
}

.track.active {
  background: var(--hover);
}

.track img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--track);
}

.track-meta {
  flex: 1;
  min-width: 0;
}

.track-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-dur {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Narrow screens: stack the panels and let them fit the viewport */
@media (max-width: 860px) {
  body {
    padding: 16px;
  }

  .panels {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .tile {
    --tile-size: min(360px, calc(100vw - 32px));
  }

  .browse {
    width: min(400px, calc(100vw - 32px));
  }
}

@media (max-width: 480px) {
  .branding {
    display: none;
  }

  /* Touch devices don't hover — the disc tap (with its title tooltip) is
     the affordance, and the pill would overlap the compact player row. */
  .expand-hint {
    display: none;
  }

  /* Compact the player column so everything fits a shrunken tile */
  .bottom {
    top: calc(var(--tile-size) * 0.42);
  }

  .song {
    font-size: 17px;
  }

  .seeker {
    margin-top: 8px;
  }

  .time-row {
    margin-top: 6px;
  }

  .transport {
    margin-top: 10px;
    gap: 10px;
  }

  .ctl {
    width: 38px;
    height: 38px;
  }
}


/* ---- Browse header: back + title + tabs ---- */
.browse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.browse-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.back svg {
  width: 18px;
  height: 18px;
}

.back:hover {
  background: var(--hover);
}

/* Segmented tabs */
.tabs {
  display: flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--track);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab[aria-selected="true"] {
  background: var(--tile-a);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.track-count {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

/* ---- Login screen ---- */
.login-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 34px;
  flex: 1;
  text-align: center;
}

.login-brand {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}

.login-sub {
  margin: 0 0 6px;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.login-btn {
  padding: 11px 26px;
  border: 0;
  border-radius: 999px;
  background: #1db954;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.login-btn:hover {
  background: #1ed760;
}

.login-btn:active {
  transform: scale(0.97);
}

.login-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---- Toast notice ---- */
.notice {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.85);
  color: #ffffff;
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Load-more indicator */
.load-more {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Fallback state when a playlist's track list is unavailable */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
}

.empty-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.play-btn {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: #1db954;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.play-btn:hover {
  background: #1ed760;
}

.play-btn:active {
  transform: scale(0.97);
}

.play-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---- Devices (Spotify Connect) ---- */
.browse-row {
  position: relative;
}

/* Tabs + devices stay pinned right regardless of the title's visibility */
.browse-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.devices-btn {
  flex-shrink: 0;
}

.devices {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--edge);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 12px 28px -8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 var(--sheen);
  z-index: 20;
}

.device-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.device-row:hover {
  background: var(--hover);
}

.device-row.is-active {
  background: var(--hover);
}

.device-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-type {
  font-size: 11px;
  color: var(--muted);
}

.devices-empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---- Radio button on the tile ---- */
.artist-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.radio-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.radio-btn svg {
  width: 14px;
  height: 14px;
}

.radio-btn:hover {
  color: var(--ink);
  background: var(--hover);
}

.radio-btn.is-on {
  color: var(--ink);
}

.radio-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- Queue view ---- */
.queue-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 10px 6px;
  border-radius: 10px;
  background: var(--hover);
}

.queue-status-text {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--play-bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mini-btn:hover {
  background: var(--hover);
}

.mini-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- Devices ---- */
.devices-btn.is-external {
  color: var(--ink);
  background: var(--play-bg);
}

/* Section labels inside search results / lists */
.section-label {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Skins ---- */
.looks {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-end;
}

.skins-wrap {
  position: relative;
}

.caret-btn {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.caret-btn svg {
  width: 9px;
  height: 9px;
}

.caret-btn:hover {
  color: var(--ink);
  background: rgba(10, 12, 18, 0.6);
}

.caret-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skins-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--edge);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 12px 28px -8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 var(--sheen);
  z-index: 30;
}

.skin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.skin-item:hover {
  background: var(--hover);
}

.skin-item:disabled {
  color: var(--muted);
  cursor: default;
}

.skin-item:disabled:hover {
  background: transparent;
}

.skin-item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skin-item .hint {
  font-size: 11px;
  color: var(--muted);
}

.skins-empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Skin glass tones: no per-tile images — the frosted panels blur the page
   background through their glass. Each tile keeps its own gradient tones. */
.tile {
  background: linear-gradient(
    180deg,
    var(--player-a, var(--tile-a)),
    var(--player-b, var(--tile-b))
  );
}

.browse {
  background: linear-gradient(
    180deg,
    var(--browse-a, var(--tile-a)),
    var(--browse-b, var(--tile-b))
  );
}

/* Skin backdrop image (fills the viewport) behind the glass */
body[data-skin]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--skin-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0.8;
  z-index: -1;
  pointer-events: none;
}

/* Very light vignette for edge softness */
body[data-skin]::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    120% 100% at 50% 30%,
    rgba(8, 10, 12, 0.03),
    rgba(4, 8, 6, 0.18)
  );
  z-index: -1;
  pointer-events: none;
}
