:root {
  --bg: #0d0c0b;        /* near-black, warm */
  --fg: #EDE6D6;        /* cream / champagne text (matches cover) */
  --muted: #9a9080;     /* warm taupe */
  --accent: #C9A227;    /* luxury gold */
  --accent-soft: #d8c9a0;/* soft champagne-gold */
  --row: rgba(255,255,255,0.035);
  --row-hover: rgba(255,255,255,0.07);
  --line: rgba(237,230,214,0.12);
  --head: "Playfair Display", Georgia, serif;
  --body: "Inter", -apple-system, system-ui, Segoe UI, Roboto, sans-serif;
}

/* Blurred cover backdrop for depth (matches the cover's dark luxe mood) */
.bg-blur {
  position: fixed; inset: -20px; z-index: -2;
  background-image: url('cover.jpg');
  background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.1) brightness(0.4);
  transform: scale(1.15); pointer-events: none;
}
.bg-overlay {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    rgba(13,12,11,0.55) 0%,
    rgba(13,12,11,0.80) 45%,
    rgba(13,12,11,0.96) 100%);
  pointer-events: none;
}

* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  background: transparent;
  font: 15px/1.5 var(--body);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.album { max-width: 720px; margin: 0 auto; padding: 40px 16px 160px; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.cover {
  width: min(360px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,162,39,0.15);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.cover:active { transform: scale(0.98); }

.meta h1 {
  margin: 16px 0 4px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.meta .artist {
  margin: 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.meta .tagline {
  margin: 10px 0 0;
  font-family: var(--head);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
}
.meta .stats { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.05em; }

.tracklist { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.tracklist ol { list-style: none; padding: 0; margin: 0; }
.tracklist li {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 13px 16px;
  background: var(--row);
  border: 1px solid transparent;
  border-radius: 9px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.tracklist li:hover { background: var(--row-hover); }
.tracklist li.active { background: var(--row-hover); border-color: var(--accent); }
.tracklist .num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.tracklist .title { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.tracklist .dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.88rem; }

/* INST badge */
.tracklist .badge-skit {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(201,162,39,0.16); color: var(--accent-soft);
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; flex: none;
}

/* Player bar — frosted dark */
.player {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(15,14,12,0.92);
  backdrop-filter: saturate(1.3) blur(18px);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.now-playing { text-align: center; color: var(--accent-soft); font-weight: 500; margin-bottom: 8px; min-height: 1.2em; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.82rem; width: 3.5ch; }
#seek { flex: 1; height: 28px; -webkit-appearance: none; appearance: none; background: transparent; outline: none; cursor: pointer; }
#seek::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--accent) var(--seek-pct, 0%), rgba(237,230,214,0.18) var(--seek-pct, 0%));
  border-radius: 2px;
}
#seek::-moz-range-track { height: 4px; background: rgba(237,230,214,0.18); border-radius: 2px; }
#seek::-moz-range-progress { height: 4px; background: var(--accent); border-radius: 2px; }
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); margin-top: -5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#seek::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.controls { display: flex; justify-content: center; align-items: center; gap: 28px; padding-top: 12px; }
.controls button {
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg); -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.controls button:active { transform: scale(0.92); }
.btn-skip { width: 48px; height: 48px; color: var(--fg); opacity: 0.8; border-radius: 50%; }
.btn-skip:hover { opacity: 1; background: rgba(255,255,255,0.05); }
.btn-play {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #0d0c0b;
  box-shadow: 0 6px 24px rgba(201,162,39,0.4);
}
.btn-play:hover { transform: scale(1.04); }
.btn-play:active { transform: scale(0.94); }

/* Loading pulse */
.tracklist li.loading { position: relative; overflow: hidden; }
.tracklist li.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,0.10), transparent);
  transform: translateX(-100%); animation: pulse 1.2s linear infinite; pointer-events: none;
}
@keyframes pulse { to { transform: translateX(100%); } }

/* Share button */
.btn-share-album {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 7px 18px; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn-share-album:hover { background: rgba(201,162,39,0.12); }
.btn-share-album:active { transform: scale(0.97); }

.tracklist .row-actions { display: flex; align-items: center; gap: 4px; }
.tracklist .row-btn {
  background: transparent; border: none; padding: 6px; border-radius: 8px;
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s ease, background 0.12s ease;
}
.tracklist .row-btn:hover { color: var(--accent-soft); background: rgba(255,255,255,0.06); }
.tracklist li.active .row-btn { color: var(--accent-soft); }

/* Equalizer */
.tracklist .eq { display: none; align-items: flex-end; gap: 2px; width: 14px; height: 14px; flex: none; }
.tracklist li.active .eq { display: inline-flex; }
.tracklist .eq i { display: block; width: 3px; height: 40%; background: var(--accent); border-radius: 1px; }
.tracklist li.active.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.tracklist .eq i:nth-child(1) { animation-delay: -0.2s; }
.tracklist .eq i:nth-child(2) { animation-delay: -0.5s; }
.tracklist .eq i:nth-child(3) { animation-delay: -0.8s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .tracklist li.active.playing .eq i { animation: none; height: 60%; }
}

/* Errored row */
.tracklist li.errored { border-color: rgba(224,107,107,0.5); opacity: 0.7; }
.tracklist li.errored .dur::after { content: " ⚠"; color: #e06b6b; }

/* Lyrics panel */
.lyrics-panel {
  background: var(--row); border-radius: 9px; margin: 0 0 7px; padding: 16px 18px;
  font-size: 0.95rem; line-height: 1.6; color: var(--fg);
  white-space: pre-wrap; border-left: 3px solid var(--accent);
}

/* Footer */
.site-footer {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.05em;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--accent-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(180px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,28,24,0.96); color: var(--fg);
  padding: 10px 18px; border-radius: 999px; font-size: 0.88rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 10;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
