:root {
  color-scheme: dark;
  --cyan: #5ce7ff;
  --green: #73ffbd;
  --amber: #ffd36a;
  --red: #ff6877;
  --panel: rgba(7, 16, 28, 0.88);
  --panel-strong: rgba(8, 24, 39, 0.96);
  --line: rgba(115, 255, 189, 0.38);
  --text: #eaf8ff;
  --muted: #9bb6c7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #02050b;
  color: var(--text);
  font-family: "Monda", Arial, Helvetica, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
}

button {
  font: inherit;
}

#gameShell {
  position: fixed;
  inset: 0;
  background: #02050b;
  transform-origin: center center;
}

body.is-warping {
  cursor: wait;
}

body.is-warping #gameShell {
  animation: warpViewport 560ms cubic-bezier(0.2, 0.78, 0.12, 1) both;
  pointer-events: none;
}

body.is-warping::before,
body.is-warping::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

body.is-warping::before {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0 2%, rgba(126, 231, 255, 0.62) 7%, transparent 18%),
    repeating-radial-gradient(circle at center, rgba(92, 231, 255, 0) 0 9px, rgba(92, 231, 255, 0.22) 10px 12px, rgba(255, 211, 106, 0.1) 13px 15px, transparent 16px 28px);
  mix-blend-mode: screen;
  animation: warpTunnel 560ms ease-in-out both;
}

body.is-warping::after {
  background:
    linear-gradient(90deg, transparent 0 45%, rgba(255, 255, 255, 0.58) 50%, transparent 55%),
    linear-gradient(0deg, transparent 0 47%, rgba(115, 255, 189, 0.32) 50%, transparent 53%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.5) 0 5%, rgba(92, 231, 255, 0.16) 20%, rgba(2, 5, 11, 0.52) 72%);
  mix-blend-mode: screen;
  animation: warpFlash 560ms ease-in-out both;
}

@keyframes warpViewport {
  0% {
    filter: blur(0) brightness(1);
    opacity: 1;
    transform: scale(1);
  }

  42% {
    filter: blur(10px) brightness(1.65) saturate(1.35);
    opacity: 0.78;
    transform: scale(1.2);
  }

  52% {
    filter: blur(18px) brightness(2.05) saturate(1.6);
    opacity: 0.22;
    transform: scale(1.54);
  }

  66% {
    filter: blur(11px) brightness(1.5) saturate(1.25);
    opacity: 0.58;
    transform: scale(1.24);
  }

  100% {
    filter: blur(0) brightness(1);
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes warpTunnel {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(0deg);
  }

  28% {
    opacity: 0.88;
  }

  54% {
    opacity: 1;
    transform: scale(1.36) rotate(16deg);
  }

  100% {
    opacity: 0;
    transform: scale(2.4) rotate(32deg);
  }
}

@keyframes warpFlash {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.88);
  }

  46% {
    opacity: 0.92;
    transform: scale(1.08);
  }

  55% {
    opacity: 1;
    transform: scale(1.26);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-warping #gameShell,
  body.is-warping::before,
  body.is-warping::after,
  .readout-body.readout-revealing,
  .readout-body.readout-revealing::after {
    animation-duration: 1ms;
  }
}

#spaceCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.world-video-object {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border-radius: 50%;
  mix-blend-mode: screen;
  object-fit: cover;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}

