/* ============================================================
   CDX MUSIC — public music player
   terminal synthwave: deep indigo space, chrome type, neon
   purple→indigo→cyan accents, mono details.
   ============================================================ */

:root {
  --bg: #07070f;
  --bg-raise: #0d0d1c;
  --panel: rgba(18, 18, 38, .62);
  --panel-solid: #11112293;
  --line: rgba(148, 156, 224, .14);
  --line-strong: rgba(148, 156, 224, .26);

  --text: #eef0ff;
  --muted: #9aa0c2;
  --faint: #5d6284;

  --purple: #c4b5fd;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #38e8ff;

  --grad-brand: linear-gradient(92deg, #e2dcff 0%, #a78bfa 34%, #6366f1 62%, #38e8ff 100%);
  --grad-play: linear-gradient(135deg, #8b5cf6, #38b6ff 60%, #38e8ff);
  --grad-edge: linear-gradient(120deg, rgba(167,139,250,.55), rgba(99,102,241,.35), rgba(56,232,255,.5));

  --glow-violet: 0 8px 32px rgba(139, 92, 246, .35);
  --glow-cyan: 0 6px 26px rgba(56, 232, 255, .22);

  --f-display: 'Unbounded', 'Arial Black', sans-serif;
  --f-body: 'Sora', 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', Consolas, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  --pb-h: 92px;           /* desktop player bar */
  --tab-h: 58px;          /* mobile tab bar */
  --sat: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--f-mono); }

::selection { background: rgba(139, 92, 246, .45); }

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

/* ---------- atmosphere ---------- */
.bg-mesh {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(42% 34% at 12% 0%, rgba(109, 40, 217, .28), transparent 70%),
    radial-gradient(38% 30% at 88% 12%, rgba(37, 99, 235, .16), transparent 70%),
    radial-gradient(44% 38% at 82% 96%, rgba(34, 211, 238, .12), transparent 72%),
    var(--bg);
}
.bg-mesh::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(160, 170, 255, .13) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.12) 40%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.12) 40%, transparent 78%);
}

/* ---------- app frame ---------- */
.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  height: 100dvh;
}

/* sidebar */
.sidebar {
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,17,34,.72), rgba(10,10,22,.35));
  backdrop-filter: blur(14px);
}
.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 10px 18px;
}
.side-logo {
  width: 42px; height: 42px; border-radius: 11px;
  box-shadow: var(--glow-violet);
}
.side-name {
  font-family: var(--f-display);
  font-weight: 700; font-size: 17px; letter-spacing: .02em;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 600; font-size: 14.5px;
  transition: color .18s, background .18s;
}
.side-nav a svg { width: 21px; height: 21px; fill: currentColor; flex: none; }
.side-nav a:hover { color: var(--text); background: rgba(148,156,224,.07); }
.side-nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139,92,246,.2), rgba(56,232,255,.06));
  box-shadow: inset 2px 0 0 var(--violet);
}
.side-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 11px; color: var(--faint); }

