:root {
  --bg: #050505;
  --surface: rgba(13, 13, 13, 0.66);
  --surface-strong: rgba(13, 13, 13, 0.9);
  --border: rgba(240, 230, 218, 0.14);
  --text: #f0e6da;
  --muted: #a99f94;
  --orange: #fc6323;
  --green: #a4c639;
  --purple: #b1a1df;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Mono", Consolas, monospace;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: fixed;
  inset: 0;
  min-width: 320px;
  background: #050505;
}

#orbitCanvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100svh;
  cursor: pointer;
  touch-action: manipulation;
}

.control-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  max-height: 40svh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.03) 50%) 0 0 / 100% 4px,
    rgba(5, 5, 5, 0.58);
  box-shadow: 0 0 38px rgba(0, 0, 0, 0.42), 0 0 28px rgba(252, 99, 35, 0.08);
  backdrop-filter: blur(10px);
}

.source-badge {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.58);
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.eyebrow,
.label {
  margin: 0;
  color: var(--green);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.date-readout strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-size: 1.02rem;
  text-transform: uppercase;
}

.slider-wrap {
  display: grid;
  gap: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

.button {
  min-height: 44px;
  border: 1px solid rgba(252, 99, 35, 0.58);
  border-radius: 8px;
  background: rgba(252, 99, 35, 0.1);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
}

.button:hover,
.button:focus-visible,
.popup-close:hover,
.popup-close:focus-visible {
  box-shadow: 0 0 20px rgba(252, 99, 35, 0.22);
  outline: none;
}

.button-secondary {
  border-color: rgba(177, 161, 223, 0.46);
  background: rgba(177, 161, 223, 0.08);
}

.fact-popup {
  position: fixed;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 178px;
  max-height: calc(100svh - 210px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(252, 99, 35, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 50%, rgba(0, 0, 0, 0.035) 50%) 0 0 / 100% 4px,
    rgba(8, 8, 8, 0.84);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.54), 0 0 30px rgba(252, 99, 35, 0.16);
  backdrop-filter: blur(12px);
}

.popup-close {
  float: right;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(240, 230, 218, 0.05);
  color: var(--muted);
  cursor: pointer;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 10px;
  color: var(--text);
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.planet-fact {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.55;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.fact-grid div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 15, 15, 0.7);
}

dt {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (min-width: 760px) {
  .control-bar {
    left: 50%;
    right: auto;
    bottom: 20px;
    width: min(1080px, calc(100vw - 40px));
    grid-template-columns: 180px 1fr 110px 172px 140px;
    transform: translateX(-50%);
    max-height: none;
    overflow: visible;
  }

  .fact-popup {
    left: auto;
    right: 26px;
    bottom: 104px;
    width: 380px;
    max-height: calc(100svh - 136px);
  }
}
