/* =============================================================================
   JustLexx Skycam — shared design system
   Loaded by index.html, panorama.html, timelapse.html, best-captures.html.
   Every page draws from these tokens; no page redefines a colour or a face.
   ============================================================================= */

:root {
  color-scheme: dark;

  --void:       #05070f;
  --ink-deep:   #0b1020;
  --ink:        #ffffff;
  --ink-dim:    rgba(255, 255, 255, 0.68);
  --ink-faint:  rgba(255, 255, 255, 0.45);
  --glass:      rgba(10, 14, 26, 0.52);
  --glass-hi:   rgba(20, 26, 44, 0.72);
  --glass-line: rgba(255, 255, 255, 0.22);
  --sky:        #7dd3fc;
  --live:       #ef4444;

  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --pad: clamp(16px, 2.4vw, 30px);
}

* { box-sizing: border-box; }

/* The `hidden` attribute has to beat the component rules below: the UA
   stylesheet's [hidden] is a bare attribute selector, so a class like
   .transport { display: flex } outranks it and the element stays visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Full-bleed pages (the viewer pages) opt out of document scrolling. */
body.is-stage { height: 100%; overflow: hidden; }

/* Night-sky ground for the document-style pages. */
body.is-doc::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.75), transparent 60%),
    radial-gradient(1.5px 1.5px at 68% 12%, rgba(255,255,255,0.6),  transparent 60%),
    radial-gradient(2px   2px   at 42% 30%, rgba(255,255,255,0.7),  transparent 60%),
    radial-gradient(1.5px 1.5px at 86% 26%, rgba(255,255,255,0.5),  transparent 60%),
    linear-gradient(180deg, #0a1030 0%, #070b1c 42%, #05070f 100%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: var(--pad) var(--pad) 64px;
}

/* -----------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: 0.16s ease;
}

.btn:hover { background: var(--glass-hi); transform: translateY(-1px); }
.btn.is-on { background: #fff; color: var(--ink-deep); border-color: #fff; font-weight: 800; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-deep);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.16s ease;
}

.chip:hover { background: var(--glass-hi); color: var(--ink); }
.chip.is-on { background: #fff; color: var(--ink-deep); border-color: #fff; }

.iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.16s ease;
}

.iconbtn:hover { background: var(--glass-hi); transform: translateY(-1px); }
.iconbtn.is-on { background: var(--sky); color: var(--ink-deep); border-color: var(--sky); }

.btn:focus-visible,
.cta:focus-visible,
.chip:focus-visible,
.iconbtn:focus-visible,
.thumb:focus-visible,
.day:focus-visible,
.shot:focus-visible,
.scrub:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

/* -----------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

/* On the viewer pages the header floats over the image. */
.topbar.is-floating {
  position: fixed;
  z-index: 3;
  top: 0; left: 0; right: 0;
  padding: var(--pad);
}

.is-doc .topbar { padding-bottom: clamp(18px, 2.4vw, 28px); }

.brand h1 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.topbar.is-floating .brand h1 {
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.is-doc .brand h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); letter-spacing: -0.01em; }

.brand p {
  margin: 5px 0 0;
  color: var(--ink-dim);
  font-size: clamp(0.78rem, 1vw, 0.95rem);
}

.topbar.is-floating .brand p { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }

.topright { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar.is-floating .topright { flex-direction: column; align-items: flex-end; gap: 12px; }

.clock {
  font-size: clamp(1.5rem, 2.9vw, 2.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.6);
}

.date {
  margin-top: 5px;
  font-size: clamp(0.74rem, 0.95vw, 0.9rem);
  color: var(--ink-dim);
  text-align: right;
}

.suntimes {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: clamp(0.76rem, 1vw, 0.95rem);
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.suntimes .sun { display: inline-flex; align-items: baseline; gap: 6px; }
.suntimes b { color: var(--ink); font-weight: 600; }

.lbl {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-faint);
}

.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav .btn { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }

.count {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Viewer stage
   -------------------------------------------------------------------------- */

.stage { position: fixed; inset: 0; z-index: 0; background: var(--void); }

.stage canvas.viewport {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.stage.is-dragging canvas.viewport { cursor: grabbing; }

/* Snapshot / live frame, shown instead of the viewer. */
.framewrap { position: absolute; inset: 0; display: none; }
.framewrap.is-on { display: block; }

.framewrap img,
.framewrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.framewrap img.frame { object-fit: contain; }

/* Blurred fill behind the contained frame, so wide screens get a soft backdrop
   of the same sky rather than hard black bars. */
.framewrap img.frame-bg {
  object-fit: cover;
  transform: scale(1.15);
  filter: blur(34px) saturate(1.3) brightness(0.5);
}

.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3,6,14,0.62) 0%, rgba(3,6,14,0.12) 22%, transparent 40%),
    linear-gradient(0deg,  rgba(3,6,14,0.90) 0%, rgba(3,6,14,0.38) 20%, transparent 48%);
}

