:root {
  color-scheme: dark;
  --ice: #e2f7f8;
  --cyan: #8ce0e5;
  --cyan-soft: #b9f1f3;
  --dim: #7e99a5;
  --line: #8fc3cc26;
  --green: #a2eba0;
  --orange: #ffc08a;
  --red: #ff5f52;
  --white: #eef7f6;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02070d;
  color: var(--white);
  font: 13px var(--sans);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#space {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}

/* ---------- visor / helmet ---------- */
.visor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: 42px;
  background:
    radial-gradient(
      ellipse at 50% 108%,
      rgba(158, 220, 228, 0.14),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 50% 46%,
      transparent 42%,
      rgba(2, 8, 13, 0.32) 74%,
      rgba(0, 2, 5, 0.84) 100%
    );
  box-shadow:
    inset 0 0 120px 32px rgba(0, 3, 7, 0.62),
    inset 0 0 0 1px rgba(155, 210, 216, 0.09);
}
.visor::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    116deg,
    rgba(205, 240, 244, 0.055) 0%,
    transparent 24%,
    transparent 76%,
    rgba(205, 240, 244, 0.04) 100%
  );
}
.visor::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    rgba(180, 230, 235, 0.05) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.32;
  mix-blend-mode: screen;
}
.helmet-top {
  position: absolute;
  top: 0;
  left: 9%;
  right: 9%;
  height: 10px;
  border-bottom: 1px solid #91bdc533;
  border-radius: 0 0 50% 50%;
  background: #0207109c;
}
.helmet-bottom {
  position: absolute;
  bottom: 0;
  left: 6%;
  right: 6%;
  height: 10px;
  border-top: 1px solid #91bdc52b;
  border-radius: 50% 50% 0 0;
  background: #0207109c;
}
.crack {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(
      125deg,
      transparent 18%,
      #efcba322 18.1%,
      transparent 18.3%
    ),
    linear-gradient(15deg, transparent 83%, #efcba330 83.1%, transparent 83.4%);
  transition: opacity 0.3s;
}
body.leaking .crack {
  opacity: 1;
}
#hit-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 110px 50px #dc794455;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 6;
}
#hit-flash.on {
  opacity: 1;
}

/* ---------- critical (low oxygen) layers ---------- */
#critical-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.45s;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 32%,
    rgba(150, 18, 12, 0.4) 72%,
    rgba(88, 0, 0, 0.9) 100%
  );
}
body.critical #critical-vignette {
  opacity: 1;
  animation: vbreathe 2.6s ease-in-out infinite;
}
.critical-frame {
  position: fixed;
  inset: 22px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.4s;
}
.critical-frame i {
  position: absolute;
  width: 46px;
  height: 46px;
  border: 0 solid rgba(255, 92, 78, 0.78);
  filter: drop-shadow(0 0 10px rgba(255, 60, 50, 0.35));
}
.critical-frame i:nth-child(1) {
  left: 0;
  top: 0;
  border-left-width: 1px;
  border-top-width: 1px;
}
.critical-frame i:nth-child(2) {
  right: 0;
  top: 0;
  border-right-width: 1px;
  border-top-width: 1px;
}
.critical-frame i:nth-child(3) {
  left: 0;
  bottom: 0;
  border-left-width: 1px;
  border-bottom-width: 1px;
}
.critical-frame i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right-width: 1px;
  border-bottom-width: 1px;
}
body.critical .critical-frame {
  opacity: 1;
}
.critical-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: -180px;
  height: 180px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.4s;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 70, 58, 0.1) 58%,
    rgba(255, 96, 80, 0.24) 78%,
    transparent
  );
}
body.critical .critical-sweep {
  opacity: 1;
  animation: sweep 3.6s linear infinite;
}
@keyframes sweep {
  to {
    transform: translateY(calc(100vh + 360px));
  }
}
@keyframes vbreathe {
  0%,
  100% {
    filter: brightness(0.9);
  }
  50% {
    filter: brightness(1.25);
  }
}

