:root {
  --bg-primary: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(28, 38, 60, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-teal: #06b6d4;
  --accent-amber: #f59e0b;
  --on-air: #ef4444;
  --on-air-glow: rgba(239, 68, 68, 0.4);
  --off-air: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

.background-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 20% 25%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(6, 182, 212, 0.12) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 580px;
  padding: 2rem 1.25rem;
  z-index: 1;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-badge.on-air {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px var(--on-air-glow);
}

.status-badge.on-air .status-dot {
  background: var(--on-air);
  box-shadow: 0 0 8px var(--on-air);
  animation: pulse-dot 1.5s infinite;
}

.status-badge.off-air {
  color: var(--text-dim);
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.2);
}

.status-badge.off-air .status-dot {
  background: var(--off-air);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.player-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-teal), var(--accent), transparent);
}

.station-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.station-icon {
  font-size: 2.25rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
}

.station-meta h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.station-sub {
  font-size: 0.825rem;
  color: var(--accent-teal);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.visualizer-container {
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#visualizer {
  width: 100%;
  height: 100%;
  display: block;
}

.track-panel {
  text-align: center;
  margin-bottom: 1.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.track-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.track-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  min-height: 1.7rem;
  word-break: break-word;
  margin-bottom: 0.5rem;
}

.stream-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-sep {
  color: var(--text-dim);
}

.controls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #4338ca 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px -4px var(--accent-glow);
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 30px 0 var(--accent-glow);
}

.play-btn:active {
  transform: scale(0.96);
}

.play-btn.playing {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 8px 25px -4px var(--on-air-glow);
}

.btn-icon {
  width: 34px;
  height: 34px;
}

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

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

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 340px;
}

.mute-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.mute-btn:hover {
  color: var(--text-main);
}

.vol-icon {
  width: 22px;
  height: 22px;
}

#volumeSlider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.2s;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-teal);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
  transition: transform 0.15s ease;
}

#volumeSlider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#volumeSlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-teal);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
}

.volume-percent {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 32px;
  text-align: right;
  font-family: monospace;
}

.direct-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.link-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.825rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.link-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.toast {
  text-align: center;
  font-size: 0.75rem;
  color: var(--accent-teal);
  margin-top: 0.75rem;
  transition: opacity 0.3s ease;
}

footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.hidden {
  display: none !important;
}
