* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #4a4a4a;
  color: #ffffff;
  font-family: Inter, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.screen {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  width: 100dvw;
  display: block;
}

.radar-panel,
.target-list {
  background: #000;
}

.radar-panel {
  position: relative;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  padding: 22px;
  overflow: hidden;
}

.corner-logo {
  display: block;
  filter: brightness(0.78);
  height: auto;
  opacity: 0.46;
  pointer-events: none;
  width: clamp(104px, 9vw, 154px);
}

.corner-logo-link {
  display: block;
  margin: 0 0 6px -8px;
}

.header,
.footer,
.control-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.08em;
  position: relative;
  transition: opacity 280ms ease;
  z-index: 3;
}

.footer {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  align-items: flex-end;
  gap: 12px;
}

.footer-time {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  text-align: left;
}

:fullscreen .header,
:fullscreen .footer,
:fullscreen .control-toolbar {
  opacity: 0;
  pointer-events: none;
}

body.controls-visible:fullscreen .header,
body.controls-visible:fullscreen .footer,
body.controls-visible:fullscreen .control-toolbar,
body.controls-visible :fullscreen .header,
body.controls-visible :fullscreen .footer,
body.controls-visible :fullscreen .control-toolbar {
  opacity: 1;
  pointer-events: auto;
}

.fullscreen-clock {
  color: rgba(255, 255, 255, 0.667);
  display: none;
  left: 50%;
  letter-spacing: 0.02em;
  position: absolute;
  text-align: center;
  top: 64px;
  transform: translateX(-50%);
  z-index: 3;
}

.fullscreen-clock-fade {
  display: none;

  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;

  width: 900px;
  height: 620px;

  background: radial-gradient(
    ellipse 60% 75% at 50% 18%,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.82) 24%,
    rgba(0, 0, 0, 0.56) 48%,
    rgba(0, 0, 0, 0.28) 70%,
    rgba(0, 0, 0, 0.08) 86%,
    rgba(0, 0, 0, 0) 100%
  );

  filter: blur(18px);
}

:fullscreen .fullscreen-clock {
  display: block;
}

:fullscreen .fullscreen-clock-fade {
  display: block;
}

:fullscreen #fullscreen-toggle,
:fullscreen #last-updated {
  display: none;
}

body.ui-hidden .header,
body.ui-hidden .footer,
body.ui-hidden .control-toolbar,
body.ui-hidden .radar-overlay-panel,
body.ui-hidden .aoa-ground-panel,
body.ui-hidden .metar-tooltip,
body.ui-hidden .weather-advisory-tooltip,
body.ui-hidden .windflow-tooltip,
body.ui-hidden .fullscreen-clock,
body.ui-hidden .fullscreen-clock-fade {
  display: none;
}

body.embedded-frame .header,
body.embedded-frame .footer,
body.embedded-frame .control-toolbar,
body.embedded-frame .radar-overlay-panel,
body.embedded-frame .aoa-ground-panel,
body.embedded-frame .metar-tooltip,
body.embedded-frame .weather-advisory-tooltip,
body.embedded-frame .windflow-tooltip,
body.embedded-frame .fullscreen-clock,
body.embedded-frame .fullscreen-clock-fade {
  display: none;
}

#fullscreen-local-time {
  font-weight: 450;
  font-size: clamp(60px, 7.8vw, 128px);
  letter-spacing: -0.01em;
  line-height: 0.94;
}

#fullscreen-utc-time {
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(16px, 1.7vw, 28px);
  font-weight: 450;
  letter-spacing: 0.04em;
  margin-top: 12px;
}

.control-toolbar {
  align-items: stretch;
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  backdrop-filter: blur(18px) saturate(1.05);
  background: rgba(12, 15, 18, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 6px;
  left: 22px;
  padding: 8px;
  position: absolute;
  top: 96px;
  transform: none;
  transition: background 180ms ease, box-shadow 180ms ease;
  touch-action: none;
  user-select: none;
  width: 220px;
  z-index: 4;
}

.control-toolbar.dragging {
  cursor: grabbing;
  transition: none;
}

.toolbar-topline {
  display: flex;
  justify-content: center;
}

.toolbar-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  max-width: 204px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 220ms ease, max-width 220ms ease, opacity 160ms ease;
}

.toolbar-section,
.range-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.toolbar-section {
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  flex-wrap: wrap;
  padding-top: 8px;
}

.toolbar-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.range-controls {
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  flex-direction: column;
  padding-top: 10px;
}

