:root {
  --navy-950: #071a2b;
  --navy-900: #0b2842;
  --navy-800: #103b5f;
  --blue-600: #1375a8;
  --blue-100: #dff2fb;
  --cyan: #4bc6dd;
  --green: #2ca46f;
  --green-soft: #dff5e9;
  --gold: #f2b84b;
  --ink: #132535;
  --muted: #5a6d7e;
  --page: #eef4f7;
  --surface: #ffffff;
  --border: #d4e0e7;
  --shadow: 0 18px 50px rgba(9, 35, 56, 0.10);
  --radius: 18px;
  --content: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, audio { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: var(--blue-600); }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 5000;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: #fff;
  color: var(--navy-950);
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(7, 26, 43, .96);
  color: #fff;
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(calc(100% - 40px), var(--content));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: .01em; }
.brand small { margin-top: .1rem; color: #a9c2d2; font-size: .74rem; }

.nav-links { display: flex; align-items: center; gap: .3rem; }
.nav-links a {
  padding: .65rem .85rem;
  border-radius: 8px;
  color: #cbdce8;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { background: rgba(75,198,221,.13); color: #fff; }
.nav-links a.active { box-shadow: inset 0 -2px var(--cyan); }

.menu-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  padding: .55rem .75rem;
  cursor: pointer;
}

main { width: min(calc(100% - 40px), var(--content)); margin: 0 auto; padding-bottom: 4rem; }

.hero {
  position: relative;
  overflow: hidden;
  margin: 28px 0 24px;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(4, 16, 28, .80), rgba(8, 28, 43, .58), rgba(4, 16, 28, .78)),
    url("assets/images/hero-lightning.webp") center 62% / cover no-repeat;
  box-shadow: var(--shadow);
  color: #fff;
  text-align: center;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--blue-600);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--cyan); }
