/* ════════════════════════════════════════════════════════════
   SOLAR SYSTEM — A Semirealistic 8K Model
   Interface style cloned from solarsys.jaksic.org:
   minimal chrome, Jura typeface, neutral white-on-space palette.
   Rendering pipeline (8K textures, bloom, ACES) is unchanged.
════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  --bg:           #020202;
  --bg-deep:      #050505;
  --panel:        rgba(24, 24, 24, 0.72);
  --panel-flat:   rgba(16, 16, 16, 0.82);
  --panel-solid:  #141414;
  --gui-bg:       rgba(32, 32, 32, 0.40);
  --gui-title:    rgba(48, 48, 48, 0.40);
  --gui-widget:   rgba(64, 64, 64, 0.60);
  --gui-hover:    rgba(89, 89, 89, 0.60);
  --accent:       #ffffff;
  --accent2:      #aaaaaa;
  --selection:    #ffffff;
  --text:         #d0d0d0;
  --text-bright:  #ffffff;
  --value:        #eeeeee;
  --muted:        #888888;
  --muted-light:  #aaaaaa;
  --border:       rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.38);
  --hairline:     rgba(255, 255, 255, 0.10);
  --glow:         rgba(255, 255, 255, 0.18);
  --glow-strong:  rgba(255, 255, 255, 0.35);
  --font-head:    'Jura', 'Gill Sans', Helvetica, sans-serif;
  --font-body:    'Jura', 'Gill Sans', Helvetica, sans-serif;
  --font-mono:    'Jura', 'Gill Sans', Helvetica, sans-serif;
  --hud-h:        0px;
  --sidebar-w:    0px;
  --panel-w:      320px;
  --radius:       8px;
  --radius-sm:    4px;
  --radius-pill:  999px;
  --blur:         blur(10px);
  --shadow-panel: 0 24px 70px rgba(0, 0, 0, 0.7);
}

/* ─── Reset & Base ───────────────────────────────────────── */
[hidden] { display: none !important; }
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

::selection {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ─── Custom Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar           { width: 4px; height: 4px; }
::-webkit-scrollbar-track     { background: transparent; }
::-webkit-scrollbar-thumb     { background: #555; border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover{ background: #999; }

/* ─── Three.js Canvas ───────────────────────────────────── */
#space-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw !important;
  height: 100vh !important;
  cursor: grab;
}
#space-canvas:active { cursor: grabbing; }

/* ════════════════════════════════════════════════════════════
   SPLASH SCREEN — jaksic style: live scene behind, centered
   title + pill Start button that fills with load progress
════════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 2, 0.28);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ─── Pre-start: all chrome stays hidden until Start is clicked ───
   (jaksic shows only the live scene + title + Start pill up front;
   display:none also re-triggers the chromeIn animation on entry) */
body:not(.app-started) #settings-panel,
body:not(.app-started) .corner-icon,
body:not(.app-started) #obj-stats,
body:not(.app-started) #info-panel,
body:not(.app-started) #obj-actions,
body:not(.app-started) #bottom-readout,
body:not(.app-started) #asset-credits {
  display: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: fadeIn 0.6s ease both;
}

.splash-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4.6vw, 40px);
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}

.splash-subtitle {
  font-family: var(--font-body);
  font-size: clamp(14px, 2.2vw, 21px);
  font-weight: 400;
  color: #b5b5b5;
  margin-top: -6px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

/* Pill Start button with integrated progress fill (jaksic .progress) */
#start-btn.progress {
  display: inline-block;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  padding: 10px 74px;
  line-height: 1;
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: box-shadow 0.5s;
}
#start-btn.progress:hover,
#start-btn.progress:focus {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.67);
  outline: none;
}
#start-btn .tz-bar {
  position: absolute;
  z-index: -1;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background: #7a7a7a;
  border-radius: 0 0 2px 2px;
  transition: width 0.4s ease;
}
#start-btn .tz-bar.background-horizontal {
  height: 100%;
  border-radius: 2px;
  opacity: 0.45;
}
#start-btn.ready {
  animation: startPulse 2.4s ease-in-out infinite;
}
@keyframes startPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 255, 255, 0.25); }
  50%      { box-shadow: 0 0 34px rgba(255, 255, 255, 0.60); }
}

