/* ============================================================
   Orrery — HUD
   A dark instrument panel over a full-bleed WebGL stage.
   Light colour scheme swaps the glass, never the sky.
   ============================================================ */

:root {
  color-scheme: dark;

  --sky:        #04060d;
  --glass:      rgba(14, 19, 32, 0.62);
  --glass-2:    rgba(20, 27, 44, 0.72);
  --stroke:     rgba(150, 190, 255, 0.16);
  --stroke-2:   rgba(150, 190, 255, 0.28);
  --ink:        #e8eefc;
  --ink-2:      #9dabc7;
  --ink-3:      #6b7a99;
  --accent:     #74d0ff;
  --accent-2:   #ffb454;
  --accent-ink: #04121c;
  --warm:       #ff8a5c;
  --shadow:     0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --radius:     16px;
  --radius-sm:  10px;
  --pad:        14px;

  --font: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --glass:      rgba(248, 250, 255, 0.80);
    --glass-2:    rgba(255, 255, 255, 0.88);
    --stroke:     rgba(24, 44, 84, 0.14);
    --stroke-2:   rgba(24, 44, 84, 0.26);
    --ink:        #101a2c;
    --ink-2:      #4a5771;
    --ink-3:      #78859d;
    --accent:     #0a6fa8;
    --accent-2:   #b45c07;
    --accent-ink: #ffffff;
    --warm:       #b8442a;
    --shadow:     0 18px 44px rgba(12, 22, 44, 0.28), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body { touch-action: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ─────────────── stage ─────────────── */

#stage { position: fixed; inset: 0; }

#scene-canvas {
  display: block;
  width: 100%; height: 100%;
  cursor: grab;
  outline: none;
}
#scene-canvas:active { cursor: grabbing; }
#scene-canvas.is-hover { cursor: pointer; }
#scene-canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

#labels {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.lbl {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  padding: 2px 7px 2px 16px;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.42);
  border: 1px solid rgba(160, 200, 255, 0.14);
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  will-change: transform;
}
.lbl::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%;
  background: var(--lbl-c, #9fd3ff);
  box-shadow: 0 0 7px var(--lbl-c, #9fd3ff);
}
.lbl.is-sel {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(6, 14, 26, 0.62);
}
.lbl.is-moon { font-size: 10px; opacity: .78; text-transform: none; letter-spacing: .04em; }

@media (prefers-color-scheme: light) {
  .lbl {
    color: #eaf2ff;
    background: rgba(6, 12, 24, 0.55);
    border-color: rgba(180, 214, 255, 0.22);
  }
  .lbl.is-sel { color: #9fdcff; border-color: rgba(159, 220, 255, .6); }
}

.pointer-hint {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
}
.pointer-hint.on { opacity: .5; }

/* ─────────────── shared panel chrome ─────────────── */

.hud {
  position: fixed;
  z-index: 20;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

button, input, select { font: inherit; color: inherit; }

button { -webkit-tap-highlight-color: transparent; }

:where(button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─────────────── top bar ─────────────── */

#topbar {
  top: 14px; left: 14px; right: 14px;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 24px; height: 24px; color: var(--accent-2); flex: none; }
.brand-text {
  font-weight: 620;
  letter-spacing: .19em;
  text-transform: uppercase;
  font-size: 13px;
}

.clock { text-align: center; line-height: 1.15; }
.clock-date {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
}
.clock-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.clock-tz { color: var(--ink-3); font-size: 10px; letter-spacing: .12em; }

.topbar-right {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

.rate-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rate-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.rate-chip.running .rate-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.rate-chip.reverse .rate-dot { background: var(--warm); box-shadow: 0 0 8px var(--warm); }

.perf {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  text-align: right;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--ink); background: var(--glass-2); border-color: var(--stroke-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--warm);
  border-color: transparent;
}

/* ─────────────── side panels ─────────────── */

.panel { width: 250px; display: flex; flex-direction: column; }

.panel-left  { top: 86px; left: 14px; max-height: calc(100vh - 300px); }
.panel-right { top: 86px; right: 14px; max-height: calc(100vh - 300px); }
.panel-view  { right: 14px; bottom: 14px; width: 250px; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 11px var(--pad) 9px;
  background: none; border: 0; border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  text-align: left;
}
.panel-title {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.chev {
  width: 8px; height: 8px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s var(--ease);
}
.panel-head[aria-expanded="false"] .chev { transform: rotate(-45deg) translate(-1px, 1px); }

.panel-body {
  padding: 0 var(--pad) var(--pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--stroke-2) transparent;
}
.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 8px; }
.panel-head[aria-expanded="false"] + .panel-body { display: none; }

/* body list */

.body-list { display: flex; flex-direction: column; gap: 1px; }

.body-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.body-item:hover { background: var(--glass-2); }
.body-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}
.body-item.is-moon { padding-left: 22px; }

.dot {
  width: 11px; height: 11px; border-radius: 50%;
  flex: none;
  background: var(--c, #888);
  box-shadow: 0 0 9px -1px var(--c, #888), inset -2px -2px 3px rgba(0,0,0,.45);
}
.body-item.is-moon .dot { width: 7px; height: 7px; }

.bi-name { font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.body-item.is-moon .bi-name { font-size: 12px; color: var(--ink-2); }
.bi-key {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 0 4px;
  flex: none;
}

.ghost-btn {
  margin-top: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.ghost-btn:hover { background: var(--glass-2); color: var(--ink); }

/* info panel */

.info-head { display: flex; align-items: center; gap: 11px; margin: 2px 0 8px; }
.info-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 52%),
    var(--c, #888);
  box-shadow: 0 0 16px -3px var(--c, #888), inset -5px -4px 9px rgba(0,0,0,.55);
}
.info-name { margin: 0; font-size: 19px; font-weight: 620; letter-spacing: -.01em; }
.info-type {
  margin: 1px 0 0;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.info-desc {
  margin: 0 0 12px;
  font-size: 12.5px; line-height: 1.5;
  color: var(--ink-2);
}

.sub-h {
  margin: 12px 0 6px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--stroke);
}

.stats { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.stats dt { font-size: 11.5px; color: var(--ink-3); align-self: baseline; }
.stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  word-break: break-word;
}
.stats dd.warm { color: var(--accent-2); }

/* view options */

.opts { display: flex; flex-direction: column; gap: 1px; }

.opt {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.opt:hover { background: var(--glass-2); color: var(--ink); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt .box {
  width: 15px; height: 15px; flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--stroke-2);
  position: relative;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.opt .box::after {
  content: "";
  position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px;
  border-right: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(42deg) scale(.4);
  opacity: 0;
  transition: opacity .13s var(--ease), transform .13s var(--ease);
}
.opt input:checked + .box { background: var(--accent); border-color: var(--accent); }
.opt input:checked + .box::after { opacity: 1; transform: rotate(42deg) scale(1); }
.opt input:checked ~ span:last-child { color: var(--ink); }
.opt input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

.opt-rule { border: 0; border-top: 1px solid var(--stroke); margin: 7px 4px; }

.opt-note {
  margin: 9px 2px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ─────────────── time deck ─────────────── */

#deck {
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 300px));
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-transport {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: filter .16s var(--ease), transform .16s var(--ease);
}
.play-btn:hover { filter: brightness(1.1); }
.play-btn:active { transform: scale(.97); }
.play-btn svg { width: 17px; height: 17px; }
.play-btn .ic-pause { display: none; }
.play-btn[aria-pressed="true"] .ic-pause { display: block; }
.play-btn[aria-pressed="true"] .ic-play { display: none; }

.speed-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.speed-label {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.speed-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 2px 0 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 48%), rgba(140,170,220,.20) var(--fill, 48%), rgba(140,170,220,.20) 100%);
}
input[type="range"]::-moz-range-track {
  height: 5px; border-radius: 4px; background: rgba(140,170,220,.20);
}
input[type="range"]::-moz-range-progress {
  height: 5px; border-radius: 4px; background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  transition: transform .14s var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.14); }

.speed-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: -2px;
}

.presets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.presets button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: none;
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.presets button:hover { background: var(--glass-2); color: var(--ink); border-color: var(--stroke-2); }
.presets button.on {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink);
}

.deck-date {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--stroke);
  padding-top: 10px;
}
.date-label {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; white-space: nowrap;
}
#date-input {
  flex: 1;
  min-width: 0;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: var(--glass-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ─────────────── help ─────────────── */

#help-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(2, 5, 12, .62);
  backdrop-filter: blur(3px);
}

#help-dialog {
  z-index: 41;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.help-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-top h2 { margin: 0; font-size: 18px; font-weight: 620; letter-spacing: -.01em; }

.help-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 26px;
}
.help-grid h3 {
  margin: 0 0 8px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  padding-bottom: 5px; border-bottom: 1px solid var(--stroke);
}
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.keys li { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.keys li > span:first-child, kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  border: 1px solid var(--stroke-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--glass-2);
  white-space: nowrap;
}
.help-note { margin: 0 0 8px; font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.help-note:empty { display: none; }

/* ─────────────── loading ─────────────── */

#loading {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #0c1426 0%, #04060d 68%);
  transition: opacity .7s var(--ease), visibility .7s;
}
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }

