* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Arial, sans-serif;
}

canvas {
  display: block;
}

/* Keyboard-focus visibility — none of this UI had any focus indicator
   before (every interactive element only styled :hover), so a keyboard or
   switch-device user tabbing through had zero visual feedback about what
   was focused. :focus-visible (not a blanket :focus) keeps this from
   showing on a mouse click, only on real keyboard/programmatic focus, so
   it doesn't fight the existing hover treatments. */
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: 2px;
}

/* Reduced-motion — none of this app's decorative animations respected the
   OS-level "reduce motion" preference before (the React landing bundle
   already does, see landing-src/App.css). Disables the purely decorative
   loops; keeps opacity/visibility transitions that communicate real state
   changes (panel show/hide) since those aren't the kind of motion this
   preference is meant to suppress. */
@media (prefers-reduced-motion: reduce) {
  #newsTickerTrack,
  #scaleBreadcrumbSegments button.active,
  #ttsToggleBtn.loading,
  #agentForm #agentMicBtn.listening {
    animation: none;
  }
  #scaleBreadcrumb,
  #tourBar {
    animation: none;
  }
}

/* Cosmic-scale tier transition fade — src/cosmos/tierTransition.js sets
   opacity directly, frame by frame, in sync with the camera dolly. Above
   every other panel (max existing z-index is 30) since it needs to
   momentarily obscure all of them, not just the 3D view. */
#tierTransitionOverlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(122,184,255,0.16) 0%, rgba(5,6,12,0.96) 55%, #05060c 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

/* The real "flying through stars" warp canvas — src/cosmos/warpStarfield.js
   draws directly into this every frame during a transition (sized to the
   viewport by src/cosmos/tierTransition.js's resize handling), so this rule
   only needs to position it — no background/animation of its own. */
#tierTransitionWarpCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Running distance readout (src/ui/scaleBar.js) — only shown while a tier
   transition is in flight, opacity-driven exactly like #tierTransitionOverlay
   above it. Sits above the overlay's own z-index (200) so the number stays
   legible even while the veil is at its darkest. */
#cosmicScaleBar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 210;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(70vw, 520px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#cosmicScaleBar.visible {
  opacity: 1;
}

.cosmic-scale-bar__line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

#cosmicScaleBarText {
  flex-shrink: 0;
  color: rgba(232, 236, 247, 0.92);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

#newsTicker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 12;
  background: rgba(6, 7, 16, 0.75);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
}

#newsTickerTrack {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 55s linear infinite;
}

#newsTicker:hover #newsTickerTrack {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

#newsTickerTrack a {
  color: #e8ecf7;
  text-decoration: none;
  font-size: 11px;
  opacity: 0.85;
}

#newsTickerTrack a:hover {
  opacity: 1;
  text-decoration: underline;
}

#newsTickerStatus {
  font-size: 11px;
  opacity: 0.6;
  padding: 0 12px;
}

.ticker-sep {
  opacity: 0.35;
  margin: 0 18px;
}

/* Replaces an inline style="opacity:0.5" that used to be built into the
   ticker's HTML string — see src/data/spaceNews.js, which now constructs
   real nodes instead so nothing from that third-party feed is ever parsed
   as markup. */
.ticker-site {
  opacity: 0.5;
}

#ui {
  position: fixed;
  top: 44px;
  left: 16px;
  z-index: 10;
  background: rgba(10, 12, 24, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 18px;
  color: #e8ecf7;
  width: 260px;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
}

#ui h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}

/* Clicking it re-opens the landing page (src/main.js) — cursor + a subtle
   hover fade is the only affordance needed, the gradient text already
   reads as "special" the way #ui's other real buttons don't. */
#godsViewTitle {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#godsViewTitle:hover {
  opacity: 0.75;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#ui label {
  font-size: 12px;
  opacity: 0.85;
  min-width: 45px;
}

#ui input[type="range"] {
  flex: 1;
  accent-color: #7ab8ff;
}

#speedVal {
  font-size: 12px;
  width: 36px;
  text-align: right;
  opacity: 0.85;
}

#ui button {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#ui button:hover {
  background: rgba(255,255,255,0.18);
}