/* ---------- HUD frame ---------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
}
.hud::before,
.hud::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
.hud::before {
  top: 0;
  height: 210px;
  background: linear-gradient(
    to bottom,
    rgba(1, 5, 9, 0.72),
    rgba(1, 5, 9, 0)
  );
}
.hud::after {
  bottom: 0;
  height: 230px;
  background: linear-gradient(
    to top,
    rgba(1, 5, 9, 0.72),
    rgba(1, 5, 9, 0)
  );
}
.hud .top {
  position: absolute;
  left: 46px;
  right: 46px;
  top: 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}

/* identity */
.ident .kick {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3.1px;
  color: #9fc3cc;
}
.ident h1 {
  margin: 10px 0 0;
  font-size: 60px;
  line-height: 0.92;
  font-weight: 300;
  letter-spacing: 3px;
  color: #f0fdfe;
  text-shadow:
    0 0 28px rgba(140, 240, 245, 0.26),
    0 2px 12px rgba(0, 0, 0, 0.9);
}
.ident .sub {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 2.2px;
  color: #8ca7b3;
}

/* heading tape */
.nav {
  width: 430px;
  justify-self: center;
  text-align: center;
}
.tape {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding-bottom: 15px;
}
.tape-k {
  font: 9px var(--mono);
  letter-spacing: 2.4px;
  color: #7f9ba7;
}
.tape b {
  font: 300 21px/1 var(--mono);
  letter-spacing: 2px;
  color: #ddf6f7;
}
.tape-ticks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    rgba(150, 215, 222, 0.42) 0 1px,
    transparent 1px 10px
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 16%,
    #000 84%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 16%,
    #000 84%,
    transparent
  );
}
.tape::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 13px;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(140, 235, 240, 0.8);
}
.objective-row {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.tag {
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: #bdf7b6;
  border: 1px solid rgba(150, 240, 150, 0.45);
  padding: 3px 7px 2px;
  border-radius: 2px;
  background: rgba(30, 60, 34, 0.35);
}
.obj-title {
  font-size: 12px;
  letter-spacing: 1.4px;
  color: #e5f7f6;
}
.obj-hint {
  min-height: 14px;
  margin: 9px auto 0;
  max-width: 430px;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #7f9aa6;
}

/* comms */
.comms {
  justify-self: end;
  text-align: right;
}
.comms-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #d7f3f2;
}
.comms-line .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(160, 240, 150, 0.9);
}
.bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-left: 3px;
}
.bars i {
  width: 2px;
  background: #a7eaa2;
  opacity: 0.85;
}
.bars i:nth-child(1) {
  height: 4px;
}
.bars i:nth-child(2) {
  height: 6px;
}
.bars i:nth-child(3) {
  height: 8px;
}
.bars i:nth-child(4) {
  height: 11px;
  box-shadow: 0 0 5px rgba(160, 240, 150, 0.7);
}
.comms-meta {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #708b97;
}
.comms-meta b {
  font: 11px var(--mono);
  font-weight: 400;
  color: #cfe9ec;
  letter-spacing: 1px;
}
#menu-button {
  pointer-events: auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(139, 200, 210, 0.35);
  border-radius: 2px;
  background: rgba(7, 20, 27, 0.55);
  color: var(--cyan);
  font-size: 11px;
  line-height: 1;
}
#menu-button:hover {
  background: rgba(20, 52, 62, 0.7);
}

/* ---------- reticle ---------- */
.reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  opacity: 0.72;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.reticle .ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(190, 238, 242, 0.36);
  border-radius: 50%;
}
.reticle i {
  position: absolute;
  background: rgba(210, 246, 248, 0.85);
}
.reticle i:nth-child(2) {
  left: 50%;
  top: -4px;
  width: 1px;
  height: 7px;
  margin-left: -0.5px;
}
.reticle i:nth-child(3) {
  left: 50%;
  bottom: -4px;
  width: 1px;
  height: 7px;
  margin-left: -0.5px;
}
.reticle i:nth-child(4) {
  top: 50%;
  left: -4px;
  width: 7px;
  height: 1px;
  margin-top: -0.5px;
}
.reticle i:nth-child(5) {
  top: 50%;
  right: -4px;
  width: 7px;
  height: 1px;
  margin-top: -0.5px;
}
.reticle b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: rgba(225, 250, 250, 0.9);
}
.reticle.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.06);
}
.reticle.active .ring {
  border-color: rgba(150, 245, 240, 0.75);
  box-shadow: 0 0 16px rgba(120, 235, 235, 0.22);
}

