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

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  --bg: #07070f;
  --surface: #0d0d1e;
  --surface-2: #12122a;
  --border: rgba(255, 255, 255, 0.07);

  --neon-pink: #ff2d6b;
  --neon-cyan: #00f0ff;

  --text: #dde0ff;
  --text-muted: #55578a;
  --text-dim: #9597cc;

  --glow-pink:
    0 0 24px rgba(255, 45, 107, 0.45), 0 0 60px rgba(255, 45, 107, 0.15);
  --glow-cyan:
    0 0 24px rgba(0, 240, 255, 0.45), 0 0 60px rgba(0, 240, 255, 0.15);

  --font: "Inter", system-ui, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────────── */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
}

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.overlay-logo {
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -3px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(255, 45, 107, 0.6));
}

.overlay-sub {
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 3px;
}

#btn-tune-in {
  margin-top: 16px;
  padding: clamp(14px, 2vh, 20px) clamp(40px, 5vw, 64px);
  background: transparent;
  border: 1.5px solid var(--neon-pink);
  border-radius: 60px;
  color: var(--neon-pink);
  font-family: var(--font);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 4px;
  cursor: pointer;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}
#btn-tune-in:hover {
  background: rgba(255, 45, 107, 0.1);
  box-shadow: var(--glow-pink);
}

.overlay-legal {
  font-size: clamp(9px, 0.75vw, 11px);
  letter-spacing: 1.5px;
  color: var(--text-muted);
  opacity: 0.45;
  text-align: center;
}

/* ── Player — full-viewport head unit ────────────────────────────────────────── */
#player {
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: row;
}

/* ── Left panel: station artwork & identity ──────────────────────────────────── */
.artwork-wrap {
  position: relative;
  width: 38%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 6%;
  background: var(--surface);
  overflow: hidden;
  border-right: 1px solid var(--border);
}

/* blurred background wash */
.artwork-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  filter: blur(50px) saturate(1.8);
  opacity: 0.4;
  transition: background-image 0.6s;
}

.artwork-logo {
  position: relative;
  z-index: 1;
  width: 65%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  filter: drop-shadow(0 6px 32px rgba(0, 0, 0, 0.7));
  transition: opacity 0.3s;
}

/* ── Station-specific logo adjustments ──────────────────────────────────────── */
/* Hospital Records logo has visual weight shifted left; nudge content right.    */
.artwork-logo[data-station="hospital-records"] {
  transform: translateX(8%);
}

/* ── Right panel: track info & controls ──────────────────────────────────────── */
.right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 5vh clamp(32px, 5vw, 80px) 5vh clamp(32px, 4.5vw, 72px);
}

/* ── Top bar ─────────────────────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.station-name {
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.top-bar-end {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 24px);
}

.power-btn {
  width: clamp(32px, 3vw, 44px);
  height: clamp(32px, 3vw, 44px);
  border-radius: 50%;
  border: 1.5px solid var(--neon-pink);
  background: transparent;
  color: var(--neon-pink);
  font-size: clamp(14px, 1.4vw, 20px);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-pink);
  transition:
    opacity 0.3s,
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}
.power-btn:hover {
  opacity: 0.8;
}
.power-btn:active {
  transform: scale(0.93);
}

/* ── Off state ───────────────────────────────────────────────────────────────── */
#player.radio-off .artwork-logo {
  opacity: 0.15;
  filter: grayscale(1) drop-shadow(0 6px 32px rgba(0, 0, 0, 0.7));
  transition:
    opacity 0.4s,
    filter 0.4s;
}
#player.radio-off .artwork-bg {
  opacity: 0.08;
}
#player.radio-off .station-freq,
#player.radio-off .track-info,
#player.radio-off .progress-wrap {
  opacity: 0.2;
  transition: opacity 0.4s;
}
#player.radio-off .power-btn {
  border-color: var(--text-muted);
  color: var(--text-muted);
  box-shadow: none;
}

