* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0c1018; color: #f3f1ea; font-family: "Segoe UI", "DejaVu Sans", system-ui, sans-serif; overflow: hidden; }
#c { display: block; width: 100%; height: 100%; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#loader {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #0c1018; z-index: 20; font-size: 15px; letter-spacing: .08em;
}
#loader.hide { display: none; }

#brand {
  position: absolute; top: 14px; left: 14px; text-shadow: 0 1px 8px rgba(0,0,0,.6);
  pointer-events: none;
}
#brand .k { font-size: 9px; letter-spacing: .16em; opacity: .72; font-weight: 600; }
#brand h1 { margin: 2px 0 0; font-size: 18px; letter-spacing: .07em; font-weight: 650; }
#brand p { margin: 3px 0 0; font-size: 11px; opacity: .82; }

#handle {
  position: absolute; top: 16px; right: 14px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(10,14,22,.48);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.28);
  color: #f7f4ee; font-weight: 650; letter-spacing: .04em; font-size: 15px;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
  pointer-events: none; z-index: 6;
}

#hud {
  position: absolute; top: 62px; left: 14px;
  width: min(320px, calc(100% - 28px));
  background: rgba(10,14,22,.52);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; padding: 10px 12px; font-size: 12px;
}
#hud .row { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
#hud .lab { opacity: .65; }
#wx { margin-top: 2px; line-height: 1.45; }
#wx .raw { opacity: .62; font-size: 10px; margin-top: 3px; }

.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
button {
  appearance: none; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #f3f1ea;
  border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 600;
  letter-spacing: .03em; cursor: pointer; min-height: 36px;
}
button:hover { background: rgba(255,255,255,.16); }
button.on, button[aria-pressed="true"] { background: rgba(80,140,255,.35); border-color: rgba(140,180,255,.6); }
#cams { position: absolute; left: 14px; bottom: 54px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 200px); }

#list {
  position: absolute; top: 62px; right: 14px; width: min(250px, calc(100% - 28px));
  max-height: calc(100% - 130px);
  background: rgba(10,14,22,.52);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
}
#list header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; font-size: 11px; letter-spacing: .04em; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#list header strong { font-size: 12px; }
#flights { overflow: auto; max-height: 42vh; padding: 4px 0; }
#list.collapsed #flights { display: none; }
.fi {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 12px; cursor: pointer; border: 0; width: 100%;
  background: transparent; border-radius: 0; text-align: left; min-height: 40px;
}
.fi:hover, .fi.on { background: rgba(80,140,255,.22); }
.fi .cs { font-weight: 650; letter-spacing: .03em; }
.fi .alt { opacity: .75; }

#foot {
  position: absolute; left: 14px; right: 14px; bottom: 8px;
  font-size: 9px; line-height: 1.35; opacity: .78;
  text-shadow: 0 1px 6px rgba(0,0,0,.7); pointer-events: none;
  max-width: calc(100% - 28px);
}

@media (max-width: 700px) {
  #list { top: auto; bottom: 54px; max-height: 36vh; width: min(220px, 48vw); }
  #hud { width: min(280px, calc(100% - 28px)); }
  #cams { max-width: calc(100% - 16px); }
  #handle { font-size: 13px; padding: 7px 12px; }
}
