/* Night radar scope: full-screen dark map, glowing amber planes, cyan range rings, red LIVE. One dark look by design. */
:root {
  --scope: #060a14; --panel: rgba(9, 15, 28, .92); --line: #22324f; --cyan: #39d0ff; --amber: #ffd34d; --live: #ff4d5e;
  --green: #4dff9a; --ink: #eef4ff; --mute: #93a3bf;
  --display: 'Oswald', 'Arial Narrow', Impact, sans-serif; --body: 'Inter', system-ui, -apple-system, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--scope); color: var(--ink); font-family: var(--body); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
#map { position: fixed; inset: 0; background: var(--scope); }
.leaflet-container { background: var(--scope); font-family: var(--body); }
.leaflet-control-attribution { background: rgba(6, 10, 20, .7) !important; color: #7d8aa3 !important; font-size: 10px; }
.leaflet-control-attribution a { color: #9fb3d4 !important; }

/* header */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 900; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(var(--st) + 10px) max(14px, var(--sr)) 26px max(14px, var(--sl));
  background: linear-gradient(rgba(6, 10, 20, .95), rgba(6, 10, 20, 0)); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 18px rgba(57, 208, 255, .35); }
.brand b { display: block; font: 700 21px/1 var(--display); letter-spacing: 2px; }
.brand span { font-size: 11px; color: var(--mute); letter-spacing: 1px; }
.live { display: flex; align-items: center; gap: 7px; background: rgba(12, 4, 8, .85); border: 1.5px solid var(--live); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.live b { color: var(--live); letter-spacing: 1.5px; font-family: var(--display); font-size: 14px; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--live); animation: lp 1.2s infinite; }
@keyframes lp { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .8); } 100% { box-shadow: 0 0 0 10px rgba(255, 77, 94, 0); } }

/* map buttons */
#ctrls { position: fixed; right: max(12px, calc(var(--sr) + 8px)); bottom: calc(var(--sb) + 30px); z-index: 900; display: flex; flex-direction: column; gap: 10px; }
#ctrls button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); font-size: 24px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
#me { color: var(--cyan); }

/* planes */
.pl { overflow: visible; }
.pl .ic { width: 34px; height: 34px; transition: transform .3s linear; filter: drop-shadow(0 0 6px rgba(255, 211, 77, .8)) drop-shadow(0 1px 2px #000); }
.pl.sel .ic { filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 4px var(--live)); }
.pl .lb { position: absolute; left: 34px; top: -4px; white-space: nowrap; font: 600 11px/1.25 var(--body); color: #fff;
  background: rgba(6, 10, 20, .8); border: 1px solid rgba(255, 211, 77, .5); border-radius: 6px; padding: 2px 5px; pointer-events: none; }
.pl .lb small { color: var(--amber); font-weight: 600; }
.pl.gnd .ic { width: 18px; height: 18px; opacity: .5; filter: none; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(57, 208, 255, .7); animation: mp 1.8s infinite; }
@keyframes mp { 0% { box-shadow: 0 0 0 0 rgba(57, 208, 255, .7); } 100% { box-shadow: 0 0 0 22px rgba(57, 208, 255, 0); } }
.ring-lb { color: var(--cyan); font: 600 11px var(--body); opacity: .8; white-space: nowrap; text-shadow: 0 1px 3px #000; }

/* plane sheet */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 18px max(18px, var(--sr)) calc(var(--sb) + 20px) max(18px, var(--sl));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .6); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .x { position: absolute; top: 12px; right: max(14px, var(--sr)); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; }
.fl { font: 700 34px/1 var(--display); letter-spacing: 2px; }
.al { color: var(--cyan); font-weight: 600; margin-top: 4px; }
.ty { color: var(--mute); font-size: 14px; margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.facts div { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; min-width: 0; }
.facts b { display: block; font: 700 22px var(--display); color: var(--amber); font-variant-numeric: tabular-nums; }
.facts span { font-size: 11px; color: var(--mute); letter-spacing: .5px; }
.trend { margin-top: 12px; font-size: 14px; color: var(--ink); }
.links { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.links a { flex: 1 1 140px; text-align: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 14px; }

/* start screen */
.start { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: calc(var(--st) + 24px) max(24px, var(--sr)) calc(var(--sb) + 24px) max(24px, var(--sl));
  background: radial-gradient(ellipse at 50% 30%, #14284d 0%, var(--scope) 65%); }
.start[hidden] { display: none; }
.big-ic { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 0 50px rgba(57, 208, 255, .35); }
.start h1 { margin: 0; font: 700 46px/1 var(--display); letter-spacing: 4px; }
.start p { margin: 0; max-width: 34ch; color: var(--mute); line-height: 1.5; }
.primary { width: min(340px, 100%); padding: 16px; border: 0; border-radius: 16px; font: 700 20px var(--display); letter-spacing: 1.5px;
  background: linear-gradient(90deg, var(--cyan), #b685ff); color: #04101c; box-shadow: 0 10px 30px rgba(57, 208, 255, .3); }
.ghost { width: min(340px, 100%); padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: transparent; font-weight: 600; }
.start .fine { font-size: 12px; }

/* install tip + toast */
.install { position: fixed; left: max(12px, var(--sl)); right: max(12px, var(--sr)); bottom: calc(var(--sb) + 14px); z-index: 950; display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--cyan); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); font-size: 14px; }
.install[hidden] { display: none; }
.install img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install div { flex: 1; min-width: 0; }
.install button { border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; background: var(--cyan); color: #04101c; }
.install .no { background: transparent; color: var(--mute); padding: 9px 6px; }
.toast { position: fixed; left: 50%; top: calc(var(--st) + 82px); transform: translateX(-50%); z-index: 1200; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .live i, .me-dot { animation: none; } .pl .ic { transition: none; } .sheet { animation: none; } }

a.listen { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 14px; text-decoration: none; color: #161000;
  background: linear-gradient(#ffe07a, #f0b400); border-radius: 14px; padding: 12px; font: 700 20px var(--display); letter-spacing: 1.5px;
  box-shadow: 0 8px 26px rgba(255, 211, 77, .3); }
a.listen small { font: 600 12px var(--body); letter-spacing: 0; opacity: .8; }