.hud {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

.top-hud {
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.bottom-hud {
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.status-panel,
.hud-button,
.action-button,
.target-hint {
  border: 1px solid rgba(92, 231, 255, 0.38);
  background: rgba(4, 14, 25, 0.68);
  color: var(--text);
  box-shadow: 0 0 18px rgba(92, 231, 255, 0.12), inset 0 0 22px rgba(92, 231, 255, 0.05);
  backdrop-filter: blur(8px);
}

.status-panel {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
}

.stardate-panel,
.score-panel {
  height: 48px;
}

.right-status-stack {
  justify-self: end;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: min(36vw, 170px);
}

.score-panel {
  text-align: right;
}

.score-panel {
  min-height: 46px;
}

.stardate-panel {
  min-height: 46px;
}

.label,
.object-type,
.stardate {
  display: block;
  color: var(--muted);
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.value {
  color: var(--green);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#scoreText {
  display: inline-block;
  transform-origin: right center;
  transition: transform 160ms ease, color 160ms ease, text-shadow 160ms ease;
}

#scoreText.counting {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(115, 255, 189, 0.8);
  transform: scale(1.34);
}

.hud-button,
.action-button,
.terminal-button {
  pointer-events: auto;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  text-transform: uppercase;
}

.hud-button {
  min-width: 104px;
  min-height: 42px;
  padding: 0 15px;
  align-self: start;
  color: var(--cyan);
}

.hud-button.needs-bearing {
  animation: mapBearingPulse 1s ease-in-out infinite;
  border-color: rgba(115, 255, 189, 1);
  background: rgba(22, 80, 65, 0.82);
  color: var(--green);
}

.action-button.scan:not(:disabled) {
  animation: scanReadyPulse 1s ease-in-out infinite;
  border-color: rgba(115, 255, 189, 1);
  background: rgba(22, 80, 65, 0.82);
  color: #ffffff;
}

@keyframes mapBearingPulse {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(92, 231, 255, 0.12), inset 0 0 22px rgba(92, 231, 255, 0.05);
  }

  50% {
    box-shadow: 0 0 34px rgba(115, 255, 189, 0.82), inset 0 0 28px rgba(115, 255, 189, 0.22);
    transform: scale(1.04);
  }
}

@keyframes scanReadyPulse {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(92, 231, 255, 0.12), inset 0 0 22px rgba(92, 231, 255, 0.05);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 34px rgba(115, 255, 189, 0.82), inset 0 0 28px rgba(115, 255, 189, 0.22);
    transform: scale(1.04);
  }
}

.action-button {
  width: clamp(78px, 23vw, 128px);
  aspect-ratio: 1;
  border-width: 2px;
  border-radius: 50%;
  color: var(--text);
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 700;
  text-transform: uppercase;
}

.action-button.scan {
  border-color: rgba(115, 255, 189, 0.7);
  color: var(--green);
}

.action-button.pulse {
  border-color: rgba(255, 211, 106, 0.75);
  color: var(--amber);
}

.audio-mute-button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(92, 231, 255, 0.38);
  border-radius: 50%;
  background: rgba(4, 14, 25, 0.58);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(92, 231, 255, 0.1), inset 0 0 18px rgba(92, 231, 255, 0.04);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.audio-mute-button[aria-pressed="true"] {
  border-color: rgba(255, 104, 119, 0.58);
  color: var(--red);
}

.sound-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-icon-off,
.audio-mute-button[aria-pressed="true"] .sound-icon-on {
  display: none;
}

.audio-mute-button[aria-pressed="true"] .sound-icon-off {
  display: block;
}

.action-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.target-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(max(124px, 16vh) + env(safe-area-inset-bottom));
  width: min(88vw, 460px);
  min-height: 54px;
  padding: 15px 18px;
  border-radius: 8px;
  transform: translateX(-50%);
  background: rgba(4, 14, 25, 0.6);
  text-align: center;
  color: var(--green);
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: auto;
  cursor: pointer;
}

.target-hint.visible {
  opacity: 1;
}

.target-hint:disabled {
  cursor: default;
}

.flight-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(50% + 86px);
  width: min(82vw, 470px);
  padding: 12px 14px;
  border: 1px solid rgba(115, 255, 189, 0.72);
  border-radius: 8px;
  background: rgba(4, 14, 25, 0.56);
  color: var(--green);
  box-shadow: 0 0 18px rgba(115, 255, 189, 0.12), inset 0 0 22px rgba(115, 255, 189, 0.05);
  backdrop-filter: blur(8px);
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: clamp(11px, 2.8vw, 14px);
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.flight-hint.visible {
  opacity: 1;
}

.readout {
  width: min(92vw, 760px);
  max-height: min(86vh, 760px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 0 38px rgba(92, 231, 255, 0.14), inset 0 0 40px rgba(115, 255, 189, 0.04);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
}

.readout[open] {
  animation: readoutOpen 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.readout.closing {
  animation: readoutClose 180ms ease-in forwards;
}

.readout::backdrop {
  background: rgba(0, 4, 10, 0.72);
  backdrop-filter: blur(3px);
}

.readout[open]::backdrop {
  animation: backdropOpen 260ms ease-out forwards;
}

.readout.closing::backdrop {
  animation: backdropClose 180ms ease-in forwards;
}

.readout::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(115, 255, 189, 0.2), rgba(115, 255, 189, 0)) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: readoutScanline 520ms ease-out forwards;
}