/* main scroll area */
.main {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 30px calc(var(--pb-h) + 42px);
  scrollbar-width: thin;
  scrollbar-color: rgba(140,150,210,.3) transparent;
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: rgba(140,150,210,.22); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
.view { max-width: 1240px; margin: 0 auto; }
.page-foot { max-width: 1240px; margin: 44px auto 0; color: var(--faint); font-size: 11px; }

/* ---------- hero (terminal window) ---------- */
.hero {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background:
    linear-gradient(150deg, rgba(139,92,246,.16), rgba(99,102,241,.06) 45%, rgba(34,211,238,.07)),
    var(--panel-solid);
  overflow: hidden;
  margin-bottom: 38px;
  box-shadow: 0 24px 60px -30px rgba(109,40,217,.55);
  animation: rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.hero::before { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 4px);
}
.hero::after { /* corner glow */
  content: ""; position: absolute; right: -140px; top: -140px; width: 380px; height: 380px;
  background: radial-gradient(closest-side, rgba(56,232,255,.16), transparent);
  pointer-events: none;
}
.hero-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(7,7,17,.5);
}
.hero-chrome i { width: 11px; height: 11px; border-radius: 50%; }
.hero-chrome i:nth-child(1) { background: #ff5f57; }
.hero-chrome i:nth-child(2) { background: #febc2e; }
.hero-chrome i:nth-child(3) { background: #28c840; }
.hero-chrome .mono { margin-left: 10px; font-size: 11.5px; color: var(--faint); }
.hero-body {
  position: relative;
  padding: 34px 38px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
}
.hero-cmd { font-family: var(--f-mono); font-size: 13px; color: var(--cyan); margin-bottom: 16px; }
.hero-cmd .dim { color: var(--faint); }
.hero-cmd .caret {
  display: inline-block; width: 8px; height: 15px; margin-left: 3px;
  background: var(--cyan); vertical-align: -2px;
  animation: blink 1.05s steps(1) infinite;
}
.hero-title {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.04;
  letter-spacing: .01em;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(139,92,246,.35));
}
.hero-sub { color: var(--muted); max-width: 52ch; margin: 0 0 24px; font-size: 15px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-stats { margin-top: 22px; font-size: 12px; color: var(--faint); display: flex; gap: 18px; flex-wrap: wrap; }
.hero-stats b { color: var(--purple); font-weight: 600; }

.hero-art { position: relative; width: 218px; height: 218px; margin-right: 8px; }
.hero-art .frame {
  position: absolute; inset: 0; border-radius: 18px;
  border: 2px solid transparent;
  background: linear-gradient(rgba(13,13,30,.9), rgba(13,13,30,.9)) padding-box, var(--grad-edge) border-box;
}
.hero-art .frame.f1 { transform: translate(26px, -26px); opacity: .38; }
.hero-art .frame.f2 { transform: translate(13px, -13px); opacity: .68; }
.hero-art .frame.f3 { overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-art .frame.f3 img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.hero-art .frame.f3 .ph { font-size: 64px; filter: drop-shadow(0 0 18px rgba(56,232,255,.5)); }

/* buttons */
.btn-solid {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 24px; border-radius: 999px;
  background: var(--grad-play);
  color: #06060f; font-weight: 700; font-size: 14.5px;
  box-shadow: var(--glow-violet);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.btn-solid svg { width: 16px; height: 16px; fill: currentColor; }
.btn-solid:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.07); }
.btn-solid:active { transform: scale(.98); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text); font-weight: 600; font-size: 14px;
  background: rgba(148,156,224,.05);
  transition: border-color .16s, background .16s, transform .16s;
}
.btn-ghost svg { width: 16px; height: 16px; fill: currentColor; }
.btn-ghost:hover { border-color: var(--cyan); background: rgba(56,232,255,.08); transform: translateY(-1px); }

/* ---------- sections ---------- */
.sec { margin-bottom: 40px; animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.sec:nth-of-type(2) { animation-delay: .05s; }
.sec:nth-of-type(3) { animation-delay: .1s; }
.sec:nth-of-type(4) { animation-delay: .15s; }
.sec-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.sec-head h2 {
  margin: 0;
  font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .01em;
}
.sec-head h2::before { content: "> "; color: var(--cyan); font-family: var(--f-mono); font-weight: 600; }
.sec-head .count { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.sec-head .more { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sec-head .more:hover { color: var(--cyan); }

/* shelf: horizontal scroll of cards */
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 176px;
  gap: 18px; overflow-x: auto; padding: 4px 2px 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.grid-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

/* card (song / album) */
.card {
  scroll-snap-align: start;
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .22s, background .22s;
  position: relative;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  background: rgba(26,26,52,.72);
  box-shadow: 0 18px 40px -18px rgba(109,40,217,.6);
}
.card .cover {
  position: relative;
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  margin-bottom: 12px;
  background: #14142c;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .t {
  font-weight: 600; font-size: 14px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .s {
  color: var(--muted); font-size: 12.5px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .fab {
  position: absolute; right: 20px; bottom: 84px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-play); color: #06060f;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .22s;
  box-shadow: var(--glow-cyan);
}
.card .fab svg { width: 18px; height: 18px; fill: currentColor; }
.card:hover .fab, .card.playing .fab { opacity: 1; transform: translateY(0); }

/* generated cover fallback */
.cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-weight: 900;
  color: rgba(238,240,255,.85);
  text-shadow: 0 2px 18px rgba(7,7,15,.5);
}

/* artist circle card */
.artist-card { text-align: center; }
.artist-card .cover { border-radius: 50%; box-shadow: 0 10px 30px -14px rgba(56,232,255,.35); }
.artist-card .t { text-align: center; }
.artist-card .s { text-align: center; }
.artist-card .fab { bottom: 92px; }

/* ---------- song rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 34px 46px minmax(0, 1fr) minmax(0, .65fr) 64px;
  gap: 14px; align-items: center;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: background .15s;
  cursor: pointer;
}
.row:hover { background: rgba(148,156,224,.08); }
.row .idx {
  font-family: var(--f-mono); font-size: 12.5px; color: var(--faint);
  text-align: center; position: relative;
}
.row:hover .idx .n { visibility: hidden; }
.row .idx .p {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  color: var(--cyan);
}
.row:hover .idx .p { display: flex; }
.row .idx .p svg { width: 14px; height: 14px; fill: currentColor; }
.row .rcover { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: #14142c; }
.row .rcover img { width: 100%; height: 100%; object-fit: cover; }
.row .rt { min-width: 0; }
.row .rt .t {
  font-weight: 600; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .rt .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .alb { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .dur { font-family: var(--f-mono); font-size: 12px; color: var(--faint); text-align: right; }

.row.current .rt .t { color: var(--cyan); }
.row.current .idx .n { visibility: hidden; }
.row.current .idx .eq { display: inline-flex; }

/* equalizer bars */
.eq { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 2.5px; }
.eq i {
  width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  transform-origin: bottom;
  animation: eq 1s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: .25s; }
.eq i:nth-child(3) { animation-delay: .5s; }
.paused .eq i, .eq.paused i { animation-play-state: paused; transform: scaleY(.35); }

/* explicit chip */
.ex {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 9px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--muted);
  border-radius: 3px; padding: 0 4px; margin-left: 7px;
  vertical-align: 1px; line-height: 1.5;
}

/* ---------- detail header (album / artist) ---------- */
.detail-head {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: 30px; align-items: end;
  padding: 30px;
  margin-bottom: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(139,92,246,.2), rgba(13,13,28,.4) 55%), var(--panel-solid);
  animation: rise .55s cubic-bezier(.2,.7,.2,1) both;
}
.detail-head .dcover {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: #14142c;
  box-shadow: 0 24px 50px -20px rgba(7,7,15,.9), var(--glow-violet);
}
.detail-head .dcover img { width: 100%; height: 100%; object-fit: cover; }
.detail-head .dcover.round { border-radius: 50%; }
.detail-head .kind { font-family: var(--f-mono); font-size: 11px; letter-spacing: .22em; color: var(--cyan); }
.detail-head h1 {
  margin: 8px 0 10px;
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(26px, 4vw, 44px); line-height: 1.05;
}
.detail-head .dmeta { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.detail-head .dmeta b { color: var(--text); }
.detail-head .dbio { color: var(--muted); font-size: 13.5px; max-width: 64ch; margin-bottom: 18px; }

/* ---------- search ---------- */
.search-wrap { margin-bottom: 30px; animation: rise .5s both; }
.search-box {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 14px 18px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.18), var(--glow-violet); }
.search-box svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search-box input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font: 500 16px var(--f-body);
}
.search-box input::placeholder { color: var(--faint); }
.search-box .mono { font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

/* ---------- empty / notice ---------- */
.empty {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel-solid);
  padding: 0; overflow: hidden;
  max-width: 620px; margin: 8vh auto;
}
.empty .hero-chrome { border-radius: 0; }
.empty .ebody { padding: 28px 30px 34px; font-family: var(--f-mono); font-size: 13.5px; }
.empty .ebody .ln { margin: 0 0 10px; color: var(--muted); }
.empty .ebody .ln b { color: var(--cyan); font-weight: 500; }
.empty .ebody .ln.err { color: #ffb4c0; }

.nores { color: var(--faint); font-family: var(--f-mono); font-size: 13px; padding: 18px 4px; }

/* ============================================================
   PLAYER BAR
   ============================================================ */
.playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--pb-h);
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 1fr) minmax(0, 22%);
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(9, 9, 20, .82);
  backdrop-filter: blur(22px);
  border-top: 1px solid var(--line);
}
.playerbar::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,.6), rgba(56,232,255,.6), transparent);
  opacity: .7;
}
.playerbar[data-empty="1"] .pb-center,
.playerbar[data-empty="1"] .pb-right { opacity: .35; pointer-events: none; }

