:root {
  color-scheme: dark;
  --ink: #050608;
  --panel: rgba(9, 13, 19, 0.9);
  --panel-strong: rgba(16, 22, 31, 0.96);
  --line: rgba(194, 232, 255, 0.62);
  --white: #f6fbff;
  --muted: #b7c4cf;
  --cyan: #62d8ff;
  --amber: #ffd35e;
  --red: #f14646;
  --green: #6df2a2;
  --violet: #b892ff;
  --safe-x: 28px;
  --topbar-h: 76px;
  --ticker-h: 42px;
  --shadow: rgba(0, 0, 0, 0.58);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.frame,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 46% 40%, rgba(98, 216, 255, 0.14), transparent 32%),
    linear-gradient(135deg, #0b0d10, #050608 58%, #000);
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

#map {
  position: absolute;
  inset: 0;
  background: #050608;
}

#map .leaflet-tile-pane {
  filter: saturate(0.82) contrast(1.18) brightness(0.78);
}

#map .leaflet-marker-pane,
#map .leaflet-overlay-pane {
  filter: none;
}

.leaflet-control-container {
  display: none;
}

.map-grid,
.scanlines,
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
}

.map-grid {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(98, 216, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 216, 255, 0.18) 1px, transparent 1px);
  background-size: 96px 96px;
  mix-blend-mode: screen;
}

.scanlines {
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.16) 1px,
    transparent 1px,
    transparent 4px
  );
}

.vignette {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.5)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 35%, rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.54));
}

.topbar,
.story-panel,
.signal-panel,
.breaking,
.lower-third,
.ticker {
  position: absolute;
  z-index: 500;
  color: var(--white);
  text-shadow: 0 2px 7px var(--shadow);
}

.topbar {
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 190px;
  align-items: center;
  gap: 22px;
  padding: 0 var(--safe-x);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 12px),
    linear-gradient(180deg, rgba(21, 28, 39, 0.98), rgba(3, 5, 8, 0.95));
  border-bottom: 2px solid var(--line);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.3),
    0 8px 22px rgba(0, 0, 0, 0.42);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 46px;
  margin-right: 14px;
  color: #050608;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 48%),
    linear-gradient(135deg, var(--amber), #ef7b45);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.34);
}