/* Frequency readout */
.station-freq {
  font-size: clamp(32px, 4vw, 60px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin-top: clamp(4px, 0.8vh, 10px);
  flex-shrink: 0;
}

/* ── Track info ──────────────────────────────────────────────────────────────── */
.track-info {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

@keyframes ticker {
  0%, 12%    { transform: translateX(0); }
  78%, 90%   { transform: translateX(var(--ticker-offset)); }
  91%, 100%  { transform: translateX(0); }
}

.track-artist {
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: clamp(8px, 1.2vh, 16px);
  white-space: nowrap;
  overflow: hidden;
}

.track-title {
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.track-artist > span,
.track-title > span {
  display: inline-block;
}

.track-artist.is-scrolling > span,
.track-title.is-scrolling > span {
  animation: ticker var(--ticker-duration, 8s) ease-in-out infinite;
}

/* ── Progress ────────────────────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: clamp(20px, 3.5vh, 40px);
  flex-shrink: 0;
}

.progress-bar {
  position: relative;
  height: 4px;
  background: var(--surface-2);
  border-radius: 4px;
  cursor: default;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 45, 107, 0.5);
  transition: width 0.5s linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  margin-top: clamp(8px, 1.2vh, 14px);
  font-size: clamp(11px, 1vw, 14px);
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

/* ── Navigation ──────────────────────────────────────────────────────────────── */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(20px, 3.5vh, 44px);
  flex-shrink: 0;
}

.nav-btn {
  width: clamp(48px, 5.5vw, 72px);
  height: clamp(48px, 5.5vw, 72px);
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: clamp(16px, 1.8vw, 24px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  flex-shrink: 0;
}
.nav-btn:hover {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}
.nav-btn:active {
  transform: scale(0.93);
}

.station-dots {
  display: flex;
  gap: clamp(8px, 1vw, 14px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 180px);
}

.station-dot {
  width: clamp(8px, 0.9vw, 12px);
  height: clamp(8px, 0.9vw, 12px);
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}
.station-dot.active {
  background: var(--neon-pink);
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 45, 107, 0.7);
  transform: scale(1.4);
}
.station-dot:hover:not(.active) {
  border-color: var(--text-muted);
  transform: scale(1.15);
}

/* ── Station transition animation ────────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Logo fades only — no transform, so station-specific translateX is never clobbered */
.station-changing .artwork-logo {
  animation: fadeIn 0.3s ease forwards;
}

.station-changing .track-info,
.station-changing .station-freq {
  animation: fadeSlideIn 0.3s ease forwards;
}

/* ── Legal trigger button ────────────────────────────────────────────────────── */
.legal-btn {
  width: clamp(28px, 2.4vw, 36px);
  height: clamp(28px, 2.4vw, 36px);
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition:
    opacity 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.legal-btn:hover {
  opacity: 0.8;
  border-color: var(--text-dim);
  color: var(--text-dim);
}

/* ── Copyright modal ─────────────────────────────────────────────────────────── */
.modal-legal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 7, 15, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-legal[hidden] {
  display: none;
}
.modal-legal-inner {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 45, 107, 0.25);
  border-radius: 16px;
  padding: clamp(28px, 4vw, 44px);
  max-width: 460px;
  width: 100%;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.04),
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 45, 107, 0.06);
  animation: fadeSlideIn 0.25s ease;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.modal-close:hover {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}
.modal-label {
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: clamp(16px, 2.5vh, 24px);
}
.modal-body {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--text-muted);
  line-height: 1.75;
}
.modal-body + .modal-body {
  margin-top: 12px;
}

/* ── Portrait / mobile layout ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #player {
    flex-direction: column;
  }

  /* Artwork: centred logo over blurred wash, takes upper ~40% of screen */
  .artwork-wrap {
    width: 100%;
    height: 40vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 5vw 10vw;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .artwork-logo {
    width: 55%;
    height: auto;
    max-height: 60%;
  }

  /* Right col fills remaining viewport height */
  .right-col {
    flex: 1;
    min-height: 0;
    padding: 3.5vw 6vw 4.5vw;
    overflow: hidden;
  }

  /* Frequency — slightly smaller but still prominent */
  .station-freq {
    font-size: clamp(24px, 7vw, 40px);
    margin-top: clamp(2px, 0.5vh, 6px);
  }

  .track-title {
    font-size: clamp(20px, 5.5vw, 34px);
  }

  /* Tighter vertical gaps so everything fits without scroll */
  .progress-wrap {
    margin-top: clamp(10px, 1.8vh, 22px);
  }

  .nav-row {
    margin-top: clamp(10px, 1.8vh, 24px);
  }

  /* Larger touch targets for prev/next */
  .nav-btn {
    width: clamp(50px, 12vw, 64px);
    height: clamp(50px, 12vw, 64px);
    font-size: clamp(18px, 4.5vw, 24px);
  }

  /* Bigger dots for touch */
  .station-dot {
    width: clamp(10px, 2.8vw, 14px);
    height: clamp(10px, 2.8vw, 14px);
  }

  .station-dots {
    gap: clamp(8px, 2.2vw, 14px);
    max-width: calc(100% - 130px);
  }

}
