/* rmd-sky — liquid-glass plane spotter for the Ray-Ban Display. */
:root {
  --bg: #070a12;
  --ink: #f2f6fc;
  --ink-soft: #a7b3c8;
  --ink-mute: #66718a;
  --accent: #7dd3fc;
  --accent-2: #818cf8;
  --glass-bg: rgba(22, 29, 44, 0.55);
  --glass-bg-hi: rgba(46, 57, 82, 0.72);
  --glass-bord: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(22px) saturate(150%);
  --focus: #8fd6ff;
  --radius: 22px;
  --radius-sm: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 600px; height: 600px; overflow: hidden; }
body {
  background:
    radial-gradient(120% 90% at 20% 0%, #121b31 0%, rgba(18,27,49,0) 55%),
    radial-gradient(110% 80% at 100% 100%, #1a1533 0%, rgba(26,21,51,0) 50%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { width: 600px; height: 600px; position: relative; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---- faint starfield ---- */
.stars { position: absolute; inset: 0; pointer-events: none; opacity: 0.7; }
.stars::before, .stars::after {
  content: ""; position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgba(255,255,255,0.5);
  box-shadow: 78px 105px rgba(255,255,255,0.30), 190px 40px rgba(255,255,255,0.20), 320px 88px rgba(255,255,255,0.34),
    455px 60px rgba(255,255,255,0.22), 540px 140px rgba(255,255,255,0.30), 60px 300px rgba(255,255,255,0.18),
    520px 320px rgba(255,255,255,0.22), 110px 470px rgba(255,255,255,0.25), 300px 545px rgba(255,255,255,0.16),
    470px 500px rgba(255,255,255,0.28), 250px 190px rgba(255,255,255,0.14), 400px 250px rgba(255,255,255,0.18);
}
.stars::after { transform: translate(23px, 51px) scale(0.7); opacity: 0.6; }

/* ---- glass primitives ---- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-bord);
  box-shadow: 0 8px 30px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.16);
}

/* ---- radar ---- */
.radar-viewport { position: absolute; inset: 0; }
.rings { position: absolute; inset: 0; width: 600px; height: 600px; }
.ring-lines circle { fill: none; stroke: rgba(158,190,235,0.16); stroke-width: 1; }
#ticks line { stroke: rgba(158,190,235,0.20); stroke-width: 1; }
#world { position: absolute; left: 300px; top: 300px; width: 0; height: 0; will-change: transform; }

/* cardinal letters (inside #world, counter-rotated to stay upright) */
.cardinal { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: var(--ink-mute); letter-spacing: 0.5px; }
.cardinal.n { color: var(--accent); }

/* me (center) */
.me { position: absolute; left: 300px; top: 300px; width: 0; height: 0; pointer-events: none; }
.me-dot { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8f3ff, var(--accent) 60%);
  box-shadow: 0 0 0 4px rgba(125,211,252,0.18), 0 0 18px rgba(125,211,252,0.55); }

/* plane markers (inside #world) */
.plane { position: absolute; width: 0; height: 0; transition: opacity 0.4s; }
.plane-g { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; }
.plane-g svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.plane-g .body { fill: #b9c6dd; }
.plane-lbl { position: absolute; left: 0; top: 15px; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--ink-soft);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9); white-space: nowrap; }
.plane.dim { opacity: 0.55; }
.plane.sel { z-index: 3; }
.plane.sel .plane-g { animation: selpulse 2s ease-in-out infinite; }
.plane.sel .plane-g .body { fill: var(--accent); }
.plane.sel .plane-g svg { filter: drop-shadow(0 0 10px rgba(125,211,252,0.75)); }
.plane.sel .plane-lbl { color: #dff2ff; font-size: 12px; }
.plane.sel::before { content: ""; position: absolute; left: -21px; top: -21px; width: 42px; height: 42px;
  border-radius: 50%; border: 1.5px solid rgba(125,211,252,0.55); animation: ringpulse 2s ease-out infinite; }
@keyframes ringpulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes selpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---- fixed HUD ---- */
.hud-top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 6; pointer-events: none; }
.pill { height: 40px; display: flex; align-items: center; padding: 0 16px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
#pill-compass b { color: var(--accent); margin-right: 6px; font-weight: 800; }
.ring-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ring-lbl { position: absolute; left: 300px; font-size: 11px; font-weight: 600; color: var(--ink-mute);
  transform: translateX(-50%); text-shadow: 0 1px 4px rgba(0,0,0,0.9); font-variant-numeric: tabular-nums; }

/* ---- status / empty state ---- */
.status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7;
  max-width: 420px; padding: 18px 26px; border-radius: var(--radius); text-align: center;
  font-size: 17px; font-weight: 600; color: var(--ink-soft); line-height: 1.45; }

/* ---- flight card ---- */
.card { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 8;
  display: flex; gap: 14px; padding: 14px; border-radius: var(--radius);
  transform: translateY(0); opacity: 1; transition: transform 0.28s ease, opacity 0.28s ease; }
.card[hidden] { display: flex; transform: translateY(24px); opacity: 0; pointer-events: none; }
.card-photo { flex: none; width: 112px; height: 84px; border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(160deg, #1d2537, #131926); display: flex; align-items: center; justify-content: center; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo .ph-ic { width: 34px; height: 34px; fill: var(--ink-mute); }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-l1 { display: flex; align-items: center; gap: 10px; }
.card-cs { font-size: 22px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.chip { flex: none; font-size: 11px; font-weight: 700; color: var(--ink-soft);
  background: rgba(255,255,255,0.07); border: 1px solid var(--glass-bord); padding: 2px 8px; border-radius: 999px; }
.card-mode { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--accent); background: rgba(125,211,252,0.12); border: 1px solid rgba(125,211,252,0.35);
  padding: 2px 9px; border-radius: 999px; }
.card-mode.manual { color: #ffd166; background: rgba(255,209,102,0.10); border-color: rgba(255,209,102,0.35); }
.card-airline { font-size: 14px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-route { font-size: 15px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-route .iata { color: var(--accent); font-weight: 800; }
.card-route .arr { color: var(--ink-mute); margin: 0 6px; }
.card-stats { font-size: 13px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-stats .sep { color: var(--ink-mute); margin: 0 6px; }
.card-stats .up { color: #8ee6a8; } .card-stats .down { color: #ffb48a; }

/* ---- hint ---- */
.hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 5;
  font-size: 12px; font-weight: 600; color: var(--ink-mute); letter-spacing: 0.3px;
  background: rgba(10,13,20,0.55); padding: 6px 14px; border-radius: 999px; }

/* ---- lock / pairing ---- */
.content { flex: 1; overflow-y: auto; padding: 14px 16px 28px; scrollbar-width: none; }
.content.centered { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 30px; }
.lock-title { font-size: 34px; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-size: 16px; color: var(--ink-soft); line-height: 1.5; max-width: 460px; }
.sub.hint-s { font-size: 13px; color: var(--ink-mute); }
.sub.err { color: #ff8a8a; min-height: 20px; }
.pin { display: flex; gap: 10px; }
.digit { width: 54px; height: 70px; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; border-radius: 14px; border: 1px solid var(--glass-bord); background: var(--glass-bg); }
.digit:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(143,214,255,0.45); }
.pin-ok { width: 66px; height: 70px; border-radius: 14px; border: 1px solid rgba(125,211,252,0.5); background: rgba(125,211,252,0.22); color: #fff; font-size: 30px; font-weight: 800; cursor: pointer; }
.pin-ok:focus { outline: none; box-shadow: 0 0 0 3px rgba(143,214,255,0.5); }

/* ---- misc ---- */
.toast { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%) translateY(14px); opacity: 0; transition: all 0.25s; background: rgba(16,20,30,0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--glass-bord); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; z-index: 20; pointer-events: none; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