.readout.closing::before {
  animation: readoutScanlineClose 180ms ease-in forwards;
}

@keyframes readoutOpen {
  0% {
    clip-path: inset(48% 2% 48% 2%);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  55% {
    clip-path: inset(0 2% 0 2%);
    opacity: 1;
    transform: translateY(0) scale(1.012);
  }

  100% {
    clip-path: inset(0);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes readoutClose {
  0% {
    clip-path: inset(0);
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    clip-path: inset(44% 3% 44% 3%);
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

@keyframes backdropOpen {
  from {
    background: rgba(0, 4, 10, 0);
    backdrop-filter: blur(0);
  }

  to {
    background: rgba(0, 4, 10, 0.72);
    backdrop-filter: blur(3px);
  }
}

@keyframes backdropClose {
  from {
    background: rgba(0, 4, 10, 0.72);
    backdrop-filter: blur(3px);
  }

  to {
    background: rgba(0, 4, 10, 0);
    backdrop-filter: blur(0);
  }
}

@keyframes readoutScanline {
  0% {
    background-position: 0 0, 0 0;
    opacity: 0;
  }

  20% {
    opacity: 0.9;
  }

  100% {
    background-position: 0 100%, 0 0;
    opacity: 0.22;
  }
}

@keyframes readoutScanlineClose {
  from {
    opacity: 0.22;
  }

  to {
    opacity: 0;
  }
}

#scanDialog {
  --scan-width: min(92vw, calc(86vh * 9 / 16), calc(760px * 9 / 16));
  position: fixed;
  inset: 0;
  width: var(--scan-width);
  height: calc(var(--scan-width) * 16 / 9);
  max-height: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  margin: auto;
  z-index: 20;
}

#scanDialog[open] {
  display: flex;
}

#scanDialog .readout-body {
  flex: 1;
  max-height: none;
  color: var(--green);
}

#welcomeDialog .readout-body {
  color: var(--green);
}

#scanDialog footer {
  display: flex;
  justify-content: center;
  text-align: center;
}

.map-readout footer {
  display: flex;
  justify-content: center;
  text-align: center;
}

.welcome-readout footer {
  display: flex;
  justify-content: center;
  text-align: center;
}

.achievement-readout footer {
  display: flex;
  justify-content: center;
  text-align: center;
}

.welcome-readout {
  position: fixed;
  inset: 0;
  z-index: 20;
  margin: auto;
}

.welcome-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(0, 4, 10, 0.72);
  backdrop-filter: blur(3px);
  animation: backdropOpen 260ms ease-out forwards;
}

.welcome-backdrop.closing {
  animation: backdropClose 180ms ease-in forwards;
}

@supports (height: 100dvh) {
  #scanDialog {
    --scan-width: min(92dvw, calc(86dvh * 9 / 16), calc(760px * 9 / 16));
  }
}

.readout header,
.readout footer {
  padding: 16px;
  background: rgba(92, 231, 255, 0.05);
}

.readout header {
  border-bottom: 1px solid rgba(115, 255, 189, 0.22);
}

.readout footer {
  border-top: 1px solid rgba(115, 255, 189, 0.18);
  text-align: right;
}

