@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #080a10;
  --text: #f4f5fa;
  --muted: #a2acc0;
  --accent: #a8f0ce;
  --accent-rgb: 168, 240, 206;
  --line: rgba(255, 255, 255, 0.09);
  --glow: rgba(168, 240, 206, 0.18);
  --glass-blur: 26px;
  --glass-alpha: 0.72;
  --bg-blur: 0px;
  --bg-dim: 0.55;
  --beat-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font: 15px 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
  transition: background 0.5s;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  background: none;
  transition: color 0.2s, background 0.25s, transform 0.22s cubic-bezier(.2,.8,.2,1), border-color 0.25s, box-shadow 0.25s;
}
button:hover { color: var(--accent); }

/* Custom Wallpaper & Ambient Orbs */
.app-bg {
  position: fixed;
  inset: -24px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(var(--bg-blur));
  transform: scale(1.04);
  transition: filter 0.3s ease, background-image 0.4s ease;
  pointer-events: none;
}

.app-bg-dim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(6, 8, 14, var(--bg-dim));
  pointer-events: none;
  transition: background 0.25s ease;
}

.ambient {
  position: fixed;
  pointer-events: none;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  z-index: 0;
  animation: drift 16s ease-in-out infinite alternate;
  transform: scale(var(--beat-scale));
}
.ambient-a { background: var(--accent); top: -24vw; left: 28vw; }
.ambient-b { background: #7063db; bottom: -26vw; right: -10vw; animation-delay: -5s; }

/* Reusable Glassmorphism Surface */
.glass {
  background: rgba(13, 17, 26, var(--glass-alpha));
  backdrop-filter: blur(var(--glass-blur)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(145%);
  border-color: var(--line);
}

.glass-modal {
  background: rgba(18, 22, 33, min(0.94, calc(var(--glass-alpha) + 0.16)));
  backdrop-filter: blur(calc(var(--glass-blur) + 8px)) saturate(150%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 8px)) saturate(150%);
}

.app { min-height: 100vh; padding-bottom: 112px; position: relative; z-index: 1; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 106px 0;
  width: 252px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 3;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font: 700 13px 'Space Grotesk';
  letter-spacing: 2px;
  margin: 0 0 32px;
}
.brand small { display: block; font-size: 9px; color: var(--muted); letter-spacing: 4px; margin-top: 3px; }
.logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 0 12px var(--glow)); }

