:root {
  --bg: #0b0b0f;
  --card: #15151c;
  --card-2: #1c1c25;
  --line: #2a2a35;
  --ink: #f2f2f5;
  --muted: #8b8b9a;
  --accent: #fa2d48; /* Apple Music red, near enough */
  --accent-dim: #3a1520;
  --gold: #e8b84b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- header */

.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 19px; margin: 0; letter-spacing: -0.02em; }
.dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(250, 45, 72, 0.7);
}
.top-meta { display: flex; align-items: center; gap: 10px; }
.countdown {
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--muted);
}

.badge {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.live { color: #4ade80; border-color: #1c5233; }
.badge.mock { color: var(--gold); border-color: #4a3c15; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.02em; }
.card h3 { margin: 0 0 4px; font-size: 14px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.question-card { background: linear-gradient(160deg, #1d1420, var(--card) 60%); }
.q-label { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
#q-date { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
#question { font-size: 24px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.02em; }

.muted { color: var(--muted); margin: 0 0 12px; }
.tiny { font-size: 12.5px; }
.error { color: var(--accent); font-size: 13px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; align-items: flex-start; }

.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 100px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- inputs */

input {
  flex: 1; width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
input:focus { border-color: #46465a; }

button {
  background: var(--accent); color: white;
  border: none; border-radius: 10px;
  padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.45; cursor: default; filter: none; }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-weight: 500; padding: 7px 12px; font-size: 12.5px;
}
button.linkish {
  background: none; color: var(--muted); padding: 0; font-weight: 400;
  font-size: 13px; text-decoration: underline;
}

/* ---------------------------------------------------------------- songs */

.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.results li:hover { background: var(--card-2); }

.art {
  width: 44px; height: 44px; border-radius: 6px; flex: 0 0 44px;
  background: var(--card-2); object-fit: cover;
  display: grid; place-items: center; color: var(--muted); font-size: 15px;
}

.song { display: flex; align-items: center; gap: 12px; }
.song-text { min-width: 0; flex: 1; }
.song-title {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-artist { color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song.mine { padding: 10px; background: var(--card-2); border-radius: 10px; }

/* ---------------------------------------------------------------- feed */

.feed { list-style: none; padding: 0; margin: 12px 0 0; }
.feed li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 10px; border: 1px solid transparent;
}
.feed li + li { margin-top: 2px; }
.feed li.top-ten { border-color: #33301f; background: rgba(232, 184, 75, 0.04); }
.feed li.is-mine { background: var(--accent-dim); }

.rank {
  width: 22px; flex: 0 0 22px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px;
}
.feed li.top-ten .rank { color: var(--gold); }

.by { font-size: 12px; color: var(--muted); margin-top: 2px; }

.like {
  display: flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 100px;
  padding: 5px 11px; font-size: 13px; font-weight: 500;
}
.like.on { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.like:disabled { opacity: 0.35; }

/* ---------------------------------------------------------------- playlist */

.playlist-card { border-color: #2f2438; background: linear-gradient(160deg, #191426, var(--card) 70%); }
.count {
  font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em; line-height: 1;
}

/* ---------------------------------------------------------------- misc */

.leaderboard { list-style: none; padding: 0; margin: 10px 0 0; }
.leaderboard li {
  display: flex; justify-content: space-between; padding: 7px 2px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .cred { color: var(--gold); font-variant-numeric: tabular-nums; }

.foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 4px; font-size: 13px;
}

.empty { color: var(--muted); font-size: 13.5px; padding: 14px 2px; }

/* provider CTA + availability warnings (added with the multi-provider rebuild) */
.cta {
  display: inline-block; margin-left: 12px; white-space: nowrap;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 100px; padding: 5px 11px;
}
.cta:hover { color: var(--ink); border-color: #46465a; }
.by.warn { color: var(--gold); }
.art { font-weight: 700; }
#playlist-actions { flex-wrap: wrap; }

/* Cover art: square, never cropped or letterboxed, never overlaid. */
img.art { object-fit: cover; background: var(--card-2); }

/* share card preview — the canvas is 1080x1920; show it at a legible fraction */
.card-canvas {
  display: block;
  width: 100%;
  max-width: 270px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 12px;
}

/* scope toggle */
button.ghost.on { color: var(--ink); border-color: var(--accent); background: var(--accent-dim); }
.people-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-radius: 10px; }
.people-row:hover { background: var(--card-2); }