.pb-track { display: flex; align-items: center; gap: 13px; min-width: 0; }
.pb-cover {
  width: 56px; height: 56px; border-radius: 9px; overflow: hidden;
  background: #14142c; flex: none;
  box-shadow: 0 6px 18px -6px rgba(7,7,15,.9);
}
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }
.pb-meta { min-width: 0; }
.pb-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-react { display: flex; gap: 2px; margin-left: 6px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .15s, background .15s, transform .12s;
  position: relative;
}
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn:hover { color: var(--text); background: rgba(148,156,224,.1); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { color: var(--cyan); }
.icon-btn.on::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--cyan);
}
.icon-btn .r1 {
  position: absolute; top: 5px; right: 6px;
  font-family: var(--f-mono); font-size: 8.5px; font-weight: 700;
}
.react-like.on { color: var(--cyan); }
.react-dislike.on { color: #ff7d9c; }
.react-dislike.on::after { background: #ff7d9c; }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 4px; }
.pb-buttons { display: flex; align-items: center; gap: 10px; }
.play-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-play); color: #06060f;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-cyan);
  transition: transform .15s, filter .15s;
  margin: 0 4px;
}
.play-fab svg { width: 19px; height: 19px; fill: currentColor; }
.play-fab:hover { transform: scale(1.07); filter: brightness(1.08); }
.play-fab:active { transform: scale(.96); }
.play-fab.big { width: 66px; height: 66px; }
.play-fab.big svg { width: 27px; height: 27px; }