.brand-title {
  overflow: hidden;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mode {
  min-width: 188px;
  padding: 10px 16px;
  border: 1px solid rgba(98, 216, 255, 0.82);
  color: var(--cyan);
  background: rgba(98, 216, 255, 0.09);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  box-shadow: inset 0 0 18px rgba(98, 216, 255, 0.15);
}

.clock-block {
  text-align: right;
  font-weight: 900;
}

.clock {
  font-size: 24px;
}

.clock-date {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.story-panel {
  top: calc(var(--topbar-h) + 24px);
  left: var(--safe-x);
  width: 330px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48px),
    var(--panel);
  border: 2px solid rgba(246, 251, 255, 0.76);
  box-shadow:
    inset 0 0 0 2px rgba(98, 216, 255, 0.22),
    8px 8px 0 rgba(0, 0, 0, 0.38);
}

.region {
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.story-count {
  margin-top: 8px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.topic-stack {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.topic-chip {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topic-chip strong {
  color: var(--cyan);
  font-size: 11px;
}

.topic-chip span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topic-chip.major {
  border-left-color: var(--red);
}

.topic-chip.major strong {
  color: var(--red);
}

.signal-panel {
  right: var(--safe-x);
  top: calc(var(--topbar-h) + 24px);
  width: 282px;
  background: var(--panel);
  border: 2px solid rgba(246, 251, 255, 0.72);
  box-shadow:
    inset 0 0 0 2px rgba(184, 146, 255, 0.2),
    8px 8px 0 rgba(0, 0, 0, 0.35);
}

.signal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #050608;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 44%),
    linear-gradient(180deg, var(--cyan), #3aa5c2);
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
}

.signal-bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  height: 76px;
  align-items: end;
  padding: 12px;
}

.signal-bars span {
  display: block;
  min-height: 18px;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  opacity: 0.85;
  animation: signalPulse 1400ms ease-in-out infinite alternate;
}

.signal-bars span:nth-child(2) { height: 32px; animation-delay: -900ms; }
.signal-bars span:nth-child(3) { height: 54px; animation-delay: -500ms; }
.signal-bars span:nth-child(4) { height: 28px; animation-delay: -1200ms; }
.signal-bars span:nth-child(5) { height: 64px; animation-delay: -300ms; }
.signal-bars span:nth-child(6) { height: 42px; animation-delay: -700ms; }
.signal-bars span:nth-child(7) { height: 58px; animation-delay: -100ms; }
.signal-bars span:nth-child(8) { height: 36px; animation-delay: -1000ms; }

.source-line {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.breaking {
  top: calc(var(--topbar-h) + 24px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
  min-width: 330px;
  padding: 12px 16px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(90deg, #a70712, #f14646 54%, #7c050c);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 0 34px rgba(241, 70, 70, 0.42),
    7px 7px 0 rgba(0, 0, 0, 0.34);
  font-weight: 900;
  text-transform: uppercase;
}

.breaking[hidden] {
  display: none;
}

.breaking span {
  padding: 4px 8px;
  color: #7c050c;
  background: #fff;
  text-shadow: none;
}

.lower-third {
  left: var(--safe-x);
  right: var(--safe-x);
  bottom: calc(var(--ticker-h) + 22px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.slide-copy {
  min-width: 0;
  padding: 15px 20px 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 44px),
    linear-gradient(180deg, rgba(18, 24, 33, 0.95), rgba(4, 6, 10, 0.92));
  border: 2px solid rgba(246, 251, 255, 0.78);
  border-left: 10px solid var(--amber);
  box-shadow:
    inset 0 0 0 2px rgba(98, 216, 255, 0.18),
    8px 8px 0 rgba(0, 0, 0, 0.36);
}

.kicker {
  color: var(--cyan);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.headline {
  margin-top: 5px;
  color: var(--white);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 900;
  line-height: 1.03;
  display: -webkit-box;
  max-height: 2.06em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.story-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 52px;
  padding: 0 16px;
  color: #050608;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 48%),
    linear-gradient(180deg, var(--amber), #ef9845);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.34);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  text-shadow: none;
}

.ticker {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--ticker-h);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 12px),
    linear-gradient(180deg, #171d27, #050608);
  border-top: 2px solid rgba(246, 251, 255, 0.78);
}

.ticker-text {
  display: inline-block;
  padding-left: 100%;
  color: var(--white);
  font-size: 18px;
  font-weight: 900;
  line-height: var(--ticker-h);
  white-space: nowrap;
  text-transform: uppercase;
  animation: ticker 55s linear infinite;
}

.news-marker {
  position: relative;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}

.news-marker::before,
.news-marker::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: 50%;
}

.news-marker::before {
  background: var(--cyan);
  border: 3px solid #fff;
  box-shadow:
    0 0 0 4px rgba(98, 216, 255, 0.22),
    0 0 24px rgba(98, 216, 255, 0.7);
}

.news-marker::after {
  border: 2px solid rgba(98, 216, 255, 0.8);
  animation: markerPing 1800ms ease-out infinite;
}

.news-marker.major::before {
  background: var(--red);
  box-shadow:
    0 0 0 4px rgba(241, 70, 70, 0.22),
    0 0 30px rgba(241, 70, 70, 0.86);
}

.news-marker.major::after {
  border-color: rgba(241, 70, 70, 0.86);
}

.news-label {
  transform: translate(18px, -18px);
  padding: 5px 7px;
  color: #050608;
  background: rgba(246, 251, 255, 0.88);
  border-left: 5px solid var(--cyan);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.38);
}

.news-label.major {
  border-left-color: var(--red);
}

.route-line {
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 6 12;
  stroke-linecap: round;
  opacity: 0.65;
  animation: dash 18s linear infinite;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes markerPing {
  0% {
    opacity: 0.85;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

@keyframes signalPulse {
  from {
    opacity: 0.45;
    transform: scaleY(0.64);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: -180;
  }
}

@media (max-width: 900px) {
  :root {
    --safe-x: 14px;
    --topbar-h: 68px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .mode {
    display: none;
  }

  .brand-mark {
    width: 68px;
    height: 40px;
    font-size: 20px;
  }

  .brand-title {
    font-size: 22px;
  }

  .clock {
    font-size: 19px;
  }

  .story-panel,
  .signal-panel {
    width: 250px;
  }

  .signal-panel {
    display: none;
  }

  .headline {
    white-space: normal;
  }
}
