/* Layout: an operations console — world map left, round radar scope right, telemetry and event log below.
   One dark world on purpose (phosphor amber on night-blue), so no light theme. */
:root {
  --bg: #070b10;
  --panel: #0c131b;
  --panel-2: #0f1822;
  --line: #1b2836;
  --text: #c8d3dc;
  --muted: #6b7f8f;
  --amber: #ffb000;
  --amber-dim: #8a5f00;
  --iss: #74d6ff;
  --quake: #ff5a4e;
  --quake-6: #ff9a3c;
  --quake-24: #9a6a5a;
  --good: #7ad39a;
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #0d1824 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--mono);
  padding-inline: 16px;
  padding-block: 0 24px;
  min-height: 100vh;
}
a { color: var(--amber); text-decoration: none; border-bottom: 1px dotted var(--amber-dim); }
a:hover, a:focus-visible { border-bottom-style: solid; outline: none; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  max-width: 1440px; margin: 0 auto; padding-block: 18px 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.lat { font: 600 34px/1 var(--display); letter-spacing: .02em; color: var(--amber); text-shadow: 0 0 18px rgba(255, 176, 0, .35); }
.sub { font: 500 12px/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.clocks { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.clock { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.k { font: 500 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.clock span:last-child { font-size: 16px; color: var(--text); }
.link { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.link.live .dot { background: var(--good); box-shadow: 0 0 10px var(--good); animation: blink 2s ease-in-out infinite; }
.link.live { color: var(--good); }
.link.stale .dot { background: var(--quake-6); }
.link.stale { color: var(--quake-6); }
@keyframes blink { 50% { opacity: .35; } }

.grid {
  max-width: 1440px; margin: 18px auto 0;
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  grid-template-areas: "world scope" "readouts quakes";
}
.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.world { grid-area: world; }
.scope { grid-area: scope; }
.readouts { grid-area: readouts; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; align-content: start; }
.quakes { grid-area: quakes; }
.ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
h2, h3 { margin: 0; font: 600 13px/1.2 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--amber); }
h3 { font-size: 12px; margin-bottom: 8px; }
.hint { font: 400 12px/1.3 var(--mono); color: var(--muted); }

.canvas-wrap { position: relative; width: 100%; }
.world-wrap { aspect-ratio: 2 / 1; }
.scope-wrap { aspect-ratio: 1 / 1; max-width: 560px; margin: 0 auto; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sw.iss { background: var(--iss); box-shadow: 0 0 6px var(--iss); }
.sw.q1 { background: var(--quake); }
.sw.q6 { background: var(--quake-6); }
.sw.q24 { background: var(--quake-24); }
.sw.sun { background: #ffd66b; }
.sw.st { background: transparent; border: 1.5px solid var(--amber); border-radius: 2px; }

.scope-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.scope-foot div { display: flex; flex-direction: column; gap: 4px; }
.scope-foot span:last-child { font-size: 15px; }

dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kp-row { display: flex; align-items: center; gap: 14px; }
.kp-now { font: 600 40px/1 var(--display); color: var(--amber); min-width: 2.2ch; font-variant-numeric: tabular-nums; }
#kp-bars { flex: 1; height: 48px; min-width: 0; }
.aurora { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.aurora b { color: var(--text); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font: 500 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
td.mag { font-weight: 600; }
td:first-child, td:nth-child(3), td:nth-child(4) { white-space: nowrap; }
td.mag.hot { color: var(--quake); }
td.mag.warm { color: var(--quake-6); }
.muted { color: var(--muted); }

.foot { max-width: 1440px; margin: 18px auto 0; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.foot p { margin: 0; }

@media (max-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "world" "scope" "readouts" "quakes"; }
  .lat { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .link.live .dot { animation: none; }
}
