:root {
  --blue: #0063d4;
  --red: #de0000;
  --white: #ffffff;
  --black: #000000;
  --text: #111111;
  --muted: #5b6570;
  --surface: #f6f9ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 99, 212, 0.12), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(222, 0, 0, 0.1), transparent 40%),
    var(--surface);
  line-height: 1.5;
}

.page {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 1.25rem 1rem 2rem;
}

.site-header {
  margin-bottom: 1rem;
}

.brand {
  margin: 0;
  color: var(--blue);
  font-weight: 800;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.player-card {
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.live-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.live-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(222, 0, 0, 0.4);
  animation: pulse 1.8s infinite;
}

.live-label {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.2;
}

.subtitle {
  margin: 0.45rem 0 1.2rem;
  color: var(--muted);
  max-width: 45ch;
}

.playback-block {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.play-button {
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, var(--blue), #00489c);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 99, 212, 0.32);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.play-button[aria-pressed="true"] {
  background: linear-gradient(145deg, var(--red), #b60000);
  box-shadow: 0 12px 24px rgba(222, 0, 0, 0.28);
}

.play-button:hover {
  transform: translateY(-1px);
}

.play-button:focus-visible,
.small-button:focus-visible,
.volume-slider:focus-visible {
  outline: 3px solid rgba(0, 99, 212, 0.35);
  outline-offset: 2px;
}

.waveform {
  width: min(100%, 340px);
  height: 2.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.7rem;
  background: #f0f4fb;
}

.wave-bar {
  width: 0.28rem;
  height: 28%;
  border-radius: 999px;
  background: rgba(0, 99, 212, 0.45);
  animation: eq 0.85s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.wave-bar:nth-child(2n) {
  animation-duration: 0.95s;
}

.wave-bar:nth-child(3n) {
  animation-duration: 1.05s;
}

.wave-bar:nth-child(4n) {
  animation-delay: 0.1s;
}

body[data-stream-state="playing"] .wave-bar {
  animation-play-state: running;
}

.audio-tools {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

.small-button {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.7rem;
  padding: 0.5rem 0.8rem;
  background: var(--white);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.volume-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.volume-slider {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
}

.status-text {
  margin: 0;
  color: #1f2d3d;
  font-weight: 700;
}

.hint {
  margin: 0.45rem 0 0;
  color: #45586f;
  font-size: 0.93rem;
}

.now-playing {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.now-playing h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.now-playing ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #213143;
}

.now-playing li + li {
  margin-top: 0.45rem;
}

.hidden {
  display: none !important;
}

audio {
  display: none;
}

body[data-stream-state="loading"] .status-text {
  color: var(--blue);
}

body[data-stream-state="playing"] .status-text {
  color: #0a3f77;
}

body[data-stream-state="error"] .status-text {
  color: var(--red);
}

@keyframes eq {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1.2);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(222, 0, 0, 0.35);
  }
  70% {
    box-shadow: 0 0 0 0.6rem rgba(222, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(222, 0, 0, 0);
  }
}

@media (min-width: 768px) {
  body {
    display: grid;
    place-items: center;
    padding: 2rem;
  }

  .page {
    padding: 0;
  }

  .player-card {
    padding: 1.75rem;
    border-radius: 1.4rem;
  }

  .playback-block {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: stretch;
  }

  .waveform {
    height: 3.1rem;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .wave-bar {
    animation: none !important;
  }

  .play-button {
    transition: none;
  }
}
