/* Rich Music — SoundCloud-style theme (complete overhaul) */
:root {
  --bg: #0d0d0d;
  --main-bg: #141414;
  --card: #1c1c1c;
  --card-hover: #262626;
  --elevated: #222222;
  --accent: #ff5500;
  --accent-bright: #ff6a00;
  --accent-dark: #e04400;
  --accent-gradient: linear-gradient(135deg, #ff7700 0%, #ff3300 100%);
  --text: #f2f2f2;
  --muted: #999999;
  --subdued: #666666;
  --border: #282828;
  --player-h: 90px;
  --navm-h: 64px;
  --radius: 6px;
  --radius-lg: 8px;
  --play-bg: #ff5500;
  --play-fg: #ffffff;
  --chip-on-bg: #ff5500;
  --chip-on-fg: #ffffff;
  --bar-bg: rgba(255, 255, 255, 0.18);
  --bar-fill: #ff5500;
  --hover: rgba(255, 255, 255, 0.06);
  --hover-strong: rgba(255, 255, 255, 0.12);
  --lyric-dim: rgba(255, 255, 255, 0.35);
  --lyric-past: rgba(255, 255, 255, 0.70);
  --lyric-now: #ffffff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  --glass: rgba(18, 18, 18, 0.85);
  --tint: 24;
  --eq: #ff5500;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f2f2f2;
  --main-bg: #ffffff;
  --card: #f8f8f8;
  --card-hover: #ececec;
  --elevated: #f0f0f0;
  --accent: #ff5500;
  --accent-bright: #ff6a00;
  --accent-dark: #d94800;
  --accent-gradient: linear-gradient(135deg, #ff7700 0%, #ff3300 100%);
  --text: #1a1a1a;
  --muted: #666666;
  --subdued: #999999;
  --border: #e0e0e0;
  --play-bg: #ff5500;
  --play-fg: #ffffff;
  --chip-on-bg: #ff5500;
  --chip-on-fg: #ffffff;
  --bar-bg: rgba(0, 0, 0, 0.14);
  --bar-fill: #ff5500;
  --hover: rgba(0, 0, 0, 0.04);
  --hover-strong: rgba(0, 0, 0, 0.08);
  --lyric-dim: rgba(0, 0, 0, 0.32);
  --lyric-past: rgba(0, 0, 0, 0.55);
  --lyric-now: #121212;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.85);
  --eq: #ff5500;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Figtree", "Inter", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", sans-serif;
  overflow: hidden;
  font-size: 14px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.ic { width: 16px; height: 16px; fill: currentColor; display: block; }
img { display: block; }
a { color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 24%, transparent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

#app {
  display: flex;
  height: 100vh;
  padding: 8px;
  gap: 8px;
  background: var(--bg);
}

/* SoundCloud-style launch splash */
#splash {
  position: fixed; inset: 0; z-index: 300;
  background: #0d0d0d;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#splash.gone {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.splash-inner {
  display: flex; flex-direction: column; align-items: center;
}
.splash-logo {
  width: 120px; height: 120px; object-fit: contain;
  animation: splashLogo 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  filter: drop-shadow(0 0 40px rgba(255, 85, 0, 0.65));
}
.splash-name {
  margin-top: 18px;
  font-size: 28px; font-weight: 800; letter-spacing: -0.04em;
  color: #fff;
  animation: splashName 0.8s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes splashLogo {
  0% { opacity: 0; transform: scale(0.72); }
  70% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes splashName {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-name { animation: none; }
}

/* ---------- sidebar ---------- */
#sidebar {
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.side-box {
  background: var(--main-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 12px;
}
.lib-box { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.q-box {
  flex: 0 1 auto; max-height: 38%; min-height: 132px;
  display: flex; flex-direction: column; overflow: hidden;
}
#side-queue { flex: 1; overflow-y: auto; min-height: 0; }
.sq-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 4px; width: 100%; text-align: left; cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.sq-row:hover { background: var(--hover-strong); }
.sq-row img {
  width: 36px; height: 36px; border-radius: 3px; object-fit: cover;
  background: var(--elevated); flex-shrink: 0;
}
.sq-meta { min-width: 0; flex: 1; }
.sq-t { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-row.now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sq-row.now .sq-t { color: var(--accent-bright); }
.sq-n { width: 16px; font-size: 11px; font-weight: 800; color: var(--accent-bright); flex-shrink: 0; text-align: center; }
.sq-tag { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; flex-shrink: 0; }
.sq-empty { color: var(--muted); font-size: 12.5px; padding: 8px 10px 12px; line-height: 1.5; }
.sq-sec { font-size: 10.5px; font-weight: 800; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 8px 4px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 900; font-size: 19px; padding: 6px 10px 14px;
  letter-spacing: -0.04em; color: var(--text);
}
.logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  display: block;
}
#nav-desktop { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px;
  border-radius: 4px; color: var(--muted); font-size: 14.5px; font-weight: 700;
  transition: color 0.15s, background 0.15s, border-left 0.15s;
  text-align: left; width: 100%; letter-spacing: -0.01em;
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 800;
}
.nav-item.active::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.nav-item .ic { width: 20px; height: 20px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.lib-title {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 14px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em;
  transition: color 0.18s;
}
.lib-title:hover { color: var(--accent); }
.lib-title .ic { width: 18px; height: 18px; color: var(--accent); }
#lib-new, #side-q-clear { color: var(--muted); border-radius: 4px; padding: 4px; }
#side-q-clear.hidden { display: none !important; }
#lib-new:hover, #side-q-clear:hover { color: var(--accent-bright); background: var(--hover); }
#lib-new .ic { width: 16px; height: 16px; }
#lib-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lib-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.12s;
}
.lib-row:hover { background: var(--hover-strong); }
.lib-row img, .lib-row .lib-ph {
  width: 44px; height: 44px; border-radius: 3px; object-fit: cover;
  background: var(--elevated); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.lib-row.round img, .lib-row.round .lib-ph { border-radius: 50%; }
.lib-ph.liked-ph {
  background: var(--accent-gradient);
  color: #fff;
}
.lib-ph.liked-ph .ic { width: 20px; height: 20px; }
.lib-row .lr-t { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row .lr-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row .lr-meta { min-width: 0; }
.lib-empty { color: var(--muted); font-size: 12.5px; padding: 14px 8px; line-height: 1.5; }
.lib-empty b { color: var(--text); }
.sidebar-footer { font-size: 11px; color: var(--subdued); padding: 10px 8px 2px; }

/* ---------- main ---------- */
#main {
  flex: 1; overflow-y: auto; min-width: 0; min-height: 0;
  background: var(--main-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-image: linear-gradient(180deg, hsl(var(--tint), 35%, 16%) 0%, var(--main-bg) 300px);
  padding-bottom: 32px;
  transition: background-image 0.6s ease;
}
html[data-theme="light"] #main {
  background-image: linear-gradient(180deg, hsl(var(--tint), 65%, 94%) 0%, var(--main-bg) 300px);
}
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--main-bg) 85%, transparent), transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}
.tb-nav { display: flex; gap: 6px; flex-shrink: 0; }
.tb-btn {
  width: 32px; height: 32px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; color: #fff;
  border: 1px solid var(--border);
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
html[data-theme="light"] .tb-btn { background: rgba(0, 0, 0, 0.05); color: var(--text); border-color: var(--border); }
.tb-btn:hover { background: var(--hover-strong); border-color: var(--accent); color: var(--accent); }
.tb-btn:disabled { color: var(--subdued); cursor: default; transform: none; border-color: transparent; }
.tb-btn .ic { width: 16px; height: 16px; }
.tb-search {
  flex: 1; max-width: 440px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 14px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-weight: 600; font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tb-search .ic { width: 18px; height: 18px; }
.tb-search:hover { background: var(--card-hover); color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.tb-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
#view { max-width: 1480px; margin: 0 auto; padding: 12px 24px 48px; }
#view.view-enter { animation: fadeUp 0.32s ease; }
.page-title {
  font-size: clamp(26px, 3.8vw, 32px);
  font-weight: 900; margin-bottom: 20px;
  letter-spacing: -0.04em; line-height: 1.1;
}
.hello-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hello-row .page-title { margin-bottom: 0; }
.greeting { font-size: 12px; color: var(--accent); margin-bottom: 4px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

/* ========================================================
   SOUNDCLOUD TABS & CHIPS
   ======================================================== */
.chip-row, .search-chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.chip {
  padding: 6px 14px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px; color: var(--muted); font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
}
.chip:hover {
  background: var(--hover-strong);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent-dark);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 85, 0, 0.35);
}

/* ========================================================
   SOUNDCLOUD QUICK GRID TILES
   ======================================================== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden; height: 60px;
  text-align: left; font-weight: 700; font-size: 13.5px;
  position: relative; min-width: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
html[data-theme="light"] .quick-card { background: #fdfdfd; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); }
.quick-card:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.quick-card img { width: 60px; height: 60px; object-fit: cover; background: var(--elevated); flex-shrink: 0; }
.quick-card .qc-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 44px; }
.quick-card .play-ov {
  position: absolute; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 85, 0, 0.45);
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s, background 0.15s;
}
.quick-card:hover .play-ov { opacity: 1; transform: scale(1); }
.quick-card .play-ov:hover { background: var(--accent-bright); transform: scale(1.08); }
.quick-card .play-ov .ic { width: 16px; height: 16px; margin-left: 2px; }

/* ========================================================
   SOUNDCLOUD CAROUSEL & CARDS
   ======================================================== */
.shelf { margin-bottom: 34px; }
.shelf-title {
  font-size: 20px; font-weight: 900; margin-bottom: 12px;
  letter-spacing: -0.03em; display: flex; align-items: center; justify-content: space-between;
  color: var(--text);
}
.carousel-wrap { position: relative; }
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 180px;
  gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.car-btn {
  display: none;
  position: absolute; top: 64px; z-index: 3;
  width: 36px; height: 36px; border-radius: 4px;
  background: rgba(18, 18, 18, 0.9); color: #fff;
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.car-btn .ic { width: 16px; height: 16px; }
.car-prev { left: 4px; }
.car-next { right: 4px; }
.car-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.06); }
.car-btn.off { opacity: 0.22; pointer-events: none; }
@media (min-width: 861px) {
  .carousel-wrap:hover .car-btn { display: flex; }
}
html[data-theme="light"] .car-btn {
  background: rgba(255, 255, 255, 0.95); color: #141414;
  border-color: var(--border);
}

/* SoundCloud Media Card */
.card {
  width: 180px; scroll-snap-align: start; cursor: pointer;
  padding: 10px; border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s;
  position: relative;
}
.card:hover {
  background: var(--card);
  border-color: var(--border);
}
.card .art {
  position: relative; width: 158px; height: 158px;
  border-radius: 4px; overflow: hidden;
  background: var(--elevated);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.card.artist .art { border-radius: 50%; }
.art-ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #242424 0%, #161616 100%);
  color: #666; flex-shrink: 0;
}
.art-ph .ic { width: 38%; height: 38%; fill: currentColor; }
.card .art .art-ph { width: 100%; height: 100%; }
.art-ph-track { width: 42px; height: 42px; border-radius: 3px; }
.art-ph-track .ic { width: 18px; height: 18px; }
.art-ph-quick { width: 60px; height: 60px; flex-shrink: 0; }
.art-ph-quick .ic { width: 22px; height: 22px; }
.art-ph-sq { width: 36px; height: 36px; border-radius: 3px; }
.art-ph-sq .ic { width: 16px; height: 16px; }
.art-ph-sr { width: 140px; height: 140px; border-radius: 4px; flex-shrink: 0; }
.art-ph-lib, .lib-row .art-ph { width: 44px; height: 44px; border-radius: 3px; }
.lib-row.round .art-ph { border-radius: 50%; }
.art-ph-sm { width: 52px; height: 52px; border-radius: 4px; }
.art-ph-sm .ic { width: 20px; height: 20px; }
html[data-theme="light"] .art-ph { background: linear-gradient(145deg, #f0f0f0, #e0e0e0); color: #999; }
.card .art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .art img { transform: scale(1.04); }

/* SoundCloud Signature Orange Play Overlay */
.card .art .play-ov {
  position: absolute; right: 8px; bottom: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(255, 85, 0, 0.5);
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s, background 0.15s;
}
.card:hover .art .play-ov { opacity: 1; transform: scale(1); }
.card .art .play-ov:hover { background: var(--accent-bright); transform: scale(1.1); }
.card .art .play-ov .ic { width: 20px; height: 20px; margin-left: 2px; }

.card .t {
  margin-top: 10px; font-size: 14px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  letter-spacing: -0.01em; color: var(--text);
}
.card .s {
  margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.liked-cover {
  background: var(--accent-gradient) !important;
  display: flex; align-items: center; justify-content: center;
}
.liked-heart { width: 44px; height: 44px; color: #fff; }

/* ========================================================
   SOUNDCLOUD MUSIC LIST & TRACK ROWS
   ======================================================== */
.track-list { display: flex; flex-direction: column; gap: 2px; }
.track {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  position: relative;
}
.track:hover {
  background: var(--hover-strong);
  border-color: var(--border);
}
.track.playing {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.track.playing .tt { color: var(--accent-bright); font-weight: 800; }
.track.playing img { box-shadow: 0 0 0 2px var(--accent); }
.track img { width: 42px; height: 42px; border-radius: 3px; object-fit: cover; background: var(--elevated); }
.track .tmeta { flex: 1; min-width: 0; }
.track .tt { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.track .ts { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.track .tdur { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.track .tbtn {
  color: var(--muted); padding: 6px; border-radius: 4px; opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.12s; line-height: 0;
}
.track .tbtn .ic { width: 15px; height: 15px; }
.track:hover .tbtn, .track.playing .tbtn { opacity: 1; }
.track .tbtn:hover { color: var(--accent); background: var(--hover); }
.track .tbtn[disabled] { opacity: 0.25 !important; pointer-events: none; }
.track .btn-fav.liked { color: var(--accent) !important; }
.track.q-user, .track.pl-track { cursor: grab; }
.track.q-user.dragging, .track.pl-track.dragging { opacity: 0.4; }
.track.q-user.drag-over, .track.pl-track.drag-over { box-shadow: inset 0 2px 0 var(--accent); }

/* Equalizer bounce in SoundCloud Orange */
.eq {
  display: none; gap: 2px; align-items: flex-end; height: 14px; width: 14px; flex-shrink: 0;
}
.track.playing .eq { display: flex; }
.eq i {
  width: 3px; height: 4px; background: var(--eq); border-radius: 1px;
  animation: eq 0.9s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: 0.18s; }
.eq i:nth-child(3) { animation-delay: 0.36s; }
body.paused .eq i { animation: none; height: 4px; }
@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* Header pages */
.detail-head {
  display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap;
  margin: -24px -24px 0; padding: 60px 24px 24px;
  background:
    linear-gradient(180deg, transparent, var(--main-bg)),
    linear-gradient(180deg, hsl(var(--tint), 45%, 26%), hsl(var(--tint), 25%, 12%));
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
html[data-theme="light"] .detail-head {
  background:
    linear-gradient(180deg, transparent, var(--main-bg)),
    linear-gradient(180deg, hsl(var(--tint), 65%, 88%), hsl(var(--tint), 40%, 94%));
}
.detail-head img {
  width: 200px; height: 200px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6); background: var(--elevated);
  border: 1px solid var(--border);
}
.detail-head.artist img { border-radius: 50%; }
.detail-info { flex: 1; min-width: 260px; }
.detail-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}
.detail-info h1 { font-size: clamp(28px, 4.5vw, 56px); margin: 6px 0 12px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; }
.detail-info .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; max-width: 720px; font-weight: 500; }
.detail-head .detail-ph {
  width: 200px; height: 200px; border-radius: 4px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55); flex-shrink: 0;
}
.detail-head .detail-ph .ic { width: 64px; height: 64px; color: #fff; }
.track-head {
  display: flex; align-items: center;
  padding: 6px 12px 8px; margin: 8px 0 2px;
  border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.th-n { width: 22px; text-align: center; margin-right: 54px; flex-shrink: 0; }
.th-t { flex: 1; }
.th-d { width: 48px; text-align: right; margin-right: 118px; flex-shrink: 0; }
.t-num {
  width: 22px; text-align: center; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.track.playing .t-num { display: none; }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.chart-grid .card { width: auto; max-width: 220px; }
.chart-grid .card .art { width: 100%; height: auto; aspect-ratio: 1; }
#related-list .shelf { margin-bottom: 20px; }
#related-list .shelf-title { font-size: 14px; margin-bottom: 8px; }
#related-list .carousel { grid-auto-columns: 140px; }
#related-list .card { width: 140px; padding: 6px; }
#related-list .card .art { width: 126px; height: 126px; }
#related-list .card .t { font-size: 13px; margin-top: 6px; }
#related-list .card .s { font-size: 11.5px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--elevated); border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.01em;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, color 0.15s;
}
.pill-btn .ic { width: 15px; height: 15px; }
.pill-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.02); }
.pill-btn.primary {
  background: var(--accent); border-color: var(--accent-dark); color: #fff;
  padding: 11px 28px; font-size: 14.5px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 85, 0, 0.4);
}
.pill-btn.primary:hover { background: var(--accent-bright); color: #fff; transform: scale(1.03); }
.pill-btn:disabled, .pill-btn.primary:disabled { opacity: 0.5; pointer-events: none; transform: none; }

/* search */
.search-bar {
  display: flex; align-items: center; gap: 12px; background: var(--elevated);
  border-radius: 4px; padding: 10px 16px; margin-bottom: 12px;
  border: 1px solid var(--border); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; font-weight: 600; }
.search-bar input::placeholder { color: var(--muted); }
.suggest { display: flex; flex-direction: column; margin-bottom: 14px; }
.suggest button { text-align: left; padding: 9px 16px; border-radius: 4px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.suggest button:hover { background: var(--hover-strong); color: var(--accent); }

/* mood grid */
.mood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.mood-card {
  position: relative; overflow: hidden;
  aspect-ratio: 2 / 1; padding: 14px; border-radius: var(--radius);
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: #fff;
  background: var(--mc, #535353); cursor: pointer; border: none; text-align: left;
  display: flex; align-items: flex-start;
  transition: transform 0.15s, filter 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.mood-card:hover { transform: scale(1.03); filter: brightness(1.1); }
.mood-card::after {
  content: "♪"; position: absolute; right: -4px; bottom: -8px;
  font-size: 56px; opacity: 0.28; transform: rotate(18deg);
}

/* library */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.empty-note { color: var(--muted); font-size: 14px; padding: 48px 0; text-align: center; font-weight: 500; }

/* ========================================================
   SOUNDCLOUD BOTTOM MUSIC PLAYER BAR
   ======================================================== */
#miniplayer {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h);
  background: var(--bg);
  display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center;
  padding: 0 20px; z-index: 40; gap: 16px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
#miniplayer.hidden { display: none; }
body.has-player #main, body.has-player #sidebar { margin-bottom: var(--player-h); }
body.np-open.has-player #nowplaying { margin-bottom: var(--player-h); }

.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
#mini-art {
  width: 52px; height: 52px; border-radius: 4px; object-fit: cover;
  background: var(--elevated); cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.18s, border-color 0.18s;
}
#mini-art:hover { transform: scale(1.04); border-color: var(--accent); }
.mini-meta { min-width: 0; cursor: pointer; }
#mini-title {
  font-size: 13.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text);
}
@media (min-width: 861px) {
  #mini-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
  }
}
#mini-title:hover { color: var(--accent); }
#mini-artist { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#mini-artist.linkish:hover { color: var(--accent); }
#mini-like { font-size: 16px; }

.pb-center {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 720px; width: 100%; justify-self: center;
}
.pb-buttons { display: flex; align-items: center; gap: 16px; }
.icon-btn {
  padding: 6px; border-radius: 4px; color: var(--muted); line-height: 0;
  transition: color 0.15s, transform 0.12s, background 0.12s;
}
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); transform: scale(1.08); }
.icon-btn.liked, .icon-btn.on { color: var(--accent) !important; }
#mini-shuffle.on, #mini-repeat.on, #np-shuffle.on, #np-repeat.on, #np-sleep.on { color: var(--accent); }

/* SoundCloud Signature Orange Play/Pause Circle */
.play-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 85, 0, 0.45);
  transition: transform 0.12s, background 0.12s;
}
.play-circle .ic { width: 18px; height: 18px; }
.play-circle:hover { background: var(--accent-bright); transform: scale(1.08); }

/* SoundCloud Continuous Orange Seek Bar */
.pb-seek {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pb-bar {
  flex: 1; height: 4px; background: var(--bar-bg); border-radius: 2px;
  position: relative; cursor: pointer; transition: height 0.12s;
}
#mini-progress-fill {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 85, 0, 0.4);
}
.pb-bar:hover { height: 6px; }
.pb-bar:hover #mini-progress-fill { background: var(--accent-bright); }
.pb-knob {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  background: #ffffff; border: 2px solid var(--accent);
  transform: translate(-50%, -50%); left: 0%;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.pb-bar:hover .pb-knob { opacity: 1; }

.pb-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.pb-vol-ic { color: var(--muted); line-height: 0; }
.pb-vol-ic .ic { width: 16px; height: 16px; }
.vol-ic { width: 16px; height: 16px; color: var(--muted); }
#mini-volume, #np-volume { accent-color: var(--accent); height: 4px; cursor: pointer; }
#mini-volume { width: 93px; }
#mini-volume:hover, #np-volume:hover { accent-color: var(--accent-bright); }

/* ---------- bottom nav mobile ---------- */
#nav-mobile { display: none; }

/* ========================================================
   SOUNDCLOUD NOW PLAYING (EXPANDED & SIDEBAR)
   ======================================================== */
#nowplaying {
  position: fixed; inset: 0; z-index: 60;
  background: #101010;
  color: #fff;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
#nowplaying.hidden { transform: translateY(100%); pointer-events: none; opacity: 0; }
#np-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(80px) brightness(0.24) saturate(1.4); transform: scale(1.45);
  transition: background-image 0.6s ease;
}
#np-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 16, 16, 0.5) 0%, rgba(16, 16, 16, 0.7) 40%, rgba(16, 16, 16, 0.92) 100%),
    radial-gradient(ellipse at center, rgba(255, 85, 0, 0.12) 0%, transparent 70%);
}
html[data-theme="light"] #np-bg::after {
  background:
    linear-gradient(180deg, rgba(16, 16, 16, 0.45) 0%, rgba(16, 16, 16, 0.65) 40%, rgba(16, 16, 16, 0.9) 100%);
}
.np-handle {
  display: none; width: 42px; height: 5px; border-radius: 99px;
  background: hsla(0, 0%, 100%, 0.35); margin: 6px auto 0;
}
.np-inner { position: relative; height: 100%; display: flex; flex-direction: column; max-width: 820px; margin: 0 auto; padding: 12px 24px 26px; }
.np-topbar { display: flex; align-items: center; justify-content: space-between; }
.np-caption { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.np-topbar .icon-btn {
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 36px; height: 36px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.np-topbar .icon-btn:hover { color: var(--accent); background: rgba(0, 0, 0, 0.7); border-color: var(--accent); }

/* SoundCloud Tab Switcher in Now Playing */
.np-tabs { display: flex; gap: 8px; justify-content: center; margin: 12px 0 8px; flex-wrap: wrap; }
.np-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 4px; font-size: 13px;
  color: rgba(255,255,255,.8); background: rgba(255, 255, 255, 0.08); font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.np-tab .ic { width: 14px; height: 14px; }
.np-tab:hover { color: #fff; border-color: var(--accent); }
.np-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 0 2px 10px rgba(255, 85, 0, 0.4);
}

.np-body { flex: 1; overflow: hidden; position: relative; }
.np-pane { display: none; height: 100%; overflow-y: auto; padding: 12px 4px; }
.np-pane.active { display: flex; flex-direction: column; }
#np-player.active { align-items: center; justify-content: center; gap: 16px; }
.np-art-wrap {
  width: min(54vw, 340px); aspect-ratio: 1;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7));
  transition: transform 0.45s ease;
}
body:not(.paused) .np-art-wrap { transform: scale(1.01); }
#np-art { width: 100%; height: 100%; border-radius: 6px; object-fit: cover; background: var(--elevated); border: 1px solid rgba(255, 255, 255, 0.1); }
.np-meta { text-align: center; width: 100%; }
#np-title { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; color: #fff; }
#np-artist { font-size: 14.5px; color: rgba(255,255,255,.75); margin-top: 4px; font-weight: 600; }
#np-artist.linkish:hover { color: var(--accent); text-decoration: underline; }

/* Now Playing Seek / Waveform aesthetic */
.np-seek {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px;
  font-size: 12px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums;
  font-weight: 700;
}
#nowplaying .icon-btn { color: rgba(255,255,255,.82); }
#nowplaying .icon-btn:hover { color: var(--accent); }
#nowplaying .icon-btn.liked { color: var(--accent); }

/* SoundCloud Large Orange Disc Play Button */
.play-big {
  width: 64px; height: 64px;
  background: var(--accent) !important;
  color: #ffffff !important;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 85, 0, 0.5);
  transition: transform 0.12s, background 0.12s;
}
.play-big .ic { width: 26px; height: 26px; }
.play-big:hover { background: var(--accent-bright) !important; transform: scale(1.06); }

#nowplaying .pill-btn {
  color: #fff; border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08); border-radius: 4px;
}
#nowplaying .pill-btn:hover { border-color: var(--accent); color: var(--accent); }
#nowplaying .pill-btn.liked { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); color: var(--accent); }

#nowplaying .track .tt, #nowplaying .q-head, #nowplaying .q-empty-title { color: #fff; }
#nowplaying .track.playing .tt { color: var(--accent-bright); }
#nowplaying .track .ts, #nowplaying .track .tdur, #nowplaying .q-note, #nowplaying .q-hint, #nowplaying .loading-note, #nowplaying .q-empty-s { color: rgba(255,255,255,.65); }
#nowplaying .track .tbtn { color: rgba(255,255,255,.7); }
#nowplaying .q-clear { color: var(--accent-bright); }
#nowplaying .empty-title { color: #fff; }
#nowplaying .empty-s { color: rgba(255,255,255,.65); }
#nowplaying .empty-ic { background: rgba(255,255,255,.1); color: var(--accent); }

.np-seek input { flex: 1; accent-color: var(--accent); height: 5px; }
.np-controls { display: flex; align-items: center; gap: 22px; }
.np-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.np-actions .np-extra { display: none !important; }
#np-more.has-on { color: var(--accent); border-color: var(--accent); }
.np-volume { display: flex; align-items: center; gap: 6px; }
.np-volume input { width: 100px; }
#np-lyric-preview {
  font-size: 13.5px; color: rgba(255,255,255,.85); text-align: center; min-height: 18px;
  cursor: pointer; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
#np-lyric-preview:hover { color: var(--accent); }

/* lyrics — SoundCloud dark with warm orange glow */
#np-lyrics {
  background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.55));
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#lyrics-container { flex: 1; overflow-y: auto; padding: 28vh 16px; scroll-behavior: smooth; }
.lyric-line {
  font-size: clamp(20px, 3.2vw, 26px); font-weight: 800;
  color: rgba(255, 255, 255, 0.4); padding: 9px 4px; cursor: pointer;
  transition: color 0.22s, transform 0.22s, text-shadow 0.22s; line-height: 1.35; letter-spacing: -0.02em;
  text-shadow: 0 1px 10px rgba(0,0,0,.35);
}
.lyric-line:hover { color: rgba(255,255,255,.92); }
.lyric-line.active {
  color: #ffffff;
  transform: translateX(4px);
  text-shadow: 0 2px 18px rgba(0,0,0,.65), 0 0 24px rgba(255,85,0,.45);
}
.lyric-line.past { color: rgba(255, 255, 255, 0.65); }
.lyric-plain {
  font-size: 16px; line-height: 1.9; color: rgba(255,255,255,.92);
  white-space: pre-wrap; font-weight: 500;
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
}
.lyrics-empty { color: rgba(255,255,255,.65); text-align: center; padding-top: 30vh; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
#lyrics-source { font-size: 11px; color: rgba(255,255,255,.4); text-align: center; padding: 6px 0 0; }

#queue-list, #related-list { padding: 4px; }
.q-head {
  font-size: 11.5px; font-weight: 800; color: var(--accent);
  padding: 16px 8px 8px; letter-spacing: 0.08em; text-transform: uppercase;
}
.q-head-row { display: flex; align-items: center; justify-content: space-between; }
.q-clear { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: none; letter-spacing: 0; }
.q-clear:hover { color: var(--accent-bright); }
.q-note {
  font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.45;
  padding: 4px 8px 2px;
}
.q-hint {
  font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.5;
  padding: 4px 8px 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.q-hint .ic { width: 16px; height: 16px; flex-shrink: 0; }
.q-empty { text-align: center; padding: 48px 16px; }
.q-empty-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.q-empty-s { font-size: 13.5px; color: var(--muted); font-weight: 500; line-height: 1.5; }
.q-num {
  width: 18px; text-align: center; font-size: 12px; font-weight: 800;
  color: var(--accent); flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.track.q-user { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.track.q-radio { opacity: 0.88; }
.track.q-radio .tt { font-weight: 500; }
#mini-queue.has-q, #mini-queue-m.has-q { color: var(--accent); }
#np-playnext.hidden, #np-queueadd.hidden { display: none !important; }
.q-modal-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.song-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ss-art {
  width: min(200px, 70vw); height: min(200px, 70vw); border-radius: 4px;
  object-fit: cover; background: var(--elevated);
  box-shadow: 0 16px 40px rgba(0,0,0,.5); margin-bottom: 6px;
  border: 1px solid var(--border);
}
.ss-title { font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; max-width: 100%; }
.ss-artist { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.ss-play { width: 100%; justify-content: center; padding: 12px 24px; font-size: 15px; }
.ss-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
@media (max-width: 980px){
  #mini-queue { display: none; }
}
@media (min-width: 981px) {
  #mini-queue-m { display: none; }
}
.loading-note { color: var(--muted); text-align: center; padding: 40px 0; font-weight: 500; }

/* modal */
#modal { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
#modal.hidden { display: none; }
.modal-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 22px;
  width: min(92vw, 420px); max-height: 80vh; overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
  animation: popIn 0.22s ease;
}
.modal-card h3 { margin-bottom: 16px; font-weight: 800; letter-spacing: -0.02em; }
.modal-card input {
  width: 100%; padding: 11px 14px; border-radius: 4px;
  background: var(--hover-strong); border: 1px solid var(--border); color: var(--text); font-size: 14px;
  margin-bottom: 10px; outline: none; font-weight: 500;
}
.modal-card input:focus { border-color: var(--accent); }
.modal-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; }
.modal-row:hover { background: var(--hover-strong); color: var(--accent); }
.modal-row .ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.modal-row > span + span { margin-left: auto; }
.pl-list-label {
  font-size: 11px; font-weight: 800; color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 4px 8px;
}
.pl-pick {
  gap: 12px; padding: 8px 10px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 6px;
}
.pl-pick:hover { background: var(--card-hover); border-color: var(--accent); }
.pl-pick-art, .pl-pick-ph {
  width: 42px; height: 42px; border-radius: 3px;
  object-fit: cover; background: var(--card); flex-shrink: 0;
}
.pl-pick-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
}
.pl-pick-ph .ic { width: 20px; height: 20px; color: #fff; }
.pl-pick-meta { min-width: 0; flex: 1; text-align: left; }
.pl-pick-name {
  display: block; font-size: 14.5px; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-pick-count { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
html[data-theme="light"] .pl-pick { background: #f8f8f8; }
html[data-theme="light"] .pl-pick:hover { background: #ececec; }
html[data-theme="light"] .pl-pick-name { color: #121212; }
.modal-row.disabled, .modal-row[disabled] { opacity: 0.35; pointer-events: none; }
.sm-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sm-head img { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; background: var(--elevated); flex-shrink: 0; }
.sm-meta { min-width: 0; }
.sm-t { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions.hidden { display: none; }

.pl-form { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.pl-form-cover {
  width: 110px; height: 110px; border-radius: 6px; margin: 4px auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  box-shadow: 0 10px 28px rgba(255, 85, 0, 0.4);
}
.pl-form-cover .ic { width: 40px; height: 40px; color: #fff; fill: currentColor; }
.pl-form-cover.im { background: linear-gradient(135deg, #ff7700 0%, #ff4400 50%, #e03300 100%); }
.pl-form-label {
  font-size: 11.5px; font-weight: 800; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px;
}
.modal-card .pl-form-input {
  width: 100%; padding: 12px 14px; border-radius: 4px;
  background: var(--elevated); border: 1px solid var(--border); color: var(--text);
  font-size: 15px; font-weight: 600; outline: none;
  margin-bottom: 8px; transition: border-color 0.15s, background 0.15s;
}
.pl-form-input::placeholder { color: var(--subdued); font-weight: 500; }
.pl-form-input:focus {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.pl-form-input.shake { animation: plShake 0.38s ease; }
@keyframes plShake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.pl-form-hint { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 16px; line-height: 1.4; }
.pl-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pl-form-actions .pill-btn.primary { padding: 10px 20px; font-size: 13.5px; }
.pl-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pl-presets .chip { margin: 0; }
.pl-presets .chip.active { background: var(--accent); color: #fff; }
@media (max-width: 860px) {
  .pl-form-cover { width: 90px; height: 90px; }
  .pl-form-actions { flex-direction: column-reverse; }
  .pl-form-actions .pill-btn { width: 100%; justify-content: center; }
}

/* stats */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 18px; text-align: center;
  border: 1px solid var(--border);
}
.stat-num { font-size: 30px; font-weight: 900; letter-spacing: -0.04em; color: var(--accent); }
.stat-lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.sb-rank {
  width: 22px; flex-shrink: 0; font-size: 12.5px; font-weight: 800;
  color: var(--accent); font-variant-numeric: tabular-nums; text-align: center;
}
.sb-name { width: 160px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-bar { flex: 1; height: 8px; background: var(--hover-strong); border-radius: 4px; overflow: hidden; }
.sb-bar div { height: 100%; background: var(--accent); border-radius: 4px; }
.sb-n { width: 40px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

#np-sb.on { border-color: var(--accent); color: var(--accent); }

/* ---------- floating widget ---------- */
#float-widget {
  position: fixed;
  z-index: 70;
  width: min(390px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--card) 92%, var(--accent) 8%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  touch-action: none;
  animation: popIn 0.22s ease;
}
#float-widget.hidden { display: none; }
#float-widget.dragging { cursor: grabbing; animation: none; }
#fw-art {
  width: 56px; height: 56px; border-radius: 4px; object-fit: cover;
  background: var(--elevated); flex-shrink: 0;
  border: 1px solid var(--border);
}
.fw-meta { min-width: 0; flex: 1; }
#fw-title {
  font-size: 13px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em;
}
#fw-artist {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#fw-lyric {
  margin-top: 4px;
  font-size: 11.5px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; min-height: 0; line-height: 1.3;
}
#fw-lyric:empty { display: none; }
#fw-lyric:hover { color: var(--accent-bright); }
.fw-bar {
  margin-top: 6px; height: 3px; background: var(--bar-bg);
  border-radius: 2px; cursor: pointer; overflow: hidden;
}
#fw-fill { height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.fw-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.fw-btn {
  width: 30px; height: 30px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.fw-btn:hover { background: var(--hover-strong); color: var(--accent); }
.fw-btn .ic { width: 15px; height: 15px; }
.fw-play {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
}
.fw-play:hover { transform: scale(1.06); background: var(--accent-bright); color: #fff; }
.fw-play .ic { width: 15px; height: 15px; }
body.float-mode #miniplayer { opacity: 0; pointer-events: none; }
body.float-mode.has-player #main,
body.float-mode.has-player #sidebar { margin-bottom: 0; }
#mini-float.on, #np-float.on { color: var(--accent); }
#np-float.on { border-color: var(--accent); }

#toast {
  position: fixed; bottom: calc(var(--player-h) + 18px); left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 10px 20px;
  border-radius: 4px; font-size: 13.5px; font-weight: 700; z-index: 90;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 6px 20px rgba(255, 85, 0, 0.45);
}
#toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px); }

/* Hidden player */
#yt-holder {
  position: fixed;
  width: 720px;
  height: 720px;
  left: 0;
  top: 0;
  opacity: 0.001;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
#yt-holder iframe,
#yt-player {
  width: 720px !important;
  height: 720px !important;
}
#pip-canvas, #pip-video {
  position: fixed;
  width: 90px;
  height: 160px;
  left: 0;
  bottom: 0;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}
body.hq-audio #yt-holder {
  width: 1920px;
  height: 1080px;
}
body.hq-audio #yt-holder iframe,
body.hq-audio #yt-player {
  width: 1920px !important;
  height: 1080px !important;
}

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--radius);
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }

/* Laptop overlay (sidebar on, NP still fullscreen) */
@media (min-width: 861px) and (max-width: 1099px) {
  .np-art-wrap { width: min(36vw, 380px); }
  #np-player.active { justify-content: flex-start; gap: 16px; overflow: hidden; }
  .np-volume { display: none; }
  .np-tabs { flex-wrap: nowrap; }
}

/* Desktop: Now Playing as right sidebar */
@media (min-width: 1100px) {
  #nowplaying:not(.hidden) {
    position: relative; inset: auto; width: 340px; flex-shrink: 0;
    height: auto; align-self: stretch; border-radius: var(--radius);
    transform: none; opacity: 1; pointer-events: auto; z-index: 5;
    overflow: hidden; order: 3;
    border: 1px solid var(--border);
    animation: fadeUp 0.28s ease;
  }
  #nowplaying.hidden { display: none; transform: none; }
  #nowplaying .np-inner {
    max-width: none;
    padding: 10px 14px 12px;
    height: 100%;
  }
  #nowplaying .np-handle { display: none; }
  #nowplaying .np-caption { font-size: 10px; letter-spacing: 1.6px; }
  #nowplaying .np-tabs {
    flex-wrap: nowrap;
    gap: 4px;
    margin: 8px 0 4px;
    justify-content: flex-start;
  }
  #nowplaying .np-tab { padding: 5px 9px; font-size: 11.5px; }
  #nowplaying .np-tab .ic { display: none; }
  #nowplaying .np-body { min-height: 0; }
  #nowplaying .np-pane { padding: 6px 0 0; }
  #nowplaying #np-player.active {
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    overflow: hidden;
  }
  #nowplaying .np-art-wrap {
    width: 100%;
    max-width: none;
    align-self: center;
  }
  #nowplaying .np-meta { text-align: left; }
  #nowplaying #np-title {
    font-size: 16px;
    text-align: left;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #nowplaying #np-artist { text-align: left; padding: 0; }
  #nowplaying .np-seek { max-width: none; }
  #nowplaying .np-controls { gap: 12px; justify-content: center; }
  #nowplaying .play-big { width: 50px; height: 50px; }
  #nowplaying .np-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  #nowplaying .np-actions .pill-btn {
    padding: 7px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
  }
  #nowplaying .np-actions .pill-btn span { display: none; }
  #nowplaying .np-actions .pill-btn .ic { width: 15px; height: 15px; }
  #nowplaying #np-speed span,
  #nowplaying #np-quality span { display: inline; font-size: 11px; font-weight: 800; }
  #nowplaying .np-volume { display: none; }
  #nowplaying #np-lyric-preview { max-width: none; text-align: left; font-size: 12px; }
  body.np-open.has-player #nowplaying { margin-bottom: var(--player-h); }
}