.readout h1,
.readout h2 {
  margin: 4px 0 0;
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: clamp(24px, 6vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.readout-label {
  margin: 0 0 7px;
  color: #73ffbd;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

#scanDialog h2 {
  font-size: clamp(20px, 4.8vw, 32px);
}

.readout-body {
  position: relative;
  max-height: min(55vh, 510px);
  overflow-y: auto;
  padding: 16px;
  line-height: 1.55;
  scrollbar-color: rgba(115, 255, 189, 0.7) rgba(255, 255, 255, 0.08);
  touch-action: pan-y;
}

.readout-body.readout-reveal-pending {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  overflow: hidden;
}

.readout-body.readout-revealing {
  animation: readoutBodyReveal 840ms cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

.readout-body.readout-revealing::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 54px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(115, 255, 189, 0.28), rgba(92, 231, 255, 0)),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  mix-blend-mode: screen;
  animation: readoutRevealSweep 840ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes readoutBodyReveal {
  0% {
    clip-path: inset(0 0 100% 0);
    opacity: 0.58;
  }

  100% {
    clip-path: inset(0);
    opacity: 1;
  }
}

@keyframes readoutRevealSweep {
  0% {
    opacity: 0;
    transform: translateY(-54px);
  }

  16% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: translateY(calc(100% + 54px));
  }
}

.readout-body p {
  margin: 0 0 14px;
}

.readout-body p:last-child {
  margin-bottom: 0;
}

.readout-body b,
.readout-body strong {
  color: #ffffff;
}

.readout-body h3 {
  margin: 20px 0 8px;
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
}

.mission-complete-banner {
  display: grid;
  gap: 3px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(255, 211, 106, 0.52);
  border-radius: 6px;
  background: rgba(58, 42, 8, 0.42);
  color: #ffd36a;
  box-shadow: inset 0 0 22px rgba(255, 211, 106, 0.08);
}

.mission-complete-banner strong {
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
}

.mission-complete-banner span {
  font-size: 13px;
  line-height: 1.35;
}

.mission-notice-section h3 {
  margin-top: 0;
  color: #ffffff;
}

.mission-notice-section p {
  color: #73ffbd;
}

.mission-next-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(115, 255, 189, 0.28);
}

.scan-image {
  margin: 18px 0 20px;
}

.scan-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(115, 255, 189, 0.3);
  border-radius: 6px;
  background: rgba(3, 13, 24, 0.76);
  box-shadow: 0 0 24px rgba(92, 231, 255, 0.08);
  cursor: zoom-in;
  overflow: hidden;
}

