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

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 72px 18px 24px;
  background:
    radial-gradient(circle at 18% 14%, rgba(99, 102, 241, 0.36), transparent 28rem),
    radial-gradient(circle at 86% 24%, rgba(34, 211, 238, 0.22), transparent 24rem),
    linear-gradient(145deg, #020617 0%, #0f172a 55%, #111827 100%);
}

.back-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.back-link:hover {
  border-color: #facc15;
  color: #facc15;
}

.space-shell {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(480px, 1fr) minmax(270px, 340px);
  gap: 22px;
  align-items: start;
}

.space-game,
.mission-panel {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.space-game {
  padding: 18px;
}

.space-game__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.space-game__top span {
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

h2 {
  color: #e2e8f0;
  font-size: 1rem;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #facc15;
  color: #111827;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.24);
}

#space {
  width: 100%;
  aspect-ratio: 720 / 520;
  display: block;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 8px;
  background: #020617;
}

.mission-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
}

.stat span {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  color: #fff;
  font-size: 1.3rem;
  text-align: right;
}

.help {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  line-height: 1.6;
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.touch-controls button {
  padding: 0;
  background: #2563eb;
  color: #fff;
  font-size: 1.1rem;
}

@media (max-width: 880px) {
  body {
    place-items: start center;
    padding: 72px 10px 18px;
  }

  .space-shell {
    grid-template-columns: 1fr;
  }

  .space-game__top {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .help {
    grid-column: 1 / -1;
  }
}
