/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0d0d;
  --card-bg:  #1a1a1a;
  --accent:   #fc3c44;   /* Apple Music red */
  --text:     #f5f5f7;
  --text-dim: #86868b;
  --radius:   16px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Layout ────────────────────────────────────────────────── */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .6);
  transition: opacity .3s ease;
}

.hidden { display: none; }

/* ── Idle state ────────────────────────────────────────────── */
.icon { font-size: 3rem; margin-bottom: .75rem; }
#idle p { color: var(--text-dim); font-size: 1.1rem; }

/* ── Artwork ───────────────────────────────────────────────── */
#artwork-wrap { margin-bottom: 1.5rem; }
#artwork {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 1;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
}

/* ── Track info ────────────────────────────────────────────── */
.info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.info h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: .15rem;
}
.info h3 {
  font-size: .9rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  color: var(--text-dim);
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

#bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s linear;
}

/* ── Live radio indicator ──────────────────────────────────── */
.progress-row.live {
  justify-content: center;
}
.progress-row.live .progress-bar,
.progress-row.live #pos,
.progress-row.live #dur {
  display: none;
}
.progress-row.live::after {
  content: "\221E";  /* ∞ */
  font-size: 1.6rem;
  color: var(--text-dim);
  letter-spacing: .15em;
}

/* ── State badge ───────────────────────────────────────────── */
#state-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
#state-badge.paused {
  background: #333;
  color: var(--text-dim);
}
#state-badge.somafm {
  background: #1a1a2e;
  color: #4fc3f7;
  font-size: .7rem;
  letter-spacing: .05em;
}

/* ── History card ──────────────────────────────────────────── */
.history-card {
  text-align: left;
  padding: 1.5rem 2rem;
}

.history-card h4 {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .75rem;
}

.history-card ul {
  list-style: none;
}

.history-card li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .45rem 0;
  border-bottom: 1px solid #222;
  gap: 1rem;
}

.history-card li:last-child {
  border-bottom: none;
}

.hist-track {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hist-artist {
  font-size: .8rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