.load-inner { text-align: center; width: min(320px, 80vw); }

.load-mark { position: relative; width: 88px; height: 88px; margin: 0 auto 18px; }
.load-sun {
  position: absolute; inset: 50% auto auto 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff5d8, #ffb454 55%, #d9691a);
  box-shadow: 0 0 30px 4px rgba(255, 175, 76, .55);
}
.load-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(116, 208, 255, .22);
}
.load-ring::after {
  content: "";
  position: absolute; top: -4px; left: 50%;
  width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%;
  background: #74d0ff;
  box-shadow: 0 0 14px 2px rgba(116, 208, 255, .8);
}
.load-ring { animation: spin 3.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.load-title {
  margin: 0;
  font-size: 15px; font-weight: 620;
  letter-spacing: .34em; text-transform: uppercase;
  color: #e8eefc;
}
.load-sub { margin: 6px 0 22px; font-size: 12px; color: #7d8ba8; letter-spacing: .04em; }

.load-track {
  height: 3px; border-radius: 3px;
  background: rgba(140, 170, 220, .16);
  overflow: hidden;
}
#loading-bar {
  height: 100%; width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #74d0ff, #ffb454);
  transition: width .35s var(--ease);
}
.load-msg {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: #6b7a99;
  min-height: 1.2em;
}

/* ─────────────── fatal ─────────────── */

#fatal {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 24px;
  background: #04060d;
}
#fatal[hidden] { display: none; }
.fatal-card {
  max-width: 460px;
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(150, 190, 255, .18);
  background: rgba(16, 22, 38, .8);
  color: #e8eefc;
}
.fatal-card h2 { margin: 0 0 10px; font-size: 18px; }
.fatal-card p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; color: #9dabc7; }
.fatal-note { font-size: 12px !important; color: #6b7a99 !important; }

/* ─────────────── responsive ─────────────── */

@media (max-width: 1180px) {
  .panel { width: 216px; }
  #deck { width: min(520px, calc(100vw - 470px)); }
}

@media (max-width: 900px) {
  #topbar { height: 52px; padding: 0 12px; }
  .brand-text { display: none; }
  .perf { display: none; }

  .panel { width: 190px; }
  .panel-left  { top: 74px; left: 10px; max-height: 34vh; }
  .panel-right { top: 74px; right: 10px; max-height: 34vh; }
  .panel-view  { right: 10px; bottom: auto; top: calc(74px + 36vh); max-height: 30vh; }
  .panel-view .panel-body { overflow-y: auto; }

  #deck {
    left: 10px; right: 10px; bottom: 10px;
    width: auto;
    transform: none;
    padding: 10px 14px 12px;
  }
  .deck-date { display: none; }
  .presets button:nth-child(n+5) { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .panel { width: 168px; }
  .panel-left, .panel-right { max-height: 30vh; }
  .panel-view { top: auto; bottom: 176px; right: 10px; }
  .info-desc, .sub-h + .stats dt { font-size: 11px; }
  .speed-ticks span:nth-child(4) { display: none; }
}

@media (max-height: 600px) {
  .panel-left, .panel-right { max-height: 40vh; }
  .panel-view { display: none; }
}

/* ─────────────── reduced motion ─────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .load-ring { animation: none; }
}
