:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #010101;
  color: #f4f4f1;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #010101;
}

#moon {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#moon:active { cursor: grabbing; }

#controls {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  width: min(27rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.15rem;
  border: 1px solid rgba(240, 240, 224, 0.2);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(15, 15, 14, 0.94), rgba(3, 3, 3, 0.84));
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
  transition: opacity 160ms ease, transform 160ms ease;
}

#controls[hidden] { display: none; }

header { margin-bottom: 0.9rem; }

.eyebrow {
  margin: 0 0 0.25rem;
  color: #f3bd79;
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 690;
  letter-spacing: -0.045em;
}

.subtitle {
  margin: 0.05rem 0 0;
  color: #d8d3c9;
  font-size: 0.95rem;
}

#status {
  min-height: 2.5em;
  margin: 0.5rem 0 0;
  color: #aca89f;
  font-size: 0.82rem;
  line-height: 1.4;
}

.actions {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 0.5rem;
}

button, input, .button { font: inherit; }

button, .button {
  min-height: 2.8rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(230, 225, 211, 0.28);
  border-radius: 0.62rem;
  background: rgba(48, 46, 42, 0.76);
  color: #f5f2ec;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

button.primary {
  border-color: rgba(255, 199, 127, 0.72);
  background: linear-gradient(135deg, #9f511d, #694127);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.button { grid-column: 1 / -1; display: grid; place-items: center; }

.instruction {
  margin: 0.75rem 0 0.9rem;
  color: #aaa69e;
  font-size: 0.76rem;
  line-height: 1.45;
}

.settings { display: grid; gap: 0.7rem; }

.settings label {
  display: grid;
  gap: 0.3rem;
  color: #d5d0c6;
  font-size: 0.78rem;
  font-weight: 620;
}

.settings label.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 520;
}

input[type="range"] { width: 100%; accent-color: #e49b55; }
.check input { width: 1.05rem; height: 1.05rem; }

output {
  justify-self: end;
  margin-top: -1.2rem;
  color: #f1bd78;
  font-variant-numeric: tabular-nums;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
}

.facts div {
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(220, 215, 202, 0.12);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.025);
}

dt { color: #eee9df; font-size: 0.72rem; font-weight: 680; }
dd { margin: 0.12rem 0 0; color: #aaa69e; font-size: 0.68rem; line-height: 1.35; }

details {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(220, 215, 202, 0.14);
  padding-top: 0.7rem;
  color: #aaa69e;
  font-size: 0.72rem;
  line-height: 1.45;
}

summary { cursor: pointer; color: #ddd8ce; font-weight: 650; }
details p { margin: 0.6rem 0; }

#loading {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: min(30rem, calc(100vw - 3rem));
  padding: 1rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(244, 197, 135, 0.28);
  border-radius: 0.8rem;
  background: rgba(5, 5, 5, 0.92);
  box-shadow: 0 1rem 4rem #000;
  text-align: center;
}

#loading span {
  display: block;
  color: #e7ab64;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#loading strong { display: block; margin-top: 0.45rem; font-size: 0.88rem; }

.progress {
  height: 0.28rem;
  margin-top: 0.8rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #29251f;
}

.progress i {
  display: block;
  width: 2%;
  height: 100%;
  background: linear-gradient(90deg, #a85a24, #ffd28e);
  transition: width 120ms ease;
}

#show-controls {
  position: fixed;
  z-index: 4;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
}

@media (max-width: 640px) {
  #controls { max-height: 70vh; }
  .actions, .facts { grid-template-columns: 1fr; }
  .button { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #controls, .progress i { transition: none; }
}

.navigation { margin-top: 1rem; }
#minimap { display: block; width: 100%; height: auto; border: 1px solid #625640; cursor: crosshair; }
.map-caption, #position-output { display: block; font-size: .7rem; line-height: 1.4; color: #bcb4a5; }
#places-list { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-top: .5rem; }
#places-list > div { display: flex; gap: .4rem; align-items: center; }
#places-list button { padding: .35rem; font-size: .7rem; }
#places-list a { color: #d3b98c; font-size: .65rem; }

#place-evidence img { width:100%; border-radius:6px; }
#place-evidence p { font-size:12px; line-height:1.5; }
#place-evidence h3 { font-size:15px; }
.evidence-note { color:#baa77c; }

#buggy-hud { position:fixed; bottom:1rem; right:1rem; z-index:3; background:#111d; color:#f5cb84; border:1px solid #625640; padding:.65rem 1rem; border-radius:8px; font-size:.8rem; pointer-events:none; }

#concept-hud { position:fixed; bottom:1rem; left:1rem; z-index:3; padding:.5rem .8rem; background:#101820df; color:#9de3f0; border:1px solid #57717d; border-radius:8px; font-size:.8rem; pointer-events:none; }

select {display:block;width:100%;margin-top:.5rem;padding:.6rem;background:#24231f;color:#f5f2ec;border:1px solid #686258;border-radius:.5rem;}
#satellite-hud {position:fixed;right:1rem;bottom:1rem;max-width:calc(100vw - 2rem);padding:.8rem;background:#141510e8;color:#a4edf0;border-radius:.5rem;font-size:.8rem;pointer-events:none;}
#satellite-hud[hidden]{display:none;}

#inferred-hud {position:fixed;top:1rem;right:1rem;max-width:26rem;padding:.8rem 1rem;border:2px solid #e2b760;background:#272014ed;color:#ffe5ae;font-weight:700;text-align:center;border-radius:.3rem;pointer-events:none;}#inferred-hud small{display:block;margin-top:.4rem;font-size:.75rem;font-weight:400;}#inferred-hud[hidden]{display:none;}
