:root {
  --bg: #0e0f13;
  --panel: #171920;
  --text: #f2f3f5;
  --muted: #8b90a0;
  --faint: #2a2d38;
  --accent: #ff5a5f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1c1f2a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center;
}
.player {
  width: 100%; max-width: 420px;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.station { font-size: 1.15rem; font-weight: 650; letter-spacing: .01em; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; color: var(--muted); border: 1px solid var(--faint); padding: 4px 9px; border-radius: 99px; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live.on { color: var(--text); border-color: rgba(255,90,95,.45); }
.live.on .dot { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.cover-wrap { width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--panel); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .4s; }
.cover.fade { opacity: 0; }

.meta { width: 100%; text-align: center; min-height: 4.6em; }
.title { font-size: 1.35rem; font-weight: 650; overflow-wrap: anywhere; }
.artist { color: var(--text); opacity: .85; margin-top: 2px; overflow-wrap: anywhere; }
.album { color: var(--muted); font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }

.progress { width: 100%; }
.bar { height: 4px; background: var(--faint); border-radius: 2px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--text); border-radius: 2px; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem;
  margin-top: 6px; font-variant-numeric: tabular-nums; }

.play { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .12s ease, background .2s;
  -webkit-tap-highlight-color: transparent; }
.play:hover { transform: scale(1.04); }
.play:active { transform: scale(.96); }
.play:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.icon { width: 36px; height: 36px; fill: currentColor; grid-area: 1/1; }
.icon-stop, .spinner { display: none; }
.playing .icon-play, .connecting .icon-play { display: none; }
.playing .icon-stop { display: block; }
.connecting .icon-stop { display: block; opacity: .25; }
.spinner { grid-area: 1/1; width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.connecting .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { color: var(--muted); font-size: .85rem; min-height: 1.2em; margin-top: -6px; }
.status.warn { color: #ffb86b; }

.volume { width: 100%; max-width: 260px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.volume svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.volume input { flex: 1; accent-color: var(--text); height: 28px; }

.listeners { color: var(--muted); font-size: .85rem; }
.listeners span { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (min-height: 820px) { .player { padding-top: 48px; } }
