:root {
  --bg: #151836;
  --bg-deep: #0f1230;
  --surface: rgba(30, 34, 80, 0.62);
  --surface-solid: #1e2250;
  --surface-hover: rgba(58, 64, 128, 0.5);
  --line: rgba(236, 233, 255, 0.12);
  --text: #ece9ff;
  --muted: #a9a6cc;
  --faint: #7d7aa6;
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.16);
  --live: #5fe1d9;
  --danger: #ff8a80;

  --font-display: 'Bricolage Grotesque Variable', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Instrument Sans Variable', 'Segoe UI', system-ui, sans-serif;

  --player-h: 112px; /* player controls (84px) + the site information row (28px) */
  --gutter: clamp(16px, 3vw, 32px);
  --viz-dim: 0.55;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% -10%, #2a2466 0%, var(--bg) 55%, var(--bg-deep) 100%) fixed;
  color: var(--text);
  font: 400 15px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--amber); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 8px; }

/* ------------------------------------------------------------ visualizer layer */

#viz {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
body.viz-live #viz { opacity: var(--viz-dim); }
body.stage #viz { opacity: 1; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(21, 24, 54, 0.35) 0%, rgba(21, 24, 54, 0.55) 40%, rgba(15, 18, 48, 0.85) 100%);
  transition: opacity 0.6s ease;
}
body.stage .backdrop { opacity: 0; }

/* ------------------------------------------------------------ shell */

.shell {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--player-h) + 40px);
  transition: opacity 0.5s ease;
}
body.stage .shell, body.stage .player { opacity: 0; pointer-events: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 700 22px/1 var(--font-display);
  letter-spacing: -0.02em;
}
.brand svg { width: 30px; height: 30px; color: var(--amber); stroke-width: 2; }

.search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  color: var(--muted);
  transition: border-color 0.2s;
}
.search:focus-within { border-color: rgba(255, 181, 71, 0.6); }
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(0.7); }
.search kbd {
  font: 500 12px/1 var(--font-text);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
}

.top-actions { display: flex; gap: 4px; margin-left: auto; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.icon-btn[aria-pressed='true'] { color: var(--amber); }
.icon-btn[aria-pressed='true'] svg { fill: currentColor; }

/* ------------------------------------------------------------ the tuning dial */

.tuner {
  position: relative;
  margin: 8px 0 26px;
}

.band {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 8px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(15, 18, 48, 0.55);
  border: 1px solid var(--line);
}
.band button {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.band button[aria-checked='true'] { background: var(--amber-soft); color: var(--amber); }

.dial {
  position: relative;
  height: 104px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%),
    rgba(12, 14, 40, 0.72);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -18px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.dial-track {
  position: relative; /* stops measure offsetLeft against the track */
  z-index: 1; /* labels sit above the needle */
  display: flex;
  align-items: flex-end;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0 50%;
  cursor: grab;
  /* the printed scale: minor ticks every 12px, major every 60px */
  background:
    repeating-linear-gradient(90deg, rgba(236, 233, 255, 0.34) 0 1px, transparent 1px 60px) 0 14px / auto 22px no-repeat local,
    repeating-linear-gradient(90deg, rgba(236, 233, 255, 0.16) 0 1px, transparent 1px 12px) 0 14px / auto 12px no-repeat local;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.dial-track::-webkit-scrollbar { display: none; }
.dial-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }

.stop {
  flex: none;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 22px 16px;
  color: var(--faint);
  white-space: nowrap;
  transition: color 0.25s;
}
.stop .stop-name {
  font: 600 19px/1.1 var(--font-display);
  letter-spacing: -0.01em;
}
.stop .stop-count { font-size: 12px; font-variant-numeric: tabular-nums; }
.stop:hover { color: var(--text); }
.stop[aria-checked='true'] { color: var(--amber); }
.stop[aria-checked='true'] .stop-name { text-shadow: 0 0 3px #0c0e28, 0 0 8px #0c0e28, 0 0 22px rgba(255, 181, 71, 0.55); }
.stop[aria-checked='true'] .stop-count { text-shadow: 0 0 3px #0c0e28, 0 0 6px #0c0e28; }

.needle {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--amber);
  border-radius: 2px;
  box-shadow: 0 0 12px 2px rgba(255, 181, 71, 0.55);
  pointer-events: none;
  z-index: 0;
}
.needle::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -5px;
  border: 6px solid transparent;
  border-top-color: var(--amber);
}

/* ------------------------------------------------------------ content */

.content { outline: none; min-height: 40vh; }

.view-head { margin-bottom: 18px; }
.view-head h1 {
  margin: 0;
  font: 750 clamp(2.4rem, 6vw, 4.4rem)/0.95 var(--font-display);
  letter-spacing: -0.035em;
  font-variation-settings: 'wdth' 90;
}
.view-sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 20px;
}
.chips {
  display: flex;
  gap: 6px;
  flex: 1 1 420px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 18, 48, 0.4);
  color: var(--muted);
  font-size: 13.5px;
  text-transform: capitalize;
}
.chip:hover { color: var(--text); border-color: rgba(236, 233, 255, 0.3); }
.chip[aria-pressed='true'] { color: #1b1530; background: var(--amber); border-color: var(--amber); font-weight: 600; }

.selects { display: flex; gap: 8px; flex-wrap: wrap; }
.select {
  height: 36px;
  padding: 0 32px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 18, 48, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a6cc' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
  appearance: none;
  font-size: 13.5px;
  max-width: 220px;
}
.select option { background: var(--surface-solid); }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.toggle[aria-pressed='true'] { color: var(--amber); border-color: rgba(255, 181, 71, 0.5); }

.section { margin: 0 0 38px; }
.section h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  font: 650 1.55rem/1.1 var(--font-display);
  letter-spacing: -0.02em;
}
.section h2 button { font: 500 13.5px var(--font-text); color: var(--muted); }
.section h2 button:hover { color: var(--amber); }

