:root {
  --bg: #07090b;
  --panel: #0d1013;
  --line: #20262b;
  --text: #cfd6da;
  --dim: #7d8a92;
  --hot: #ff9a4d;
  --cold: #6cb6e8;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.45 var(--mono); overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
a { color: var(--text); }

#app { display: grid; grid-template-columns: minmax(0, 1fr) 430px; height: 100%; }
#stage { position: relative; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #0e1418 0%, var(--bg) 70%); }

#globes { position: absolute; inset: 0 0 64px 0; display: flex; }
.globe { position: relative; flex: 1 1 0; min-width: 0; cursor: grab; touch-action: none; }
.globe.drag { cursor: grabbing; }
.globe[hidden] { display: none; }
.globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe .fx { pointer-events: none; }
.globe .tag { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.globe + .globe { border-left: 1px solid var(--line); }

#title { position: absolute; top: 14px; left: 18px; z-index: 2; pointer-events: none; text-shadow: 0 0 8px #000; }
#title h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
#title h1 span { color: var(--hot); }
#dateLabel { font-size: 30px; font-weight: 300; letter-spacing: .02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
#stateLabel { color: var(--dim); }
#stateLabel b { font-weight: 600; }

#menu { position: absolute; left: 18px; bottom: 78px; max-width: min(500px, calc(100% - 300px)); background: #0b0e11e6; border: 1px solid var(--line); border-radius: 4px; }
#menuToggle { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 10px; cursor: pointer; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
#menuToggle span { float: right; }
#menuBody { padding: 2px 10px 8px; max-height: 46vh; overflow-y: auto; font-size: 12px; }
#menu.closed #menuBody { display: none; }
.row { display: grid; grid-template-columns: 62px 1fr; gap: 6px; align-items: start; padding: 1px 0; }
.row.tight { grid-template-columns: auto 1fr; margin-top: 8px; align-items: center; }
.k { color: var(--dim); padding-top: 3px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips.right { margin: 0 0 6px -7px; }
.chip { background: none; border: 1px solid transparent; border-radius: 3px; padding: 2px 7px; cursor: pointer; color: var(--dim); white-space: nowrap; }
.chip:hover { color: #fff; border-color: var(--line); }
.chip.on { color: #fff; border-color: #55616a; background: #1a2026; }
.chip:disabled { opacity: .35; cursor: default; }
.chip:focus-visible, #play:focus-visible, #menuToggle:focus-visible { outline: 1px solid var(--hot); outline-offset: 1px; }

#legend { position: absolute; right: 16px; top: 14px; width: 250px; background: #0b0e11e6; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
#legendTitle { font-size: 12px; margin-bottom: 5px; }
#legendBar { width: 100%; height: 10px; display: block; image-rendering: auto; border-radius: 2px; }
#legendTicks { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; margin-top: 2px; }
#readout { margin-top: 5px; color: var(--text); font-size: 12px; min-height: 2.9em; font-variant-numeric: tabular-nums; }

#timebar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; display: flex; gap: 12px; align-items: center; padding: 0 18px; border-top: 1px solid var(--line); background: #090b0d; }
#play { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #55616a; background: #1a2026; cursor: pointer; font-size: 13px; flex: none; }
#play:hover { border-color: #fff; }
#sliderWrap { flex: 1; min-width: 0; padding-top: 6px; }
#slider { width: 100%; margin: 0; accent-color: var(--hot); display: block; }
#months { position: relative; height: 16px; color: var(--dim); font-size: 10.5px; margin: 2px 8px 0; }
#months span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
#months span.y { color: var(--text); }
#speed { background: #1a2026; border: 1px solid var(--line); border-radius: 3px; padding: 4px; flex: none; }

#panel { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 4px 16px 24px; }
#panel section { padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
#panel section:last-child { border-bottom: 0; }
#panel h2 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
#panel h2 .sub { display: block; color: var(--dim); font-weight: 400; letter-spacing: 0; text-transform: none; }
.chart { width: 100%; display: block; cursor: crosshair; }
.note, .credits p { color: var(--dim); font-size: 11.5px; margin: 6px 0 0; }
#aboutText { margin: 0; }

#tip { position: fixed; z-index: 5; pointer-events: none; background: #000d; border: 1px solid var(--line); border-radius: 3px; padding: 3px 7px; font-size: 12px; white-space: nowrap; }

@media (max-width: 900px) {
  body { overflow: auto; }
  #app { display: block; height: auto; }
  #stage { height: 100svh; }
  #legend { display: none; }
  #menu { max-width: calc(100% - 36px); }
  #panel { border-left: 0; border-top: 1px solid var(--line); }
}