.loader-status {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.06em;
  min-height: 16px;
}

.splash-proof {
  position: fixed;
  bottom: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #777;
}

/* ════════════════════════════════════════════════════════════
   CORNER ICONS (fullscreen top-left, help bottom-right)
════════════════════════════════════════════════════════════ */
.corner-icon {
  position: fixed;
  z-index: 100;
  width: 1.3em;
  height: 1.3em;
  margin: 1em;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  font-size: 20px;
}
.corner-icon:hover { opacity: 1; transform: scale(1.08); }
.corner-icon svg { width: 100%; height: 100%; display: block; }
#fullscreen-btn { top: 0; left: 0; }
#help-btn {
  right: 0;
  bottom: 42px;
}
/* Small ambient-sound toggle, sitting just left of the help icon */
#sound-btn {
  right: 46px;
  bottom: 42px;
  width: 1.05em;
  height: 1.05em;
  margin-top: 1.13em;
}
#sound-btn .icon-on { display: none; }
#sound-btn .icon-off { display: block; }
#sound-btn.is-on .icon-on { display: block; }
#sound-btn.is-on .icon-off { display: none; }
#sound-btn.is-on { opacity: 1; }
#sound-btn.is-on svg { stroke: #e8e8e8; }

/* ════════════════════════════════════════════════════════════
   SETTINGS — left-edge command palette and persistent rail
════════════════════════════════════════════════════════════ */
#controls-rail {
  position: fixed;
  top: 72px;
  left: 12px;
  z-index: 101;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 14px;
  background: rgba(17, 19, 24, 0.82);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity 0.24s ease, transform 0.24s ease, border-color 0.2s ease;
}
#controls-rail svg { width: 20px; height: 20px; }
#controls-rail:hover { border-color: rgba(255, 255, 255, 0.48); }
#controls-rail:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
body.controls-closed #controls-rail { opacity: 1; pointer-events: auto; transform: translateX(0); }

#settings-panel {
  position: fixed;
  top: 64px;
  left: 12px;
  z-index: 100;
  width: 232px;
  max-height: calc(100vh - 76px);
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(17, 19, 24, 0.82);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  color: #ebebeb;
  font-size: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 255, 255, 0.08);
  animation: chromeIn 0.7s ease both;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
#settings-panel.body-closed { visibility: hidden; opacity: 0; pointer-events: none; transform: translateX(-16px) scale(0.97); }

#settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  font-family: var(--font-head);
  text-align: left;
  cursor: pointer;
}
.settings-heading { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 650; letter-spacing: 0.02em; }
.settings-kicker { color: #999; font-size: 8px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
#settings-toggle .caret { display: inline-block; color: #999; font-size: 11px; transform: rotate(90deg); transition: transform 0.2s ease; }
#settings-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

#settings-body { display: flex; flex-direction: column; gap: 5px; padding: 10px; }

.s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.s-row:hover { background: rgba(255, 255, 255, 0.055); }
.s-label { color: #d4d5d8; font-weight: 560; }

#camera-select {
  width: 128px;
  height: 30px;
  padding: 0 28px 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
#camera-select:hover, #camera-select:focus-visible { border-color: rgba(255, 255, 255, 0.38); }
#camera-select,
#camera-select option {
  background-color: rgb(17, 19, 24);
  color: #fff;
}

.s-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 34px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.s-row input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #aaa;
  transition: transform 0.2s ease, background 0.2s ease;
}
.s-row input[type="checkbox"]:checked { border-color: rgba(255, 255, 255, 0.72); background: rgba(255, 255, 255, 0.88); }
.s-row input[type="checkbox"]:checked::after { background: #16181d; transform: translateX(14px); }
.s-row input[type="checkbox"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.s-time { gap: 8px; }
#time-speed {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 54px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  cursor: pointer;
}
#time-speed::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border: 3px solid #15171b; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.34); cursor: pointer; transition: transform 0.15s ease; }
#time-speed::-webkit-slider-thumb:hover { transform: scale(1.18); }
#time-speed::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #15171b; border-radius: 50%; background: #fff; cursor: pointer; }
#speed-label { min-width: 38px; color: #fff; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }

.s-btn {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #ddd;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.s-btn:hover { border-color: rgba(255, 255, 255, 0.26); background: rgba(255, 255, 255, 0.10); color: #fff; transform: translateX(2px); }
.s-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* VR button states (driven by js/vr.js) */
#btn-vr.vr-ready { background: rgba(255, 255, 255, 0.85); color: #111; font-weight: 600; }
#btn-vr.vr-ready:hover { background: #fff; }
#btn-vr.vr-unsupported { opacity: 0.45; }
#btn-vr.vr-connecting { animation: vr-pulse 1s ease-in-out infinite; }
#btn-vr.vr-active { background: #fff; color: #111; font-weight: 700; }
@keyframes vr-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Open/close controls footer button */
#controls-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 20px);
  min-height: 38px;
  margin: 0 10px 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #bfc0c4;
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
#controls-toggle:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
#controls-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Search (lives inside the settings panel) */
.s-search { padding: 0; cursor: default; }
.s-search:hover { background: transparent; }
.search-wrap { position: relative; width: 100%; }
.search-icon {
  position: absolute;
  left: 7px;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 4px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #999;
  cursor: pointer;
}
.search-icon svg { width: 14px; height: 14px; }
.search-icon:hover { color: #fff; }
#search-input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  outline: none;
  caret-color: #fff;
}
#search-input::placeholder { color: #85868b; }
#search-input:focus { border-color: rgba(255, 255, 255, 0.38); background: rgba(255, 255, 255, 0.08); }

#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(16, 16, 16, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  display: none;
}
#search-results.open { display: block; animation: fadeIn 0.15s ease; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.selected { background: rgba(255, 255, 255, 0.08); }
.search-result-emoji { font-size: 15px; flex-shrink: 0; width: 22px; text-align: center; }
.search-result-name { font-size: 12px; font-weight: 600; color: #fff; flex: 1; }
.search-result-type {
  font-size: 9px;
  color: #bbb;
  background: rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-pill);
  padding: 2px 6px;
  text-transform: uppercase;
}
.search-no-results { padding: 12px; text-align: center; color: #888; font-size: 11px; }

/* ════════════════════════════════════════════════════════════
   OBJECT STATS — bottom-left borderless table (jaksic #info)
════════════════════════════════════════════════════════════ */
#obj-stats {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 90;
  padding: 10px 14px;
  text-align: center;
  font-size: 10pt;
  opacity: 0.85;
  pointer-events: none;
  animation: fadeIn 0.4s ease both;
}
#obj-stats th {
  padding-bottom: 0.4em;
  color: #fff;
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}
#obj-stats td { padding: 2px 6px; }
#obj-stats .metric { text-align: center; }
#obj-stats .value { text-align: center; }
#obj-stats svg {
  height: 2em;
  max-width: 3em;
  vertical-align: baseline;
  opacity: 0.9;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8));
}
#row-moons svg { height: 1.6em; }
#obj-stats .abs_value {
  color: var(--value);
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
#obj-stats .rel_value {
  color: var(--muted-light);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

/* ════════════════════════════��═══════════════════════════════
   DETAIL PANEL (right) — neutral dark glass, Jura
════════════════════════════════════════════════════════════ */
#info-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--panel-w);
  height: 100vh;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 54px 18px 20px;
  overflow-y: auto;
  background: rgba(12, 12, 12, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow-panel);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#info-panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