.nav-label, .side-label { font-size: 10px; color: #758298; letter-spacing: 2px; margin: 0 10px 10px; }
.nav {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 14px;
  margin: 2px 0;
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav.active {
  color: var(--text);
  background: linear-gradient(100deg, rgba(var(--accent-rgb), 0.16), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}
.nav.active .nav-icon { color: var(--accent); }
.nav:hover { background: rgba(255, 255, 255, 0.06); }

.side-label { margin-top: 26px; }
#playlist-list { overflow-y: auto; max-height: 36vh; padding-right: 2px; }
.playlist-nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-nav:hover, .playlist-nav.selected { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.pl-nav-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  font-size: 12px;
  flex: none;
}
.pl-nav-thumb img { width: 100%; height: 100%; object-fit: cover; }

.new-playlist { padding: 11px 10px; text-align: left; color: var(--muted); display: flex; gap: 10px; align-items: center; font-size: 13px; }
.new-playlist:hover { color: var(--accent); }

.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.settings-open { width: 100%; padding: 11px 10px; border-radius: 10px; color: var(--text); display: flex; gap: 10px; font-size: 13px; background: rgba(255,255,255,0.04); }
.settings-open:hover { background: rgba(var(--accent-rgb), 0.15); }
.offline-note { font-size: 11px; color: #8492a6; padding: 10px 10px 2px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); margin-right: 8px; }

/* Main Content Area */
main { margin-left: 252px; padding: 26px 36px; min-height: calc(100vh - 106px); }

header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.top-controls { display: flex; gap: 6px; }
.glass-btn {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
}
.circle { border-radius: 50%; width: 36px; height: 36px; font-size: 20px; color: #c4cddb; display: grid; place-items: center; }
.circle:hover { background: rgba(var(--accent-rgb), 0.16); border-color: rgba(var(--accent-rgb), 0.4); }

.search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 0 16px;
  flex: 1;
  max-width: 480px;
  gap: 9px;
  transition: 0.25s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12); }
.search span { font-size: 19px; color: var(--muted); }
.search input { background: none; border: 0; color: white; outline: none; width: 100%; padding: 11px 0; }

.add {
  background: var(--accent);
  color: #09110e;
  padding: 11px 18px;
  border-radius: 28px;
  font-weight: 700;
  box-shadow: 0 4px 22px var(--glow);
  margin-left: auto;
}
.add:hover { color: #09110e; transform: translateY(-2px); filter: brightness(1.06); }
.mobile-brand, .mobile-settings-btn { display: none; }

/* Hero Section */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(115deg, rgba(23, 31, 43, var(--glass-alpha)), rgba(23, 36, 42, var(--glass-alpha)) 48%, rgba(32, 33, 54, var(--glass-alpha)));
  backdrop-filter: blur(var(--glass-blur));
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  margin-bottom: 18px;
  min-height: 300px;
  display: flex;
  align-items: center;
  animation: rise 0.55s cubic-bezier(.2,.8,.2,1) both;
}
.hero:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 68% 45%, var(--glow), transparent 50%);
  z-index: -1;
}
.hero-copy { z-index: 2; max-width: 520px; }
.eyebrow { font-size: 10px; color: var(--accent); letter-spacing: 2.4px; font-weight: 700; text-transform: uppercase; }
.sparkle { margin-right: 6px; }
.hero h1 { font: 600 clamp(32px, 4vw, 52px) 'Space Grotesk'; letter-spacing: -1.8px; line-height: 1.03; margin: 14px 0; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: #b8c2d1; margin: 10px 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta {
  background: var(--accent);
  color: #09120f;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 24px var(--glow);
}
.hero-cta:hover { transform: translateY(-2px); color: #09120f; }
.hero-sec {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
}
.hero-sec:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }

#hero-visualizer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 1;
}

