* { box-sizing: border-box; }
:root { font: 15px "DM Sans", sans-serif; color: #edf6f2; background: black; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .54; cursor: default; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid #e58b57; outline-offset: 2px; }
button, summary { touch-action: manipulation; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }
.topbar { background: #fbf8f0; color: #284d3e; padding: max(7px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { font: 600 25px/1 "Fredoka", sans-serif; letter-spacing: -.8px; display: flex; gap: 7px; align-items: center; margin: 0; }
.brand-second { font-weight: 400; }.brand b { color: #df8057; }
#tagline { margin: 3px 0 0 39px; color: #516459; font-size: 11px; line-height: 1.3; }
nav, nav button { display: flex; align-items: center; gap: 7px; }
nav button { justify-content: center; font-size: 13px; border-radius: 8px; min-height: 42px; min-width: 42px; padding: 7px 11px; }
nav button:hover { background: #e9ece2; } nav #install { background: #284d3e; color: #fffaf1; }
main { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
#map { position: absolute; inset: 0; background: #000; }
#compass { position: absolute; right: max(11px, env(safe-area-inset-right)); top: 12px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: white; box-shadow: 0 0 0 2px #0003; }
#compass svg { width: 38px; height: 38px; }
#compass-dial { transform-origin: 20px 20px; }
.map-tools { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 60px; display: grid; border: 1px solid #354540; border-radius: 10px; overflow: hidden; background: #101916ed; }
.map-tools button { color: #9ef8de; display: grid; place-items: center; height: 36px; width: 36px; font-size: 19px; }
.map-tools button:hover { background: #293932; }
/* Bottom-center live panel, sized to the Chasing Invader radar. */
.stats {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  width: min(270px, calc(100% - 24px));
  padding: 10px 14px;
  border: 1px solid #225860;
  border-radius: 20px;
  background: #091b25ee;
  color: #b9fff1;
  font: 600 12px/16px Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.summary { text-align: center; }
#connection[data-state="error"] { color: #ffc998; }
.frequency { margin-top: 6px; font: 600 9px/12px Arial, sans-serif; }
#chart { display: flex; align-items: end; height: 32px; margin-top: 3px; border-bottom: 1px solid #255156; }
.chart-bar { flex: none; background: #80ffe5; }
.maplibregl-ctrl-bottom-right { bottom: env(safe-area-inset-bottom); right: env(safe-area-inset-right); }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { margin: 0 4px 4px 0; }
.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button { padding: 0; }
.map-tools #locate { border-top: 1px solid #354540; }
.my-position { width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: #30bca2; box-shadow: 0 0 0 5px #5fffe237; pointer-events: none; }
#location-message { position: absolute; top: 55px; right: 58px; max-width: min(240px, 65vw); padding: 10px; background: #102831; color: #e8fff8; border-radius: 8px; font-size: 13px; }
.maplibregl-ctrl-scale { color: #151515; }
.maplibregl-ctrl-bottom-left { bottom: env(safe-area-inset-bottom); left: env(safe-area-inset-left); }
@media (max-width: 560px) {
  .stats { bottom: calc(54px + env(safe-area-inset-bottom)); }
}
#map-message { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); padding: 12px; background: #15201c; border-radius: 8px; font-size: 13px; }
.maplibregl-popup-content { color: #20392d; border-radius: 10px; padding: 14px 22px 12px 14px; }
.maplibregl-popup-content p { margin: 5px 0 0; }
.flash-popup .maplibregl-popup-content { padding: 10px; background: #102831; color: #e8fff8; border: 1px solid #225860; }
.flash-popup .maplibregl-popup-close-button { color: #b9fff1; font-size: 18px; width: 28px; height: 28px; }
.flash-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #102831; }
.flash-card { display: grid; gap: 4px; width: min(184px, 56vw); }
.flash-card strong { padding-right: 16px; line-height: 18px; }
.flash-card time { color: #bad8d1; font-size: 11px; line-height: 16px; }
.flash-card img, .flash-card > span { width: 100%; height: min(155px, 23dvh); background: #071820; border-radius: 6px; }
.flash-card img { object-fit: contain; }
.flash-card > span { display: grid; place-items: center; color: #bad8d1; }
.flash-navigation { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; color: #b9fff1; }
.flash-navigation button { height: 36px; width: 36px; border: 1px solid #335b62; border-radius: 8px; background: #17343b; font: 24px/1 Arial, sans-serif; }
.flash-popup:has(.flash-navigation[hidden]) .maplibregl-popup-content { pointer-events: none; }
dialog { background: #121b18; color: #eef3ed; border: 1px solid #435448; border-radius: 16px; padding: 24px; width: min(420px, calc(100% - 28px)); max-height: 85dvh; overflow: auto; }
dialog::backdrop { background: #0009; }
dialog h2 { font: 500 25px "Fredoka", sans-serif; margin: 0 32px 16px 0; }
dialog h3 { font-size: 13px; margin: 18px 0 8px; color: #bbccbf; }
dialog p { font-size: 13px; line-height: 1.6; }
.dialog-close { float: right; width: 34px; height: 34px; font-size: 24px; }
.setting { display: block; margin-top: 6px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid #526356; border-radius: 8px; }
.setting[aria-pressed="true"] { background: #294237; }
.studio-logo { display: block; margin: 8px 0 18px; height: auto; }
summary { cursor: pointer; padding: 7px 0; }
#feed { max-height: 220px; overflow: auto; }
.feed-row { width: 100%; display: flex; gap: 8px; align-items: center; text-align: left; padding: 8px; border-bottom: 1px solid #334039; }
.feed-flash svg { width: 14px; height: 14px; color: #e6bc86; }
.feed-time { margin-left: auto; font-size: 12px; color: #c2cfc6; }
@media (max-width: 620px) {
  nav button span { display: none; }
  nav { gap: 1px; } nav button { padding: 6px; }
  .topbar { padding-inline: 10px; }
  .brand { font-size: 22px; } .brand img { width: 27px; height: 27px; }
  #tagline { margin-left: 0; font-size: 10px; max-width: 220px; }

}
.iss-marker {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  color: #dfb2a2;
}
.iss-marker > svg {
  width: 22px;
  height: 15px;
  opacity: .78;
  stroke: none;
  fill: none;
}
.iss-marker > span {
  position: absolute;
  top: calc(50% + 9px);
  padding: 2px 4px;
  border-radius: 3px;
  background: #172d29;
  font-size: 9px;
  visibility: hidden;
}
.iss-marker:focus-visible { outline: 2px solid currentColor; }
.iss-marker:focus-visible > span { visibility: visible; }
@media (hover: hover) {
  .iss-marker:hover > span { visibility: visible; }
  .iss-marker:hover > svg { opacity: 1; }
}
.iss-nearby > svg { animation: iss-nearby-pulse 1.5s ease-in-out infinite; }
@keyframes iss-nearby-pulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px #ffc494); }
  50% { opacity: .32; }
}
@media (prefers-reduced-motion: reduce) {
  .iss-nearby > svg { animation: none; opacity: 1; filter: drop-shadow(0 0 4px #ffc494); }
}
