/* === Galactic Radio — Station XR-7 === */

:root {
  --bg-deep: #0a0c10;
  --bg-panel: #0f1118;
  --bg-card: #141822;
  --accent: #00e5a0;
  --accent-dim: #00e5a033;
  --accent-glow: #00e5a066;
  --text: #c8d6e5;
  --text-muted: #5a6a7a;
  --danger: #ff4757;
  --amber: #ffc048;
  --font-mono: 'Space Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Atmosphere overlays --- */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
}

/* --- Header --- */
.station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--accent-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

.freq-badge {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
}

.freq-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.freq-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.freq-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.station-id {
  text-align: center;
  flex: 1;
  min-width: 180px;
}

.station-id h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}

.station-id .accent {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

.signal-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.signal-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.bar {
  width: 4px;
  background: var(--accent);
  border-radius: 1px;
  animation: pulse-bar 1.8s ease-in-out infinite;
}

.bar-1 { height: 5px; animation-delay: 0s; }
.bar-2 { height: 9px; animation-delay: 0.15s; }
.bar-3 { height: 14px; animation-delay: 0.3s; }
.bar-4 { height: 11px; animation-delay: 0.45s; }
.bar-5 { height: 18px; animation-delay: 0.6s; }

@keyframes pulse-bar {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- Main content --- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Visualizer --- */
.visualizer-section {
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  overflow: hidden;
}

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

.now-playing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--accent-dim);
  overflow: hidden;
}

.np-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.np-track {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  animation: scroll-track 14s linear infinite;
}

@keyframes scroll-track {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Transmission Log --- */
.transmission-log {
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--accent-dim);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.log-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.log-time {
  margin-left: auto;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.75rem;
}

.log-entries {
  padding: 0.75rem 1rem;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.log-entry {
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0;
  animation: fade-in 0.4s ease forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

.log-ts {
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.log-src {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.4rem;
}

.log-msg {
  color: var(--text);
}

.log-msg.warn { color: var(--amber); }
.log-msg.error { color: var(--danger); }

/* --- Dial & Info cards --- */
.dial-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.dial-card, .info-card {
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 1.25rem;
}

.dial-card h2, .info-card h2 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Range slider */
.dial-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--accent-dim);
}

.dial-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 14px var(--accent-glow);
  border: 2px solid var(--bg-deep);
}

.dial-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 14px var(--accent-glow);
  border: 2px solid var(--bg-deep);
}

.dial-readout {
  text-align: center;
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.dial-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Intel list */
.intel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.intel-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1a1f2e;
}

.intel-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.intel-key {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intel-val {
  font-size: 0.82rem;
  color: var(--text);
}

.intel-val.live {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 8px var(--accent-glow);
  position: relative;
}

.intel-val.live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5rem;
  animation: blink 1.2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  border-top: 1px solid #111420;
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .dial-section {
    grid-template-columns: 1fr 1fr;
  }

  .station-id h1 {
    font-size: 2rem;
  }

  #visualizer {
    height: 200px;
  }
}

@media (min-width: 1024px) {
  main {
    padding: 2rem 1rem;
    gap: 2rem;
  }

  .station-header {
    padding: 1.5rem 2.5rem;
  }
}

/* -- Scrollbar -- */
.log-entries::-webkit-scrollbar {
  width: 4px;
}
.log-entries::-webkit-scrollbar-track {
  background: transparent;
}
.log-entries::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 2px;
}