/* ------------------------------------------------------------ station list */

.stations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 6px 14px;
}

.station {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 9px 8px 9px 9px;
  border-radius: 14px;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}
.station:hover, .station:focus-within { background: var(--surface-hover); }
.station.playing { background: var(--amber-soft); }

.art {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  --mono-bg: #2b2f66; /* each station sets its own colour inline */
  background: var(--mono-bg);
  display: grid;
  place-items: center;
  font: 700 20px/1 var(--font-display);
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.02em;
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}
.art img.ok { opacity: 1; background: #fff; }
.art img.failed { display: none; }

.station-text { min-width: 0; }
.station-name {
  font: 600 16px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.station-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-play {
  position: absolute;
  inset: 0;
  border-radius: 14px;
}
.station .fav {
  position: relative;
  z-index: 1;
  opacity: 0;
  width: 36px;
  height: 36px;
}
.station:hover .fav, .station:focus-within .fav, .station .fav[aria-pressed='true'] { opacity: 1; }
.station .fav svg { width: 19px; height: 19px; }

/* live equaliser on the playing station's artwork */
.eq {
  position: absolute;
  inset: auto 0 0 0;
  height: 26px;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.station.playing .eq { display: flex; }
.eq i { width: 4px; background: var(--live); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 15px; } }

.more-sentinel { height: 1px; }
.list-end { color: var(--faint); font-size: 13.5px; text-align: center; margin: 24px 0; }

.empty {
  padding: 48px 0;
  color: var(--muted);
  max-width: 52ch;
}
.empty h2 { font: 650 1.5rem var(--font-display); color: var(--text); margin: 0 0 6px; }
.empty button { color: var(--amber); text-decoration: underline; }

/* ------------------------------------------------------------ boot / loading */

.loading-state {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 80px 0;
  color: var(--muted);
}
.boot-dial {
  width: 240px;
  height: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(236, 233, 255, 0.25) 0 1px, transparent 1px 10px);
  position: relative;
}
.boot-dial span {
  position: absolute;
  top: -8px;
  width: 2px;
  height: 22px;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 181, 71, 0.8);
  animation: sweep 2.4s ease-in-out infinite alternate;
}
@keyframes sweep { from { left: 0; } to { left: 100%; } }

/* ------------------------------------------------------------ player */