/* ---------- interaction / repair ---------- */
.interact {
  position: absolute;
  left: 50%;
  top: calc(50% + 72px);
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 390px;
  opacity: 0;
  transition: opacity 0.15s;
}
.interact.show {
  opacity: 1;
}
.interact > span {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  border: 1px solid rgba(163, 226, 221, 0.6);
  background: rgba(10, 34, 40, 0.6);
  border-radius: 2px;
  font: 11px var(--mono);
  color: var(--cyan);
}
.interact strong {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.8px;
}
.interact small {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
  margin-top: 5px;
  letter-spacing: 0.4px;
}
.repair {
  position: absolute;
  left: 50%;
  top: 64%;
  width: 220px;
  transform: translateX(-50%);
  text-align: center;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 1px;
}
.repair > div {
  height: 2px;
  background: rgba(127, 201, 188, 0.2);
  margin: 10px 0;
}
.repair i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(140, 235, 235, 0.7);
}
.repair small {
  color: var(--dim);
  font-size: 9px;
}

/* ---------- warnings / toast ---------- */
.alert {
  position: absolute;
  top: 168px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 72vw);
  padding: 10px 26px 11px;
  text-align: center;
  color: #ffcf9e;
  border-top: 1px solid rgba(255, 180, 110, 0.5);
  border-bottom: 1px solid rgba(255, 180, 110, 0.5);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(42, 25, 10, 0.62),
    transparent
  );
}
.alert strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
}
.alert small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #d8b28d;
}
.alert.oxygen-alert {
  color: #ffc7bf;
  border-color: rgba(255, 90, 78, 0.62);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(66, 8, 7, 0.72),
    transparent
  );
  animation: alertpulse 1.5s ease-in-out infinite;
}
.alert.oxygen-alert strong {
  font-size: 16px;
  letter-spacing: 4px;
  color: #fff0ed;
  text-shadow: 0 0 20px rgba(255, 70, 55, 0.8);
}
.alert.oxygen-alert small {
  color: #f3a79c;
}
@keyframes alertpulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.5);
  }
}
.toast {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  max-width: 520px;
  font-size: 11.5px;
  line-height: 1.85;
  text-align: center;
  padding: 11px 20px;
  color: var(--ice);
  background: rgba(8, 21, 27, 0.72);
  border: 1px solid var(--line);
  border-radius: 2px;
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}
.toast.show {
  opacity: 1;
}

/* ---------- world markers ---------- */
#world-markers {
  position: absolute;
  inset: 0;
}
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--cyan-soft);
  text-shadow:
    0 1px 8px #000,
    0 0 14px rgba(0, 0, 0, 0.85);
}
.marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 1px;
  height: 17px;
  background: linear-gradient(currentColor, transparent);
  opacity: 0.55;
}
.marker .diamond {
  position: relative;
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
  margin: 0 auto 9px;
  background: rgba(6, 22, 27, 0.55);
  box-shadow: 0 0 9px currentColor;
  z-index: 1;
}
.marker > span:not(.diamond),
.marker small {
  transition: opacity 0.15s;
}
.marker small {
  display: block;
  margin-top: 5px;
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #a9c3c6;
}
.marker.pod {
  color: #a8eda2;
}
.marker.pod small {
  color: #8fb98b;
}
.marker.optional {
  color: var(--orange);
}
.marker.edge .diamond {
  border-width: 2px;
  transform: rotate(45deg) scale(0.82);
}

