/* ── Pulsar :: premium UI — Apple Music style ────────────────────────────── */
:root {
  --bg: #0B0C10;
  --bg-2: #12131A;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.10);
  --txt: #F4F6FB;
  --txt-dim: rgba(244, 246, 251, 0.55);
  --txt-faint: rgba(244, 246, 251, 0.34);
  --accent: #7C5CFF;
  --accent-grad: linear-gradient(135deg, #7C5CFF 0%, #4FD1FF 100%);
  --white-glow: rgba(255, 255, 255, .5);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.55);
  --ease-apple: cubic-bezier(.32,.72,0,1);
}
body.light {
  --bg: #F2F3F7;
  --bg-2: #E8EAF0;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(20, 24, 40, 0.09);
  --txt: #171923;
  --txt-dim: rgba(23, 25, 35, 0.58);
  --txt-faint: rgba(23, 25, 35, 0.38);
  --shadow-lg: 0 24px 60px -22px rgba(30, 34, 60, 0.28);
}

* { -webkit-font-smoothing: antialiased; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Manrope', 'Inter', -apple-system, 'SF Pro Display', sans-serif;
  overflow: hidden;
  transition: background .45s ease, color .45s ease;
}

/* ── ambient glow ── */
#ambient {
  position: fixed; inset: -20%;
  filter: blur(120px) saturate(1.25);
  opacity: .45;
  background: radial-gradient(45% 45% at 30% 30%, var(--glow-1, #7C5CFF) 0%, transparent 70%),
              radial-gradient(40% 40% at 75% 65%, var(--glow-2, #4FD1FF) 0%, transparent 70%),
              radial-gradient(35% 35% at 50% 80%, var(--glow-3, #FF5CA8) 0%, transparent 70%);
  transition: background 1.2s ease, opacity .8s ease;
  z-index: 0;
  pointer-events: none;
}
body.light #ambient { opacity: .30; }
#ambient.dimmed { opacity: .12; }

/* ── glass ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
}
.glass-strong {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(36px) saturate(1.55);
  -webkit-backdrop-filter: blur(36px) saturate(1.55);
}
html.no-glass .glass, html.no-glass .glass-strong {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--bg-2) !important;
}
html.no-glass #ambient { display: none !important; }

/* ── scrollbars ── */
.nice-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.nice-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ── hover lift ── */
.lift { transition: transform .28s var(--ease-apple), box-shadow .28s, background .28s, border-color .28s; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ── nav pill ── */
.nav-item { position: relative; transition: color .25s, background .3s; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(124,92,255,.22), rgba(79,209,255,.12));
  color: var(--txt);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 99px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(124,92,255,.8);
}

/* ── track cards ── */
.track-card { transition: transform .25s var(--ease-apple), background .25s; }
.track-card:hover { background: var(--glass-strong); transform: translateY(-2px); }
.track-card:hover .play-overlay { opacity: 1; transform: scale(1); }
.play-overlay { opacity: 0; transform: scale(.6); transition: all .25s cubic-bezier(.34,1.56,.64,1); }
.track-list-row { transition: background .2s; }
.track-list-row:hover { background: var(--glass-strong); }

/* ── breathing art — white glow ── */
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 30px 80px -20px rgba(0,0,0,.65), 0 0 0 0 rgba(255,255,255,.28); }
  50% { transform: scale(1.018); box-shadow: 0 34px 90px -18px rgba(0,0,0,.7), 0 0 70px 10px rgba(255,255,255,.22); }
}
.breathing { animation: breathe 5.5s ease-in-out infinite; }
.breathing.paused { animation-play-state: paused; }

/* ── play disc: WHITE ── */
.play-disc {
  background: #ffffff !important;
  color: #0B0C10 !important;
  animation: disc-pulse 2.2s ease-out infinite;
}
@keyframes disc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.4), 0 14px 34px -8px rgba(0,0,0,.55); }
  50% { box-shadow: 0 0 0 14px rgba(255,255,255,0), 0 14px 34px -8px rgba(0,0,0,.55); }
}
body.light .play-disc { background: #171923 !important; color: #fff !important; }

/* mini play button white */
#miniPlay {
  background: #ffffff;
  color: #0B0C10;
  transition: transform .2s var(--ease-apple), box-shadow .3s;
}
#miniPlay:hover { box-shadow: 0 8px 26px -6px rgba(255,255,255,.45); transform: scale(1.06); }
body.light #miniPlay { background: #171923; color: #fff; }

/* volume slider white */
#volSlider { accent-color: #ffffff; }

/* ── progress (fs) ── */
.prog-glow { box-shadow: 0 0 14px 2px rgba(124,92,255,.55); }

