/* God's Eye LIVE — lean, touch-first (Tesla browser is the acceptance test).
   Big targets (>=56px), no hover-only interactions. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #020409; color: #eaf2ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; }
#globe { position: fixed; inset: 0; }
#globe canvas { display: block; }

header { position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: linear-gradient(180deg, rgba(2,6,18,.92), rgba(2,6,18,.55) 80%, transparent);
  pointer-events: none; }
header > * { pointer-events: auto; }
h1 { font-size: 20px; letter-spacing: .14em; font-weight: 800; }
h1 .live { color: #ff5d47; }
#clock { margin-left: auto; font-size: 15px; color: #9db8dd; font-variant-numeric: tabular-nums; }

#pairbar { display: flex; align-items: center; gap: 10px;
  background: rgba(10,22,44,.9); border: 1px solid #274b7a; border-radius: 12px;
  padding: 6px 12px; min-height: 52px; }
#pairbar .code { font-size: 24px; font-weight: 800; letter-spacing: .22em; color: #ffe066; }
#pairbar .hint { font-size: 12px; color: #9db8dd; line-height: 1.25; }
#pairbar .dot { width: 14px; height: 14px; border-radius: 50%; background: #5a6b84; flex: none; }
#pairbar .dot.on { background: #51cf66; box-shadow: 0 0 10px #51cf66; }

#layers { position: fixed; left: 12px; bottom: 12px; z-index: 10;
  display: flex; flex-direction: column; gap: 8px; max-width: 46vw; }
.layerbtn { display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 58px; min-width: 218px; padding: 8px 14px; cursor: pointer;
  background: rgba(8,18,36,.88); color: #eaf2ff; border: 1px solid #274b7a;
  border-radius: 14px; font-size: 16px; }
.layerbtn .ic { font-size: 22px; }
.layerbtn .nm { font-weight: 700; }
.layerbtn .ct { color: #9db8dd; font-size: 13px; }
.layerbtn .fresh { margin-left: auto; font-size: 12.5px; color: #69db7c;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.layerbtn.off { opacity: .45; }
.layerbtn.err .fresh { color: #ff8787; }
.layerbtn:active { transform: scale(.98); }

#card { position: fixed; right: 12px; bottom: 12px; z-index: 11; width: min(360px, 92vw);
  background: rgba(8,18,36,.94); border: 1px solid #3b6db3; border-radius: 16px;
  padding: 14px 16px; display: none; }
#card.show { display: block; }
#card h2 { font-size: 18px; margin-bottom: 4px; padding-right: 44px; word-break: break-word; }
#card .kind { font-size: 12px; letter-spacing: .12em; color: #9db8dd; text-transform: uppercase; }
#card table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14.5px; }
#card td { padding: 3px 0; vertical-align: top; }
#card td.k { color: #9db8dd; width: 42%; }
#card .src { margin-top: 8px; font-size: 12.5px; color: #ffd43b; display: none; }
#cardClose { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  border-radius: 10px; border: 1px solid #274b7a; background: #0d213f; color: #eaf2ff;
  font-size: 20px; cursor: pointer; }

#toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 12;
  background: rgba(13,32,58,.95); border: 1px solid #ffd43b; color: #ffe066;
  padding: 12px 20px; border-radius: 12px; font-size: 16px; display: none; max-width: 92vw; }
#toast.show { display: block; }

footer { position: fixed; right: 12px; bottom: 12px; z-index: 9; font-size: 11px;
  color: #63788f; max-width: 40vw; text-align: right; }
#card.show ~ footer { display: none; }

/* ---------- Live Cams (panel + viewer; DOM built by js/cams.js) ---------- */
#campanel { position: fixed; top: 76px; right: 12px; bottom: 12px; z-index: 13;
  width: min(400px, 94vw); display: none; flex-direction: column;
  background: rgba(6,14,30,.97); border: 1px solid #3b6db3; border-radius: 16px;
  padding: 14px; }
#campanel.show { display: flex; }
#campanel #camlist { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.camhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.camhead h2 { font-size: 19px; letter-spacing: .04em; }
.camnote { font-size: 13px; color: #9db8dd; margin-bottom: 10px; line-height: 1.4; }
.camgroup { font-size: 14px; letter-spacing: .06em; color: #ffe066;
  margin: 14px 0 8px; text-transform: uppercase; }
.cambtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  min-height: 58px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer;
  background: rgba(10,22,44,.9); color: #eaf2ff; border: 1px solid #274b7a;
  border-radius: 12px; font-size: 15px; }