#ttsToggleBtn,
#ambientToggleBtn {
  position: fixed;
  top: 44px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 12, 24, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e8ecf7;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  transition: background 0.15s ease, transform 0.15s ease;
}

#ttsToggleBtn {
  right: 50px;
}

#ambientToggleBtn {
  right:94px;
}

#ttsToggleBtn:hover,
#ambientToggleBtn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.06);
}

#ttsToggleBtn.muted,
#ambientToggleBtn.muted {
  opacity: 0.55;
}

#ttsToggleBtn.speaking {
  border-color: rgba(122, 216, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 216, 255, 0.18), 0 8px 24px rgba(4,6,16,0.45);
}

#ttsToggleBtn.loading {
  animation: tts-pulse 0.9s ease-in-out infinite;
}

@keyframes tts-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

#info {
  font-size: 11px;
  opacity: 0.75; /* was 0.6 — this is real onboarding instruction text, not a decorative footnote */
  margin-top: 6px;
  line-height: 1.4;
}

#tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: rgba(10, 12, 24, 0.85);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
  white-space: nowrap;
}

#infoPanel {
  position: fixed;
  top: 44px;
  right: 16px;
  z-index: 10;
  width: 280px;
  background: rgba(10, 12, 24, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 18px 20px;
  color: #e8ecf7;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  display: none;
}

#infoPanel.visible {
  display: block;
}

#infoClose {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

#infoClose:hover {
  opacity: 1;
}

#infoName {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}

#infoMeta {
  font-size: 11px;
  opacity: 0.82; /* was 0.7 — these are the real facts the panel exists to show */
  margin-bottom: 10px;
  line-height: 1.6;
}

#infoMeta span {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 0 6px 6px 0;
}

.real-data-row {
  margin-top: 2px;
}

.real-data-row .real-data {
  background: rgba(122, 255, 180, 0.12);
  border: 1px solid rgba(122, 255, 180, 0.35);
}

#infoCredit {
  font-size: 10px;
  opacity: 0.5;
  margin: -8px 0 10px;
  min-height: 12px;
}

#infoDesc {
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.9;
  margin-bottom: 14px;
}

#infoReset {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

#infoReset:hover {
  background: rgba(255,255,255,0.18);
}

/* Land on Surface — same pill shape as #infoReset, but in the app's gold/blue
   gradient (matching #agentForm's Send button) so it reads as the primary,
   more consequential action in the panel rather than a secondary one. */
#landBtn {
  width: 100%;
  background: linear-gradient(90deg, #7ab8ff, #ffd27a);
  border: none;
  color: #0b0d18;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

#landBtn:hover {
  filter: brightness(1.08);
}

/* Visit a Real Place (Earth only) — had no rule at all before, so it was
   rendering as an unstyled default browser button (tiny, gray, easy to
   mistake for "no button" against this panel's dark theme). Same pill
   shape as #landBtn/#infoReset, styled as a distinct third tier — a blue
   outline rather than #landBtn's filled gold/blue gradient — so "the
   stylized Land on Surface" and "the real 360° photosphere" read as two
   different, clearly real actions rather than one being invisible. */
#landmarksBtn {
  width: 100%;
  background: rgba(122, 184, 255, 0.12);
  border: 1px solid rgba(122, 184, 255, 0.45);
  color: #bcdcff;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

#landmarksBtn:hover {
  background: rgba(122, 184, 255, 0.22);
}

.hidden {
  display: none !important;
}

#exitSurfaceBtn {
  position: fixed;
  top: 44px;
  left: 16px;
  z-index: 30;
  background: rgba(10, 12, 24, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e8ecf7;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  transition: background 0.15s ease, transform 0.15s ease;
}

#exitSurfaceBtn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.03);
}

/* Same treatment as #exitSurfaceBtn — never shown at the same time, since
   AppState.mode is exclusively 'orbital'/'surface'/'landmark'. */
#exitLandmarkBtn {
  position: fixed;
  top: 44px;
  left: 16px;
  z-index: 30;
  background: rgba(10, 12, 24, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e8ecf7;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  transition: background 0.15s ease, transform 0.15s ease;
}
#exitLandmarkBtn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.03);
}

#surfaceHint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(10, 12, 24, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e8ecf7;
  font-size: 12px;
  opacity: 0.85;
  padding: 7px 14px;
  border-radius: 20px;
  pointer-events: none;
}