/* ---------- oxygen gauge ---------- */
.oxygen {
  position: absolute;
  left: 46px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.oxygen::before,
.stack::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 55% 55%,
    rgba(1, 5, 9, 0.72),
    rgba(1, 5, 9, 0) 70%
  );
}
.oxygen::before {
  inset: -46px -58px -30px -58px;
}
.gauge {
  position: relative;
  width: 236px;
  height: 236px;
}
.gauge svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.g-ticks {
  fill: none;
  stroke: rgba(150, 225, 232, 0.4);
  stroke-width: 8;
  stroke-dasharray: 1.6 5.9;
  opacity: 0.55;
}
.g-track {
  fill: none;
  stroke: rgba(130, 200, 210, 0.14);
  stroke-width: 5;
}
.g-arc {
  fill: none;
  stroke: url(#oxy-grad);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 584.34 584.34;
  filter: drop-shadow(0 0 6px rgba(140, 245, 245, 0.6));
  transition: stroke-dasharray 0.15s linear;
}
.g-read {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.g-label {
  font-size: 9px;
  letter-spacing: 2.6px;
  color: #8fb0ba;
}
.g-num {
  display: flex;
  align-items: baseline;
  margin-top: 3px;
}
.g-num span {
  font: 300 56px/1 var(--mono);
  letter-spacing: -2px;
  color: #e9fcfd;
  text-shadow: 0 0 24px rgba(140, 240, 245, 0.35);
}
.g-num em {
  font: 300 15px/1 var(--mono);
  font-style: normal;
  color: #a6ccd2;
  margin-left: 3px;
}
.g-time {
  margin-top: 7px;
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: #7f99a6;
}
.chip {
  margin-top: 14px;
  padding: 5px 14px 4px;
  border: 1px solid rgba(140, 240, 235, 0.42);
  border-radius: 2px;
  background: rgba(10, 32, 38, 0.4);
  color: #cdf7f4;
  font-size: 10px;
  letter-spacing: 3px;
  box-shadow: inset 0 0 14px rgba(120, 230, 230, 0.07);
}
.chip.warm {
  border-color: rgba(255, 190, 130, 0.5);
  color: var(--orange);
}
body.critical .g-arc {
  stroke: url(#oxy-grad-low);
  stroke-width: 6;
  filter: drop-shadow(0 0 10px rgba(255, 74, 58, 0.95));
}
body.critical .g-ticks {
  stroke: rgba(255, 96, 80, 0.5);
  opacity: 0.7;
}
body.critical .g-track {
  stroke: rgba(255, 96, 80, 0.18);
}
body.critical .g-label,
body.critical .g-time {
  color: #d99a90;
}
body.critical .g-num span {
  color: #ffe0da;
  text-shadow: 0 0 26px rgba(255, 62, 46, 0.62);
}
body.critical .g-num em {
  color: #e5a298;
}
body.critical .chip {
  border-color: rgba(255, 90, 78, 0.65);
  background: rgba(96, 12, 9, 0.6);
  color: #ffe7e2;
  text-shadow: 0 0 10px rgba(255, 80, 62, 0.55);
  box-shadow:
    inset 0 0 16px rgba(255, 60, 45, 0.2),
    0 0 18px rgba(255, 60, 45, 0.22);
  animation: chipPulse 1.1s ease-in-out infinite;
}
@keyframes chipPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ---------- target lock + telemetry ---------- */
.stack {
  position: absolute;
  right: 46px;
  bottom: 70px;
  width: 300px;
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
}
.stack::before {
  inset: -38px -46px -38px -96px;
  background: radial-gradient(
    140% 130% at 55% 55%,
    rgba(1, 5, 9, 0.88),
    rgba(1, 5, 9, 0.66) 60%,
    rgba(1, 5, 9, 0) 92%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 106% 102% at 60% 50%,
    #000 48%,
    transparent 88%
  );
  mask-image: radial-gradient(
    ellipse 106% 102% at 60% 50%,
    #000 48%,
    transparent 88%
  );
}
.lock-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(140, 205, 215, 0.18);
  font: 9px var(--mono);
  letter-spacing: 1.4px;
  color: #7e9aa6;
}
.lock-head #sector {
  color: #6c8a95;
}
.lock-body {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 13px 0 11px;
}
.lock-diamond {
  width: 9px;
  height: 9px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(162, 235, 160, 0.55);
  flex: none;
}
.lock-body strong {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #d3f0cd;
}
.lock-body small {
  display: block;
  margin-top: 6px;
  font: 9.5px var(--mono);
  letter-spacing: 0.8px;
  color: #86a08b;
}
.lock-signal {
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #8fe89a 0 16px,
    transparent 16px 21px
  );
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000);
}
.telemetry {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(140, 205, 215, 0.18);
}
.tel-head {
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: #7e9aa6;
  text-align: right;
}
.tel-rows {
  margin: 9px 0 0;
  display: grid;
  gap: 3px;
}
.tel-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.tel-rows dt {
  font-size: 10.5px;
  letter-spacing: 0.8px;
  color: #97aeb8;
}
.tel-rows dd {
  margin: 0;
  font: 11px var(--mono);
  letter-spacing: 0.6px;
  color: #dff5f6;
}
.tel-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(140, 205, 215, 0.12);
  font-size: 9px;
  letter-spacing: 1px;
  color: #7e9aa6;
}
.tel-assist {
  margin-top: 6px;
  text-align: right;
  font-size: 9px;
  letter-spacing: 1px;
  color: #67838f;
}

