:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;

  --cockpit-bg-top: #0c1018;
  --cockpit-bg-bottom: #06080d;
  --cockpit-panel: rgba(8, 14, 22, 0.92);
  --cockpit-border: #2a3d52;
  --cockpit-border-bright: #3d5a73;
  --cockpit-amber: #e8b84a;
  --cockpit-green: #45f58a;
  --cockpit-cyan: #6ed4f0;
  --cockpit-dim: #5a7088;
  --cockpit-value: #d8eef8;
  --cockpit-red: #ff6b6b;
  --cockpit-glow-green: rgba(69, 245, 138, 0.35);
  --cockpit-glow-amber: rgba(232, 184, 74, 0.25);
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  background: #0a0e14;
  color: #0f172a;
}

.topbar {
  position: relative;
  padding: 0.55rem 0.85rem 0.65rem;
  font-family: "Share Tech Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cockpit-amber);
  background: linear-gradient(
    180deg,
    var(--cockpit-bg-top) 0%,
    var(--cockpit-bg-bottom) 100%
  );
  border-bottom: 2px solid var(--cockpit-border);
  box-shadow:
    inset 0 1px 0 rgba(110, 212, 240, 0.08),
    0 6px 18px rgba(0, 0, 0, 0.55);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.35;
}

.status-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--cockpit-amber);
  background: var(--cockpit-panel);
  border: 1px solid var(--cockpit-border);
  border-radius: 2px;
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(110, 212, 240, 0.06);
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cockpit-amber);
  box-shadow: 0 0 6px var(--cockpit-glow-amber);
}

#ws-status::before {
  background: var(--cockpit-red);
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.5);
}

.badge.connected {
  color: var(--cockpit-green);
  border-color: rgba(69, 245, 138, 0.45);
  text-shadow: 0 0 10px var(--cockpit-glow-green);
}

.badge.connected::before {
  background: var(--cockpit-green);
  box-shadow: 0 0 8px var(--cockpit-glow-green);
}

.badge:has(#aircraft-count) {
  color: var(--cockpit-cyan);
  border-color: rgba(110, 212, 240, 0.35);
}

.badge:has(#aircraft-count)::before {
  display: none;
}

#aircraft-count {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--cockpit-cyan);
  text-shadow: 0 0 12px rgba(110, 212, 240, 0.45);
}

.selection-panel {
  position: relative;
  z-index: 1;
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 0.25rem 0;
  min-height: 2.35rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  background: var(--cockpit-panel);
  border: 1px solid var(--cockpit-border);
  border-radius: 2px;
  box-shadow:
    inset 0 0 16px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(110, 212, 240, 0.05);
}

.selection-panel.empty {
  border-style: dashed;
  border-color: rgba(42, 61, 82, 0.85);
}

.selection-panel.empty::after {
  content: "— seleziona un veicolo —";
  color: var(--cockpit-dim);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.selection-panel.empty .selection-item {
  display: none;
}

.selection-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.15rem 0.75rem;
  border-right: 1px solid rgba(42, 61, 82, 0.9);
}

.selection-item:last-child {
  border-right: none;
}

.selection-item strong {
  color: var(--cockpit-dim);
  font-weight: 400;
  font-size: 0.65rem;
}

.selection-item [id^="sel-"] {
  color: var(--cockpit-cyan);
  text-shadow: 0 0 8px rgba(110, 212, 240, 0.3);
}

main {
  flex: 1;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}