.hero h1 { position: relative; margin: 0; font-size: clamp(2.25rem, 6vw, 4.6rem); letter-spacing: -.05em; line-height: 1; }
.hero > p:not(.eyebrow) { position: relative; max-width: 680px; margin: 1.25rem auto 0; color: #cce0eb; font-size: clamp(1rem, 2vw, 1.25rem); }
.hero strong { color: #fff; }

.status-summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.6rem;
  padding: .55rem .85rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #e3f0f6;
  font-size: .86rem;
  font-weight: 700;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #51df96; box-shadow: 0 0 0 5px rgba(81,223,150,.13); }
.status-summary.is-offline .live-dot { background: #a7b6c0; box-shadow: none; }

.map-card, .stream-group, .content-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(9,35,56,.06);
}

.map-card { overflow: hidden; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.6rem 1rem; }
.section-heading h2 { margin: 0; color: var(--navy-900); font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.025em; }
.map-legend { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .84rem; font-weight: 700; }
.map-legend i { color: var(--blue-600); }

.tabs { display: flex; gap: .35rem; padding: 0 1.6rem; border-bottom: 1px solid var(--border); }
.tab {
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: .8rem 1rem;
  font-weight: 800;
  cursor: pointer;
}
.tab:hover, .tab.active { color: var(--navy-900); }
.tab.active { border-bottom-color: var(--blue-600); }

#map-panel { position: relative; }
#station-map { height: min(58vh, 530px); min-height: 390px; background: #dce8ee; }
.leaflet-container { position: relative; overflow: hidden; isolation: isolate; }
.leaflet-container img,
.leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; }
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas { position: absolute; top: 0; left: 0; }
.map-empty { position: absolute; z-index: 500; left: 50%; bottom: 1rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.95); color: var(--muted); font-size: .82rem; box-shadow: 0 6px 20px rgba(9,35,56,.12); }
.station-map-icon { background: transparent; }
.station-map-icon span { display: block; width: 28px; height: 28px; border: 5px solid #fff; border-radius: 50% 50% 50% 0; background: var(--navy-950); box-shadow: 0 3px 10px rgba(7,26,43,.38); transform: rotate(-45deg); }

.leaflet-popup-content-wrapper { border-radius: 12px; }
.map-popup { min-width: 205px; display: grid; gap: .28rem; color: var(--ink); }
.map-popup .popup-status { color: var(--green); font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.map-popup strong { color: var(--navy-900); font-size: 1.25rem; }
.map-popup small { color: var(--muted); }
.popup-stream-option { display: grid; gap: .2rem; margin-top: .35rem; }
.popup-stream-option button { width: 100%; }
.map-popup button, .primary-button, .play-button, .secondary-button {
  border: 0;
  border-radius: 8px;
  background: var(--navy-900);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.map-popup button { margin-top: .55rem; padding: .65rem .8rem; }

.directory { margin-top: 2rem; }
.directory > .section-heading { padding-inline: 0; }
.directory-tabs { margin-bottom: 1rem; padding-inline: 0; }
.secondary-button { padding: .7rem .95rem; background: #fff; border: 1px solid var(--border); color: var(--navy-900); }
.secondary-button:hover { background: var(--blue-100); }
.secondary-button:disabled { opacity: .6; cursor: wait; }
.stream-groups { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.stream-group { overflow: hidden; }
.stream-group[hidden] { display: none; }
.group-title { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--border); }
.group-title h3 { margin: 0; color: var(--navy-900); font-size: 1.15rem; }
.count-badge, .alternate-badge { border-radius: 999px; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.count-badge { padding: .35rem .55rem; background: var(--green-soft); color: #1d7c53; }
.stream-list { display: grid; }
.stream-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.stream-row:last-child { border-bottom: 0; }
.stream-row.is-offline { background: #f9fbfc; }
.stream-status span { display: block; width: 10px; height: 10px; border-radius: 50%; background: #9cadb8; }
.is-online .stream-status span { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.stream-main { min-width: 0; display: grid; gap: .12rem; }
.stream-title { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.stream-title strong { color: var(--navy-900); font-size: 1rem; }
.alternate-badge { padding: .24rem .42rem; background: #fff0d3; color: #855900; }
.stream-main > span { color: var(--ink); font-size: .82rem; overflow-wrap: anywhere; }
.stream-main .stream-facts { color: var(--blue-600); font-size: .68rem; font-weight: 800; }
.stream-main .stream-listeners { color: var(--muted); font-size: .68rem; font-weight: 700; }
.stream-main small { color: var(--muted); font-size: .72rem; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.stream-provider { display: none; }
.play-button { min-width: 72px; padding: .65rem .85rem; }
.play-button:hover { background: var(--blue-600); }
.play-button.is-playing { background: var(--cyan); color: var(--navy-950); }
.play-button.is-playing:hover { background: #72d8e9; }
.play-button:disabled { background: #dbe3e8; color: #71818d; cursor: not-allowed; }
.stream-actions { display: grid; min-width: 108px; gap: .4rem; }
.stream-actions button { width: 100%; }
.copy-link-button { padding: .48rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--navy-900); font-size: .72rem; font-weight: 800; cursor: pointer; }
.copy-link-button:hover { border-color: #9ac8df; background: var(--blue-100); }
.copy-link-button.is-copied { border-color: #82caa9; background: var(--green-soft); color: #1d7c53; }
.map-popup .copy-link-button { margin-top: .15rem; border: 1px solid var(--border); background: #fff; color: var(--navy-900); }
.map-popup .copy-link-button:hover { background: var(--blue-100); }
.loading-row, .empty-row { padding: 1.5rem; color: var(--muted); text-align: center; }

.notice { margin: 1.5rem 0; padding: 1rem; border-radius: 10px; }
.notice-error { border: 1px solid #e8c7c3; background: #fff0ee; color: #852f28; }

.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem max(20px, calc((100% - var(--content)) / 2)); background: var(--navy-950); color: #a9c2d2; font-size: .8rem; }
.site-footer p { margin: 0; }

.player-bar {
  position: fixed;
  z-index: 2000;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 54px;
  padding: .55rem max(20px, calc((100% - var(--content)) / 2));
  border-top: 1px solid rgba(255,255,255,.15);
  background: rgba(7,26,43,.98);
  box-shadow: 0 -15px 40px rgba(7,26,43,.22);
  color: #fff;
  transform: translateY(110%);
  transition: transform .22s ease;
}
.player-bar.open { transform: translateY(0); }
.player-now { min-width: 0; display: flex; align-items: center; gap: .7rem; }
.player-live-icon { color: var(--cyan); font-size: .76rem; }
.player-now strong { overflow: hidden; font-size: .92rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.player-bar audio { display: none; }
.player-controls { display: grid; grid-template-columns: auto auto auto minmax(90px, 130px); align-items: center; gap: .65rem; }
.control-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; text-decoration: none; }
.control-button:hover, .control-button:focus-visible { border-color: var(--cyan); background: rgba(75,198,221,.16); }
.stop-button { background: var(--cyan); color: var(--navy-950); box-shadow: 0 2px 10px rgba(75,198,221,.3); }
.stop-button:hover, .stop-button:focus-visible { border-color: #a5edf6; background: #72d8e9; }
.player-range { width: 100%; height: 4px; margin: 0; accent-color: var(--cyan); cursor: pointer; }

.narrow-page { max-width: 820px; min-height: calc(100vh - 220px); }
.page-intro { padding: 4.5rem 0 2rem; text-align: center; }
.page-intro h1 { margin: 0; color: var(--navy-900); font-size: clamp(2.3rem, 6vw, 4rem); letter-spacing: -.045em; }
.page-intro > p:last-child { max-width: 620px; margin: 1rem auto 0; color: var(--muted); font-size: 1.08rem; }
.content-card { padding: clamp(1.4rem, 5vw, 2.6rem); }
.narrow-page > .content-card + .content-card { margin-top: 1.25rem; }
.prose h2 { margin-top: 0; color: var(--navy-900); }
.prose p, .prose li { color: #425665; }
.prose li + li { margin-top: .5rem; }
.primary-button { display: inline-block; margin-top: 1rem; padding: .8rem 1rem; text-decoration: none; }
.disabled-link { background: #6f808c; pointer-events: none; }
.form-note { padding: .8rem 1rem; border-left: 3px solid var(--gold); background: #fff8e9; font-size: .84rem; }
.rules-list { padding-left: 1.4rem; }
.rules-list > li { margin-top: 1.15rem; padding-left: .25rem; }
.rules-list > li::marker { color: var(--navy-900); font-weight: 800; }
.rules-list ol { margin-top: .55rem; padding-left: 1.35rem; }
.disclaimer-reminder { display: flex; align-items: center; gap: .85rem; margin: 2rem 0 0; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); box-shadow: 0 8px 24px rgba(9,35,56,.05); }
.disclaimer-reminder i { color: var(--blue-600); font-size: 1.1rem; }
.disclaimer-reminder p { margin: 0; }
.mission-card { margin-top: 2rem; }
.mission-card h2 { margin: 0; color: var(--navy-900); font-size: 1.65rem; }
.mission-card p:not(.eyebrow) { margin: .75rem 0 0; color: var(--muted); }
.mission-card strong { color: var(--navy-900); }
.community-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.2rem; margin-top: 2rem; }
.community-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--blue-100); color: var(--blue-600); font-size: 1.25rem; }
.community-card h2 { margin: 0; color: var(--navy-900); font-size: 1.35rem; }
.community-card p:not(.eyebrow) { margin: .3rem 0 0; color: var(--muted); }
.community-card .primary-button { margin: 0; white-space: nowrap; }

@media (min-width: 1000px) {
  .stream-row { grid-template-columns: auto minmax(0,1fr) minmax(120px,.7fr) auto; }
  .stream-provider { min-width: 0; display: grid; }
  .stream-provider span { color: var(--muted); font-size: .66rem; text-transform: uppercase; }
  .stream-provider strong { color: var(--ink); font-size: .75rem; line-height: 1.3; overflow-wrap: anywhere; white-space: normal; }
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav-links { position: absolute; top: 76px; right: 0; left: 0; display: none; align-items: stretch; flex-direction: column; padding: .65rem 20px 1rem; border-top: 1px solid rgba(255,255,255,.12); background: var(--navy-950); }
  .nav-links.show { display: flex; }
  .stream-groups { grid-template-columns: 1fr; }
  .player-bar { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
  .player-controls { grid-template-columns: auto auto auto minmax(70px, 100px); }
  .community-card { grid-template-columns: auto minmax(0, 1fr); }
  .community-card .primary-button { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 560px) {
  .header-inner, main { width: min(calc(100% - 24px), var(--content)); }
  .brand strong { font-size: .88rem; }
  .brand small { font-size: .67rem; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .hero { margin-top: 12px; border-radius: 16px; }
  .hero h1 { font-size: 2.35rem; }
  .section-heading { align-items: start; flex-direction: column; padding: 1.2rem; }
  .map-legend { display: none; }
  .tabs { padding-inline: .8rem; }
  #station-map { min-height: 360px; }
  .directory > .section-heading { flex-direction: row; align-items: end; }
  .secondary-button { padding: .55rem .65rem; font-size: .75rem; }
  .stream-row { padding-inline: .85rem; }
  .player-controls { grid-template-columns: auto auto auto; }
  .volume-range { display: none; }
  .site-footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
