:root {
  color-scheme: dark;
  --bg: #070a12;
  --panel: rgba(16, 24, 39, 0.86);
  --panel-strong: rgba(21, 32, 50, 0.96);
  --line: rgba(151, 177, 205, 0.22);
  --text: #eef4ff;
  --muted: #9fb0c7;
  --accent: #38d6bf;
  --accent-two: #ffcf56;
  --danger: #ff6a7a;
  --ok: #69e27f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(56, 214, 191, 0.18), transparent 26rem),
    radial-gradient(circle at 90% 15%, rgba(255, 207, 86, 0.13), transparent 20rem),
    linear-gradient(135deg, #060910 0%, #111827 58%, #10131d 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.mission-shell {
  min-height: 100vh;
  padding: clamp(1rem, 2vw, 2rem);
}

.control-room {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.mission-clock,
.panel,
.status-board {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mission-clock {
  display: grid;
  min-width: 11rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  text-align: right;
}

.mission-clock span,
.quick-stats span,
.telemetry-grid span,
.panel-header span,
.launch-state span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mission-clock strong,
.quick-stats strong,
.telemetry-grid strong {
  font-family: "JetBrains Mono", monospace;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(19rem, 0.6fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.space-view {
  position: relative;
  min-height: 24rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.2) 0 0.08rem, transparent 0.1rem),
    radial-gradient(circle at 25% 32%, rgba(255, 255, 255, 0.28) 0 0.1rem, transparent 0.12rem),
    linear-gradient(180deg, #111d32 0%, #0b1020 48%, #18223a 100%);
  box-shadow: var(--shadow);
}

.stars,
.stars::before,
.stars::after {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(#fff 0 1px, transparent 1.5px),
    radial-gradient(rgba(255,255,255,0.65) 0 1px, transparent 1.5px);
  background-position: 0 0, 38px 52px;
  background-size: 92px 92px, 130px 130px;
  animation: drift 18s linear infinite;
}

.stars::before,
.stars::after {
  content: "";
}

.stars::before {
  opacity: 0.5;
  animation-duration: 28s;
}

.stars::after {
  opacity: 0.3;
  animation-direction: reverse;
}

.planet {
  position: absolute;
  right: -8rem;
  bottom: -10rem;
  width: 27rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #5eead4, #2f9eb3 32%, #203f68 70%),
    #2f9eb3;
  box-shadow: inset -2rem -1.5rem 4rem rgba(4, 8, 18, 0.42);
}

.orbit {
  position: absolute;
  right: -4rem;
  bottom: -6rem;
  width: 28rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.orbit-two {
  width: 34rem;
  opacity: 0.55;
}

.rocket {
  position: absolute;
  left: 24%;
  bottom: 18%;
  width: 5.5rem;
  height: 12rem;
  transform: rotate(18deg);
  animation: rocketFloat 3s ease-in-out infinite;
}

.nose,
.body,
.window,
.fin,
.flame {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nose {
  top: 0;
  width: 3.2rem;
  height: 3.8rem;
  border-radius: 50% 50% 8px 8px;
  background: var(--danger);
}

.body {
  top: 2.5rem;
  width: 3.6rem;
  height: 6.8rem;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(90deg, #cad6e7, #fff, #a8b7cb);
}

.window {
  z-index: 2;
  top: 4.1rem;
  width: 1.35rem;
  aspect-ratio: 1;
  border: 4px solid #233047;
  border-radius: 50%;
  background: #68e1ff;
}

.fin {
  top: 7.4rem;
  width: 1.5rem;
  height: 2.8rem;
  background: #38d6bf;
}

.fin-left {
  left: 1.1rem;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.fin-right {
  left: 4.4rem;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.flame {
  top: 9rem;
  width: 1.6rem;
  height: 3.8rem;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(#ffcf56, #ff7a3d 55%, transparent);
  filter: blur(0.5px);
  animation: burn 0.16s infinite alternate;
}

.status-board {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
  border-radius: 8px;
}

.launch-state {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.launch-state strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 3.2rem;
  line-height: 1;
}

.readiness-meter {
  height: 0.75rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.readiness-meter span {
  display: block;
  width: 83%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-two));
  transition: width 0.3s ease;
}

.quick-stats {
  display: grid;
  gap: 0.75rem;
}

.quick-stats article,
.telemetry-grid div {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.quick-stats strong,
.telemetry-grid strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.3rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  min-height: 16rem;
  padding: 1rem;
  border-radius: 8px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.live-dot {
  position: relative;
  color: var(--ok) !important;
}

.live-dot::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(105, 226, 127, 0.8);
  animation: pulse 1.4s infinite;
}

.telemetry {
  grid-column: span 2;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.checklist {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  color: #dce6f7;
}

.checklist input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.command-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.command-buttons button {
  min-height: 2.8rem;
  border: 0;
  border-radius: 8px;
  color: #071018;
  font-weight: 800;
  cursor: pointer;
  background: #dce6f7;
}

#holdBtn {
  background: var(--accent-two);
}

#launchBtn {
  background: var(--danger);
  color: #fff;
}

.command-log {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mission-log {
  grid-column: span 2;
}

.mission-log ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.2rem;
  color: #dce6f7;
  line-height: 1.45;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(92px); }
}

@keyframes rocketFloat {
  50% { transform: translate(0.35rem, -0.55rem) rotate(18deg); }
}

@keyframes burn {
  from { transform: translateX(-50%) scaleY(0.86); opacity: 0.78; }
  to { transform: translateX(-50%) scaleY(1.08); opacity: 1; }
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 0.45rem rgba(105, 226, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(105, 226, 127, 0); }
}

@media (max-width: 900px) {
  .topbar,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .mission-clock {
    width: 100%;
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .telemetry,
  .mission-log {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .mission-shell {
    padding: 0.75rem;
  }

  .space-view {
    min-height: 19rem;
  }

  .hero-panel,
  .dashboard-grid,
  .telemetry-grid {
    grid-template-columns: 1fr;
  }

  .telemetry,
  .mission-log {
    grid-column: auto;
  }

  .rocket {
    left: 18%;
    transform: scale(0.82) rotate(18deg);
  }

  .planet {
    width: 20rem;
  }

  .command-buttons {
    grid-template-columns: 1fr;
  }
}