/* ── LYRICS — full Apple Music copy ──────────────────────────────────────── */
#fsLyricsPanel {
  position: relative;
  width: 44%;
  height: 88%;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: width .7s var(--ease-apple), transform .7s var(--ease-apple),
              opacity .7s var(--ease-apple);
  transform-origin: center;
}
#fsLyricsPanel.lyrics-hidden-state { width: 0; opacity: 0; transform: translateX(80px) scale(.95); pointer-events: none; }
#fsContent { transition: max-width .7s var(--ease-apple); }

#lyricsScroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 16vh 2vw 22vh 2vw;
  mask-image: linear-gradient(to bottom, transparent 0, black 10%, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 10%, black 82%, transparent 100%);
  text-align: center;
}
.lyr-line {
  font-size: clamp(26px, 2.3vw, 40px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.01em;
  color: #fff;
  opacity: .26;
  cursor: pointer;
  padding: .3em 0;
  margin: 0 auto;
  transform: scale(.94);
  transform-origin: center;
  will-change: transform, opacity;
  transition: opacity .6s var(--ease-apple), transform .65s var(--ease-apple), color .6s;
  user-select: none;
  display: block;
  width: 100%;
  max-width: none;
}
.lyr-line.past { opacity: .18; transform: scale(.92); }
.lyr-line.active {
  opacity: 1; transform: scale(1.015);
  text-shadow: 0 2px 34px rgba(0,0,0,.35);
}
body.light .lyr-line { color: #1a1c28; }
body.light .lyr-line.active { text-shadow: none; }
/* user scrolling: reveal all */
#lyricsScroll.user-scrolling .lyr-line { opacity: .7 !important; transform: scale(.98) !important; transition: opacity .3s, transform .3s; }
#lyricsScroll.user-scrolling .lyr-line.active { opacity: 1 !important; transform: scale(1.01) !important; }

/* lyrics header — centered minimal */
#lyrHeader {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 14px 4px;
}
#lyrHeader .lyr-title { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); }

/* ── FS progress bar: white + hover system like mini ── */
#fsProgress { transition: height .22s var(--ease-apple); height: 4px; }
#fsProgress:hover { height: 7px; }
#fsTimes { opacity: 0; }
#fsProgress:hover + #fsTimes, #fsTimes.show { opacity: 1 !important; }
#fsTimes { transition: opacity .25s var(--ease-apple); }
.fs-prog-dot {
  transform: translate(-50%, -50%) scale(0);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  top: 50%;
}
#fsProgress:hover .fs-prog-dot, #fsProgress.seeking .fs-prog-dot { transform: translate(-50%, -50%) scale(1); }

/* ── styled select (language) ── */
select.txt {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A0A6B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
  cursor: pointer;
  color: var(--txt) !important;
}
select.txt option {
  background: #14151C;
  color: #F4F6FB;
  font-weight: 600;
  padding: 8px;
}

/* ── inputs ── */
input.txt, textarea.txt, select.txt {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--txt);
  border-radius: 14px;
  padding: 10px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  font-family: inherit;
}
input.txt:focus, textarea.txt:focus, select.txt:focus {
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 4px rgba(124,92,255,.14);
}
input.txt::placeholder { color: var(--txt-faint); }
input[type=range] { accent-color: #7C5CFF; }
#volSlider { accent-color: #fff; }

/* ── buttons ── */
.btn-grad {
  background: var(--accent-grad);
  color: #fff;
  border-radius: 14px;
  transition: transform .2s var(--ease-apple), box-shadow .25s, filter .2s;
}
.btn-grad:hover { filter: brightness(1.1); box-shadow: 0 10px 30px -8px rgba(124,92,255,.55); transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 14px;
  transition: background .2s, border-color .2s, transform .2s;
  color: var(--txt);
}
.btn-ghost:hover { background: var(--glass-strong); transform: translateY(-1px); }

/* transport button active states (white, never transparent) */
.tp-btn { transition: color .25s, opacity .25s, transform .2s; color: var(--txt-dim); opacity: 1 !important; }
.tp-btn:hover { color: var(--txt); }
.tp-btn.on { color: #ffffff !important; opacity: 1 !important; text-shadow: 0 0 18px rgba(255,255,255,.65); }
body.light .tp-btn.on { color: #171923 !important; text-shadow: 0 0 14px rgba(23,25,35,.4); }

/* like button states */
.like-btn { transition: color .25s var(--ease-apple), transform .25s var(--ease-apple); color: var(--txt-dim); }
.like-btn:hover { color: var(--txt); transform: scale(1.12); }
.like-btn.liked { color: #ffffff !important; opacity: 1 !important; filter: drop-shadow(0 0 10px rgba(255,255,255,.75)); }
body.light .like-btn.liked { color: #171923 !important; filter: drop-shadow(0 0 8px rgba(23,25,35,.5)); }
.like-btn.liked i { font-weight: 900; }
@keyframes heartpop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.like-btn.pop i { animation: heartpop .45s var(--ease-apple); }

/* lyrics toggle button white when on */
#miniLyricsBtn.on, #fsLyrToggle.on {
  color: #ffffff !important;
  text-shadow: 0 0 16px rgba(255,255,255,.6);
}
body.light #miniLyricsBtn.on, body.light #fsLyrToggle.on { color: #171923 !important; text-shadow: none; }

/* ── EQ ── */
.eq-band input[type=range] { writing-mode: vertical-lr; direction: rtl; width: 26px; height: 130px; }

/* ── view transitions ── */
.view { animation: viewin .42s var(--ease-apple); }
@keyframes viewin { from { opacity: 0; transform: translateY(18px) scale(.995); } to { opacity: 1; transform: none; } }

/* staggered section fade */
.stagger > * { animation: viewin .5s var(--ease-apple) backwards; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }
.stagger > *:nth-child(5) { animation-delay: .28s; }
.stagger > *:nth-child(6) { animation-delay: .34s; }

/* ── toast ── */
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(20px);
  opacity: 0; transition: all .35s var(--ease-apple);
  z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── fullscreen player ── */
#fullscreenPlayer { transition: opacity .5s var(--ease-apple), transform .5s var(--ease-apple); }
#fullscreenPlayer.hidden-fs { opacity: 0; transform: translateY(40px) scale(.98); pointer-events: none; }

/* ── skeleton + modern loading ── */
@keyframes shimmer { from { background-position: -400px 0 } to { background-position: 400px 0 } }
.skeleton {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass-strong) 50%, var(--glass) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 12px;
}
.source-loading {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-border);
}
.source-loading .dots { display: flex; gap: 5px; }
.source-loading .dots i {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--accent-grad);
  animation: dotjump 1.2s ease-in-out infinite;
}
.source-loading .dots i:nth-child(2) { animation-delay: .15s; }
.source-loading .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotjump { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-7px); opacity: 1; } }

