/* ============================================================
   Release Player — styles
   Everything visual is driven by the tokens in :root below.
   A theme is just a set of overrides for these.
   ============================================================ */

:root {
  /* --- color --- */
  --mp-bg:            #0d0b12;
  --mp-surface:       #17141d;
  --mp-surface-2:     #201c29;
  --mp-text:          #f3efe9;
  --mp-text-dim:      #a49cb0;
  --mp-accent:        #ff8a4c;
  --mp-accent-text:   #1a0f08;
  --mp-border:        #2b2635;

  /* --- shape --- */
  --mp-radius:        14px;
  --mp-radius-sm:     8px;
  --mp-control-size:  46px;
  --mp-play-size:     62px;

  /* --- type --- */
  --mp-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mp-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- layout --- */
  --mp-max-width:     880px;
  --mp-gap:           22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: var(--mp-font);
  -webkit-font-smoothing: antialiased;
}

/* Ambient wash pulled from the album art */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--mp-art-wash, radial-gradient(circle at 50% 0%, #2a1a24, transparent 70%));
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}

.mp-page {
  position: relative;
  z-index: 1;
  max-width: var(--mp-max-width);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 28px) 80px;
}

/* ---------- header: art + meta ---------- */

.mp-head {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 36px);
  align-items: end;
  margin-bottom: var(--mp-gap);
}

@media (max-width: 620px) {
  .mp-head { grid-template-columns: 1fr; align-items: start; }
}

.mp-art-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--mp-radius);
  overflow: hidden;
  background: var(--mp-surface-2);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.75), 0 0 0 1px var(--mp-border);
}

.mp-art-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.mp-meta h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.05;
  margin: 0 0 .3em;
  letter-spacing: -.02em;
}

.mp-artist {
  font-size: 1.05rem;
  color: var(--mp-accent);
  font-weight: 600;
  margin: 0 0 .5em;
}

.mp-sub {
  color: var(--mp-text-dim);
  font-size: .9rem;
  margin: 0;
}

.mp-about {
  color: var(--mp-text-dim);
  font-size: .95rem;
  line-height: 1.6;
  margin: 1.1em 0 0;
  max-width: 52ch;
}

/* ---------- transport ---------- */

.mp-transport {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  padding: 18px 20px 16px;
  margin-bottom: var(--mp-gap);
}

.mp-now {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
  min-height: 1.4em;
}

.mp-now-title { font-weight: 600; font-size: 1rem; }
.mp-now-index {
  color: var(--mp-text-dim);
  font-size: .8rem;
  font-family: var(--mp-font-mono);
  white-space: nowrap;
}

/* seek bar */
.mp-seek {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.mp-seek-rail {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--mp-surface-2);
  overflow: hidden;
}

.mp-seek-buffered,
.mp-seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: 0%;
  border-radius: 99px;
}

.mp-seek-buffered { background: rgba(255,255,255,.10); }
.mp-seek-fill     { background: var(--mp-accent); }

.mp-seek-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px; height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: var(--mp-accent);
  transform: translateY(-50%) scale(0);
  transition: transform .14s ease;
  pointer-events: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mp-accent) 22%, transparent);
}

.mp-seek:hover .mp-seek-knob,
.mp-seek:focus-visible .mp-seek-knob,
.mp-seek.is-scrubbing .mp-seek-knob { transform: translateY(-50%) scale(1); }

.mp-seek:focus-visible .mp-seek-rail {
  box-shadow: 0 0 0 2px var(--mp-bg), 0 0 0 4px var(--mp-accent);
}

.mp-times {
  display: flex;
  justify-content: space-between;
  font-family: var(--mp-font-mono);
  font-size: .74rem;
  color: var(--mp-text-dim);
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

/* buttons */
.mp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.mp-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mp-text);
  width: var(--mp-control-size);
  height: var(--mp-control-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, opacity .15s ease;
  flex: none;
}

.mp-btn:hover  { background: var(--mp-surface-2); }
.mp-btn:active { transform: scale(.93); }
.mp-btn:focus-visible { outline: 2px solid var(--mp-accent); outline-offset: 2px; }
.mp-btn[disabled] { opacity: .35; cursor: default; }
.mp-btn[disabled]:hover { background: transparent; }
.mp-btn svg { width: 21px; height: 21px; fill: currentColor; }

.mp-btn--play {
  width: var(--mp-play-size);
  height: var(--mp-play-size);
  background: var(--mp-accent);
  color: var(--mp-accent-text);
}
.mp-btn--play:hover { background: var(--mp-accent); filter: brightness(1.08); }
.mp-btn--play svg { width: 26px; height: 26px; }

.mp-btn[aria-pressed="true"] { color: var(--mp-accent); }

.mp-spacer { flex: 1; }