#scaleBreadcrumb {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 12, 24, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  transition: opacity 0.15s ease;
  animation: panel-pop-in 0.35s ease;
}

#scaleBreadcrumb.hidden {
  display: none !important;
}

#scaleBreadcrumb.busy {
  opacity: 0.5;
  pointer-events: none;
}

#scaleBreadcrumb button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

#scaleBreadcrumb button:hover {
  background: rgba(255,255,255,0.18);
}

#scaleBreadcrumb button:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

#scaleBreadcrumbSegments {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
}

#scaleBreadcrumbSegments button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7); /* was 0.55 — real navigation labels (tier names), not decoration */
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  width: auto;
  height: auto;
}

#scaleBreadcrumbSegments button:hover {
  background: rgba(255,255,255,0.1);
  color: #e8ecf7;
}

#scaleBreadcrumbSegments button.active {
  background: rgba(122,184,255,0.22);
  color: #7ab8ff;
  font-weight: 600;
  animation: segment-glow 2.4s ease-in-out infinite;
}

@keyframes segment-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(122,184,255,0); }
  50% { box-shadow: 0 0 10px rgba(122,184,255,0.45); }
}

@keyframes panel-pop-in {
  from { opacity: 0; transform: translate(-50%, -6px) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

#scaleBreadcrumbSegments .sep {
  color: rgba(255,255,255,0.3);
  font-size: 11px;
}

#tourBar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 12, 24, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 8px 10px 8px 16px;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  animation: panel-pop-in 0.35s ease;
}

#tourBar button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

#tourBar button:hover {
  background: rgba(255,255,255,0.18);
}

#tourPrevBtn, #tourPlayPauseBtn, #tourNextBtn {
  padding: 6px 10px;
  font-size: 15px;
}

#tourExitBtn {
  background: linear-gradient(90deg, #7ab8ff, #ffd27a) !important;
  color: #0b0d18 !important;
  font-weight: 600;
  border: none !important;
}

#tourStopLabel {
  font-size: 12px;
  opacity: 0.85; /* was 0.75 — the actual tour progress readout */
  padding: 0 4px;
  min-width: 70px;
  text-align: center;
}

#agentPanel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  width: 300px;
  background: rgba(10, 12, 24, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  color: #e8ecf7;
  box-shadow: 0 8px 24px rgba(4,6,16,0.45);
  display: flex;
  flex-direction: column;
}

#agentPanel h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #b8a8ff; /* was a gradient-text-clip treatment — solid accent instead, same reasoning as the modal headings below */
}

#agentLog {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

#agentLog:empty::before {
  content: "Try: \"hide Mars\", \"focus on Saturn\", \"tell me about Jupiter\"…";
  font-size: 11px;
  opacity: 0.5;
  font-style: italic;
}

#agentLog .msg {
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 90%;
}

#agentLog .msg.user {
  align-self: flex-end;
  background: rgba(122, 184, 255, 0.18);
  border: 1px solid rgba(122, 184, 255, 0.25);
}

#agentLog .msg.agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#agentLog .msg.agent.answer {
  max-width: 96%;
  line-height: 1.5;
  background: rgba(122, 216, 255, 0.08);
  border: 1px solid rgba(122, 216, 255, 0.28);
  border-left: 3px solid #7ad8ff;
}

#agentChips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #e8ecf7;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.chip:hover {
  background: rgba(255,255,255,0.18);
}

#agentForm {
  display: flex;
  gap: 6px;
}

#agentInput {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  outline: none; /* replaced by an explicit :focus border/glow below, not left with no indicator at all */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#agentInput:focus {
  border-color: rgba(122, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(122, 184, 255, 0.18);
}

#agentInput::placeholder {
  color: rgba(232,236,247,0.4);
}

#agentForm button {
  background: linear-gradient(90deg, #7ab8ff, #b98bff);
  border: none;
  color: #0b0d18;
  font-weight: 600;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

#agentForm button:hover {
  filter: brightness(1.08);
}

/* Higher-specificity selector (#agentForm #agentMicBtn) so this overrides
   the generic "#agentForm button" gradient above without !important. */