.hero-art {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%) scale(var(--beat-scale));
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease-out;
}
.orb { position: absolute; border-radius: 50%; animation: orbit 10s linear infinite; }
.orb-one { width: 215px; height: 215px; border: 1px solid rgba(var(--accent-rgb), 0.35); box-shadow: inset 0 0 50px rgba(var(--accent-rgb), 0.1), 0 0 45px var(--glow); }
.orb-two { width: 160px; height: 160px; background: radial-gradient(circle at 30% 30%, var(--accent), rgba(var(--accent-rgb), 0.35) 45%, #344f71 75%, transparent); opacity: 0.85; animation: float 5s ease-in-out infinite; }
.orb-core { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #ffffff, var(--accent) 45%, #233c44 85%); color: #0c1f1b; font-size: 34px; box-shadow: 0 0 55px var(--glow); z-index: 1; }
.hero-ring { position: absolute; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; transform: rotate(-25deg); }
.ring-a { width: 275px; height: 92px; animation: orbit 18s linear infinite; }
.ring-b { width: 255px; height: 126px; transform: rotate(45deg); animation: orbit 24s linear infinite reverse; }

/* Stats & Quick Picks */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.stats-strip > div:not(.status-pill) { display: flex; flex-direction: column; gap: 3px; }
.stats-strip strong { font: 600 19px 'Space Grotesk'; color: var(--text); }
.stats-strip span { font-size: 9px; color: #8b98ad; letter-spacing: 1.3px; }
.status-pill { margin-left: auto; color: #9aa7ba; font-size: 11px; }

.quick-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 14px; }
.quick-heading h2, .section-heading h2 { font: 600 21px 'Space Grotesk'; margin: 0; }
.quick-heading > span, .section-heading p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 12px; margin-bottom: 26px; }
.quick {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  font-weight: 600;
  font-size: 13px;
  min-height: 68px;
  padding: 0 12px 0 0;
  text-align: left;
}
.quick:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.1); border-color: rgba(var(--accent-rgb), 0.35); box-shadow: 0 10px 26px rgba(0,0,0,0.25); }
.quick-icon { width: 68px; height: 68px; flex: none; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, #6c73d5, #363c78); color: white; overflow: hidden; }
.quick-icon img { width: 100%; height: 100%; object-fit: cover; }
.liked-quick .quick-icon, .liked-icon { background: linear-gradient(135deg, #db79b8, #6d5dc8); }
.q0 { background: linear-gradient(135deg, #57a995, #235b64); }
.q1 { background: linear-gradient(135deg, #bd8b6d, #653f57); }
.q2 { background: linear-gradient(135deg, #6689bd, #39446f); }
.q3 { background: linear-gradient(135deg, #d1a05d, #784a43); }
.q4 { background: linear-gradient(135deg, #646f83, #283342); }

/* Custom Playlist Banner Hero */
.collection-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  margin-bottom: 24px;
  min-height: 230px;
  background: linear-gradient(115deg, rgba(48, 52, 86, 0.8), rgba(24, 32, 44, 0.85));
  overflow: hidden;
  animation: rise 0.45s cubic-bezier(.2,.8,.2,1) both;
}
.playlist-hero { background: linear-gradient(115deg, rgba(45, 86, 77, 0.78), rgba(28, 33, 48, 0.85)); }

.banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.6s ease;
}
.collection-hero:hover .banner-img { transform: scale(1.03); }
.banner-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 10, 16, 0.92) 0%, rgba(8, 10, 16, var(--banner-dim, 0.45)) 60%, rgba(8, 10, 16, 0.25) 100%);
  z-index: 1;
}
.collection-hero > *:not(.banner-img):not(.banner-scrim) { position: relative; z-index: 2; }

.liked-icon {
  width: 136px;
  height: 136px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 44px;
  color: white;
  flex: none;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.liked-icon img { width: 100%; height: 100%; object-fit: cover; }

.collection-meta { flex: 1; min-width: 0; }
.collection-hero h1 { font: 700 clamp(28px, 4vw, 44px) 'Space Grotesk'; letter-spacing: -1.2px; margin: 6px 0; text-shadow: 0 2px 16px rgba(0,0,0,0.4); }
.collection-desc { color: #d5dce8; font-size: 14px; margin: 0 0 8px; max-width: 620px; }
.collection-stats { color: #9fb0c6; font-size: 12px; margin: 0; }

.hero-toolbar {
  display: flex;
  gap: 10px;
  align-self: flex-start;
  margin-left: auto;
}
.customize-btn {
  background: rgba(15, 19, 28, 0.65);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 9px 15px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.customize-btn:hover { background: var(--accent); color: #09110e; border-color: var(--accent); }

/* Track List & Active Playing Animation */
.track-list { display: flex; flex-direction: column; gap: 3px; }
.track {
  display: grid;
  grid-template-columns: 32px 46px minmax(0, 1fr) 58px 34px 34px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  animation: fadein 0.3s both;
}
.track:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.05); }
.track.is-playing {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
}
.track.is-playing .track-name { color: var(--accent); }

.track-index { color: #8390a5; font-size: 12px; text-align: center; display: grid; place-items: center; }
.eq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.eq-bars i { display: block; width: 3px; background: var(--accent); border-radius: 2px; animation: eq 0.7s ease-in-out infinite alternate; }
.eq-bars i:nth-child(2) { animation-delay: 0.2s; }
.eq-bars i:nth-child(3) { animation-delay: 0.4s; }

.track-art {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #263a39, #151e27);
  color: var(--accent);
  font-size: 19px;
}
.track-art img, .art img { width: 100%; height: 100%; object-fit: cover; }
.track-info { min-width: 0; }
.track-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-duration { color: #8e9aaf; font-size: 12px; }
.track-action { font-size: 17px; color: #8592a6; padding: 5px; border-radius: 8px; }
.track-action:hover, .track-action.liked { color: var(--accent); background: rgba(255, 255, 255, 0.06); }

/* Empty States */
.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}
.empty h3 { color: white; font: 600 20px 'Space Grotesk'; margin: 8px 0; }
.empty-icon { font-size: 32px; color: var(--accent); }
.empty-add, .subtle-button { background: rgba(255, 255, 255, 0.08); padding: 10px 16px; border-radius: 24px; font-size: 12px; font-weight: 600; }
.empty-add:hover, .subtle-button:hover { background: var(--accent); color: #09110e; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; color: #8996ab; font-size: 10px; letter-spacing: 1.6px; margin-bottom: 10px; }

/* Player Bar */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 106px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  align-items: center;
  padding: 12px 24px;
  z-index: 6;
}
.now { display: flex; align-items: center; gap: 13px; min-width: 0; cursor: pointer; }
.art.tiny {
  width: 54px;
  height: 54px;
  font-size: 22px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #263a39, #151e27);
  display: grid;
  place-items: center;
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.track-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.track-meta b, .track-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta b { font-size: 13.5px; }
.track-meta span { font-size: 11.5px; color: var(--muted); }
.heart { font-size: 21px; color: #8c98ab; margin-left: 4px; }
.heart.liked { color: var(--accent); }

.controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.buttons { display: flex; align-items: center; gap: 18px; color: #b4bfcf; }
.buttons button { font-size: 16px; }
.play {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--accent);
  color: #09120f;
  font-size: 15px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px var(--glow);
}
.play:hover { color: #09120f; transform: scale(1.09); }
.skip { font-size: 12px; }
.active-control { color: var(--accent) !important; }
.progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 470px; font-size: 11px; color: #8c99ad; }

input[type=range] { accent-color: var(--accent); cursor: pointer; }
#seek { width: 100%; height: 4px; }

.volume { justify-self: end; color: #9aa7ba; display: flex; align-items: center; gap: 10px; }
.volume input { width: 96px; }
.icon-btn { font-size: 17px; padding: 6px; border-radius: 8px; color: #9aa7ba; }
.icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--accent); }

/* Queue Drawer */
.queue-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 120px;
  width: min(350px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  animation: slideLeft 0.25s ease both;
}
.queue-drawer.hidden { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-head h3 { margin: 4px 0 0; font: 600 20px 'Space Grotesk'; }
.queue-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.03); cursor: pointer; }
.q-item:hover { background: rgba(255,255,255,0.08); }
.q-item.current { border: 1px solid rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.1); }
.q-item-info { flex: 1; min-width: 0; }
.q-item-info b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item-info span { font-size: 11px; color: var(--muted); }

/* Full-Screen Now Playing Theater */
.now-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(7, 9, 15, 0.86);
  backdrop-filter: blur(36px);
  display: flex;
  flex-direction: column;
  padding: 28px 36px;
  animation: fadein 0.3s ease both;
}
.now-modal.hidden { display: none; }
.now-modal-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.22; filter: blur(40px); pointer-events: none; }
.now-modal-inner { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; }
.now-top { display: flex; justify-content: space-between; align-items: center; }
.now-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; }

.vinyl-wrap {
  width: min(290px, 64vw);
  height: min(290px, 64vw);
  border-radius: 50%;
  padding: 12px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), rgba(0,0,0,0.6));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 60px var(--glow);
}
.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 64px;
  color: var(--accent);
  background: linear-gradient(135deg, #1d2936, #0d131c);
  animation: spinDisc 18s linear infinite;
  animation-play-state: paused;
}
.vinyl-wrap.spinning .vinyl-disc { animation-play-state: running; }
.vinyl-disc img { width: 100%; height: 100%; object-fit: cover; }
.now-details h2 { font: 700 clamp(24px, 3.5vw, 38px) 'Space Grotesk'; margin: 0 0 6px; }
.now-details p { color: var(--muted); font-size: 15px; margin: 0; }
#big-visualizer { width: min(600px, 90vw); height: 95px; }

/* Modals & Forms */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.65);
  backdrop-filter: blur(12px);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(540px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 25px 100px rgba(0, 0, 0, 0.65);
  animation: rise 0.25s ease both;
  position: relative;
}
.modal-close { position: absolute; right: 18px; top: 16px; font-size: 26px; color: #9aa7ba; }
.modal-card h2 { font: 600 26px 'Space Grotesk'; margin: 8px 0 6px; }
.modal-sub { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.modal-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #b7c2d4; margin: 22px 0 10px; }

.swatches { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; background: var(--swatch); border: 2px solid rgba(255,255,255,0.15); }
.swatch:hover { transform: scale(1.14); border-color: #fff; }
.custom-color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-size: 16px;
}
.custom-color-btn input[type=color], #pl-custom-color {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Wallpaper & Glass Controls */
.wallpaper-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 16px;
}
.wallpaper-preview {
  width: 110px;
  height: 64px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 4px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.wallpaper-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.slider-group { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.slider-row { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #cfd7e6; }
.slider-row span { display: flex; justify-content: space-between; }
.slider-row b { color: var(--accent); font-weight: 600; }
.slider-row input[type=range] { width: 100%; }

.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.theme-choice { font-size: 11px; color: #b8c2d2; display: flex; flex-direction: column; gap: 7px; align-items: center; }
.theme-preview { height: 54px; width: 100%; border-radius: 11px; border: 1px solid rgba(255,255,255,0.12); }
.midnight { background: linear-gradient(135deg, #101722, #252f3b); }
.plum { background: linear-gradient(135deg, #1b1325, #44305b); }
.ocean { background: linear-gradient(135deg, #071a27, #164b62); }
.minimal { background: linear-gradient(135deg, #0b0d11, #15171b); }

.setting-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-toggle span { display: flex; flex-direction: column; gap: 2px; }
.setting-toggle b { font-size: 13px; }
.setting-toggle small { font-size: 11px; color: var(--muted); }

/* Playlist Studio Form Controls */
.field-group { margin-bottom: 14px; }
.field-group label, .field-label { display: block; font-size: 12px; color: #b7c2d4; margin-bottom: 6px; font-weight: 500; }
.text-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  color: white;
  font: inherit;
  outline: none;
}
.text-input:focus { border-color: var(--accent); }

.media-upload-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.upload-zone {
  height: 115px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  padding: 10px;
  transition: 0.2s;
}
.upload-zone:hover { border-color: var(--accent); color: var(--accent); }
.mini-actions { margin-top: 5px; }
.text-link { font-size: 11px; color: var(--muted); text-decoration: underline; }

.pill-btn {
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.16); color: white; }
.pill-btn.primary { background: var(--accent); color: #09120f; border-color: transparent; }
.pill-btn.primary:hover { filter: brightness(1.07); color: #09120f; }
.pill-btn.danger { background: rgba(255, 92, 114, 0.15); color: #ff8093; border-color: rgba(255, 92, 114, 0.3); }
.pill-btn.danger:hover { background: #ff5c72; color: white; }

.modal-actions-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Floating Context Menu */
.context-menu {
  position: fixed;
  z-index: 40;
  min-width: 210px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  animation: rise 0.16s ease both;
}
.context-menu.hidden { display: none; }
.ctx-item {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.ctx-item:hover { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); }
.ctx-item.danger:hover { background: rgba(255, 92, 114, 0.18); color: #ff8093; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 8px; }
.ctx-label { font-size: 10px; color: var(--muted); padding: 6px 12px 3px; letter-spacing: 1px; text-transform: uppercase; }

/* Drag & Drop Overlay */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 11, 18, 0.82);
  backdrop-filter: blur(18px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.drop-overlay.hidden { display: none; }
.drop-box {
  border: 2px dashed var(--accent);
  border-radius: 28px;
  padding: 48px 64px;
  text-align: center;
  background: rgba(var(--accent-rgb), 0.08);
}
.drop-icon { font-size: 44px; color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 124px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: rgba(24, 30, 44, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 14px;
  padding: 11px 18px;
  font-size: 12.5px;
  z-index: 45;
  transition: 0.25s;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Themes & States */
body[data-theme=plum] { --bg: #0e0a14; }
body[data-theme=plum] .ambient-a { background: #8f64df; }
body[data-theme=ocean] { --bg: #061018; }
body[data-theme=ocean] .ambient-a { background: #40b9e5; }
body[data-theme=minimal] { --bg: #090a0d; }
body[data-theme=minimal] .ambient { opacity: 0.03; }

body.compact .track { padding: 4px 10px; grid-template-columns: 28px 36px minmax(0, 1fr) 58px 34px 34px; }
body.compact .track-art { width: 36px; height: 36px; }
body.no-motion *, body.no-motion *:before, body.no-motion *:after { animation: none !important; transition: none !important; }

/* Keyframes */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(9vw, 6vw); } }
@keyframes orbit { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes spinDisc { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(8px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; transform: scale(0.95); } }
@keyframes eq { from { height: 3px; } to { height: 13px; } }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 205px; }
  main { margin-left: 205px; padding: 22px; }
  .player { grid-template-columns: 1fr 1.3fr; }
  .volume { display: none; }
  .hero-art { right: 3%; opacity: 0.7; }
}

@media (max-width: 640px) {
  .app { padding-bottom: 155px; }
  .sidebar {
    inset: auto 0 92px 0;
    width: auto;
    height: 60px;
    padding: 6px 8px;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  .brand, .nav-label, .side-label, #playlist-list, .new-playlist, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; flex: 1; justify-content: space-around; }
  .nav { width: auto; flex-direction: column; gap: 2px; padding: 5px 10px; font-size: 16px; margin: 0; }
  .nav span:last-child { font-size: 10px; }
  main { margin: 0; padding: 14px 14px 0; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; color: var(--accent); font: 700 12px 'Space Grotesk'; letter-spacing: 1.7px; margin-right: auto; }
  .mobile-brand img { width: 23px; height: 23px; object-fit: contain; border-radius: 5px; }
  .mobile-settings-btn { display: grid; }
  .top-controls { display: none; }
  .add { margin-left: 0; padding: 9px 13px; font-size: 12px; }
  .hero { min-height: 230px; padding: 24px; }
  .hero-art { width: 145px; height: 145px; right: -4%; opacity: 0.45; }
  .collection-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero-toolbar { margin-left: 0; }
  .liked-icon { width: 92px; height: 92px; }
  .media-upload-grid { grid-template-columns: 1fr; }
  .player { height: 92px; grid-template-columns: 1fr; grid-template-rows: 1fr 32px; padding: 7px 12px; }
  .controls { grid-row: 2; display: grid; grid-template-columns: 125px 1fr; gap: 8px; width: 100%; }
  .buttons { gap: 10px; }
}

/* Auroral Calm Mode — immersive, soft-focus listening space */
#now-modal { --calm-tint: var(--accent); overflow:hidden; padding:clamp(18px,4vw,46px); background:radial-gradient(ellipse at 50% 42%,color-mix(in srgb,var(--calm-tint) 14%,transparent),transparent 54%),rgba(5,7,12,.88); backdrop-filter:blur(28px) saturate(1.35); }
#now-modal::before,#now-modal::after { content:"";position:absolute;inset:-25%;pointer-events:none;border-radius:50%; }
#now-modal::before { background:radial-gradient(circle at 32% 35%,color-mix(in srgb,var(--calm-tint) 22%,transparent),transparent 34%);filter:blur(60px);animation:calm-drift 18s ease-in-out infinite alternate; }
#now-modal::after { background:radial-gradient(circle at 70% 65%,color-mix(in srgb,var(--calm-tint) 14%,transparent),transparent 32%);filter:blur(80px);animation:calm-drift 22s ease-in-out infinite alternate-reverse; }
#now-modal .now-modal-bg { opacity:.28;filter:blur(65px) saturate(1.45);transform:scale(1.18);transition:background-image .4s ease,opacity .4s; }
#now-modal .now-modal-inner { min-height:0; }
#now-modal .now-top { position:relative;z-index:5; }
.calm-brand { display:flex;align-items:center;gap:11px;letter-spacing:.18em;font-size:11px;color:rgba(255,255,255,.78); }
.calm-brand-mark { width:35px;height:35px;object-fit:contain;border-radius:8px;box-shadow:0 0 28px color-mix(in srgb,var(--calm-tint) 18%,transparent); }
.calm-brand b { display:block;font-weight:600; }.calm-brand small { display:block;margin-top:4px;font-size:8px;opacity:.48;letter-spacing:.27em; }
.calm-exit { width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);color:white;font-size:22px;cursor:pointer;backdrop-filter:blur(12px);transition:transform .2s,background .2s; }
.calm-exit:hover { transform:rotate(90deg);background:rgba(255,255,255,.12); }
.calm-stage { position:relative;z-index:3;overflow:hidden;gap:clamp(12px,2.2vh,24px);padding:8px 0 0; }
.calm-art-stack { position:relative;display:grid;place-items:center;width:min(370px,70vw);aspect-ratio:1;isolation:isolate;margin:0 auto; }
.calm-ring { position:absolute;border-radius:50%;border:1px solid color-mix(in srgb,var(--calm-tint) 24%,transparent);box-shadow:0 0 30px color-mix(in srgb,var(--calm-tint) 7%,transparent),inset 0 0 26px color-mix(in srgb,var(--calm-tint) 5%,transparent); }
.calm-ring-one { inset:2%;animation:calm-ring-pulse 7s ease-in-out infinite; }.calm-ring-two { inset:9%;opacity:.65;animation:calm-ring-pulse 9s ease-in-out infinite reverse; }.calm-ring-three { inset:16%;opacity:.42;animation:calm-ring-pulse 11s ease-in-out infinite; }
.calm-cover-wrap { position:relative;z-index:2;width:min(245px,54vw);height:min(245px,54vw);padding:0;border-radius:28px;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.06);box-shadow:0 35px 100px rgba(0,0,0,.5),0 0 70px color-mix(in srgb,var(--calm-tint) 22%,transparent); }
.calm-cover-wrap .vinyl-disc { border-radius:27px;animation:none!important;background:linear-gradient(145deg,rgba(255,255,255,.12),rgba(0,0,0,.35));overflow:hidden; }.calm-cover-wrap .vinyl-disc img { width:100%;height:100%;object-fit:cover;border-radius:27px;transform:scale(1.015); }.calm-cover-wrap.spinning .vinyl-disc { animation:none!important; }
.calm-wave-shell { width:min(850px,90vw);height:clamp(70px,13vh,130px);position:relative;margin-top:-10px;filter:drop-shadow(0 0 15px color-mix(in srgb,var(--calm-tint) 24%,transparent)); } #big-visualizer { width:100%;height:100%; }
.calm-details { text-align:center;margin-top:0; }.calm-details h2 { font-size:clamp(24px,3.2vw,38px);letter-spacing:-.035em;text-shadow:0 5px 24px rgba(0,0,0,.25); }.calm-details p { font-size:14px;letter-spacing:.04em;color:rgba(255,255,255,.62); }
.calm-progress { width:min(520px,85vw);display:flex;align-items:center;gap:12px;color:rgba(255,255,255,.48);font-size:10px;font-variant-numeric:tabular-nums;margin-top:5px; }.calm-progress-track { flex:1;height:3px;background:rgba(255,255,255,.15);border-radius:99px;overflow:hidden; }.calm-progress-track #calm-progress-fill { width:0%;height:100%;background:var(--calm-tint);border-radius:99px;box-shadow:0 0 12px var(--calm-tint);transition:width .12s linear; }
.calm-controls { display:flex;align-items:center;justify-content:center;gap:32px; }.calm-controls button { border:0;background:transparent;color:rgba(255,255,255,.7);font-size:19px;cursor:pointer;transition:transform .18s,color .18s; }.calm-controls button:hover { transform:scale(1.12);color:white; }.calm-controls .calm-play { width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--calm-tint) 92%,white);color:#09100d;font-size:18px;box-shadow:0 0 34px color-mix(in srgb,var(--calm-tint) 38%,transparent); }
.calm-caption { font-size:10px;letter-spacing:.12em;color:rgba(255,255,255,.3);padding-bottom:5px; }
@keyframes calm-ring-pulse { 0%,100%{transform:scale(.98);opacity:.32}50%{transform:scale(1.025);opacity:.78} } @keyframes calm-drift { from{transform:translate3d(-2%,0,0) scale(.95)}to{transform:translate3d(2%,2%,0) scale(1.08)} }
@media(max-width:640px){#now-modal{padding:18px 18px calc(18px + env(safe-area-inset-bottom));}.calm-stage{justify-content:center;gap:clamp(10px,2vh,20px);}.calm-art-stack{width:min(310px,76vw);}.calm-cover-wrap{width:min(205px,52vw);height:min(205px,52vw);border-radius:23px;}.calm-cover-wrap .vinyl-disc,.calm-cover-wrap .vinyl-disc img{border-radius:22px;}.calm-controls{gap:26px;}}
@media(prefers-reduced-motion:reduce){.calm-ring,.calm-brand-mark,#now-modal::before,#now-modal::after{animation:none!important;}}

/* Keep the playlist custom color input confined to its own circular swatch. */
.playlist-custom-color-btn {
  flex: 0 0 32px;
  padding: 0;
  color: #dbe4f2;
}
.playlist-custom-color-btn input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
