:root {
  --space: #01030a;
  --ink: #eef3ff;
  --muted: #8ea0bf;
  --faint: rgba(160, 190, 255, 0.16);
  --glass: rgba(4, 10, 26, 0.58);
  --home: #ffc24a;
  --gutter: clamp(16px, 2.2vw, 44px);
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--space);
  color: var(--ink);
  font-family: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body.idle { cursor: none; }

#globe { position: fixed; inset: 0; }

/* Vignet zodat de panelen leesbaar blijven boven de bol */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 3, 10, 0.78) 0%, transparent 26%, transparent 70%, rgba(1, 3, 10, 0.82) 100%),
    linear-gradient(0deg, rgba(1, 3, 10, 0.85) 0%, transparent 22%);
}

.brand, .stats, .feed, .bottom, .banner { position: fixed; z-index: 2; }

/* ---------- Station ---------- */

.brand { top: var(--gutter); left: var(--gutter); }

.brand h1 {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(44px, 5.4vw, 112px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--home);
  text-shadow: 0 0 40px rgba(255, 194, 74, 0.35);
}

.brand p {
  margin-top: 0.5em;
  font-size: clamp(15px, 1.25vw, 26px);
  color: var(--muted);
}

/* ---------- Totalen ---------- */

.stats {
  top: calc(var(--gutter) + clamp(120px, 10.5vw, 220px));
  left: var(--gutter);
  display: grid;
  grid-template-columns: repeat(2, max-content);
  column-gap: clamp(24px, 2.8vw, 56px);
  row-gap: clamp(10px, 1.2vw, 24px);
  align-items: start;
}

.stats > div:not(.conditions) { display: flex; flex-direction: column; }

.stats > div:not(.conditions) > strong {
  font-family: var(--cond);
  font-weight: 600;
  font-size: clamp(30px, 3.3vw, 68px);
  line-height: 1;
}

.stats > div:not(.conditions) > span {
  font-size: clamp(13px, 0.95vw, 19px);
  color: var(--muted);
}

.stats .far strong { font-size: clamp(30px, 3.3vw, 68px); }
.stats .far span + span b { color: var(--ink); font-weight: 700; }

/* ---------- Bandcondities ---------- */

.conditions[hidden] { display: none; }

.conditions {
  margin-top: clamp(6px, 0.8vw, 16px);
  font-size: clamp(12px, 0.85vw, 17px);
  min-width: 13em;
}

.conditions h2 {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.25em;
  color: var(--muted);
  margin-bottom: 0.3em;
}

.conditions h2 span { font-family: var(--text); font-weight: 400; font-size: 0.75em; }

.conditions ul { list-style: none; display: grid; gap: 0.1em; }


.conditions li span { color: var(--muted); }