.scan-image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.scan-image figcaption {
  margin: 8px 2px 0;
  color: rgba(215, 241, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.scan-video {
  margin: 18px 0 20px;
}

.scan-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(115, 255, 189, 0.3);
  border-radius: 6px;
  background: rgba(3, 13, 24, 0.76);
  box-shadow: 0 0 24px rgba(92, 231, 255, 0.08);
  overflow: hidden;
}

.scan-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.scan-video figcaption {
  margin: 8px 2px 0;
  color: rgba(215, 241, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.readout-body ul,
.readout-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.readout-body li {
  margin: 0 0 7px;
}

.readout-body a {
  color: var(--cyan);
}

.jump-gate-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 2px;
}

.jump-gate-link {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(115, 255, 189, 0.26);
  border-radius: 6px;
  background: rgba(2, 10, 18, 0.42);
  color: var(--green);
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-decoration: none;
}

.jump-gate-link:hover,
.jump-gate-link:focus-visible {
  border-color: rgba(115, 255, 189, 0.68);
  background: rgba(92, 231, 255, 0.1);
  color: #ffffff;
  outline: none;
}

.jump-gate-link img {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.music-channel-links {
  display: grid;
  gap: 10px;
  margin: 22px 0 4px;
}

.music-channel-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(115, 255, 189, 0.46);
  border-radius: 6px;
  background: rgba(115, 255, 189, 0.1);
  color: var(--green);
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.music-channel-link:hover,
.music-channel-link:focus-visible {
  border-color: rgba(115, 255, 189, 0.78);
  background: rgba(92, 231, 255, 0.12);
  color: #ffffff;
  outline: none;
}

.music-channel-link img {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.readout-body hr {
  height: 1px;
  margin: 18px 0;
  border: 0;
  background: rgba(115, 255, 189, 0.22);
}

.subspace-form {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.subspace-form label {
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.subspace-form input,
.subspace-form textarea {
  width: 100%;
  border: 1px solid rgba(115, 255, 189, 0.34);
  border-radius: 6px;
  background: rgba(2, 10, 18, 0.74);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  box-shadow: inset 0 0 22px rgba(92, 231, 255, 0.04);
  outline: none;
}

.subspace-form input {
  min-height: 44px;
  padding: 0 12px;
}

.subspace-form textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

.subspace-form input::placeholder,
.subspace-form textarea::placeholder {
  color: rgba(215, 241, 255, 0.42);
}

.subspace-form input:focus,
.subspace-form textarea:focus {
  border-color: rgba(115, 255, 189, 0.78);
  box-shadow: 0 0 18px rgba(115, 255, 189, 0.12), inset 0 0 22px rgba(92, 231, 255, 0.06);
}

.subspace-submit {
  justify-self: center;
  margin-top: 4px;
  color: #ffffff;
}

.subspace-submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.relay-clearance {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.subspace-status {
  min-height: 1.5em;
  margin: 2px 0 0;
  color: #73ffbd;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.subspace-status.error {
  color: #ff9f5c;
}

.subspace-confirmation {
  margin: 22px 0 8px;
  padding: 22px 16px;
  border: 1px solid rgba(115, 255, 189, 0.62);
  border-radius: 6px;
  background: rgba(7, 30, 27, 0.62);
  box-shadow: 0 0 24px rgba(115, 255, 189, 0.1), inset 0 0 24px rgba(115, 255, 189, 0.04);
  color: #73ffbd;
  text-align: center;
}

.subspace-confirmation strong {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
}

.image-dialog {
  position: relative;
  width: min(94vw, 1120px);
  max-height: 92vh;
  margin: auto;
  padding: 14px;
  border: 1px solid rgba(115, 255, 189, 0.38);
  border-radius: 8px;
  background: rgba(2, 7, 13, 0.94);
  color: var(--text);
  box-shadow: 0 0 42px rgba(92, 231, 255, 0.18);
}

.image-dialog::backdrop {
  background: rgba(0, 4, 10, 0.82);
  backdrop-filter: blur(5px);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.image-dialog p {
  margin: 10px 36px 0;
  color: rgba(215, 241, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.image-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 8px 10px;
  border: 1px solid rgba(115, 255, 189, 0.42);
  border-radius: 6px;
  background: rgba(2, 10, 18, 0.86);
  color: #ffffff;
  font-family: "Audiowide", Arial, Helvetica, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
}

.mission {
  color: var(--amber);
  font-weight: 700;
}

.terminal-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(115, 255, 189, 0.58);
  background: rgba(115, 255, 189, 0.12);
  color: var(--green);
}

.map-readout {
  width: min(94vw, 540px);
  max-height: min(94vh, 760px);
  overflow: hidden;
  flex-direction: column;
}

.map-readout[open] {
  display: flex;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  min-height: 0;
  overflow: hidden;
}

#mapCanvas {
  width: min(100%, 460px);
  aspect-ratio: 13 / 8;
  height: auto;
  max-height: min(30vh, 280px);
  justify-self: center;
  border: 1px solid rgba(92, 231, 255, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  cursor: crosshair;
  touch-action: none;
}

.map-list {
  max-height: min(34vh, 280px);
  overflow: auto;
  padding-right: 4px;
  touch-action: pan-y;
}

.map-instructions {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.map-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  width: 100%;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.map-item-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.map-item-select {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.map-item-button {
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  cursor: pointer;
}

.map-item-button:hover,
.map-item-button:focus-visible,
.map-item-button.active,
.map-item-row.active,
.map-item-select:hover,
.map-item-select:focus-visible {
  color: var(--text);
  background: rgba(100, 168, 255, 0.12);
  outline: none;
}

.map-warp-button {
  min-height: 32px;
  margin-right: 2px;
  padding: 0 10px;
  border: 1px solid rgba(100, 168, 255, 0.75);
  border-radius: 8px;
  background: rgba(100, 168, 255, 0.16);
  color: #cfe2ff;
  cursor: pointer;
}

.map-warp-button:hover,
.map-warp-button:focus-visible {
  background: rgba(100, 168, 255, 0.28);
  outline: none;
}

.map-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
}

.map-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 680px) {
  .top-hud {
    grid-template-columns: 1fr auto 1fr;
  }

  .status-panel {
    min-height: 42px;
    padding: 7px 8px;
  }

  .right-status-stack {
    gap: 6px;
    min-width: min(34vw, 132px);
  }

  .hud-button {
    min-width: 92px;
    padding: 0 10px;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-list {
    max-height: 180px;
  }

  .jump-gate-links {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 980px) {
  .bottom-hud {
    left: max(34px, env(safe-area-inset-left));
    right: max(34px, env(safe-area-inset-right));
  }
}
