/* Uplift movie — GPS relief sheet over a flat satellite map (uplift-movie.js).
   Reuses the .d3-* sidebar primitives so the panel matches the other 3D
   views. The stage is always a dark scene, so its overlays use a fixed dark
   "glass" palette rather than the page theme. */

.um-stage {
  --um-glass: rgba(10, 16, 22, 0.8);
  --um-line: rgba(255, 255, 255, 0.12);
  --um-ink: #eef3f6;
  --um-soft: #bac7d1;
  --um-faint: #8c9cab;
  --um-accent: #65dfc3;
  background: radial-gradient(ellipse at 50% 38%, #1c2731 0%, #10171e 55%, #0a0f14 100%);
  color: var(--um-ink);
}

/* ---------- canvas + overlays ---------- */

.um-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
}
.um-canvas:active { cursor: grabbing; }

/* renderer.setSize(w, h, false) sizes only the drawing buffer; the element
   itself must be stretched here or a 2x display shows a quarter of it. */
.um-canvas > canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.um-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.um-place {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  font: 600 10.5px var(--font-ui);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.75);
}
.um-place[hidden] { display: none; }

/* Station marker: a zero-size anchor at the projected point, children
   positioned around it. */
.um-st {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
}
.um-st[hidden] { display: none; }

/* Larger invisible hit area than the visible dot. */
.um-st::before {
  content: '';
  position: absolute;
  left: -13px;
  top: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.um-st-dot {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c, #fff);
  border: 2px solid #0b1117;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92), 0 2px 6px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease;
}
.um-st:hover .um-st-dot,
.um-st:focus-visible .um-st-dot,
.um-st.is-selected .um-st-dot { transform: scale(1.4); }
.um-st.is-selected .um-st-dot { box-shadow: 0 0 0 2px var(--um-accent), 0 2px 8px rgba(0, 0, 0, 0.6); }
.um-st:focus-visible { outline: none; }
.um-st.is-missing .um-st-dot {
  background: rgba(20, 28, 36, 0.6);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.um-st-label {
  display: none;
  position: absolute;
  left: 11px;
  top: -8px;
  white-space: nowrap;
  font: 600 10.5px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.85);
}
.show-labels .um-st-label,
.um-st.is-selected .um-st-label { display: block; }
.show-labels .um-st.no-label:not(.is-selected) .um-st-label { display: none; }

.um-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  translate: 16px -50%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(8, 13, 18, 0.94);
  border: 1px solid var(--um-line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.um-tip[hidden] { display: none; }
.um-tip strong { font-family: var(--font-mono); color: var(--um-ink); }
.um-tip span { color: var(--um-faint); }
.um-tip b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- glass cards ---------- */

.um-date,
.um-legend,
.um-detail,
.um-status,
.um-dock {
  background: var(--um-glass);
  border: 1px solid var(--um-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.um-date {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 15px 11px;
  border-radius: 12px;
  pointer-events: none;
}
.um-date-main {
  font: 600 24px/1.1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--um-ink);
}
.um-date-sub {
  font: 11px var(--font-mono);
  color: var(--um-faint);
}

.um-side {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.um-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 13px 11px;
  border-radius: 12px;
}
.um-legend-title {
  font: 500 10px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--um-faint);
}
.um-legend-bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.um-legend-ticks {
  display: flex;
  justify-content: space-between;
  font: 11px var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--um-soft);
}
.um-legend-note {
  font: 10.5px var(--font-mono);
  color: var(--um-faint);
}

.um-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px 12px;
  border-radius: 12px;
}
.um-detail[hidden] { display: none; }
.um-detail-code { font: 600 15px var(--font-mono); color: var(--um-ink); }
.um-detail-name { font-size: 12.5px; color: var(--um-soft); }
.um-detail-value {
  margin-top: 4px;
  font: 600 22px var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.um-detail-meta { font: 10.5px var(--font-mono); color: var(--um-faint); }
.um-detail-chart {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 8px;
}
.um-detail-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--um-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.um-detail-close:hover { color: var(--um-ink); background: rgba(255, 255, 255, 0.08); }

.um-status {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 5;
  translate: -50% 0;
  margin: 0;
  padding: 6px 13px;
  border-radius: 999px;
  font: 11px var(--font-mono);
  color: var(--um-soft);
  white-space: nowrap;
  pointer-events: none;
}
.um-status[hidden] { display: none; }

/* ---------- playback dock ---------- */

.um-dock {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 16px 9px 12px;
  border-radius: 14px;
}

.um-play {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--um-accent);
  color: #06231d;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(101, 223, 195, 0.28);
  transition: transform 0.12s ease, background 0.15s ease;
}
.um-play:hover { background: #82ead2; }
.um-play:active { transform: scale(0.95); }
.um-play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.um-play svg { width: 22px; height: 22px; fill: currentColor; }
.um-play .um-icon-pause,
.um-play.is-playing .um-icon-play { display: none; }
.um-play.is-playing .um-icon-pause { display: block; }

.um-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Inset by half the slider thumb so chart x and thumb x line up. */
.um-spark {
  display: block;
  width: calc(100% - 16px);
  height: 42px;
  margin: 0 8px;
  cursor: ew-resize;
  touch-action: none;
}

.um-timeline input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.um-timeline input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.um-timeline input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.um-timeline input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--um-accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}
.um-timeline input[type='range']::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--um-accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}
.um-timeline input[type='range']:focus-visible { outline: none; }
.um-timeline input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45); }
.um-timeline input[type='range']:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45); }

.um-timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  font: 10.5px var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--um-faint);
}
.um-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
}


/* ---------- sidebar ---------- */

.um-lede {
  margin: -6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.um-buttons { flex-wrap: wrap; }
.um-buttons button { flex: 1 1 40%; }

.um-stats dd { font-size: 13px; }
.um-stats dd.um-stat-code {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
}

/* ---------- smaller screens ---------- */

@media (max-width: 1100px) {
  .um-side { width: 210px; }
  .um-hint { display: none; }
}

@media (max-width: 860px) {
  /* Scene leads; controls scroll beneath it, like the other 3D views. */
  #panel-uplifttl .d3-layout {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  #panel-uplifttl .d3-stage {
    order: -1;
    flex: none;
    height: 66vh;
    min-height: 400px;
  }
  #panel-uplifttl .d3-sidebar {
    flex: none;
    overflow: visible;
    border-right: none;
    border-top: 1px solid var(--line);
  }
}

/* The phone nav is a 4 × 2 grid (animation-view.css): eight slots. With the
   Uplift movie the desktop build has nine tabs, so the ninth fell off the
   bar; five columns fit them in the same two rows. Scoped with :has() so the
   m. build (Mixed Map removed, eight tabs) keeps its 4 × 2 layout. */
@media (max-width: 760px) {
  .view-nav:has(> .view-tab:nth-child(9)) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .um-date { top: 10px; left: 10px; padding: 7px 10px 8px; }
  .um-date-main { font-size: 17px; }
  .um-date-sub { font-size: 9.5px; }
  /* Legend sits above the dock so it never collides with the date. */
  .um-side { top: auto; bottom: 104px; right: 8px; width: 168px; gap: 8px; }
  .um-legend { padding: 8px 10px; }
  .um-legend-title { font-size: 8.5px; }
  .um-legend-note { display: none; }
  .um-detail-chart { height: 44px; }
  .um-status { top: 64px; }
  .um-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 10px;
    padding: 8px 10px 7px 8px;
  }
  .um-play { width: 40px; height: 40px; }
  .um-spark { height: 32px; }
}
