:root {
  --bg: #07070c;
  --ink: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.28);
  --pink: #fa2d48;
  --player-h: 96px;
  --sidebar: 248px;
  --radius: 28px;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.011em;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }

.ambient {
  position: fixed;
  inset: -8%;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.45);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.8s ease;
  z-index: 0;
}
.ambient.is-on { opacity: 0.5; }

.glow {
  position: fixed;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}
.glow-a {
  top: -16vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(250, 45, 72, 0.85), transparent 68%);
  animation: drift 24s ease-in-out infinite alternate;
}
.glow-b {
  right: -12vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(92, 140, 255, 0.75), transparent 68%);
  animation: drift 30s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vw, 0) scale(1.12); }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.7'/></svg>");
}

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 38%, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08) 32%, rgba(255, 255, 255, 0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 16px;
  min-height: 100vh;
  padding: 16px 16px calc(var(--player-h) + 32px);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100vh - var(--player-h) - 48px);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 16px;
  overflow: hidden;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 10px 18px;
}
.brand strong { display: block; font-size: 20px; letter-spacing: -0.04em; }
.brand small { color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; }
.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #1a0b10;
  background: linear-gradient(160deg, #fff, #ffd5dc 42%, var(--pink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(250, 45, 72, 0.28);
}
.mark svg { width: 18px; height: 18px; fill: currentColor; }

.sidenav, .tabbar { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
}
.nav-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-btn em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
}
.nav-btn.is-active {
  color: white;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.legal {
  margin-top: auto;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
  padding: 12px;
}

.workspace { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topbar {
  position: sticky;
  top: 16px;
  z-index: 5;
  padding: 8px;
}
#search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 8px 0 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}
#search-form > svg {
  width: 18px;
  height: 18px;
  stroke: white;
  fill: none;
  stroke-width: 1.8;
  opacity: 0.7;
  flex: none;
}
#search {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 12px 0;
}
#search::placeholder { color: rgba(255, 255, 255, 0.46); }
#search::-webkit-search-cancel-button { display: none; }

.icon-btn, .fab, .play-main, .pill, .ghost {
  border: 0;
  background: transparent;
  color: white;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.icon-btn svg, .fab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover, .ghost:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn[aria-pressed="true"] { color: var(--pink); }
.like svg, #icon-play, #icon-pause, .fab svg, .play-main svg { fill: currentColor; stroke: none; }
.like.is-on { color: var(--pink); }
.like:disabled { opacity: 0.35; }

.view { padding: 6px 8px 24px; }
.date { color: var(--muted); text-transform: capitalize; font-size: 13px; }
.lede { color: var(--muted); max-width: 46ch; line-height: 1.45; }
h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 700;
}
h2 { font-size: 22px; letter-spacing: -0.03em; }

.hero {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.hero-copy h1 { margin: 2px 0 6px; }
.kicker {
  color: var(--faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
}
.hero-art, .art img, .row img, #np-cover {
  object-fit: cover;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
    #1a1a22;
}
.hero-art {
  width: 156px;
  height: 156px;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.pill, .ghost {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 600;
}
.pill { background: white; color: #16161a; }
.ghost { background: rgba(255, 255, 255, 0.1); }

.shelf { margin-top: 28px; }
.shelf-head, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}
.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 176px;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 10px;
}
.shelf-row .card { scroll-snap-align: start; }
.shelf-row::-webkit-scrollbar, .view::-webkit-scrollbar { height: 8px; }
.shelf-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 99px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px 14px;
}
.card {
  min-width: 0;
  padding: 8px 8px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card.is-current { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); }
.art { position: relative; border-radius: 18px; overflow: hidden; }
.art img { width: 100%; aspect-ratio: 1; }
.fab {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pink);
  color: white;
  opacity: 0;
  transform: translateY(6px);
  transition: 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.card:hover .fab, .card.is-current .fab, .fab:focus-visible { opacity: 1; transform: none; }
.len {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.card-meta { padding: 10px 6px 0; }
.card-meta h3, .row strong, #np-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta p, .row small, #np-artist { color: var(--muted); font-size: 13px; }
.card-meta p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: flex; gap: 2px; padding: 4px 2px 0; }
.card-actions .icon-btn { width: 32px; height: 32px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
}
.row.is-current { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.row > button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.row img { width: 52px; height: 52px; border-radius: 12px; }
.row span { min-width: 0; display: flex; flex-direction: column; }
.row em { color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; font-size: 13px; }

.empty, .error {
  padding: 28px;
  color: var(--muted);
  line-height: 1.5;
}
.error { color: white; }

.skel {
  height: 180px;
  border-radius: 24px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skel.hero { height: 200px; }
.skel-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.player {
  position: fixed;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.25fr) minmax(150px, 0.7fr);
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 12px;
  border-radius: 30px;
}
.np, .transport, .extras { min-width: 0; display: flex; align-items: center; }
.np { gap: 10px; }
.cover-btn {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  flex: none;
}
#np-cover { width: 100%; height: 100%; }
.np-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#np-title { font-size: 15px; }
.eq {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.eq i {
  width: 3px;
  height: 4px;
  border-radius: 99px;
  background: white;
  animation: bounce 0.8s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: 0.15s; }
.eq i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  50% { height: 12px; }
}

.transport { flex-direction: column; gap: 4px; }
.transport-btns { display: flex; align-items: center; justify-content: center; gap: 4px; }
.play-main {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pink);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 24px rgba(250, 45, 72, 0.32);
}
.play-main svg { width: 22px; height: 22px; margin-left: 2px; }
.play-main.is-playing svg { margin-left: 0; }
.seek-row, .extras { gap: 8px; }
.seek-row { width: min(460px, 100%); display: flex; align-items: center; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.extras { justify-content: flex-end; }
.slider {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  touch-action: none;
}
.slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}
.slider-fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  border-radius: 99px;
  background: white;
}
.slider.vol { width: 92px; flex: none; }
#repeat-btn[data-mode="one"] { position: relative; }
#repeat-btn[data-mode="one"]::after {
  content: "1";
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 700;
}

.dock {
  position: fixed;
  z-index: 16;
  right: 22px;
  bottom: calc(var(--player-h) + 28px);
  width: min(400px, calc(100vw - 40px));
}
.dock[hidden] { display: none !important; }
.dock-frame {
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 16 / 9;
  padding: 0;
  background: #000;
}
#yt-slot, .dock-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.tabbar { display: none; }
.toast {
  position: fixed;
  z-index: 40;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 16px;
  max-width: min(520px, calc(100vw - 32px));
}
.toast[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  :root { --player-h: 118px; }
  .sidebar { display: none; }
  .shell { grid-template-columns: 1fr; padding: 12px 12px calc(var(--player-h) + 92px); }
  .hero { grid-template-columns: 96px 1fr; padding: 16px; }
  .hero-art { width: 96px; height: 96px; border-radius: 18px; }
  h1 { font-size: 36px; }
  .player {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 10px 8px;
    gap: 4px;
  }
  .extras { display: none; }
  .np-meta { max-width: 46vw; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    z-index: 21;
    left: 12px;
    right: 12px;
    bottom: calc(var(--player-h) + 18px);
    padding: 6px;
    border-radius: 20px;
  }
  .tabbar .nav-btn { justify-content: center; min-height: 38px; font-size: 13px; }
  .dock { left: 12px; right: 12px; width: auto; bottom: calc(var(--player-h) + 86px); }
  .skel-row { grid-template-columns: repeat(3, 1fr); }
  .fab { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .glow-a, .glow-b, .eq i, .skel { animation: none; }
  .ambient, .fab { transition: none; }
}