#agentForm #agentMicBtn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  font-weight: 400;
  flex: 0 0 auto;
}

#agentForm #agentMicBtn.listening {
  background: rgba(255,90,90,0.25);
  border-color: #ff6b6b;
  animation: micPulse 1.2s ease-in-out infinite;
}

#agentForm #agentMicBtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: none;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}

/* thin scrollbar for the agent log */
#agentLog::-webkit-scrollbar {
  width: 6px;
}
#agentLog::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
/* Attribution line at the foot of a modal. */
.modal-credit {
  font-size: 11px;
  opacity: 0.45;
  margin-top: 12px;
}

/* ---------- event toast (alignment / eclipse notifications) ---------- */
#eventToast {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 25;
  width: min(380px, 88vw);
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(157, 255, 192, 0.35);
  border-radius: 12px;
  padding: 12px 34px 12px 16px;
  color: #e8ecf7;
  box-shadow: 0 12px 32px rgba(4,6,16,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#eventToast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

#eventToastTitle {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

#eventToastBody {
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.85;
}

#eventToastClose {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

#eventToastClose:hover {
  opacity: 1;
}

/* ---------- real eclipse calendar modal ---------- */
#eclipseCalModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
}

#eclipseCalModal.visible {
  display: flex;
}

#eclipseCalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

#eclipseCalCard {
  position: relative;
  z-index: 1;
  width: min(520px, 90vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px;
  color: #e8ecf7;
  box-shadow: 0 20px 60px rgba(4,6,16,0.6);
}

#eclipseCalCard h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}

#eclipseCalClose {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

#eclipseCalClose:hover {
  opacity: 1;
}

.eclipse-row {
  background: rgba(255,255,255,0.05);
  border-left: 3px solid rgba(122, 184, 255, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.eclipse-row-head {
  font-size: 13px;
  margin-bottom: 4px;
}

.eclipse-row-body {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
}

/* ---------- trip log modal (edu/tripLog.js) — same shape as the eclipse
   calendar modal above, .eclipse-row/-head/-body reused directly for its
   entries ---------- */
#tripLogModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
}
#tripLogModal.visible {
  display: flex;
}
#tripLogBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
#tripLogCard {
  position: relative;
  z-index: 1;
  width: min(480px, 90vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px;
  color: #e8ecf7;
  box-shadow: 0 20px 60px rgba(4,6,16,0.6);
}
#tripLogCard h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}
#tripLogClose {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}
#tripLogClose:hover {
  opacity: 1;
}
#tripLogClearBtn {
  margin-top: 8px;
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
}
#tripLogClearBtn:hover {
  background: rgba(255,255,255,0.18);
}

/* ---------- landmark picker modal (landmark/desktopLandmarkUI.js) — same
   shape as the trip log / eclipse calendar modals ---------- */
#landmarksModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
}
#landmarksModal.visible {
  display: flex;
}
#landmarksBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
#landmarksCard {
  position: relative;
  z-index: 1;
  width: min(480px, 90vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px;
  color: #e8ecf7;
  box-shadow: 0 20px 60px rgba(4,6,16,0.6);
}
#landmarksCard h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}
#landmarksClose {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}
#landmarksClose:hover {
  opacity: 1;
}
.landmark-row {
  background: rgba(255,255,255,0.05);
  border-left: 3px solid rgba(122, 184, 255, 0.4);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.landmark-row:hover {
  background: rgba(255,255,255,0.1);
}
.landmark-row-head {
  font-size: 13px;
  margin-bottom: 4px;
}
.landmark-row-body {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
}

/* ---------- quiz modal (edu/quiz.js) ---------- */
#quizModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
}
#quizModal.visible {
  display: flex;
}
#quizBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
#quizCard {
  position: relative;
  z-index: 1;
  width: min(420px, 90vw);
  background: rgba(14, 16, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px;
  color: #e8ecf7;
  box-shadow: 0 20px 60px rgba(4,6,16,0.6);
}
#quizCard h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}
#quizClose {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}
#quizClose:hover {
  opacity: 1;
}
.quiz-score {
  font-size: 11px;
  opacity: 0.75; /* was 0.6 — real score feedback, not a footnote */
  margin-bottom: 10px;
}
.quiz-question {
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e8ecf7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.quiz-option:hover:not(:disabled) {
  background: rgba(255,255,255,0.18);
}
.quiz-option:disabled {
  cursor: default;
}
.quiz-option.quiz-correct {
  background: rgba(122,255,180,0.18);
  border-color: rgba(122,255,180,0.5);
}
.quiz-option.quiz-wrong {
  background: rgba(255,107,107,0.18);
  border-color: rgba(255,107,107,0.5);
}
.quiz-feedback {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
}
.quiz-feedback-correct {
  color: #7affb4;
}
.quiz-feedback-wrong {
  color: #ff8f8f;
}
.quiz-next-btn {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(90deg, #7ab8ff, #ffd27a);
  color: #0b0d18;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Size Compare (src/sizeCompare/sizeCompareMode.js) ----------
   A slim chrome bar over the 3D viewport itself — the comparison content
   is real scene geometry (a full-scene takeover), not a DOM popup, so this
   is just Prev/Next/Exit + a title, the same treatment #tourBar already
   gets for the same reason (a scripted sequence driving the real scene). */
#sizeCompareBar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(14, 16, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 22px;
  color: #e8ecf7;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}
#sizeCompareBar.visible {
  display: flex;
}
#sizeCompareStepLabel {
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 0.04em;
}
#sizeCompareTitle {
  font-size: 15px;
  margin: 0;
  color: #ffd27a; /* was a gradient-text-clip treatment repeated identically across every modal heading — reserved that for the two most prominent headings (#ui h1, #infoName) instead, plain accent color here for a clearer primary/secondary hierarchy */
}
#sizeCompareBar .row {
  display: flex;
  gap: 10px;
}
#sizeCompareBar button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e8ecf7;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
}
#sizeCompareBar button:hover {
  background: rgba(255, 255, 255, 0.18);
}
#sizeCompareBar button:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
#sizeCompareExitBtn {
  margin-top: 2px;
  color: #ffb0a0;
}

/* ---------- curiosity card (src/edu/curiosityCards.js) ----------
   Sits under the left control panel, deliberately quiet: it poses a
   question on arriving at a new tier and holds the answer until asked. */
#curiosityCard {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 20;
  width: 260px;
  display: none;
  background: rgba(10, 12, 24, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 210, 122, 0.28);
  border-left: 3px solid #ffd27a;
  border-radius: 12px;
  padding: 14px 16px;
  color: #e8ecf7;
  box-shadow: 0 8px 24px rgba(4, 6, 16, 0.45);
}

#curiosityCard.visible {
  display: block;
  animation: curiosity-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes curiosity-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#curiosityEyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffd27a;
  margin-bottom: 6px;
}

#curiosityQuestion {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  margin-bottom: 10px;
}

#curiosityRevealBtn {
  background: rgba(255, 210, 122, 0.14);
  border: 1px solid rgba(255, 210, 122, 0.45);
  color: #ffd27a;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#curiosityRevealBtn:hover {
  background: rgba(255, 210, 122, 0.26);
}

/* Collapsed to zero height until revealed, then eased open — the reveal is
   the point of the card, so it gets an actual transition rather than a
   display swap. max-height is animatable where height:auto is not. */
#curiosityAnswer {
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin-top 0.4s ease;
}

#curiosityAnswer.revealed {
  opacity: 0.92;
  max-height: 320px;
  margin-top: 10px;
}

#curiosityClose {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

#curiosityClose:hover {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #curiosityCard.visible { animation: none; }
  #curiosityAnswer { transition: none; }
}


/* ---------- auth gate ---------- */
/* Hidden by default and only ever shown by src/auth/authGate.js once someone
   actually tries to enter the app — the landing page is public, so this must
   never appear over it uninvited. */
#authGate {
  position: fixed;
  inset: 0;
  z-index: 4000; /* above the landing bundle, which owns everything below this */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 12, 0.82);
  backdrop-filter: blur(6px);
}
#authGate.visible { display: flex; }