.cambtn:active { transform: scale(.98); }
.cambtn .camtx { flex: 1; min-width: 0; }
.cambtn .camnm { font-weight: 700; font-size: 15.5px; }
.cambtn .campl { color: #9db8dd; font-size: 12.5px; }
.camtag { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  padding: 5px 8px; border-radius: 999px; }
.camtag.vid { background: #5c1616; color: #ff8787; border: 1px solid #ff5d47; }
.camtag.sti { background: #4a3503; color: #ffd43b; border: 1px solid #b58900; }
#camsearch { width: 100%; min-height: 56px; font-size: 17px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid #3b6db3; background: #04101f;
  color: #eaf2ff; margin-bottom: 6px; }
.camchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.camchip { min-height: 48px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid #274b7a; background: #0d213f; color: #eaf2ff; font-size: 14px; }
.camchip.sel { background: #1c4e89; border-color: #4d7cff; }
#camresNote { margin-bottom: 8px; }
.camx { margin-left: auto; flex: none; width: 48px; height: 48px; border-radius: 10px;
  border: 1px solid #274b7a; background: #0d213f; color: #eaf2ff; font-size: 20px;
  cursor: pointer; }
.camback { flex: none; min-height: 48px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid #274b7a; background: #0d213f; color: #eaf2ff; font-size: 16px;
  cursor: pointer; }

#camview { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 14; width: min(880px, 96vw); display: none;
  background: rgba(6,14,30,.98); border: 1px solid #3b6db3; border-radius: 16px;
  padding: 14px; }
#camview.show { display: block; }
#camview .camttl { flex: 1; min-width: 0; }
#camview .camttl h2 { font-size: 19px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
#camMeta { color: #9db8dd; font-size: 13.5px; }
#camMedia { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: 10px; overflow: hidden; }
#camMedia iframe, #camMedia img { position: absolute; inset: 0; width: 100%;
  height: 100%; border: 0; }
#camMedia img { object-fit: contain; }
#camStatus { margin-top: 10px; font-size: 14px; color: #ffe066; line-height: 1.4; }

@media (max-width: 760px) {
  #campanel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto;
    max-height: 62vh; }
  #camview { width: 96vw; padding: 10px; }
}
  h1 { font-size: 16px; }
  #pairbar .hint { display: none; }
  #layers { max-width: 94vw; flex-direction: row; flex-wrap: wrap; }
  .layerbtn { min-width: 0; flex: 1 1 44%; }
}

/* ---------- Deep Space Network (panel; DOM built by js/dsn.js) ---------- */
#dsnpanel { position: fixed; top: 76px; right: 12px; bottom: 12px; z-index: 13;
  width: min(400px, 94vw); display: none; flex-direction: column;
  background: rgba(6,14,30,.97); border: 1px solid #3b6db3; border-radius: 16px;
  padding: 14px; }
#dsnpanel.show { display: flex; }
#dsnpanel #dsnlist { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.camtag.dsntalk { background: #0d3a1a; color: #69db7c; border: 1px solid #2f9e44; }
.camtag.dsnassign { background: #4a3503; color: #ffd43b; border: 1px solid #b58900; }
.camtag.dsnidle { background: #22282f; color: #adb5bd; border: 1px solid #495057; }

@media (max-width: 760px) {
  #dsnpanel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto;
    max-height: 62vh; }
}

/* ---------- Layers panel toggle (2026-10-27 Tesla fix) ----------
   The layer grid had no way to hide it: on the Tesla browser it wrapped
   across most of the screen and buried the globe. The panel is now
   capped + scrollable, and a big pill button toggles it. On narrow
   screens and in Tesla browsers it starts hidden (globe first). */
#layers { max-height: calc(100vh - 110px); overflow-y: auto;
  -webkit-overflow-scrolling: touch; }
body.layers-hidden #layers { display: none; }
#layersToggle { position: fixed; right: 12px; bottom: 12px; z-index: 12;
  min-height: 56px; padding: 14px 22px; border-radius: 999px; cursor: pointer;
  background: #2ee6a8; color: #06251a; border: none;
  font-size: 17px; font-weight: 800; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
#layersToggle:active { transform: scale(.97); }