.conditions b { font-weight: 600; }
.conditions .good { color: #5fe08a; }
.conditions .fair { color: #ffc24a; }
.conditions .poor { color: #ff7a6b; }
.conditions .closed { color: var(--muted); font-weight: 400; }

.conditions p { margin-top: 0.4em; max-width: 34em; color: var(--muted); font-size: 0.8em; }

/* Tabel: band, conditie, balk met clustermeldingen, aantal, waarvan EU */
.conditions { grid-column: 1 / -1; }

.conditions li {
  display: grid;
  grid-template-columns: 3.2em 5.4em 4.5em 2.2em 6.4em 4.6em auto;
  align-items: center;
  gap: 0.1em 0.6em;
}

.conditions li .band { color: var(--c); font-weight: 600; }
.conditions li .where { color: var(--muted); white-space: nowrap; }
.conditions li .where b { color: var(--ink); }

.conditions li.head span { color: var(--muted); font-size: 0.8em; }
.conditions li.head span:nth-child(3) { grid-column: 3 / 5; }

.conditions li i {
  height: 0.45em;
  width: var(--w);
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent);
}

.conditions li strong { text-align: right; color: var(--ink); font-weight: 600; }
.conditions li em { font-style: normal; font-weight: 600; color: var(--home); font-size: 0.85em; }

/* ---------- Laatste verbindingen ---------- */

.feed {
  top: var(--gutter);
  right: var(--gutter);
  width: clamp(280px, 25vw, 520px);
  max-height: calc(100vh - var(--gutter) * 2 - clamp(70px, 6vw, 110px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feed h2 {
  font-family: var(--cond);
  font-weight: 600;
  font-size: clamp(18px, 1.5vw, 30px);
  color: var(--muted);
  margin-bottom: 0.5em;
}

.feed ol {
  list-style: none;
  display: grid;
  align-content: start;
  gap: clamp(4px, 0.45vw, 9px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 190, 255, 0.28) transparent;
  /* onderrand vervaagt, zodat zichtbaar is dat er meer onder staat */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
}

.feed li {
  display: grid;
  /* vaste eerste kolom (tijd, band en frequentie), zodat de calls recht onder elkaar staan */
  grid-template-columns: 7.9em minmax(0, 1fr) auto;
  column-gap: 0.8em;
  align-items: baseline;
  padding: 0.5em 0.8em 0.55em 0.9em;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 4px solid var(--c);
  border-radius: 2px 8px 8px 2px;
  font-size: clamp(13px, 0.95vw, 19px);
}

.feed li.fresh { animation: fresh 2.4s ease-out; }

@keyframes fresh {
  0% { background: color-mix(in srgb, var(--c) 55%, transparent); transform: translateX(-12px); }
  100% { background: var(--glass); transform: none; }
}

.feed .time { color: var(--muted); }

.feed li.recent {
  background: color-mix(in srgb, var(--c) 18%, var(--glass));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
}

.feed .new {
  display: inline-block;
  vertical-align: 0.2em;
  margin-left: 0.6em;
  padding: 0.1em 0.55em 0.15em;
  border-radius: 999px;
  background: var(--c);
  color: #04060c;
  font-family: var(--text);
  font-weight: 600;
  font-size: 0.5em;
}

.feed .call {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.45em;
  line-height: 1;
}

.feed .dist { color: var(--ink); font-weight: 500; text-align: right; }

.feed .by {
  grid-column: 3;
  grid-row: 2;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}

.feed .by b { color: var(--ink); font-weight: 700; }

.feed .where {
  grid-column: 2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed .band {
  grid-column: 1;
  grid-row: 2;
  color: var(--c);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed .empty {
  border-left-color: var(--faint);
  grid-template-columns: 1fr;
  color: var(--muted);
}

/* ---------- Banden en klok ---------- */

.bottom {
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.bands {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.6vw, 12px) clamp(14px, 1.4vw, 28px);
}

.bands li {
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--cond);
  font-weight: 600;
  font-size: clamp(16px, 1.35vw, 28px);
}

.bands li::before {
  content: '';
  width: 1.6em;
  height: 4px;
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}

.bands li span { color: var(--muted); font-weight: 500; }

.meta { text-align: right; flex-shrink: 0; }

.clock {
  font-family: var(--cond);
  font-weight: 600;
  font-size: clamp(26px, 2.4vw, 50px);
  line-height: 1;
}

.clock small {
  font-family: var(--text);
  font-weight: 500;
  font-size: 0.38em;
  color: var(--muted);
  margin: 0 0.9em 0 0.35em;
}

.clock small:last-child { margin-right: 0; }
.clock .local { color: var(--muted); font-size: 0.7em; }

.status {
  margin-top: 0.5em;
  font-size: clamp(12px, 0.8vw, 16px);
  color: var(--muted);
}

.status.warn { color: #ff8a7a; }

/* ---------- Nieuwe verbinding ---------- */

.banner {
  left: 50%;
  bottom: clamp(90px, 9vw, 170px);
  transform: translateX(-50%);
  min-width: min(92vw, 640px);
  max-width: min(92vw, 1100px);
  padding: clamp(14px, 1.4vw, 28px) clamp(20px, 2.2vw, 44px);
  text-align: center;
  background: rgba(3, 8, 22, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 14px;
  box-shadow: 0 0 80px color-mix(in srgb, var(--c) 30%, transparent);
}

.banner.show { animation: banner-in 0.7s cubic-bezier(0.2, 0.9, 0.2, 1.15) both; }
.banner.hide { animation: banner-out 0.5s ease-in both; }

@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, 30px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes banner-out {
  to { opacity: 0; transform: translate(-50%, 16px); }
}

.banner-kicker {
  font-size: clamp(14px, 1.1vw, 22px);
  color: var(--c);
  font-weight: 600;
}

.banner-call {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(60px, 7.5vw, 160px);
  line-height: 0.95;
  color: var(--c);
  text-shadow: 0 0 50px color-mix(in srgb, var(--c) 60%, transparent);
}

.banner-name {
  font-size: clamp(17px, 1.6vw, 34px);
  font-weight: 500;
  margin-top: 0.15em;
}

.banner-facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4em 1.4em;
  margin-top: 0.6em;
  font-size: clamp(14px, 1.2vw, 25px);
  color: var(--muted);
}

.banner-facts b { color: var(--ink); font-weight: 700; }

/* ---------- Labels op de bol ---------- */

.pin {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pin i {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 14px var(--c);
}

.pin .tag {
  position: absolute;
  top: -13px;
  left: 12px;
  display: flex;
  gap: 0.45em;
  align-items: baseline;
  white-space: nowrap;
  padding: 2px 8px 3px 7px;
  background: rgba(2, 6, 16, 0.82);
  border-left: 3px solid var(--c);
  border-radius: 1px 5px 5px 1px;
  font-size: clamp(12px, 0.85vw, 17px);
  color: var(--muted);
}

.pin.west .tag { border-left: 0; border-right: 3px solid var(--c); border-radius: 5px 1px 1px 5px; }
.pin.hidden-tag .tag { visibility: hidden; }

.pin .tag b {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.25em;
  color: var(--ink);
}

.pin.home i {
  width: 14px;
  height: 14px;
  left: -7px;
  top: -7px;
  background: var(--home);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.6), 0 0 22px var(--home);
}

.pin.home .tag { border-color: var(--home); }
.pin.home .tag b { color: var(--home); }

.pin.recent i { animation: beacon 1.6s ease-in-out infinite; }
.pin.recent .tag { color: var(--ink); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }

@keyframes beacon {
  50% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 26px 6px var(--c); }
}

.pin.hot .tag { background: color-mix(in srgb, var(--c) 35%, rgba(2, 6, 16, 0.9)); color: var(--ink); }

/* ---------- Telefoon en kleine schermen ---------- */

@media (max-width: 760px) {
  body::after { background: linear-gradient(0deg, rgba(1, 3, 10, 0.9) 0%, transparent 45%), linear-gradient(180deg, rgba(1, 3, 10, 0.8) 0%, transparent 30%); }
  .stats { top: auto; bottom: 150px; grid-template-columns: repeat(3, max-content); }
  .stats .far, .stats .conditions { display: none; }
  .feed { top: auto; bottom: 230px; left: var(--gutter); right: var(--gutter); width: auto; max-height: 30vh; }
  .center-dock { bottom: auto; top: var(--gutter); }
  .layer-legend { max-width: calc(100vw - var(--gutter) * 2); }
  .legend-note { display: none; }
  .bottom { flex-direction: column; align-items: stretch; }
  .meta { text-align: left; }
}

/* ---------- Modusfilter ---------- */

.center-dock {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: var(--gutter);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  pointer-events: none;
}

.mode-legend {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.45em 1em;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  font-size: clamp(12px, 0.85vw, 17px);
  white-space: nowrap;
  pointer-events: none;
}
.ml-label { color: var(--muted); }
.ml-mode { font-family: var(--cond); font-weight: 700; font-size: 1.5em; color: var(--home); }
.ml-count { color: var(--ink); }

/* ---------- Aangeklikt station ---------- */

.pin.clickable i, .pin.clickable .tag { pointer-events: auto; cursor: pointer; }
.feed li { cursor: pointer; }

.station-card {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: var(--gutter);
  transform: translateX(-50%);
  min-width: min(92vw, 380px);
  padding: 0.75em 2.6em 0.85em 1.1em;
  background: rgba(3, 8, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 5px solid var(--c);
  border-radius: 3px 12px 12px 3px;
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 22%, transparent);
  font-size: clamp(13px, 0.95vw, 19px);
}

.sc-close {
  position: absolute;
  top: 0.3em;
  right: 0.45em;
  width: 1.6em;
  height: 1.6em;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.3em;
  line-height: 1;
  cursor: pointer;
}

.sc-close:hover, .sc-close:focus-visible { color: var(--ink); background: var(--faint); outline: none; }

.sc-head { display: flex; align-items: baseline; gap: 0.7em; }
.sc-call { font-family: var(--cond); font-weight: 700; font-size: 2.1em; letter-spacing: 0.02em; }
.sc-band { font-family: var(--cond); font-weight: 600; font-size: 1.25em; color: var(--c); }
.sc-where { color: var(--muted); margin-top: -0.1em; }
.sc-where:empty { display: none; }

.sc-aim { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.5em; margin-top: 0.45em; }
.sc-label { color: var(--muted); }
.sc-deg { font-family: var(--cond); font-weight: 700; font-size: 2.3em; line-height: 1; color: var(--home); }
.sc-dir { font-family: var(--cond); font-weight: 600; font-size: 1.3em; color: var(--home); }
.sc-km { margin-left: 0.6em; font-weight: 600; }
.sc-long { color: var(--muted); }
.sc-power {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0.2em 1.4em;
  margin-top: 0.5em;
  padding-top: 0.45em;
  border-top: 1px solid var(--faint);
}
.sc-power div { display: flex; flex-direction: column; }
.sc-power span { color: var(--muted); font-size: 0.85em; }
.sc-power b { font-family: var(--cond); font-weight: 600; font-size: 1.3em; }
.sc-note { color: var(--muted); font-size: 0.88em; margin-top: 0.35em; max-width: 34em; }
.sc-note:empty { display: none; }

/* ---------- Lagen en hulp ---------- */

.layer-legend {
  width: max-content;
  max-width: min(46vw, 900px);
  display: grid;
  gap: 0.5em;
  padding: 0.8em 1.1em 0.9em;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  font-size: clamp(12px, 0.8vw, 16px);
  pointer-events: none;
}

.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 0.5em; }

.legend-title {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.35em;
  margin-right: 0.4em;
}

.layer-legend .chip {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.1em;
  padding: 0.05em 0.55em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 30%, transparent);
  box-shadow: inset 0 -2px 0 var(--c);
}

.aurora-scale {
  width: 9em;
  height: 0.7em;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(57, 255, 136, 0.2), rgb(57, 255, 136) 45%, rgb(214, 107, 255));
}

.legend-note { color: var(--muted); margin-left: 0.4em; }

.rotor-value { font-family: var(--cond); font-weight: 700; font-size: 1.35em; color: var(--home); }


.help {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 620px);
  padding: clamp(18px, 1.8vw, 34px) clamp(22px, 2.2vw, 42px);
  background: rgba(3, 8, 22, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--faint);
  border-radius: 14px;
  font-size: clamp(14px, 1vw, 19px);
}

.help h2 {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.8em;
  margin-bottom: 0.6em;
}

.help dl { display: grid; grid-template-columns: auto 1fr; gap: 0.55em 1em; align-items: baseline; }

.help dt {
  min-width: 1.8em;
  padding: 0.1em 0.45em;
  text-align: center;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.15em;
  border: 1px solid rgba(160, 190, 255, 0.35);
  border-bottom-width: 3px;
  border-radius: 6px;
  color: var(--home);
}

.help p { margin-top: 0.9em; color: var(--muted); line-height: 1.4; }
.help dl + p { margin-top: 1.3em; }

[hidden] { display: none !important; }

/* ---------- Lichte modus voor oudere pc's ---------- */

body.low .feed li,
body.low .layer-legend,
body.low .station-card,
body.low .mode-legend,
body.low .help,
body.low .banner {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.low .feed li { background: rgba(4, 10, 26, 0.86); }
body.low .banner { background: rgba(3, 8, 22, 0.92); box-shadow: none; }
body.low .banner-call { text-shadow: none; }
body.low .pin.recent i { animation: none; }
body.low .feed li.fresh { animation-duration: 1.2s; }

@media (prefers-reduced-motion: reduce) {
  .banner.show, .banner.hide, .feed li.fresh, .pin.recent i { animation: none; }
}