.player {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 20px;
  padding: 0 var(--gutter);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(17, 20, 50, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
  border-top: 1px solid var(--line);
  transition: opacity 0.5s ease;
}

.np { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np-art { flex: none; }
.np-art .art { width: 52px; height: 52px; }
.np-text { min-width: 0; }
.np-station {
  font: 650 16px/1.25 var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-title {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.4em;
}
.player[data-state='playing'] .np-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  vertical-align: 1px;
}
.player[data-state='error'] .np-title { color: var(--danger); }

.transport { display: flex; align-items: center; gap: 10px; }
.play {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--amber);
  color: #1b1530;
  box-shadow: 0 6px 24px rgba(255, 181, 71, 0.35);
  transition: transform 0.12s;
}
.play:active { transform: scale(0.95); }
.play svg { fill: currentColor; stroke: none; width: 24px; height: 24px; }
.play .i-stop, .play .spinner { display: none; }
.player[data-state='playing'] .play .i-play { display: none; }
.player[data-state='playing'] .play .i-stop { display: block; }
.player[data-state='connecting'] .play .i-play { display: none; }
.player[data-state='connecting'] .play .spinner { display: block; }
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(27, 21, 48, 0.25);
  border-top-color: #1b1530;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tools { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.volume input { width: 110px; accent-color: var(--amber); }
.viz-controls { display: flex; align-items: center; gap: 2px; }
.chip-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.chip-btn:hover { color: var(--text); }
.chip-btn.on { color: var(--amber); border-color: rgba(255, 181, 71, 0.5); }

/* ------------------------------------------------------------ full-screen visuals */

.stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: none;
  pointer-events: none;
}
body.stage .stage-overlay { display: block; }
body.stage.idle, body.stage.idle * { cursor: none; }
.stage-np {
  position: absolute;
  left: clamp(20px, 5vw, 64px);
  bottom: clamp(24px, 7vh, 80px);
  max-width: min(80vw, 900px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
.stage-station { font: 750 clamp(2rem, 5vw, 4rem)/1 var(--font-display); letter-spacing: -0.03em; }
.stage-title { margin-top: 10px; font-size: clamp(1rem, 2vw, 1.4rem); color: rgba(236, 233, 255, 0.85); }
.stage-preset, .stage-hint {
  position: absolute;
  right: clamp(20px, 5vw, 64px);
  font-size: 13px;
  color: rgba(236, 233, 255, 0.7);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
  transition: opacity 0.6s;
}
.stage-preset { bottom: clamp(24px, 7vh, 80px); max-width: 40vw; text-align: right; }
.stage-hint { top: 24px; }
body.stage.idle .stage-hint, body.stage.idle .stage-preset { opacity: 0; }

/* ------------------------------------------------------------ toast & dialogs */

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(var(--player-h) + 18px);
  transform: translate(-50%, 12px);
  max-width: min(92vw, 520px);
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sheet {
  width: min(94vw, 480px);
  max-height: 88vh;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.sheet::backdrop { background: rgba(8, 9, 28, 0.6); backdrop-filter: blur(4px); }
.sheet h2 { margin: 0 0 8px; font: 700 1.6rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.sheet-lede, .muted { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.sheet label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.sheet label.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 500; }
.sheet input:not([type='checkbox']):not([type='range']), .sheet select {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  font-weight: 400;
}
.sheet input[type='range'] { accent-color: var(--amber); width: 150px; }
.sheet input[type='checkbox'] { accent-color: var(--amber); width: 18px; height: 18px; }
.sheet select option { background: var(--surface-solid); }
.optional { color: var(--faint); font-weight: 400; }
.sheet fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 16px 0 6px; }
.sheet legend { font: 650 15px var(--font-display); padding-right: 10px; color: var(--amber); }
.sheet fieldset .ghost { margin: 0 8px 10px 0; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.primary, .ghost { height: 40px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.primary { background: var(--amber); color: #1b1530; }
.ghost { border: 1px solid var(--line); color: var(--text); }
.ghost:hover { border-color: rgba(236, 233, 255, 0.35); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-deep); margin-bottom: 14px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 14px; color: var(--muted); }
.seg button[aria-checked='true'] { background: var(--amber-soft); color: var(--amber); font-weight: 600; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 860px) {
  .volume { display: none; }
  .player { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .tools { display: none; }
  .transport #prev, .transport #next { display: none; }
}

@media (max-width: 640px) {
  :root { --player-h: 104px; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search kbd { display: none; }
  .dial { height: 88px; }
  .stop { padding: 0 16px 12px; }
  .stop .stop-name { font-size: 17px; }
  .stations { grid-template-columns: 1fr; }
  .station .fav { opacity: 1; }
  .np-art .art { width: 44px; height: 44px; }
  .play { width: 48px; height: 48px; }
}

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

/* ================================================================ Alpha additions */

.brand-group { display: flex; align-items: center; gap: 12px; }
.topbar { position: relative; z-index: 10; } /* keeps the version menu above the dial */

/* ------------------------------------------------------------ adverts */

.stations > .ad-slot { grid-column: 1 / -1; }
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  margin: 6px 0;
  padding: 22px 14px 10px;
  border-radius: 14px;
  border: 1px dashed rgba(236, 233, 255, 0.18);
  background: rgba(15, 18, 48, 0.45);
  color: var(--text);
  text-decoration: none;
}
.ad-label { position: absolute; top: 6px; left: 14px; font-size: 11.5px; color: var(--faint); }
.ad-slot ins { flex: 1; }
.ad-slot.house img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.ad-slot.house .ad-text { color: var(--muted); font-size: 14px; }
.ad-slot.house strong { color: var(--text); }

/* ------------------------------------------------------------ about & footer */

.prose { max-width: 68ch; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.prose h2 { margin: 30px 0 8px; font: 650 1.3rem/1.2 var(--font-display); color: var(--text); letter-spacing: -0.015em; }
.prose p { margin: 0 0 12px; }
.credits { padding-left: 18px; margin: 0; }
.credits li { margin-bottom: 6px; }
.authors { font-size: 13.5px; color: var(--faint); }

.section.spaced { margin-top: 38px; }


.file-btn { display: inline-flex !important; align-items: center; cursor: pointer; margin: 0 8px 10px 0 !important; font-weight: 600 !important; }

/* ------------------------------------------------------------ full-screen song */

.stage-song { font: 750 clamp(2rem, 5vw, 4rem)/1 var(--font-display); letter-spacing: -0.03em; }
.stage-artist { margin-top: 10px; font-size: clamp(1.1rem, 2.4vw, 1.7rem); color: rgba(236, 233, 255, 0.9); }
.stage-np .stage-station { margin-top: 14px; font: 600 15px/1.2 var(--font-text); letter-spacing: 0; color: rgba(255, 181, 71, 0.9); }
.stage-song:empty + .stage-artist:empty + .stage-station { font: 750 clamp(2rem, 5vw, 4rem)/1 var(--font-display); color: var(--text); }


/* ------------------------------------------------------------ side panels */

:root { --left-w: 360px; --right-w: 340px; --pop-gap: 16px; }

/* Both panels are floating pop-up cards: they sit over the page (it never
   moves), only as tall as their content, with rounded corners. */
.dock {
  position: fixed;
  z-index: 8;
  bottom: calc(var(--player-h) + var(--pop-gap));
  max-height: calc(100vh - var(--player-h) - 96px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  /* A lighter card than the page so it stands out when it opens. Secondary
     text is lightened to match, so it stays easy to read (WCAG AA). */
  --muted: #c9c6ea;
  --faint: #b3b0da;
  --line: rgba(236, 233, 255, 0.16);
  border: 1px solid rgba(236, 233, 255, 0.24);
  background: rgba(52, 59, 124, 0.94);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: pop-in 0.2s ease-out;
  transform-origin: bottom center;
}
.dock-left { left: var(--pop-gap); width: var(--left-w); transform-origin: bottom left; }
.dock-right { right: var(--pop-gap); width: var(--right-w); transform-origin: bottom right; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
body.stage .dock, body.stage .dock-buttons, body.stage .coffee-btn { display: none; }

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 6px 20px;
}
.dock-head .icon-btn { width: 36px; height: 36px; margin: -2px -2px 0 0; }
.dock-head .icon-btn svg { width: 20px; height: 20px; }
.dock-head h2 { margin: 0; font: 700 1.3rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.dock-body { flex: 1; min-height: 0; overflow-y: auto; }

/* The buttons that open each panel */
.dock-buttons {
  position: fixed;
  z-index: 5;
  left: 16px;
  bottom: calc(var(--player-h) + 16px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
body.left-open .dock-buttons { display: none; }
/* Large round icon buttons; their names show as tooltips and are read out
   by screen readers (aria-label). */
.dock-btn, .coffee-btn {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 181, 71, 0.5);
  background: rgba(21, 24, 54, 0.72);
  backdrop-filter: blur(8px);
  color: var(--amber);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, background 0.15s;
}
.dock-btn:hover, .coffee-btn:hover { background: rgba(52, 59, 124, 0.9); transform: scale(1.06); }
.dock-btn:active, .coffee-btn:active { transform: scale(0.96); }
.dock-btn svg, .coffee-btn svg { width: 28px; height: 28px; stroke-width: 1.8; }
.coffee-btn { position: fixed; z-index: 5; right: 16px; bottom: calc(var(--player-h) + 16px); }
body.right-open .coffee-btn { display: none; }

/* Now playing tab */
.info { padding: 4px 18px 22px; }
.info-empty { padding: 12px 2px; }
/* Logo pinned top-left; the text flows beside it, then full width below. */
.info-station { display: flow-root; margin-bottom: 8px; }
.info-station .art { float: left; width: 76px; height: 76px; margin: 2px 14px 6px 0; border-radius: 14px; font-size: 24px; }
.info-kicker { margin: 0 0 3px; font-size: 12.5px; font-weight: 600; color: var(--live); }
.info-name { margin: 0; font: 700 1.3rem/1.15 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.info .muted { margin: 4px 0 0; }
.info-block { padding: 16px 0 2px; border-top: 1px solid var(--line); margin-top: 14px; }
.info-block h4 { margin: 0 0 8px; font: 650 14px/1.2 var(--font-display); color: var(--amber); }
.info .fine, .coffee .fine { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.info-block.support p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--text); opacity: 0.9; }
.support-link, .coffee-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #1b1530;
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
}
.support-link:hover, .coffee-cta:hover { filter: brightness(1.08); }
.support-link svg { width: 16px; height: 16px; stroke-width: 2.2; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.info-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.link-btn { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }

/* Support panel: the coffee call to action first, other ways to help below */
.coffee { padding: 8px 22px 24px; display: flex; flex-direction: column; }
.coffee-hero { text-align: center; padding: 10px 0 22px; }
.coffee-icon { width: 56px; height: 56px; color: var(--amber); stroke-width: 1.5; }
.coffee-pitch { margin: 8px 0 6px; font: 750 1.7rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.coffee-lede { margin: 0 auto 20px; max-width: 30ch; font-size: 15px; line-height: 1.55; color: var(--text); opacity: 0.88; }
.coffee-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 14px;
  background: var(--amber);
  color: #1b1530;
  font: 700 17px/1 var(--font-text);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(255, 181, 71, 0.3);
  transition: transform 0.12s, filter 0.15s;
}
.coffee-cta:hover { filter: brightness(1.07); }
.coffee-cta:active { transform: scale(0.98); }
.coffee-cta svg { width: 22px; height: 22px; }
.coffee-cta-soon { margin: 0; background: rgba(255, 181, 71, 0.18); color: var(--amber); box-shadow: none; cursor: default; }
.coffee-hero .fine { margin: 14px auto 0; max-width: 34ch; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.coffee-more { padding-top: 16px; border-top: 1px solid var(--line); }
.coffee-more h3 { margin: 0 0 8px; font: 600 13.5px/1.2 var(--font-text); color: var(--muted); }
.coffee-more .help-list { padding-left: 16px; gap: 6px; font-size: 13.5px; color: var(--muted); }
.help-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.5; }

@media (max-width: 640px) {
  .dock-left, .dock-right { left: 8px; right: 8px; width: auto; }
  .dock-btn, .coffee-btn { width: 50px; height: 50px; }
  .dock-btn svg, .coffee-btn svg { width: 24px; height: 24px; }
  .dock-buttons { flex-direction: row; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* "No station currently playing": resume the last station */
.info-empty .muted { margin: 6px 0 0; }
.info-station.resume { margin: 12px 0 14px; } /* uses the playing view's logo-and-wrap layout */
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #1b1530;
  font-weight: 650;
  font-size: 14px;
}
.resume-btn:hover { filter: brightness(1.08); }
.resume-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* About page: libraries compiled into another one sit beneath it */
.credits li.bundled { margin-left: 22px; list-style: circle; font-size: 14.5px; }

/* ------------------------------------------------------------ site information row */

.legal {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 28px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}
.legal a { color: var(--muted); text-decoration: none; }
.legal a:hover { color: var(--amber); }
.legal .legal-company { color: var(--text); opacity: 0.85; }
.legal-credit { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.legal-credit a { text-decoration: underline; text-underline-offset: 2px; }
/* On the standalone Terms and Privacy pages it sits at the end of the page. */
.legal.legal-page { height: auto; flex-wrap: wrap; white-space: normal; margin: 40px 0 0; padding: 16px 0 0; }
.legal.legal-page .legal-credit { margin-left: 0; flex-basis: 100%; }

@media (max-width: 860px) {
  .legal-credit { display: none; }
  .legal { gap: 14px; }
}
@media (max-width: 480px) {
  .legal .legal-company { font-size: 0; }
  .legal .legal-company::after { content: '© Dragontech'; font-size: 12px; }
}