/* volume */
.mp-volume { display: flex; align-items: center; gap: 6px; }
.mp-volume input[type="range"] {
  width: 84px;
  accent-color: var(--mp-accent);
  cursor: pointer;
}
@media (max-width: 560px) { .mp-volume input[type="range"] { display: none; } }

/* ---------- tracklist ---------- */

.mp-tracklist { list-style: none; margin: 0; padding: 0; }

.mp-track {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-radius: var(--mp-radius-sm);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .13s ease;
}

.mp-track:hover { background: var(--mp-surface); }
.mp-track:focus-visible { outline: 2px solid var(--mp-accent); outline-offset: -2px; }

.mp-track[aria-current="true"] { background: var(--mp-surface); }
.mp-track[aria-current="true"] .mp-track-title { color: var(--mp-accent); font-weight: 600; }

.mp-track-num {
  font-family: var(--mp-font-mono);
  font-size: .8rem;
  color: var(--mp-text-dim);
  text-align: right;
}

.mp-track[aria-current="true"] .mp-track-num { color: var(--mp-accent); }

.mp-track-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-track-dur {
  font-family: var(--mp-font-mono);
  font-size: .8rem;
  color: var(--mp-text-dim);
  font-variant-numeric: tabular-nums;
}

/* equalizer bars on the playing row */
.mp-eq { display: none; gap: 2px; align-items: flex-end; height: 13px; }
.mp-track[aria-current="true"][data-playing="true"] .mp-eq { display: flex; }
.mp-track[aria-current="true"][data-playing="true"] .mp-track-num { display: none; }
.mp-eq i {
  width: 2.5px;
  background: var(--mp-accent);
  border-radius: 1px;
  animation: mp-eq 900ms ease-in-out infinite;
}
.mp-eq i:nth-child(1) { height: 40%; animation-delay: -300ms; }
.mp-eq i:nth-child(2) { height: 90%; animation-delay: -600ms; }
.mp-eq i:nth-child(3) { height: 60%; }

@keyframes mp-eq { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .mp-eq i { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- actions ---------- */

.mp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--mp-border);
}

.mp-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 17px;
  border-radius: 99px;
  border: 1px solid var(--mp-border);
  background: var(--mp-surface);
  color: var(--mp-text);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  text-decoration: none;
}

.mp-action:hover { background: var(--mp-surface-2); border-color: var(--mp-text-dim); }
.mp-action:focus-visible { outline: 2px solid var(--mp-accent); outline-offset: 2px; }
.mp-action[hidden] { display: none; }
.mp-action svg { width: 16px; height: 16px; fill: currentColor; }

.mp-action--primary {
  background: var(--mp-accent);
  color: var(--mp-accent-text);
  border-color: transparent;
  font-weight: 600;
}
.mp-action--primary:hover { background: var(--mp-accent); filter: brightness(1.08); }

/* progress state on the offline button */
.mp-action[data-progress] {
  background:
    linear-gradient(to right,
      color-mix(in srgb, var(--mp-accent) 30%, transparent) var(--mp-progress, 0%),
      var(--mp-surface) var(--mp-progress, 0%));
}

.mp-note {
  font-size: .8rem;
  color: var(--mp-text-dim);
  margin: 14px 0 0;
  line-height: 1.5;
}

/* ---------- iOS install sheet ---------- */

.mp-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  background: var(--mp-surface);
  border-top: 1px solid var(--mp-border);
  border-radius: var(--mp-radius) var(--mp-radius) 0 0;
  padding: 22px 24px 30px;
  box-shadow: 0 -20px 50px rgba(0,0,0,.5);
}
.mp-sheet[hidden] { display: none; }
.mp-sheet h3 { margin: 0 0 10px; font-size: 1rem; }
.mp-sheet p  { margin: 0 0 8px; font-size: .875rem; color: var(--mp-text-dim); line-height: 1.55; }
.mp-sheet button { margin-top: 12px; }

/* ---------- embed mode ---------- */

body.mp-embed { background: transparent; }
body.mp-embed::before { display: none; }
body.mp-embed .mp-page { padding: 12px; max-width: none; }
body.mp-embed .mp-head { grid-template-columns: 92px minmax(0,1fr); align-items: center; gap: 14px; margin-bottom: 14px; }
body.mp-embed .mp-meta h1 { font-size: 1.15rem; }
body.mp-embed .mp-about,
body.mp-embed .mp-sub { display: none; }
body.mp-embed .mp-transport { padding: 14px 15px 12px; }
body.mp-embed .mp-actions { margin-top: 16px; padding-top: 14px; }

.mp-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The `hidden` attribute is an HTML global — SVG elements ignore it,
   so the play/pause icons need this to actually swap. */
[hidden] { display: none !important; }