/* ---------- key hints ---------- */
.hud footer {
  position: absolute;
  left: 46px;
  right: 46px;
  bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-size: 9.5px;
  letter-spacing: 0.8px;
  color: #7e97a2;
}
kbd {
  font: 9px var(--mono);
  color: #d3eef1;
  background: rgba(6, 18, 24, 0.55);
  border: 1px solid rgba(130, 200, 215, 0.32);
  border-radius: 2px;
  padding: 2px 6px;
  margin-right: 5px;
  letter-spacing: 1px;
}

/* ---------- overlay / modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #020a12a8;
  backdrop-filter: blur(7px);
  padding: 24px;
  z-index: 10;
}
.modal {
  width: 560px;
  max-width: 100%;
  max-height: 94vh;
  overflow: auto;
  background: linear-gradient(135deg, #10232eea, #061019f5);
  border: 1px solid #7898aa55;
  border-radius: 4px;
  padding: 36px 40px;
  box-shadow: 0 25px 120px #0008;
}
.modal h2 {
  font-size: 38px;
  font-weight: 300;
  letter-spacing: 4px;
  line-height: 1.35;
  margin: 22px 0 16px;
}
.modal h2 span {
  color: var(--ice);
  margin-left: 12px;
}
.modal > p {
  font-size: 13px;
  color: #b5c8d2;
  line-height: 1.95;
  margin: 0 0 21px;
}
.eyebrow {
  font: 9px var(--mono);
  letter-spacing: 2.4px;
  color: var(--cyan);
}
.briefing-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 18px;
}
.briefing-stats span {
  font-size: 9px;
  color: var(--dim);
}
.briefing-stats b {
  display: block;
  margin-top: 8px;
  font-weight: 400;
  font-size: 11px;
}
.instructions {
  padding-left: 15px;
  color: #9eb3c1;
  font-size: 11px;
  line-height: 1.9;
}
.instructions li {
  margin-bottom: 6px;
}
.sound-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #b5c8d2;
  margin-top: 19px;
}
.sound-option input {
  accent-color: var(--cyan);
}
.sound-option small {
  font-size: 9px;
  color: var(--dim);
  margin-left: auto;
}
.desktop-note {
  font-size: 9px;
  color: var(--dim);
  margin: 12px 0 17px;
}
#previous {
  font-size: 11px;
  line-height: 1.8;
  color: #cfb48b;
  max-height: 75px;
  overflow: auto;
  white-space: pre-wrap;
}
.primary,
.secondary,
.danger {
  width: 100%;
  border: 0;
  border-radius: 2px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 1px;
}
.primary {
  background: var(--ice);
  color: #0d222c;
  font-weight: 600;
}
.primary:hover {
  background: #d9f9f1;
}
.secondary {
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--ice);
  background: transparent;
  margin-top: 10px;
}
.danger {
  justify-content: center;
  background: transparent;
  color: #c79c8c;
  padding: 11px;
  font-size: 10px;
  margin-top: 7px;
}
.primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.warm {
  color: var(--orange) !important;
}
body.paused .hud {
  opacity: 0.5;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hud .top {
    left: 30px;
    right: 30px;
    top: 22px;
  }
  .ident h1 {
    font-size: 48px;
  }
  .nav {
    width: 340px;
  }
  .oxygen {
    left: 30px;
    bottom: 58px;
  }
  .gauge {
    width: 200px;
    height: 200px;
  }
  .g-num span {
    font-size: 46px;
  }
  .stack {
    right: 30px;
    bottom: 58px;
    width: 265px;
  }
  .hud footer {
    left: 30px;
    right: 30px;
    gap: 12px;
  }
}
@media (max-width: 860px) {
  .nav {
    width: 260px;
  }
  .obj-hint {
    display: none;
  }
  .gauge {
    width: 176px;
    height: 176px;
  }
  .g-num span {
    font-size: 40px;
  }
  .g-label,
  .g-time {
    letter-spacing: 1.4px;
  }
  .stack {
    width: 230px;
  }
  .tel-rows dt,
  .tel-rows dd {
    font-size: 10px;
  }
  .hud footer span:nth-child(n + 6) {
    display: none;
  }
}
@media (max-height: 700px) {
  .hud .top {
    top: 18px;
  }
  .ident h1 {
    font-size: 44px;
  }
  .ident .sub {
    margin-top: 8px;
  }
  .gauge {
    width: 184px;
    height: 184px;
  }
  .g-num span {
    font-size: 42px;
  }
  .oxygen,
  .stack {
    bottom: 46px;
  }
  .alert {
    top: 138px;
  }
  .chip {
    margin-top: 10px;
  }
  .telemetry {
    margin-top: 12px;
    padding-top: 9px;
  }
  .hud footer {
    bottom: 14px;
  }
}
@media (max-width: 680px) {
  .nav {
    display: none;
  }
  .hud .top {
    grid-template-columns: 1fr auto;
  }
  .ident h1 {
    font-size: 38px;
  }
  .oxygen {
    left: 16px;
  }
  .stack {
    right: 16px;
    width: 190px;
  }
  .lock-body small {
    font-size: 9px;
  }
  .hud footer {
    left: 16px;
    right: 16px;
    gap: 8px;
    font-size: 8px;
  }
  .alert {
    top: 122px;
    width: 88vw;
  }
}

/* Live heading ruler and navigation beacons. */
.tape { padding-bottom: 28px; }
.tape-ticks { bottom: 14px; }
.tape::after { bottom: 14px; }
#compass-degrees { position: absolute; inset: auto 0 0; height: 12px; font: 8px var(--mono); color: #8eacb7; }
#compass-degrees span { position: absolute; transform: translateX(-50%); }
#compass-targets { position: relative; height: 74px; margin: 10px 0 0; }
.compass-target { position: absolute; transform: translateX(-50%); color: var(--cyan); font-size: 9px; white-space: nowrap; padding: 1px 5px; background: #041019bd; border-left: 1px solid currentColor; }
.compass-target.pod, .compass-target.dock { color: #b4ef9f; }
.compass-target.pack { color: #ffcf92; }
.objective-row { margin-top: 4px; }
#supply-nav { margin-top: 12px; white-space: pre-line; color: #d4b891; font-size: 10px; line-height: 1.8; }
.marker { min-width: 108px; max-width: 220px; padding: 7px 9px; background: linear-gradient(90deg,#031019dd,#03101999); border-left: 1px solid currentColor; }
.marker span { display: block; font-size: 10px; }
.marker small { white-space: normal; line-height: 1.4; max-width: 210px; }
.marker.dock { color: var(--green); }
.marker.pack { color: #f2c48c; }
.marker.occluded .diamond { border-style: dashed; }
.direction-arrow { display: none; }
.marker.edge .diamond { display: none; }
.marker.edge .direction-arrow { display: block; position: absolute; left: -17px; top: 9px; font-size: 15px; transform: rotate(var(--arrow-angle)); }
.marker.edge { border-left-style: dashed; }
@media (max-width: 860px) { .ident .kick { max-width: 180px; line-height: 1.5; } .compass-target { font-size: 8px; } }
@media (max-width: 680px) { .nav { display: block; position: absolute; width: 60vw; top: 70px; left: 20vw; } .objective-row { display:none; } .ident .sub { display:none; } .marker { max-width:155px; } }

.alert { top: 235px; }
.toast { top: 295px; }
.marker::before { display: none; }
@media (max-height: 700px) { .alert { top: 202px; } .toast { top: 260px; } }

/* Sanity affects the outside view; instrument text remains readable. */
.sanity-filters { position: absolute; pointer-events: none; }
.sanity-haze { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(ellipse, transparent 35%, #57234b66 100%); }
body[data-sanity="1"] #space, body[data-sanity="2"] #space, body[data-sanity="3"] #space { filter: url(#sanity-warp); animation: sanity-drift 9s ease-in-out infinite alternate; transform-origin: center; }
body[data-sanity="1"] .sanity-haze { opacity: .12; }
body[data-sanity="2"] .sanity-haze { opacity: .3; }
body[data-sanity="3"] .sanity-haze { opacity: .55; }
body[data-sanity="2"] #space { animation-duration: 6s; }
body[data-sanity="3"] #space { animation-duration: 4s; }
body[data-sanity="2"] #sanity, body[data-sanity="3"] #sanity { color: #e9a1d4; }
@keyframes sanity-drift {
  from { transform: scale(1.045) skewX(calc(-1 * var(--sanity-shift))) translateY(calc(-1 * var(--sanity-drift))); }
  to { transform: scale(1.045) skewX(var(--sanity-shift)) translateY(var(--sanity-drift)); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-sanity] #space { animation: none; }
}

/* ARIA owns the controls during the prologue; the exterior stays visible. */
.opening { position: fixed; z-index: 12; left: 5vw; right: 5vw; bottom: 5vh; max-width: 1120px; margin: 0 auto; padding: 24px 30px 18px; border: 1px solid #8ce0e548; border-top: 2px solid #8ce0e5a0; background: linear-gradient(115deg, #031019f5, #06121ae8 65%, #07151bd9); box-shadow: 0 20px 80px #0009, inset 0 0 50px #8ce0e505; backdrop-filter: blur(10px); }
.opening[hidden], .opening-log[hidden] { display: none; }
.opening-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--dim); font: 10px var(--mono); letter-spacing: .14em; }
.opening-head strong { color: var(--ice); font-size: 23px; letter-spacing: .25em; }
.opening-head i { display: inline-block; width: 6px; height: 6px; margin-left: 5px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px var(--cyan); }
.opening-logs { min-height: 112px; padding: 18px 0 12px; font: 12px/1.9 var(--mono); color: #a6bac1; }
.opening-log { display: flex; gap: 16px; }
.opening-log time { flex: 0 0 auto; color: #627f8a; }
.opening-log.warning { color: #ffc078; }
.opening-log.warning time { color: #bb925e; }
.opening-dialogue { border-top: 1px solid var(--line); padding-top: 18px; }
.opening-speaker { color: var(--cyan); font: 11px var(--mono); letter-spacing: .14em; display: flex; justify-content: space-between; }
.opening-speaker span { color: var(--dim); }
#opening-text { min-height: 64px; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.9; margin: 12px 0 20px; max-width: 940px; color: #e3eeee; }
.opening-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
#opening-status { color: #9baeb5; font-size: 10px; line-height: 1.8; }
.opening-foot > div { display: flex; gap: 12px; flex-shrink: 0; }
.opening button { padding: 9px 13px; background: transparent; border: 1px solid #8ce0e538; color: #a2bbc2; font-size: 12px; }
.opening #opening-next { color: #d5f6f3; background: #8ce0e512; border-color: #8ce0e57a; }
.opening button:hover { background: #8ce0e52a; color: white; }
.opening-playing .hud > :not(.top), .opening-playing .top .nav, .opening-playing .top .comms { visibility: hidden; }
.opening-playing .hud { pointer-events: none; }
.opening-playing .visor { opacity: .65; }
@media (max-width: 680px), (max-height: 600px) {
  .opening { left: 3vw; right: 3vw; bottom: 3vh; padding: 16px 18px; max-height: 88vh; overflow-y: auto; }
  .opening-head { flex-wrap: wrap; font-size: 9px; }
  .opening-logs { min-height: 80px; font-size: 11px; }
  .opening-log { gap: 9px; }
  #opening-text { min-height: 0; font-size: 15px; margin-bottom: 14px; }
  .opening-foot { flex-wrap: wrap; }
  .opening-foot > div { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}