/* ---------- responsive ---------- */
@media (max-width: 980px){
  .pb-right { display: none; }
  #miniplayer { grid-template-columns: 1fr 1.4fr; }
  .tb-search { max-width: 280px; }
}
@media (max-width: 860px){
  #app { padding: 0; gap: 0; }
  #sidebar { display: none; }
  #topbar { display: none; }
  #main { border-radius: 0; border: none; }
  :root { --player-h: 64px; }
  .np-handle { display: block; }
  #miniplayer {
    left: 8px; right: 8px; bottom: calc(var(--navm-h) + 8px); height: 62px;
    background: color-mix(in srgb, var(--card) 94%, var(--accent) 6%);
    border-radius: 8px; display: flex; align-items: center; padding: 0 10px; gap: 10px;
    border: 1px solid var(--border); backdrop-filter: blur(20px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
  body.has-player #main { margin-bottom: 0; padding-bottom: calc(var(--navm-h) + 90px); }
  body.float-mode.has-player #main { padding-bottom: calc(var(--navm-h) + 16px); }
  .pb-left { flex: 1; }
  #mini-art { width: 44px; height: 44px; }
  .pb-center { flex-direction: row; max-width: none; width: auto; }
  .pb-seek { position: absolute; left: 8px; right: 8px; bottom: 0; }
  .pb-seek span { display: none; }
  .pb-bar { height: 3px; }
  .pb-buttons { gap: 8px; }
  #mini-shuffle, #mini-repeat { display: none; }
  .play-circle { width: 34px; height: 34px; }
  #view { padding: 16px 14px 28px; }
  .sr-top { flex-direction: row; gap: 12px; padding: 12px; }
  .sr-top img, .art-ph-sr { width: 88px; height: 88px; }
  .sr-title { font-size: 18px; }
  .sr-sub { margin: 4px 0 0; }
  .sr-top .pill-btn.primary { display: none; }
  .mood-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .mood-card { font-size: 14.5px; padding: 12px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  #nav-mobile {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--navm-h);
    background: linear-gradient(0deg, var(--bg) 50%, color-mix(in srgb, var(--bg) 85%, transparent));
    z-index: 45; padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
  }
  #nav-mobile .nav-item {
    flex: 1; flex-direction: column; gap: 3px; font-size: 10px; padding: 8px 0;
    justify-content: center; align-items: center; border-radius: 0; font-weight: 700;
  }
  #nav-mobile .nav-item.active::before { display: none; }
  .carousel { grid-auto-columns: 150px; }
  .card { width: 150px; padding: 8px; }
  .card .art { width: 134px; height: 134px; }
  .detail-head { padding: 44px 14px 18px; margin: -16px -14px 8px; }
  .detail-head img { width: 140px; height: 140px; }
  #toast { bottom: calc(var(--navm-h) + 88px); }
  .lyric-line { font-size: 20px; }

  /* Track rows */
  .track { gap: 10px; padding: 7px 6px; }
  .track .tbtn { display: none; }
  .track .btn-more { display: inline-flex !important; opacity: 1; }
  .track .btn-qrm, .track .btn-qup, .track .btn-qdn { display: none !important; }
  .track.q-user, .track.pl-track { cursor: pointer; }
  .track .tdur { min-width: 34px; font-size: 12px; }
  .track .tt { font-size: 14px; }
  .track.playing .eq { display: none; }
  #queue-list, #related-list { padding: 0; }
  .q-head { padding: 12px 6px 6px; font-size: 11px; letter-spacing: 0.04em; }
  .q-note { display: none; }
  .q-hint { padding: 4px 6px 10px; font-size: 12px; }

  /* Now Playing mobile */
  .np-inner { padding: 2px 16px calc(10px + env(safe-area-inset-bottom)); }
  .np-handle { margin: 4px auto 2px; }
  .np-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 6px 0 2px;
    gap: 6px;
  }
  .np-tabs::-webkit-scrollbar { display: none; }
  .np-tab { padding: 6px 12px; font-size: 12px; flex-shrink: 0; }
  .np-pane { padding: 4px 0; }
  #np-player.active {
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
    padding: 4px 0 6px;
  }
  .np-art-wrap {
    width: min(80vw, 44vh);
    max-width: 400px;
    flex-shrink: 1;
  }
  #np-title {
    font-size: 20px;
    line-height: 1.22;
    padding: 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  #np-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
  }
  .np-controls { gap: 16px; }
  .play-big { width: 62px; height: 62px; }
  .np-volume, #np-float { display: none !important; }
  .np-actions {
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
  }
  .np-actions .pill-btn {
    padding: 9px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
  }
  .np-actions .pill-btn span { display: none; }
  .np-actions .pill-btn .ic { width: 18px; height: 18px; }
  #np-speed span, #np-quality span { display: inline; font-size: 11px; font-weight: 800; }
  #np-lyric-preview { min-height: 16px; font-size: 12px; }
}

