@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

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

body {
  background: #080808;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ── Layout ── */
#layout {
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  height: 100vh;
  margin: 0;
}
#visualization, #glContainer { height: 100%; }
#css-world, #css-camera {
  width: 100%; height: 100%;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  position: absolute;
}
#css-container {
  width: 100%; height: 100%;
  top: 0; left: 0;
  position: absolute;
}
canvas { pointer-events: none; z-index: 10; }

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  background: #080808;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loader div { text-align: center; }
#loader img { opacity: 0.12; filter: invert(1); }
#loader p {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  margin-top: 16px;
  line-height: 1.6;
}

/* ── HUD Buttons — bottom right ── */
#hud-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 9999;
}

.hud-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 8px;
  height: 28px;
  background: rgba(8,8,8,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  outline: none;
  -webkit-appearance: none;
}
.hud-btn:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.25);
  background: rgba(20,20,20,0.98);
}
.hud-btn.active {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
}

.hud-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.hud-btn-icon svg {
  width: 10px;
  height: 10px;
  color: inherit;
  display: block;
}

.hud-btn-label {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: inherit;
}

/* ── Zoom slider (minimap) ── */
#minimap {
  position: fixed !important;
  right: 20px !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  padding: 0 !important;
  z-index: 9998;
  opacity: 0.25;
  transition: opacity 0.2s;
  user-select: none;
}
#minimap.ready { opacity: 0.25; }
#minimap.ready:hover, #minimap:hover { opacity: 1 !important; }

#minimap #zoom-levels {
  width: 2px !important;
  height: 120px !important;
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  cursor: ns-resize;
  position: relative;
  margin: 0 auto;
}
#minimap #zoom-backdrop { display: none !important; }
#minimap #zoom-cursor {
  position: absolute;
  left: -5px !important;
  right: auto !important;
  width: 12px !important;
  height: 2px !important;
  background: rgba(255,255,255,0.8) !important;
  border: none !important;
  top: 0;
}
#minimap #about { display: none !important; }
#minimap #volume { display: none !important; }

/* ── Star markers ── */
.marker, .legacymarker {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: absolute;
  padding: 0;
  cursor: pointer;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: opacity 0.5s;
  user-select: none;
}
.marker span.name {
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 6px rgba(255,255,255,0.6), 0 0 16px rgba(255,255,255,0.25);
  transition: color 0.15s, text-shadow 0.15s;
}
.marker span.name:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,1), 0 0 24px rgba(255,255,255,0.5);
}
.legacymarker span.name {
  display: inline-block;
  width: 100%;
  color: rgba(255,255,255,0.6);
  text-shadow: 0 0 6px rgba(255,255,255,0.35), 0 0 14px rgba(255,255,255,0.15);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ── Star name bottom-left ── */
#star-name {
  position: fixed;
  left: 0; bottom: 0;
  margin: 0 0 16px 20px;
  width: auto;
  display: none;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: none;
  color: rgba(255,255,255,0.4);
  border-bottom: none;
  user-select: none;
}
#star-name span { cursor: pointer; }
#star-name span:hover { color: rgba(255,255,255,0.9); }

/* ── Detail panel ── */
#detailContainer {
  display: none;
  background: rgba(8,8,8,0.94);
  border-right: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: absolute;
  top: 0; bottom: 0; left: 0;
  overflow: auto;
  width: 240px;
  z-index: 9999 !important;
}
#detailContainer::-webkit-scrollbar { display: none; }

#detailTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  position: sticky;
  top: 0;
  background: rgba(8,8,8,0.97);
  z-index: 1;
}

#detailBody {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  line-height: 1.85;
  color: rgba(255,255,255,0.3);
  padding: 14px;
}
#detailBody p + p { margin-top: 10px; }
#detailBody b { color: rgba(255,255,255,0.6); font-weight: 700; }
#detailBody a:link, #detailBody a:visited {
  color: rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
}
#detailBody a:hover {
  color: rgba(255,255,255,0.8);
  border-bottom-color: rgba(255,255,255,0.3);
}

#detailFooter {
  padding: 0 14px 14px;
  color: rgba(255,255,255,0.15);
  font-size: 8px;
  letter-spacing: 0.1em;
}

#detailClose {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
#detailClose > * {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  display: inline-block;
  transition: color 0.15s;
}
#detailClose > *:hover { color: rgba(255,255,255,0.8); }

/* ── Tour messages ── */
#theater .top-bar {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 48px;
  background: #080808;
  margin-top: -48px;
}
#theater .bottom-bar {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 48px;
  background: #080808;
  margin-bottom: -48px;
}
#theater .message {
  position: absolute;
  bottom: 60px;
  left: 0; right: 0;
  top: auto;
  text-align: center;
}
#theater .message p {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-shadow: none;
  color: rgba(255,255,255,0.5);
  height: auto;
  line-height: 1.7;
  padding: 0;
  margin: 0;
  display: inline-block;
}
#theater .message p span {
  display: inline-block;
  background: rgba(8,8,8,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 20px;
  letter-spacing: 0.2em;
}

/* ── Hidden ── */
#spectral-graph { display: none; }
#controlshelp { display: none !important; }
#icon-nav { display: none !important; }

/* ── Spectral graph ── */
#spectral-graph {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  text-align: center;
  font-family: 'Space Mono', monospace;
}
#heat-map {
  width: 280px;
  height: 12px;
  background: linear-gradient(to right, #ff6600, #ffcc00, #ffffff, #aabbff, #6688ff);
  margin-bottom: 6px;
}
#spectral-graph p {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
  position: absolute;
  top: 16px;
  white-space: nowrap;
}
#spectral-graph p.left  { left: 0; }
#spectral-graph p.center { left: 50%; transform: translateX(-50%); }
#spectral-graph p.right { right: 0; }
#spectral-graph h5 {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 22px;
  text-align: left;
}

/* ── Tour stop/skip button (#meta) ── */
#meta {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 9999;
  color: rgba(255,255,255,0.4);
  text-shadow: none;
  transition: none;
}
#meta p {
  vertical-align: bottom;
  padding: 0;
  background: none;
}
#meta p a {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 5px 14px;
  text-decoration: none;
  background: rgba(8,8,8,0.85);
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
}
#meta p a:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

/* ── Tooltip ── */
div.tip {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  background: rgba(8,8,8,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 4px 8px;
  white-space: nowrap;
  font-style: normal;
  pointer-events: none;
}

/* ── Misc ── */
.unselectable { user-select: none; }
sup { vertical-align: super; font-size: 0.7em; line-height: 0; }
.reference { display: none; visibility: hidden; }

a:link, a:active, a:visited {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  transition: border-color 0.15s;
}
a:hover { border-bottom-color: rgba(255,255,255,0.4); }

::selection { background: rgba(255,255,255,0.1); }
::-moz-selection { background: rgba(255,255,255,0.1); }