#info-panel.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

#info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  z-index: 2;
}
#info-close:hover { color: #fff; border-color: var(--border-hover); background: rgba(255, 255, 255, 0.12); }

/* Hero section */
.info-hero { display: flex; align-items: center; gap: 14px; padding-top: 4px; }
.info-icon { font-size: 44px; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.35)); }
.info-title-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
#info-name {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #eee;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  width: fit-content;
}

/* Description */
#info-description {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  border-left: 1px solid var(--border-hover);
  padding-left: 12px;
}

/* Stats grid */
.info-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--hairline);
}
.stat-card { background: rgba(10, 10, 10, 0.72); padding: 10px 11px; transition: background 0.2s; }
.stat-card:hover { background: rgba(255, 255, 255, 0.07); }
.stat-key {
  display: block;
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-val { display: block; font-size: 12.5px; font-weight: 500; color: #fff; word-break: break-word; }

/* Official media and resources */
.info-media { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.info-media.hidden { display: none; }
.media-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}
#media-quality { color: #fff; letter-spacing: 0.04em; text-align: right; }
.media-title { color: #fff; font-size: 11px; font-weight: 600; line-height: 1.35; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.info-links { display: flex; flex-wrap: wrap; gap: 6px; }
.resource-link {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: #eee;
  font-size: 9.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.resource-link:hover, .resource-link:focus-visible {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

/* Latest Developments */
.latest-dev {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.latest-dev.hidden { display: none; }
.news-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}
.news-rss-link { color: #eee; text-decoration: none; font-size: 8px; opacity: 0.7; }
.news-rss-link:hover { opacity: 1; }
.news-feed { display: flex; flex-direction: column; gap: 6px; }
.news-card {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.news-card:hover { border-color: var(--border-hover); background: rgba(255, 255, 255, 0.07); }
.news-date { font-size: 8.5px; color: var(--muted); margin-bottom: 2px; letter-spacing: 0.06em; }
.news-title { font-size: 11px; font-weight: 600; color: #fff; line-height: 1.35; margin-bottom: 3px; }
.news-snippet {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-fallback { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.news-link {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px 3px 2px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: #eee;
  font-size: 9px;
  font-weight: 500;
  text-decoration: none;
}
.news-link:hover { border-color: var(--border-hover); background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Object actions — floating bottom-center bar (outside the right panel) */
#obj-actions {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 96;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(12, 12, 12, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#obj-actions.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}
#obj-actions .action-btn { flex: 0 0 auto; min-width: 110px; height: 32px; }
.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
}
.action-btn.primary {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid #fff;
  color: #fff;
}
.action-btn.primary:hover { box-shadow: 0 0 22px rgba(255, 255, 255, 0.45); transform: translateY(-1px); }
.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-light);
}
.action-btn.secondary:hover { border-color: var(--border-hover); color: #fff; background: rgba(255, 255, 255, 0.06); }

/* ════════════════════════════════════════════════════════════
   ABOUT MODAL — jaksic .modal style (#222 card)
════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  animation: fadeIn 0.2s ease;
}
.modal-card {
  position: relative;
  max-width: 50em;
  width: calc(100vw - 48px);
  max-height: 82vh;
  overflow-y: auto;
  padding: 2em 2.4em;
  border-radius: 8px;
  background: #222;
  font-size: 12pt;
  color: var(--text);
  user-select: text;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}
.modal-card h3 { margin-top: 0.4em; margin-bottom: 0.4em; font-weight: 600; color: #fff; }
.modal-card h4 { margin-top: 1em; margin-bottom: 0.4em; font-weight: 500; color: #fff; }
.modal-card p { margin: 10px 0; }
.modal-card ul { margin: 6px 0 6px 1.3em; }
.modal-card li { margin: 3px 0; }
.modal-card a { color: #fff; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; border-color: var(--border-hover); }
.graytext { color: #888; font-size: 10pt; }

/* ════════════════════════════════════════════════════════════
   BOTTOM-RIGHT READOUT (simulation clock)
════════════════════════════════════════════════════════════ */
#bottom-readout {
  position: fixed;
  right: 10px;
  bottom: 6px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 10.5px;
  color: #999;
  opacity: 0.75;
  pointer-events: none;
  text-align: right;
}
#sim-date { color: #ccc; }
#current-date { font-size: 9.5px; color: #777; }

/* ════════════════════════════════════════════════════════════
   TOOLTIP
════════════════════════════════════════════════════════════ */
#tooltip {
  position: fixed;
  z-index: 500;
  max-width: 200px;
  padding: 5px 11px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
#tooltip.visible { opacity: 1; transform: translateY(0); }

/* ════════════════════════════════════════════════════════════
   ASSET CREDITS (bottom-right)
════════════════════════════════════════════════════════════ */
#asset-credits {
  position: fixed;
  right: 10px;
  bottom: 44px;
  z-index: 80;
  max-width: 400px;
  color: rgba(160, 160, 160, 0.5);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-align: right;
  pointer-events: none;
}
body.surface-active #asset-credits { color: var(--text); }

/* ════════════════════════════════════════════════════════════
   VR NOTICE
════════════════════════════════════════════════════════════ */
#vr-notice {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 12px);
  z-index: 400;
  max-width: min(460px, calc(100vw - 40px));
  padding: 12px 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  background: var(--panel-flat);
  backdrop-filter: var(--blur);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#vr-notice.visible { opacity: 1; transform: translate(-50%, 0); }

/* Hide all chrome while the headset mirror view is running */
body.xr-presenting #settings-panel,
body.xr-presenting #controls-rail,
body.xr-presenting #obj-stats,
body.xr-presenting #info-panel,
body.xr-presenting #obj-actions,
body.xr-presenting #tooltip,
body.xr-presenting #bottom-readout,
body.xr-presenting #asset-credits,
body.xr-presenting .corner-icon { display: none !important; }

/* ═══════���════════════════════════════════════════════════════
   IMMERSIVE SURFACE EXPLORATION (inside detail panel)
════════════════════════════════════════════════════════════ */
.surface-explorer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}
.surface-explorer.hidden { display: none; }
.surface-explorer.is-active { border-color: rgba(255, 255, 255, 0.5); }
.surface-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.surface-eyebrow { color: #bbb; font-size: 8px; letter-spacing: 0.16em; }
.surface-heading h3 { margin-top: 4px; color: #fff; font-size: 16px; font-weight: 600; text-transform: uppercase; }
.surface-badge { padding: 4px 7px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--radius-pill); color: #fff; font-size: 8px; letter-spacing: 0.12em; }
.surface-explorer > p { color: var(--muted-light); font-size: 12.5px; line-height: 1.5; }
.surface-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.surface-status-grid div { min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.35); }
.surface-status-grid span, .surface-status-grid strong { display: block; }
.surface-status-grid span { color: var(--muted); font-size: 7px; letter-spacing: 0.14em; }
.surface-status-grid strong { overflow: hidden; margin-top: 4px; color: #fff; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.surface-progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.surface-progress { height: 2px; overflow: hidden; background: var(--border); }
.surface-progress span { display: block; width: 0; height: 100%; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.7); transition: width 0.35s ease; }
.surface-progress-wrap p { color: var(--muted-light); font-size: 9px; }
.surface-actions { display: flex; gap: 8px; }
.surface-actions .action-btn { min-height: 38px; }

/* ════════════════════════════════════════════════════════════
   SHARED PRIMITIVES (used by admin page too)
═══════════════════════���════════════════════════════════════ */
.launch-kicker { color: #eee; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.launch-primary, .launch-secondary { font: 600 11px var(--font-head); letter-spacing: 0.11em; text-transform: uppercase; cursor: pointer; }
.launch-primary { padding: 15px 22px; border: 1px solid #fff; border-radius: var(--radius-pill); background: #fff; color: #111; }
.launch-primary:disabled { opacity: 0.55; cursor: wait; }
.launch-secondary { padding: 15px 20px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.35); color: #fff; }
.launch-primary:hover { filter: brightness(0.9); }
.launch-secondary:hover { border-color: #fff; }

/* ════════════════════════════════════════════════════════════
   ADMIN PAGE (shares this stylesheet)
════════════════════════════════════════════════════════════ */
.admin-root, .admin-body { min-height: 100%; height: auto; overflow: auto; background: var(--bg-deep); user-select: text; }
.admin-body { background-image: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.05), transparent 34%); }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.admin-header h1 { margin-top: 8px; color: var(--text-bright); font: 600 clamp(34px, 5vw, 62px)/1 var(--font-head); text-transform: uppercase; }
.admin-header a { color: #fff; font-size: 11px; text-decoration: none; text-transform: uppercase; }
.admin-login { width: min(460px, 100%); margin: 11vh auto 0; padding: 36px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.admin-login h2 { color: var(--text-bright); font: 600 28px var(--font-head); text-transform: uppercase; }
.admin-login p { margin-top: 8px; }
.admin-login form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.admin-login label { display: flex; flex-direction: column; gap: 7px; color: var(--muted-light); font: 500 10px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.admin-login input, #admin-search { border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: var(--text-bright); padding: 13px; font: 15px var(--font-body); outline: none; }
#admin-dashboard { margin-top: 32px; }
.admin-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-tools label { flex: 1; }
#admin-search { width: min(540px, 100%); }
.admin-tools .launch-secondary { display: inline-block; text-decoration: none; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: rgba(10, 10, 10, 0.76); }
.admin-table-wrap table { width: 100%; border-collapse: collapse; }
.admin-table-wrap th, .admin-table-wrap td { padding: 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table-wrap th { color: var(--muted-light); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-table-wrap td { min-width: 130px; color: var(--text); font-size: 14px; line-height: 1.5; }
.admin-table-wrap td:nth-child(3) { min-width: 320px; white-space: normal; }
.admin-table-wrap strong, .admin-table-wrap a { display: block; color: var(--text-bright); }
.admin-table-wrap a { color: #fff; text-decoration: none; }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; }
.admin-pagination button { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: transparent; color: var(--text); cursor: pointer; font-family: var(--font-body); }
.admin-pagination button:disabled { opacity: 0.35; }
#admin-status { margin-top: 14px; text-align: center; font-size: 11px; color: var(--muted-light); }
@media (max-width: 640px) { .admin-header, .admin-tools { align-items: stretch; flex-direction: column; } .admin-login { padding: 24px; } }

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════════════════ */
@keyframes chromeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #settings-panel, .splash-inner, #obj-stats { animation: none; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile adaptations
════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  :root { --panel-w: 100vw; }

  #settings-panel {
    top: 62px;
    left: 10px;
    width: min(232px, calc(100vw - 20px));
    max-height: calc(100vh - 72px);
    font-size: 11px;
  }
  #controls-rail { top: 70px; left: 10px; }
  #camera-select { width: 122px; }

  #info-panel {
    width: 100vw;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    height: auto;
    max-height: 62vh;
    padding-top: 40px;
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  #obj-stats { font-size: 9pt; padding: 8px 10px; }
  #obj-actions { bottom: calc(62vh + 10px); }
  #asset-credits { display: none; }
}

@media (max-width: 480px) {
  #start-btn.progress { padding: 8px 54px; font-size: 16px; }
  .splash-title { letter-spacing: 0.22em; }
  .splash-proof { font-size: 8.5px; }
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
════════════════════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.glow { text-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}