#authGate .auth-card {
  width: min(420px, 100%);
  padding: 30px 30px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(10, 12, 24, 0.96);
  box-shadow: 0 24px 70px rgba(4, 6, 16, 0.6);
}
#authGate h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: #ffd27a;
}
#authGate .auth-lede {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.45;
}
#authGate label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}
#authGate input {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}
#authGate input:focus {
  outline: none;
  border-color: rgba(122, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(122, 184, 255, 0.18);
}
/* Shared by every submit button across the auth card's forms (sign in, set
   password, request an institute) — previously only #authSubmit had this,
   so the other two rendered as bare unstyled HTML buttons. */
#authGate .auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border: 1px solid rgba(122, 184, 255, 0.5);
  border-radius: 8px;
  background: rgba(122, 184, 255, 0.18);
  color: #cfe4ff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
#authGate .auth-submit:hover:not(:disabled) {
  background: rgba(122, 184, 255, 0.28);
  border-color: rgba(122, 184, 255, 0.7);
}
#authGate .auth-submit:active:not(:disabled) { transform: scale(0.98); }
#authGate .auth-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(122, 184, 255, 0.35);
}
#authGate .auth-submit:disabled { opacity: 0.6; cursor: default; }

/* Reserves its line at all times, so the card doesn't jump when a message
   appears — a layout shift under an error is how a mis-click happens. */
#authGate .auth-error {
  min-height: 1.2em;
  margin: 0 0 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #ff9d9d;
}
#authGate .auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
#authGate .linklike {
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: color 0.15s ease;
}
#authGate .linklike:hover { color: #7ab8ff; }
#authGate .linklike:focus-visible {
  outline: none;
  color: #7ab8ff;
  text-decoration-color: #7ab8ff;
}
#authGate .auth-foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- account panel ---------- */
/* Same modal shell as #quizModal above, widened: it carries lists (rosters,
   score history) rather than a single question. */
#accountModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
}
#accountModal.visible { display: flex; }
#accountBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
#accountCard {
  position: relative;
  z-index: 1;
  width: min(540px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
  background: rgba(14, 16, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px;
  color: #e8ecf7;
  box-shadow: 0 20px 60px rgba(4, 6, 16, 0.6);
}
#accountCard h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ffd27a;
}
#accountClose {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #e8ecf7;
  font-size: 20px;
  cursor: pointer;
}

.account-section {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.account-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.account-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #7ab8ff;
}
.account-field {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 6px;
  font-size: 13px;
}
.account-field-label { color: rgba(255, 255, 255, 0.55); }
.account-field-value { color: #e8ecf7; text-align: right; word-break: break-word; }
.account-hint, .account-empty {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
}
.account-status {
  margin: 8px 0 0;
  min-height: 1.2em; /* reserved, so the card doesn't jump when a message lands */
  font-size: 12.5px;
  color: #7ab8ff;
}

.account-list { list-style: none; margin: 8px 0 0; padding: 0; }
.account-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.account-list li:last-child { border-bottom: none; }
.account-list-main { color: #e8ecf7; word-break: break-word; }
.account-list-meta { color: rgba(255, 255, 255, 0.45); font-size: 12px; text-align: right; white-space: nowrap; }
.account-fails .account-list-meta { color: #ff9d9d; white-space: normal; }

.account-textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.account-textarea:focus {
  outline: none;
  border-color: rgba(122, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(122, 184, 255, 0.18);
}

.account-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 8px;
}
.account-select:focus {
  outline: none;
  border-color: rgba(122, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(122, 184, 255, 0.18);
}
.account-select:disabled { opacity: 0.55; }

.account-primary, .account-signout, .account-mini {
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.account-primary {
  margin-top: 10px;
  border: 1px solid rgba(122, 184, 255, 0.5);
  background: rgba(122, 184, 255, 0.18);
  color: #cfe4ff;
}
.account-primary:hover:not(:disabled) { background: rgba(122, 184, 255, 0.28); }
.account-primary:disabled, .account-mini:disabled { opacity: 0.55; cursor: default; }
.account-signout {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}
.account-signout:hover { border-color: rgba(255, 157, 157, 0.5); color: #ff9d9d; }
.account-institute { flex-wrap: wrap; }
.account-institute-main { display: flex; flex-direction: column; gap: 2px; }
.account-institute-actions { display: flex; gap: 8px; }
.account-mini {
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}
.account-mini:hover:not(:disabled) { border-color: rgba(122, 184, 255, 0.5); color: #cfe4ff; }
