:root {
  --bg: #081522;
  --panel: rgba(22, 39, 58, 0.34);
  --panel-2: rgba(36, 59, 84, 0.3);
  --border: rgba(177, 216, 255, 0.26);
  --text: #e8f4ff;
  --soft: #aac0d7;
  --accent: #31ddb5;
  --accent-2: #5cead0;
  --cover-glow: 49, 221, 181;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 10px;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 8% 12%, rgba(36, 198, 220, 0.3) 0%, rgba(36, 198, 220, 0) 42%),
    radial-gradient(circle at 90% 16%, rgba(255, 94, 98, 0.2) 0%, rgba(255, 94, 98, 0) 40%),
    radial-gradient(circle at 82% 88%, rgba(255, 196, 0, 0.2) 0%, rgba(255, 196, 0, 0) 44%),
    radial-gradient(circle at 14% 84%, rgba(49, 221, 181, 0.22) 0%, rgba(49, 221, 181, 0) 44%);
  background-size: 6px 6px, 6px 6px, auto, auto, auto, auto;
}

body[data-theme="light"] {
  --bg: #edf4ff;
  --panel: rgba(255, 255, 255, 0.42);
  --panel-2: rgba(236, 244, 255, 0.46);
  --border: rgba(15, 42, 76, 0.18);
  --text: #13253a;
  --soft: #445d79;
  --accent: #02866f;
  --accent-2: #03ab8f;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(19, 37, 58, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 37, 58, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 10% 12%, rgba(2, 134, 111, 0.13) 0%, rgba(2, 134, 111, 0) 42%),
    radial-gradient(circle at 87% 12%, rgba(210, 94, 107, 0.11) 0%, rgba(210, 94, 107, 0) 40%),
    radial-gradient(circle at 90% 88%, rgba(255, 171, 0, 0.1) 0%, rgba(255, 171, 0, 0) 42%),
    radial-gradient(circle at 14% 86%, rgba(0, 116, 204, 0.1) 0%, rgba(0, 116, 204, 0) 42%);
  background-size: 6px 6px, 6px 6px, auto, auto, auto, auto;
}

.v-player {
  --play-pulse: 1;
  width: min(352px, 93vw);
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(155deg, rgba(9, 30, 51, 0.78), rgba(54, 28, 54, 0.58), rgba(25, 55, 45, 0.66)),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: auto, 7px 7px, 7px 7px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.maintenance-banner {
  position: relative;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 171, 0, 0.38);
  background: rgba(255, 171, 0, 0.14);
  color: #ffe9b5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

body[data-theme="light"] .maintenance-banner {
  border-color: rgba(176, 107, 0, 0.28);
  background: rgba(255, 196, 107, 0.25);
  color: #644100;
}

.track-flash-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 30% 32%, rgba(var(--cover-glow), 0.38) 0%, rgba(var(--cover-glow), 0) 58%);
}

.fx-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(var(--cover-glow), 0.26) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(255, 255, 255, 0.12) 0 1px, transparent 1.3px);
  background-size: 20px 20px, 28px 28px;
  animation: particlesDrift 20s linear infinite;
}

.v-player::before {
  content: "";
  position: absolute;
  inset: -12% -25% auto;
  height: 190px;
  background: radial-gradient(circle, rgba(var(--cover-glow), 0.28) 0%, rgba(var(--cover-glow), 0) 68%);
  pointer-events: none;
  filter: blur(10px);
  transition: background 0.45s ease;
}

.v-player::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid rgba(var(--cover-glow), 0.14);
  pointer-events: none;
  opacity: 0;
}

.v-player.playing::after {
  opacity: 1;
  animation: neonPulse 2.4s ease-in-out infinite;
}

body[data-theme="light"] .v-player {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(239, 249, 255, 0.76), rgba(249, 239, 255, 0.72)),
    linear-gradient(rgba(19, 37, 58, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 37, 58, 0.04) 1px, transparent 1px);
  background-size: auto, 7px 7px, 7px 7px;
}

.cover-block,
.now-block,
.history-block {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.history-block {
  background: transparent;
  padding: 2px 0;
}

body[data-theme="light"] .cover-block,
body[data-theme="light"] .history-block {
  background: rgba(255, 255, 255, 0.18);
}

body[data-theme="light"] .history-block {
  background: transparent;
}

.station-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
}

.radio-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid rgba(49, 221, 181, 0.5);
  background: rgba(49, 221, 181, 0.16);
  color: #9cfde7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  max-width: calc(100% - 86px);
  overflow: hidden;
}

body[data-theme="light"] .radio-badge {
  color: #066654;
}

.wave {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.station-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onair-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffbcbc;
}

body[data-theme="light"] .onair-state {
  border-left-color: rgba(12, 35, 60, 0.25);
  color: #a52020;
}

.cone {
  width: 10px;
  height: 10px;
  background: #ff4747;
  clip-path: polygon(0% 25%, 72% 0%, 72% 100%, 0% 75%);
  border-radius: 1px;
  box-shadow: 0 0 7px rgba(255, 71, 71, 0.6);
}

.radio-badge.offline .onair-state {
  color: #ffd6d6;
}

.radio-badge.offline .cone {
  background: #ca6666;
  box-shadow: none;
}

.theme-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(14, 33, 55, 0.58);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 7px 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

body[data-theme="light"] .theme-btn {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px rgba(19, 37, 58, 0.06), 0 4px 10px rgba(19, 37, 58, 0.08);
}

.cover-wrap {
  --cover-size: 214px;
  --disc-size: 232px;
  --disc-exposed: 40%;
  position: relative;
  width: min(322px, 100%);
  height: 258px;
  margin: 0 auto;
  isolation: isolate;
}