.control-toolbar.collapsed {
  background: rgba(0, 0, 0, 0.44);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.26);
}

.control-toolbar.collapsed .toolbar-content {
  max-height: 0;
  max-width: 0;
  opacity: 0;
}

.range-slider {
  align-items: center;
  color: rgba(211, 224, 232, 0.72);
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 8px;
  inline-size: 100%;
  letter-spacing: 0.06em;
}

.range-slider span {
  color: rgba(238, 244, 247, 0.82);
  display: inline-block;
  font-size: 10px;
  min-width: 0;
  text-align: center;
  width: 100%;
}

.range-slider input,
.radar-overlay-panel input {
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 18px;
  margin: 0;
}

.range-slider input {
  inline-size: 184px;
}

#range-stops {
  display: none;
}

.range-slider input::-webkit-slider-runnable-track,
.radar-overlay-panel input::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.24);
  block-size: 3px;
  border-radius: 999px;
}

.range-slider input::-webkit-slider-thumb,
.radar-overlay-panel input::-webkit-slider-thumb {
  appearance: none;
  background: rgba(238, 244, 247, 0.94);
  border: 2px solid rgba(12, 15, 18, 0.92);
  border-radius: 50%;
  block-size: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  inline-size: 16px;
  margin-block-start: -6.5px;
}

.range-slider input::-moz-range-track,
.radar-overlay-panel input::-moz-range-track {
  background: rgba(255, 255, 255, 0.24);
  block-size: 3px;
  border-radius: 999px;
}

.range-slider input::-moz-range-thumb,
.radar-overlay-panel input::-moz-range-thumb {
  background: rgba(238, 244, 247, 0.94);
  border: 2px solid rgba(12, 15, 18, 0.92);
  border-radius: 50%;
  block-size: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  inline-size: 16px;
}

.toolbar-topline button,
.toolbar-section button,
.radar-overlay-panel__scrub button {
  align-items: center;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  color: rgba(220, 231, 236, 0.72);
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  min-height: 36px;
  min-width: 92px;
  padding: 5px 8px;
}

.toolbar-topline button {
  min-height: 28px;
  min-width: 52px;
  padding: 2px 8px 3px;
}

@media (max-width: 760px) {
  .control-toolbar {
    bottom: 78px;
    left: 12px;
    top: auto;
    transform: none;
    width: 202px;
  }

  .toolbar-content {
    max-height: calc(100dvh - 150px);
    max-width: 186px;
  }

  .toolbar-topline button,
  .toolbar-section button {
    min-height: 36px;
    min-width: 82px;
    padding: 4px;
  }

  .range-slider input {
    inline-size: 166px;
  }
}

.toolbar-topline button.active,
.toolbar-section button.active,
.radar-overlay-panel__scrub button.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.94);
}

h1 {
  margin: 0;
  font-size: 36px;
}

p {
  margin: 4px 0 0;
  opacity: 0.75;
}

.status {
  font-size: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#data-status {
  color: rgba(168, 240, 207, 0.62);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.radar-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#map,
#windflow,
#radar {
  position: absolute;
  inset: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
}

.radar-wrap {
  transition: filter 240ms ease, opacity 240ms ease;
}

#map {
  touch-action: none;
  z-index: 0;
}

#windflow {
  display: block;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 1;
}

body.windflow-enabled #windflow {
  opacity: 0.94;
}

.weather-pane {
  opacity: 1;
  transition: opacity 80ms ease;
}

body.map-zooming .weather-pane {
  opacity: 0;
}

.airspace-pane {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.85));
}

#map.leaflet-container {
  overflow: hidden;
  position: absolute;
}

#map .leaflet-pane,
#map .leaflet-tile,
#map .leaflet-map-pane,
#map .leaflet-tile-container {
  left: 0;
  position: absolute;
  top: 0;
}

#map .leaflet-tile {
  border: 0;
  height: 256px;
  max-width: none;
  user-select: none;
  width: 256px;
}

#map .base-map-tile {
  filter: brightness(1.38) contrast(0.94) saturate(0.9);
}

.surface-front {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.72));
  stroke-linecap: round;
  stroke-linejoin: round;
}

#map .leaflet-map-pane {
  z-index: 400;
}

#map .leaflet-tile-pane {
  z-index: 200;
}

#map .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.48);
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

#map .leaflet-control-attribution a {
  color: rgba(96, 218, 255, 0.66);
}

