:root {
  --station-color: #b967ff;
  --bg-color: #08080f;
  --card-color: rgba(17, 17, 28, 0.9);
  --text-color: #f8f8ff;
  --muted-color: #a5a5b8;
  --border-color: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at 12% 8%,
      rgba(185, 103, 255, 0.24),
      transparent 25rem
    ),
    radial-gradient(
      circle at 88% 12%,
      rgba(0, 229, 255, 0.14),
      transparent 26rem
    ),
    var(--bg-color);
  color: var(--text-color);
  font-family: "Space Mono", monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: repeating-radial-gradient(
    circle at 20% 20%,
    rgba(255, 255, 255, 0.12) 0 1px,
    transparent 1px 5px
  );
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--station-color);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0;
}

.top-bar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--station-color);
  font-size: 0.75rem;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Anton", sans-serif;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 11vw, 7rem);
  line-height: 0.9;
  text-shadow: 0 0 24px var(--station-color);
}

.clock-box,
.station-card,
.request-card,
.floating-widget {
  border: 1px solid var(--station-color);
  background: var(--card-color);
  box-shadow: 0 0 34px rgba(185, 103, 255, 0.18);
  backdrop-filter: blur(16px);
}

.clock-box {
  width: fit-content;
  padding: 14px;
}

.clock-box span {
  color: var(--muted-color);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.clock-box strong {
  display: block;
  color: var(--station-color);
  font-size: 1.8rem;
  text-shadow: 0 0 14px var(--station-color);
}

.main-grid {
  display: grid;
  gap: 18px;
}

.station-card,
.request-card {
  padding: 20px;
}

.station-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vibe-badge,
.on-air-badge {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.vibe-badge {
  background: var(--station-color);
  color: #08080f;
}

.on-air-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 77, 77, 0.45);
  color: #ff4d4d;
}

.on-air-badge span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2b2b;
  animation: pulse 1s infinite;
}

.station-card h2 {
  margin: 28px 0 0;
  font-size: clamp(2.5rem, 12vw, 6rem);
  line-height: 1;
}

.frequency-display {
  margin: 0;
  color: var(--station-color);
  font-size: clamp(2rem, 8vw, 4rem);
  text-shadow: 0 0 20px var(--station-color);
}

.dj-name {
  margin-top: 8px;
  color: var(--muted-color);
}

.now-playing-box {
  margin: 24px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.now-playing-box span {
  color: var(--muted-color);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.now-playing-box strong {
  display: block;
  margin-top: 6px;
  color: var(--station-color);
}

.visualizer {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 160px;
  overflow: hidden;
  padding: 12px;
  background: rgba(0, 0, 0, 0.32);
}

.visualizer-bar {
  flex: 1;
  min-height: 8%;
  height: 12%;
  background: var(--station-color);
  box-shadow: 0 0 16px var(--station-color);
  transition: height 0.12s ease;
}

.controls {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.control-btn,
.request-card button {
  border: 0;
  padding: 12px 18px;
  background: var(--station-color);
  color: #08080f;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
}

.control-btn.ghost {
  border: 1px solid var(--station-color);
  background: transparent;
  color: var(--station-color);
}

.volume-control {
  display: grid;
  gap: 8px;
  color: var(--muted-color);
}

input[type="range"] {
  accent-color: var(--station-color);
}

.station-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 18px;
}

.station-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  cursor: pointer;
  padding: 10px 14px;
  font-size: 0.8rem;
}

.station-pill.active {
  border-color: var(--station-color);
  background: var(--station-color);
  color: #08080f;
}

.request-card h3 {
  margin-top: 0;
  color: var(--station-color);
}

.request-card p {
  color: var(--muted-color);
  line-height: 1.6;
}

.request-card form {
  display: grid;
  gap: 10px;
}

#requestTrackSelect {
  width: 100%;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-color);
  padding: 12px;
}

#requestTrackSelect option {
  background: #11111b;
}

.floating-zone {
  position: relative;
  min-height: 540px;
  margin-top: 22px;
}

.floating-widget {
  position: relative;
  margin-bottom: 16px;
  padding: 14px;
}

.widget-handle {
  margin-bottom: 12px;
  color: var(--station-color);
  cursor: grab;
  font-size: 0.75rem;
  text-transform: uppercase;
  user-select: none;
}

.mini-equalizer {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 70px;
}

.mini-bar {
  flex: 1;
  height: 30%;
  background: var(--station-color);
  animation: miniBounce 0.8s infinite alternate;
}

.chat-log {
  display: grid;
  gap: 10px;
  height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.chat-message {
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.chat-message strong {
  display: block;
  color: var(--station-color);
  font-size: 0.75rem;
}

.chat-message span {
  color: var(--muted-color);
  font-size: 0.85rem;
  line-height: 1.5;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
}

.stat-line strong {
  color: var(--station-color);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 43, 43, 0.5);
  }

  50% {
    transform: scale(1.4);
    box-shadow: 0 0 18px rgba(255, 43, 43, 0.9);
  }
}

@keyframes miniBounce {
  from {
    height: 18%;
  }

  to {
    height: 90%;
  }
}

@media (min-width: 768px) {
  .top-bar {
    flex-direction: row;
    align-items: start;
    justify-content: space-between;
  }

  .main-grid {
    grid-template-columns: 1.4fr 0.6fr;
  }

  .controls {
    grid-template-columns: auto auto 1fr;
    align-items: center;
  }

  .floating-zone {
    min-height: 420px;
  }

  .floating-widget {
    position: absolute;
    width: 300px;
    margin: 0;
  }

  #miniWidget {
    top: 10px;
    left: 20px;
  }

  #chatWidget {
    top: 30px;
    right: 30px;
    width: 360px;
  }

  #statsWidget {
    top: 190px;
    left: 38%;
  }
}

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