.cover-wrap img#coverImage {
  position: absolute;
  left: 8px;
  top: 20px;
  width: var(--cover-size);
  height: var(--cover-size);
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  z-index: 2;
  transition: transform 0.45s ease, opacity 0.45s ease, filter 0.45s ease;
}

.v-player.cover-swapping .cover-wrap img#coverImage {
  opacity: 0.55;
  transform: scale(1.045);
  filter: saturate(1.14);
}

.v-player.cinema-blur .cover-wrap img#coverImage,
.v-player.cinema-blur .now-block {
  filter: blur(1.8px);
  opacity: 0.82;
}

.cover-wrap::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 24px;
  width: 210px;
  height: 210px;
  border-radius: 16px;
  background: rgba(var(--cover-glow), 0.24);
  filter: blur(20px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.disc {
  position: absolute;
  left: 88px;
  top: 16px;
  width: var(--disc-size);
  height: var(--disc-size);
  border-radius: 50%;
  z-index: 1;
  opacity: 0.95;
  transform-origin: 50.7% 49.6%;
  animation: spin 7.8s linear infinite;
  animation-play-state: paused;
}

.v-player.playing .disc {
  animation-play-state: running;
}

.v-player.vinyl-drop .disc {
  animation: spin 7.8s linear infinite, vinylDrop 0.45s ease-out 1;
}

.vinyl-shine {
  position: absolute;
  left: 126px;
  top: 24px;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 62%);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.6;
}

.play-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04251f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transform: scale(var(--play-pulse));
  transition: transform 100ms linear, box-shadow 140ms ease;
}

.v-player.playing .play-btn {
  box-shadow: 0 0 0 1px rgba(var(--cover-glow), 0.36), 0 0 16px rgba(var(--cover-glow), 0.25);
}

.v-player.perf-lite .fx-particles {
  display: none;
}

.v-player.perf-lite::before {
  filter: blur(4px);
  opacity: 0.65;
}

.v-player.perf-lite::after {
  animation: none;
}

.v-player.perf-lite .disc {
  animation: spin 7.2s linear infinite;
}

.v-player.perf-lite .vinyl-shine {
  opacity: 0.4;
}

.v-player.perf-lite .ticker-track.animate {
  animation-duration: 44s;
}

.v-player.track-flash .track-flash-layer {
  animation: trackFlash 0.26s ease-out 1;
}

.control-row {
  margin-top: 4px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.conn-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.conn-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69d38f;
  box-shadow: 0 0 8px rgba(105, 211, 143, 0.5);
}

.conn-pill.good::before {
  background: #69d38f;
  box-shadow: 0 0 8px rgba(105, 211, 143, 0.5);
}

.conn-pill.warn::before {
  background: #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.55);
}

.conn-pill.bad::before {
  background: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.55);
}

#volumeRange {
  width: 100%;
  accent-color: var(--accent);
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--soft);
}

.eyebrow strong {
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.2px;
  color: var(--text);
}

.now-block {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 4px;
}

h1 {
  margin: 1px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  line-height: 1;
  max-width: 100%;
  word-break: break-word;
}

.now-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.ticker-wrap {
  margin-top: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 26px;
}

.ticker-wrap:hover .ticker-track.animate,
.ticker-wrap:active .ticker-track.animate {
  animation-play-state: paused;
}

.status-hint {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--soft);
}

.ticker-track {
  display: inline-flex;
  width: max-content;
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 11px;
  color: var(--soft);
  transform: translateX(0);
  opacity: 0.75;
  transition: opacity 0.28s ease;
}

.ticker-item {
  display: inline-block;
  padding: 0 24px;
  white-space: nowrap;
}

.ticker-item strong {
  color: var(--text);
  font-weight: 700;
}

.ticker-track.animate {
  animation: ticker-rtl 36s linear infinite;
  opacity: 1;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 3px 0;
  border-bottom: 1px solid rgba(177, 216, 255, 0.2);
  width: 100%;
  min-width: 0;
}

body[data-theme="light"] .history-list li {
  border-bottom-color: rgba(15, 42, 76, 0.18);
}

.history-list img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.history-main strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-main span {
  display: block;
  color: var(--soft);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
}

@keyframes neonPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--cover-glow), 0.14), 0 0 34px rgba(var(--cover-glow), 0.18) inset;
  }
  50% {
    box-shadow: 0 0 0 2px rgba(var(--cover-glow), 0.24), 0 0 42px rgba(var(--cover-glow), 0.22) inset;
  }
}

@keyframes ticker-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes trackFlash {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 0.58;
  }
  100% {
    opacity: 0;
  }
}

@keyframes particlesDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-32px, -18px, 0);
  }
}

@keyframes vinylDrop {
  0% {
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .v-player {
    width: 100%;
    border-radius: 14px;
    padding: 9px;
  }

  .cover-wrap {
    --cover-size: 188px;
    --disc-size: 204px;
    --disc-exposed: 40%;
    width: min(292px, 100%);
    height: 220px;
  }

  .cover-wrap img#coverImage {
    width: var(--cover-size);
    height: var(--cover-size);
    left: 6px;
    top: 16px;
  }

  .disc {
    width: var(--disc-size);
    height: var(--disc-size);
    left: 78px;
    top: 12px;
  }

  .vinyl-shine {
    left: 112px;
    top: 22px;
    width: 130px;
    height: 130px;
  }

  h1 {
    font-size: 20px;
  }

  .station-top {
    gap: 8px;
  }

  .radio-badge {
    font-size: 10px;
    padding: 5px 8px;
  }

  .status-hint {
    display: none;
  }

  .history-main span {
    display: none;
  }
}