.pb-seek { display: flex; align-items: center; gap: 11px; width: 100%; max-width: 640px; }
.time { font-size: 11px; color: var(--faint); min-width: 36px; }
.time:last-child { text-align: left; }

/* range inputs */
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #8b5cf6, #38e8ff calc(var(--p, 0) * 1%), rgba(148,156,224,.18) calc(var(--p, 0) * 1%));
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: #eef0ff;
  box-shadow: 0 0 10px rgba(56,232,255,.65);
  opacity: 0; transition: opacity .15s;
}
.range::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%;
  background: #eef0ff;
  box-shadow: 0 0 10px rgba(56,232,255,.65);
  opacity: 0; transition: opacity .15s;
}
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb, .range:focus-visible::-moz-range-thumb { opacity: 1; }

.pb-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pb-right .vol { max-width: 110px; }

.pb-progress-mini { display: none; }
.pb-mini-play { display: none; }

/* ============================================================
   NOW PLAYING SHEET (mobile)
   ============================================================ */
.nowplaying {
  position: fixed; inset: 0; z-index: 60;
  transform: translateY(103%);
  transition: transform .42s cubic-bezier(.32, .72, .22, 1);
  background: var(--bg);
  visibility: hidden;
}
.nowplaying.open { transform: translateY(0); visibility: visible; }
.np-bg {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.35) brightness(.5);
  opacity: .75;
}
.np-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,7,15,.25), rgba(7,7,15,.88) 78%);
}
.np-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 26px calc(26px + var(--sat));
  max-width: 560px; margin: 0 auto;
}
.np-head { display: flex; align-items: center; justify-content: space-between; }
.np-head .icon-btn { color: var(--text); }
.np-src { font-size: 10px; letter-spacing: .28em; color: var(--muted); }
.np-head-spacer { width: 38px; }
.np-cover-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px 0; min-height: 0; }
.np-cover {
  width: min(78vw, 42vh, 420px); aspect-ratio: 1;
  border-radius: 18px; overflow: hidden; background: #14142c;
  box-shadow: 0 30px 80px -20px rgba(7,7,15,.95), 0 0 60px -18px rgba(139,92,246,.55);
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-title {
  font-family: var(--f-display); font-weight: 700; font-size: 21px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-artist { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.np-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.np-chips span {
  font-size: 10px; letter-spacing: .08em; color: var(--purple);
  border: 1px solid rgba(167,139,250,.35); border-radius: 999px;
  padding: 3px 10px;
  background: rgba(139,92,246,.08);
}
.np-seek { margin-top: 20px; }
.np-seek .range { height: 5px; }
.np-seek .range::-webkit-slider-thumb { opacity: 1; }
.np-seek .range::-moz-range-thumb { opacity: 1; }
.np-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 7px; }
.np-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px;
}
.np-controls .icon-btn { width: 52px; height: 52px; }
.np-controls .icon-btn svg { width: 26px; height: 26px; }
.np-sub { display: flex; justify-content: center; gap: 38px; margin-top: 8px; }

/* ============================================================
   MOBILE TAB BAR
   ============================================================ */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(var(--tab-h) + var(--sat));
  padding-bottom: var(--sat);
  background: rgba(8, 8, 18, .92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .02em;
  transition: color .15s;
}
.tabbar a svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar a.active { color: var(--cyan); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--pb-h) + 22px); z-index: 70;
  transform: translate(-50%, 16px);
  background: rgba(20, 20, 42, .95);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px -10px rgba(7,7,15,.9);
  max-width: 86vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- animations ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes eq {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  body { overflow: auto; }
  .app { display: block; height: auto; }
  .sidebar { display: none; }
  .main {
    height: auto; overflow: visible;
    padding: 18px 16px calc(var(--tab-h) + var(--sat) + 96px);
  }
  .tabbar { display: flex; }

  .hero-body { grid-template-columns: 1fr; padding: 26px 22px 30px; }
  .hero-art { display: none; }

  .shelf { grid-auto-columns: 148px; gap: 13px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 13px; }
  .card .fab { display: none; }

  .row { grid-template-columns: 28px 44px minmax(0, 1fr) 52px; gap: 11px; padding: 7px 8px; }
  .row .alb { display: none; }
  .row .idx .p { display: none !important; }
  .row:hover .idx .n { visibility: visible; }
  .row.current .idx .n { visibility: hidden; }

  .detail-head { grid-template-columns: 132px minmax(0, 1fr); gap: 18px; padding: 20px; align-items: center; }

  /* mini player card docked above the tab bar */
  .playerbar {
    left: 10px; right: 10px;
    bottom: calc(var(--tab-h) + var(--sat) + 10px);
    height: 62px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px; padding: 0 14px 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: rgba(17, 17, 36, .96);
    box-shadow: 0 16px 40px -12px rgba(7,7,15,.95);
    overflow: hidden;
  }
  .playerbar::before { display: none; }
  .playerbar[data-empty="1"] { display: none; }
  .pb-center, .pb-right, .pb-react { display: none; }
  .pb-cover { width: 46px; height: 46px; border-radius: 8px; }
  .pb-mini-play {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    color: var(--text); flex: none;
  }
  .pb-mini-play svg { width: 22px; height: 22px; fill: currentColor; }
  .pb-progress-mini {
    display: block; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: rgba(148,156,224,.15);
  }
  .pb-progress-mini i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--violet), var(--cyan));
  }
  .toast { bottom: calc(var(--tab-h) + var(--sat) + 86px); }
}

@media (max-width: 1080px) and (min-width: 921px) {
  .pb-right .vol { max-width: 80px; }
  .row { grid-template-columns: 34px 46px minmax(0, 1fr) 64px; }
  .row .alb { display: none; }
}