#radar {
  display: block;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.aoa-ground-panel {
  background: rgba(0, 0, 0, 0.74);
  border: 1px solid rgba(123, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.06em;
  position: absolute;
  right: 22px;
  top: 88px;
  width: min(285px, calc(100vw - 44px));
  z-index: 2;
}

.radar-overlay-panel {
  border-top: 1px solid rgba(123, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.06em;
  padding-top: 10px;
  width: 100%;
}

.radar-overlay-panel[hidden] {
  display: none;
}

.radar-overlay-panel__header,
.radar-overlay-panel__ticks {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.radar-overlay-panel__header {
  color: rgba(21, 255, 247, 0.86);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.radar-overlay-panel__header strong {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 600;
}

.radar-overlay-panel img {
  display: block;
  image-rendering: auto;
  max-width: 100%;
  opacity: 0.92;
  width: 100%;
}

.radar-overlay-panel__dbz-values {
  color: rgba(255, 255, 255, 0.58);
  display: grid;
  font-size: 9px;
  gap: 4px;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  margin-top: 4px;
  width: 100%;
}

.radar-overlay-panel__dbz-values span {
  min-width: 0;
  text-align: center;
}

.radar-overlay-panel__dbz-values span:nth-child(even) {
  visibility: hidden;
}

.radar-overlay-panel__scrub {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.radar-overlay-panel__scrub button {
  letter-spacing: 0.06em;
  min-height: 28px;
  padding: 4px 6px;
  width: 100%;
}

.radar-overlay-panel input {
  display: block;
  flex: 1 1 auto;
  inline-size: 100%;
}

.radar-overlay-panel__ticks {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  margin-top: 6px;
}

.metar-tooltip {
  background: rgba(0, 0, 0, 0.86);
  border: 1px solid rgba(123, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.04em;
  max-width: min(390px, calc(100vw - 24px));
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 5;
}

.metar-tooltip[hidden] {
  display: none;
}

.traffic-tooltip,
.windflow-tooltip,
.weather-advisory-tooltip {
  background: rgba(0, 0, 0, 0.86);
  border: 1px solid rgba(123, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.04em;
  max-width: min(390px, calc(100vw - 24px));
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 5;
}

.weather-advisory-tooltip {
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden auto;
  pointer-events: auto;
  width: min(460px, calc(100vw - 24px));
}

.traffic-tooltip[hidden],
.windflow-tooltip[hidden],
.weather-advisory-tooltip[hidden] {
  display: none;
}

.weather-advisory-tooltip__header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.weather-advisory-tooltip__close {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(123, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
  width: 22px;
}

.weather-advisory-tooltip__close:hover,
.weather-advisory-tooltip__close:focus-visible {
  background: rgba(123, 255, 255, 0.12);
  border-color: rgba(123, 255, 255, 0.48);
  color: rgba(255, 255, 255, 0.96);
  outline: none;
}

.metar-tooltip__title {
  align-items: baseline;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
}

.metar-tooltip__title span {
  color: rgba(21, 255, 247, 0.86);
  font-size: 10px;
  font-weight: 700;
}

.metar-tooltip__name {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  margin-top: 2px;
  text-transform: uppercase;
}

.metar-tooltip__grid {
  display: grid;
  font-size: 11px;
  gap: 4px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 9px;
}

.metar-tooltip__raw {
  border-top: 1px solid rgba(123, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  line-height: 1.35;
  margin-top: 9px;
  padding-top: 8px;
}

.aoa-ground-panel__header {
  align-items: center;
  border-bottom: 1px solid rgba(123, 255, 255, 0.16);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  padding: 10px 12px;
}

.aoa-ground-panel__header strong {
  color: rgba(21, 255, 247, 0.82);
  font-size: 10px;
  font-weight: 600;
}

.aoa-ground-list {
  display: grid;
}

.aoa-ground-item {
  border-bottom: 1px solid rgba(123, 255, 255, 0.1);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
}

.aoa-ground-item:last-child {
  border-bottom: 0;
}

.aoa-ground-item strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
}

.aoa-ground-item span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  text-align: right;
  word-break: normal;
}

.target-list {
  padding: 22px;
  overflow: hidden;
}

.target-list h2 {
  margin-top: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.target {
  border-bottom: 1px solid rgba(168, 240, 207, 0.16);
  padding: 12px 0;
}

.target strong {
  display: block;
  font-size: 18px;
}

.target span {
  display: block;
  opacity: 0.8;
  font-size: 14px;
  margin-top: 3px;
}