/* -----------------------------------------------------------------------------
   Floating viewer chrome
   -------------------------------------------------------------------------- */

.badge {
  position: fixed;
  z-index: 3;
  left: var(--pad);
  top: clamp(84px, 9vw, 120px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.badge.is-live { background: rgba(220, 38, 38, 0.86); border-color: rgba(255,255,255,0.28); }
.badge.is-live::before { background: #fff; animation: blink 1.5s ease-in-out infinite; }
.badge.is-tl { background: rgba(125, 211, 252, 0.9); color: var(--ink-deep); border-color: rgba(255,255,255,0.3); }
.badge.is-tl::before { background: var(--ink-deep); }
.badge.is-down { background: rgba(180, 83, 9, 0.82); border-color: rgba(255,255,255,0.24); }
.badge.is-down::before { background: #ffd9a8; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Instrument readout under the badge. */
.meta {
  position: fixed;
  z-index: 3;
  left: var(--pad);
  top: clamp(126px, 13vw, 168px);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.75;
  color: var(--ink-faint);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.meta b { color: var(--ink-dim); font-weight: 500; }
.meta a { color: var(--sky); text-decoration: none; }
.meta a:hover { text-decoration: underline; }

/* Anchored to the bottom-right rather than the top: the header's clock, sun
   times and nav stack to a variable height, and a top-anchored column collides
   with the nav row on common window sizes. */
.tools {
  position: fixed;
  z-index: 3;
  right: var(--pad);
  bottom: clamp(112px, 13vw, 140px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint {
  position: fixed;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(200px, 23vw, 240px);
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: opacity 0.5s ease;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.hint.gone { opacity: 0; }

/* -----------------------------------------------------------------------------
   Bottom HUD — compass, tier chips, transport
   -------------------------------------------------------------------------- */

.hud {
  position: fixed;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(112px, 13vw, 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(760px, 92vw);
}

.compasswrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.compasswrap canvas { display: block; width: min(520px, 74vw); height: 34px; }

.bearing {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.tiers, .transport { pointer-events: auto; }
.tiers { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 640px;
}

.play {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--ink-deep);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.tlclock {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  flex: 0 0 auto;
}

.scrub {
  flex: 1 1 auto;
  min-width: 60px;
  height: 4px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  cursor: pointer;
}

.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  cursor: pointer;
}

.scrub::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  cursor: pointer;
}

.speeds { display: flex; gap: 4px; flex: 0 0 auto; }

.spd {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.spd:hover { color: var(--ink); }
.spd:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.spd.is-on { background: rgba(255, 255, 255, 0.16); color: var(--ink); }

/* -----------------------------------------------------------------------------
   Filmstrip
   -------------------------------------------------------------------------- */

.strip {
  position: fixed;
  z-index: 3;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px var(--pad) 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 999px; }

.thumb {
  flex: 0 0 auto;
  position: relative;
  height: 74px;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0b0f1c;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.thumb:hover { transform: translateY(-2px); }
.thumb.is-active { border-color: #fff; }
.thumb img { display: block; height: 100%; width: auto; min-width: 120px; object-fit: cover; }

.thumb .when {
  position: absolute;
  left: 5px; bottom: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(3, 6, 14, 0.72);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.thumb .pip {
  position: absolute;
  right: 5px; top: 5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(3, 6, 14, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.55rem;
}

/* Tail card that leads into the full archive. */
.thumb.is-more {
  display: grid;
  place-items: center;
  min-width: 130px;
  padding: 0 16px;
  border: 1px dashed var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.thumb.is-more:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.45); }

/* -----------------------------------------------------------------------------
   Auto-hiding chrome — an unobstructed sky after a few idle seconds
   -------------------------------------------------------------------------- */

.topbar.is-floating, .badge, .meta, .tools, .strip, .hud { transition: opacity 0.5s ease; }

body.chrome-hidden .topbar.is-floating,
body.chrome-hidden .badge,
body.chrome-hidden .meta,
body.chrome-hidden .tools,
body.chrome-hidden .strip { opacity: 0; pointer-events: none; }

body.chrome-hidden .hud { opacity: 0.45; }
body.chrome-hidden.is-stage { cursor: none; }

/* -----------------------------------------------------------------------------
   Document-page pieces
   -------------------------------------------------------------------------- */

.notice {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-dim);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(10, 14, 26, 0.35);
}

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  padding: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.rail { max-height: 74vh; overflow-y: auto; padding: 10px; }

.rail h2 {
  margin: 6px 8px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
}

.day {
  width: 100%;
  display: block;
  text-align: left;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease;
}

.day small { display: block; margin-top: 2px; color: var(--ink-faint); font-weight: 500; font-size: 0.72rem; }
.day:hover { background: rgba(255, 255, 255, 0.08); }
.day.is-active { background: #fff; color: var(--ink-deep); }
.day.is-active small { color: rgba(11, 16, 32, 0.6); }

.videobox {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
}

.videobox video { width: 100%; height: 100%; display: block; background: #000; }
.videobox canvas.viewport { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.videobox.is-dragging canvas.viewport { cursor: grabbing; }
.videobox .empty { color: var(--ink-dim); font-size: 0.95rem; padding: 20px; text-align: center; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.toolbar .title { font-weight: 700; font-size: 1rem; margin-right: auto; }
.toolbar .btn { padding: 9px 14px; font-size: 0.82rem; background: rgba(10, 14, 26, 0.55); }

/* Two chip groups (source, then tier) sit on one row. A rule between them keeps
   the two simultaneously-active chips from reading as one confused set. */
.groupbar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.groupbar .tiers + .tiers { position: relative; padding-left: 18px; }
.groupbar .tiers + .tiers::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 20px;
  background: var(--glass-line);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.shot {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: #0b0f1c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shot:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.35); }

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--void);
}

.shot .when {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 12, 0.93);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox.open { display: grid; }

.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lightbox .caption {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* Loading overlay */
.loading {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease;
  pointer-events: none;
  text-align: center;
}

.loading.hidden { opacity: 0; visibility: hidden; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading .t { font-weight: 700; }
.loading .s { margin-top: 5px; font-size: 0.86rem; color: var(--ink-dim); }

/* -----------------------------------------------------------------------------
   Motion + responsive
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .topbar.is-floating, .badge, .meta, .tools, .strip, .hud, .hint { transition: none; }
  .badge.is-live::before, .spinner { animation: none; }
  .btn:hover, .cta:hover, .iconbtn:hover, .thumb:hover, .shot:hover { transform: none; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .rail { max-height: 40vh; }

  .topbar.is-floating { flex-direction: column; }
  .topbar.is-floating .topright { align-items: flex-start; width: 100%; }
  .topbar.is-floating .date { text-align: left; }
  .topbar.is-floating .suntimes { justify-content: flex-start; }
  /* Let the nav wrap within the viewport instead of overflowing off-screen. */
  .topbar.is-floating .nav { width: 100%; justify-content: flex-start; }

  /* The floating header stacks to a fixed ~205px tall on phones (brand, clock,
     date, sun times, nav). Drop the badge and its readout clear of it so the
     nav buttons never sit on top of them. */
  .badge { top: 214px; }
  .meta  { top: 250px; }

  /* Narrow screens: lay the tools out as a row and stack the HUD above them,
     so the controls never sit on top of the compass. */
  .tools { flex-direction: row; bottom: clamp(104px, 13vw, 132px); }
  .hud   { bottom: clamp(162px, 25vw, 196px); }
  .hint  { bottom: clamp(228px, 34vw, 262px); }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .thumb { height: 58px; }
  /* Tighter nav so the three buttons stay on one row down to ~330px wide. */
  .nav { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 0.78rem; }
  .nav .cta { padding: 9px 14px; font-size: 0.82rem; }
  .transport { gap: 8px; padding: 7px 10px; }
  .speeds { display: none; }
}