/* Light theme overrides for Now Playing & Modals */
html[data-theme="light"] #nowplaying {
  background: #101010;
  color: #fff;
}
html[data-theme="light"] #nowplaying .play-big {
  background: var(--accent) !important;
  color: #ffffff !important;
}
html[data-theme="light"] #nowplaying .icon-btn { color: rgba(255, 255, 255, 0.9); }
html[data-theme="light"] #nowplaying .icon-btn:hover { color: var(--accent); }
html[data-theme="light"] #nowplaying .np-topbar .icon-btn {
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
}
html[data-theme="light"] #nowplaying .pill-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}
html[data-theme="light"] #nowplaying .pill-btn:hover { border-color: var(--accent); color: var(--accent); }
html[data-theme="light"] #nowplaying #np-title { color: #fff; }
html[data-theme="light"] #nowplaying #np-artist { color: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] #nowplaying .np-seek { color: rgba(255, 255, 255, 0.75); }
html[data-theme="light"] #nowplaying .np-caption { color: var(--accent); }
html[data-theme="light"] #nowplaying .track .tt { color: #fff; }
html[data-theme="light"] #nowplaying .track.playing .tt { color: var(--accent-bright); }
html[data-theme="light"] #nowplaying .card .t { color: #fff; }
html[data-theme="light"] #nowplaying .card .s { color: rgba(255, 255, 255, 0.65); }
html[data-theme="light"] #lyrics-source { color: rgba(255, 255, 255, 0.45); }
html[data-theme="light"] #nowplaying .np-tab {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
}
html[data-theme="light"] #nowplaying .np-tab.active { background: var(--accent); color: #fff; }

html[data-theme="light"] .modal-card {
  background: #fff;
  color: #121212;
  border-color: var(--border);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .modal-card h3,
html[data-theme="light"] .modal-row { color: #121212; }
html[data-theme="light"] .modal-row:hover { color: var(--accent); }
html[data-theme="light"] .pl-form-label,
html[data-theme="light"] .pl-form-hint { color: #5a5a5a; }
html[data-theme="light"] .modal-card .pl-form-input {
  background: #f8f8f8;
  color: #121212;
  border-color: var(--border);
}

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