/* ── misc ── */
.chip {
  border: 1px solid var(--glass-border); background: var(--glass);
  border-radius: 99px; padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
  white-space: nowrap; color: var(--txt);
}
.chip.active { background: var(--accent-grad); border-color: transparent; color: #fff; }
.chip:hover { background: var(--glass-strong); }
.liked { color: #ffffff !important; }
.divider { height: 1px; background: var(--glass-border); }

/* ── modal ── */
#modalCard { animation: modalcard .45s var(--ease-apple); }
@keyframes modalcard { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }

/* ═ MINI PLAYER: top progress line (hover: thicker + dot + times) ═ */
#miniProgWrap {
  position: absolute; left: 14px; right: 14px; top: -2px; height: 4px;
  cursor: pointer;
}
#miniProg {
  position: absolute; left: 0; right: 0; top: 1px;
  height: 3px; border-radius: 99px;
  background: rgba(255,255,255,.14);
  transition: height .22s var(--ease-apple), background .22s;
}
body.light #miniProg { background: rgba(20,24,40,.16); }
#miniProgWrap:hover #miniProg { height: 6px; background: rgba(255,255,255,.22); }
#miniProgFill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255,255,255,.5);
}
body.light #miniProgFill { background: #171923; box-shadow: none; }
#miniProgDot {
  position: absolute; top: 50%;
  width: 11px; height: 11px; border-radius: 99px;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
body.light #miniProgDot { background: #171923; }
#miniProgWrap:hover #miniProgDot { transform: translate(-50%, -50%) scale(1); }
#miniTimes {
  position: absolute; top: -26px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 800;
  color: var(--txt-dim);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .25s var(--ease-apple), transform .25s var(--ease-apple);
  pointer-events: none;
  z-index: 5;
}
#miniProgWrap:hover #miniTimes { opacity: 1; transform: none; }

/* ── PULSE hero: animated background (beat-reactive via CSS vars) ── */
#pulseHero {
  position: relative; overflow: hidden;
}
#pulseCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .55; pointer-events: none;
}
.pulse-orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: .5;
  animation: orbfloat 12s ease-in-out infinite;
  pointer-events: none;
}
.pulse-orb:nth-child(2) { animation-delay: -4s; animation-duration: 16s; }
.pulse-orb:nth-child(3) { animation-delay: -8s; animation-duration: 20s; }
@keyframes orbfloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.15); }
  66% { transform: translate(-30px, 25px) scale(.9); }
}
#pulseIcon {
  animation: pulsebeat 2.4s ease-in-out infinite;
  position: relative; z-index: 2;
}
@keyframes pulsebeat {
  0%, 100% { transform: scale(1); box-shadow: 0 20px 50px -12px rgba(124,92,255,.5), 0 0 0 0 rgba(124,92,255,.35); }
  50% { transform: scale(1.05); box-shadow: 0 20px 50px -12px rgba(124,92,255,.6), 0 0 40px 6px rgba(124,92,255,.3); }
}

/* artist banner fade */
.artist-banner {
  position: relative;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
