:root {
  color-scheme: dark;
  --bg: #0c0911;
  --card: rgba(25, 18, 31, 0.88);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f8f5fa;
  --muted: #a89fad;
  --accent: #ff4d6d;
  --accent-light: #ff8095;
  --success: #53d89b;
  --danger: #ff6b6b;
  font-family: Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(120, 42, 90, 0.25), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(255, 77, 109, 0.16), transparent 32%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 440px);
  min-height: 100vh;
  padding: 32px 18px 20px;
  align-content: center;
  justify-content: center;
  gap: 18px;
}

.radio-card {
  position: relative;
  width: 100%;
  padding: 26px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.radio-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 35%);
  pointer-events: none;
}

.card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  font-size: 23px;
  font-weight: 800;
  color: white;
  background: linear-gradient(145deg, var(--accent-light), var(--accent));
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(255, 77, 109, 0.28);
  place-items: center;
}

.brand-kicker,
.track-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.card-header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.live-badge {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  color: #ffd8df;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.2);
  border-radius: 999px;
  gap: 7px;
  font-size: 11px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.55);
  animation: live-pulse 1.8s infinite;
}

.artwork {
  position: relative;
  display: grid;
  height: 230px;
  margin: 18px 0 4px;
  place-items: center;
}

.vinyl {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  background:
    repeating-radial-gradient(circle, transparent 0 5px, rgba(255, 255, 255, 0.035) 6px 7px),
    conic-gradient(from 45deg, #1c1820, #08070a, #252028, #08070a, #1c1820);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.42);
  place-items: center;
}

.vinyl::before {
  width: 72px;
  height: 72px;
  content: "";
  background: linear-gradient(145deg, var(--accent-light), #8d2443);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.12);
}

.vinyl-label {
  position: absolute;
  display: grid;
  width: 23px;
  height: 23px;
  color: rgba(255, 255, 255, 0.9);
  background: #171119;
  border-radius: 50%;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.ambient-ring {
  position: absolute;
  border: 1px solid rgba(255, 77, 109, 0.16);
  border-radius: 50%;
}

.ring-one {
  width: 216px;
  height: 216px;
}

.ring-two {
  width: 240px;
  height: 240px;
  border-color: rgba(255, 255, 255, 0.04);
}

.is-playing .vinyl {
  animation: spin 8s linear infinite;
}

.is-playing .ring-one {
  animation: ring-pulse 2.2s ease-in-out infinite;
}

.track-info {
  min-height: 74px;
  text-align: center;
}

.track-info h2 {
  margin: 0;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-info > p:last-child {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  display: grid;
  margin-top: 18px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.play-button {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  grid-column: 2;
  padding: 0;
  color: white;
  cursor: pointer;
  background: linear-gradient(145deg, var(--accent-light), var(--accent));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(255, 77, 109, 0.32);
  transition: transform 160ms ease, box-shadow 160ms ease;
  place-items: center;
}

.play-button:hover {
  box-shadow: 0 17px 38px rgba(255, 77, 109, 0.42);
  transform: translateY(-2px);
}

.play-button:active {
  transform: translateY(0) scale(0.97);
}

.play-button:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(255, 128, 149, 0.45);
  outline-offset: 4px;
}

.play-button svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.play-icon {
  margin-left: -3px;
}

.pause-icon,
.spinner,
.is-playing .play-icon,
.is-loading .play-icon,
.is-loading .pause-icon {
  display: none;
}

.is-playing .pause-icon,
.is-loading .spinner {
  display: block;
}

.spinner {
  width: 23px;
  height: 23px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.volume-control {
  display: flex;
  width: 90px;
  grid-column: 3;
  justify-self: end;
  align-items: center;
  gap: 8px;
}

.volume-control svg {
  width: 19px;
  flex: 0 0 auto;
  fill: var(--muted);
}

input[type="range"] {
  width: 64px;
  height: 4px;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.stream-meta {
  display: flex;
  min-height: 34px;
  margin-top: 22px;
  padding-top: 15px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  font-size: 11px;
}

.connection-status,
.listeners {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: #706a73;
  border-radius: 50%;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 10px rgba(83, 216, 155, 0.55);
}

.status-dot.error {
  background: var(--danger);
}

footer {
  color: #6f6873;
  font-size: 11px;
  text-align: center;
}

.channel-picker {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  font-size: 12px;
}

.channel-mode {
  font-size: 12px;
  line-height: 1.9;
  margin: 0;
  color: var(--success);
}

select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  color: var(--text);
  background: #17111e;
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

select:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(255, 77, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 109, 0);
  }
}

@keyframes ring-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@media (max-width: 480px) {
  .page-shell {
    padding: 14px;
  }

  .radio-card {
    padding: 21px;
    border-radius: 24px;
  }

  .artwork {
    height: 210px;
  }

  .vinyl {
    width: 175px;
    height: 175px;
  }

  .ring-one {
    width: 198px;
    height: 198px;
  }

  .ring-two {
    width: 218px;
    height: 218px;
  }

  .live-badge {
    padding: 6px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
