:root {
  --bg: #ffd400;          /* yellow */
  --text: #0a0a0a;        /* black  */
  --muted: rgba(0, 0, 0, 0.55);
  --panel: rgba(0, 0, 0, 0.06);
  --panel-hi: rgba(0, 0, 0, 0.12);
  --accent: #0a0a0a;      /* black accent on yellow */
  --line: rgba(0, 0, 0, 0.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(56px + var(--safe-top)) 18px calc(24px + var(--safe-bot));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- NOW PLAYING ---------- */
.now {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.art {
  width: min(74vw, 510px);
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: rgba(0,0,0,.08);       /* placeholder until the image paints */
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.art.playing { transform: scale(1); }
.art:not(.playing) { transform: scale(.94); }

.art-fallback {
  font-size: 72px;
  color: rgba(0,0,0,.85);
}

.meta {
  text-align: center;
  width: 100%;
  min-height: 46px;
}
.title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist {
  color: var(--muted);
  font-size: 15px;
  margin-top: 2px;
}

/* ---------- SCRUBBER ---------- */
.scrubber { width: 100%; }
.times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--fill, 0%),
    rgba(0,0,0,.18) var(--fill, 0%),
    rgba(0,0,0,.18) 100%
  );
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
}
input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -4.5px;
  /* border-radius: 50%; */
  background: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: none;
  /* border-radius: 50%; */
  background: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* ---------- CONTROLS ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, color .2s ease;
}
.btn:active { transform: scale(.9); }
.btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* solid-fill icons (play/pause/prev/next triangles) */
#playIcon path, #pauseIcon path { fill: currentColor; stroke: none; }
#prevBtn svg, #nextBtn svg { fill: currentColor; }
#prevBtn svg path, #nextBtn svg path { stroke: currentColor; stroke-width: 1.5; }

.btn.play {
  width: 72px;
  height: 72px;
  background: #000;
  color: var(--bg);        /* yellow glyph on black */
  /* box-shadow: 0 10px 24px -10px rgba(0,0,0,.55); */
}
.btn.play svg { width: 32px; height: 32px; }
.btn.ghost { color: var(--muted); }
.btn.ghost.active {
  color: #fff;
  background: #000;
}

/* ---------- LIBRARY ---------- */
.library {
  background: var(--panel);
  border: 1px solid var(--line);
  /* border-radius: 18px; */
  padding: 8px;
}
.lib-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lib-head .count { color: var(--muted); font-weight: 400; font-size: 13px; }

.tracklist { list-style: none; margin: 0; padding: 0; }
.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.track:active { background: var(--panel-hi); }
@media (hover: hover) {
  .track:hover { background: var(--panel-hi); }
}
.track .idx {
  width: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.track .info { min-width: 0; flex: 1; }
.track .t-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.track .t-artist {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: .5rem;
}
.track.current { background: rgba(0,0,0,.14); }
.track.current .t-title { color: var(--text); font-weight: 700; }
.track.current .idx { display: none; }

/* animated equalizer bars for the playing row */
.eq {
  width: 22px; height: 16px;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex: none;
}
.track.current .eq { display: flex; }
.eq span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  height: 30%;
}
.track.current.playing .eq span { animation: bounce .9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: .2s; }
.eq span:nth-child(3) { animation-delay: .4s; }
.eq span:nth-child(4) { animation-delay: .1s; }
@keyframes bounce {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}
