* { box-sizing: border-box; }

:root {
  --bg: #030821;
  --text: #f8fbff;
  --muted: #b8c4e6;
  --blue: #4d8dff;
  --purple: #a54dff;
}

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body { min-height: 100vh; }

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: none;
  position: relative;
  z-index: 2;
}

.screen.active { display: flex; }

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.95) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 12%, rgba(255,255,255,.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 72%, rgba(255,255,255,.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 38% 78%, rgba(255,255,255,.75) 0 1px, transparent 1.5px),
    radial-gradient(circle at 55% 38%, rgba(255,255,255,.7) 0 1px, transparent 1.5px);
  background-size: 260px 220px, 330px 280px, 410px 330px, 370px 310px, 290px 250px;
  animation: drift 35s linear infinite;
}

.nebula {
  position: fixed;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .17;
  pointer-events: none;
  z-index: 0;
}

.nebula-one { background: #214cff; top: -25vw; left: -15vw; }
.nebula-two { background: #b329ff; bottom: -30vw; right: -15vw; }

@keyframes drift {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(-40px,25px,0); }
}

.screen-home {
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}

.home-content {
  width: min(900px, 100%);
  text-align: center;
  animation: appear .7s ease both;
}

.astronaut {
  font-size: clamp(42px, 7vw, 70px);
  filter: drop-shadow(0 0 18px rgba(150,210,255,.55));
  margin-bottom: 4px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8fc8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 78px);
  line-height: .95;
  letter-spacing: -.04em;
}

h1 span {
  background: linear-gradient(100deg, #70cfff, #b887ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 20px 0 34px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 21px);
  line-height: 1.55;
}

.choose {
  color: #dce5ff;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}

.missions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 800px;
  margin: 0 auto;
}

.mission {
  min-height: 180px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  color: white;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.16);
  transition: transform .18s ease, filter .18s ease;
}

.mission::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  right: -75px;
  top: -75px;
  background: rgba(255,255,255,.12);
}

.mission-blue { background: linear-gradient(135deg, #1462db, #263da4); }
.mission-purple { background: linear-gradient(135deg, #8e27db, #55249c); }

.mission:hover, .mission:focus-visible {
  transform: translateY(-5px) scale(1.01);
  filter: brightness(1.08);
  outline: none;
}

.mission:active { transform: scale(.98); }

.mission-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.14);
  font-size: 31px;
}

.mission h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.mission p {
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.4;
  font-size: 14px;
}

.mission-arrow {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: #18327f;
  font-size: 22px;
  font-weight: 800;
}

.home-footer {
  margin-top: 28px;
  color: rgba(220,230,255,.55);
  font-size: 12px;
}

#form-screen {
  flex-direction: column;
  padding: 14px;
}

.form-topbar {
  width: min(1100px, 100%);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.back-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: white;
  border-radius: 13px;
  padding: 12px 16px;
  cursor: pointer;
}

.back-button:active { transform: scale(.97); }

.form-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-heading h2 {
  margin: 0;
  font-size: 24px;
}

.small-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  font-size: 23px;
}

.form-layout {
  flex: 1;
  width: min(1250px, 100%);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 14px;
}

.form-shell {
  min-height: 0;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.form-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 65vh;
  border: 0;
  background: white;
}

.mission-guide {
  min-height: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 22px 18px;
  background: linear-gradient(160deg, rgba(21,40,105,.78), rgba(56,24,91,.72));
  box-shadow: 0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.guide-header .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}

.guide-header h3 {
  margin: 0;
  font-size: 18px;
}

.guide-orbit {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #bfe2ff;
  font-size: 20px;
  box-shadow: 0 0 22px rgba(130,190,255,.18);
}

.guide-steps {
  padding: 20px 0 10px;
}

.guide-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 11px;
}

.step-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #dce9ff;
  font-size: 15px;
  font-weight: 900;
}

.guide-step-active .step-number {
  background: rgba(112,207,255,.2);
  border-color: rgba(112,207,255,.65);
  color: white;
  box-shadow: 0 0 20px rgba(112,207,255,.16);
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-content strong {
  font-size: 14px;
  line-height: 1.25;
}

.step-content span {
  color: rgba(230,237,255,.66);
  font-size: 11px;
  line-height: 1.35;
}

.step-content .score-warning {
  color: #ffe28a;
  font-weight: 900;
  font-size: 12px;
}

.guide-line {
  height: 22px;
  width: 1px;
  margin: 3px 0 3px 19px;
  background: linear-gradient(to bottom, rgba(255,255,255,.28), rgba(255,255,255,.08));
}

.guide-tip {
  margin-top: auto;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(230,237,255,.64);
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}

.finish-bar {
  width: min(1100px, 100%);
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(230,236,255,.72);
  font-size: 13px;
}

.finish-bar button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: white;
  color: #13276e;
  font-weight: 800;
  cursor: pointer;
}

#thanks-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.thanks-content { animation: appear .45s ease both; }

.success-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #5df09a;
  color: #052d1a;
  font-size: 48px;
  font-weight: 900;
  box-shadow: 0 0 45px rgba(93,240,154,.35);
}

.thanks-content h1 {
  font-size: clamp(50px, 9vw, 82px);
  margin-bottom: 18px;
}

.thanks-content > p:not(.eyebrow):not(.return-text) {
  color: var(--muted);
  font-size: 18px;
}

.return-text {
  color: #dbe5ff;
  margin: 38px 0 12px;
  font-size: 14px;
}

.countdown {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 3px solid #91cfff;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .screen-home { padding: 28px 16px; }
  .missions { grid-template-columns: 1fr; }
  .mission { min-height: 145px; padding: 21px; }
  .mission-icon { width: 54px; height: 54px; }
  #form-screen { padding: 9px; }
  .form-topbar { gap: 10px; }
  .form-heading h2 { font-size: 19px; }
  .form-layout { grid-template-columns: 1fr; }
  .mission-guide { order: 2; }
  .form-shell { min-height: 58svh; }
  .form-shell iframe { min-height: 58svh; }
  .guide-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .guide-line { display: none; }
  .guide-step { grid-template-columns: 32px 1fr; gap: 7px; }
  .step-number { width: 32px; height: 32px; font-size: 13px; }
  .step-content strong { font-size: 11px; }
  .step-content span { font-size: 9px; }
  .guide-tip { display: none; }
  .finish-bar { flex-wrap: wrap; }
  .finish-bar span { display: none; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .screen-home { padding: 18px; }
  .astronaut { font-size: 36px; }
  .subtitle { margin: 12px 0 18px; }
  .mission { min-height: 125px; padding: 16px; }
  .home-footer { margin-top: 12px; }

  #form-screen { padding: 8px; }
  .form-topbar { margin-bottom: 8px; }
  .form-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
  .mission-guide { padding: 16px 14px; }
  .guide-header { padding-bottom: 12px; }
  .guide-orbit { width: 34px; height: 34px; font-size: 16px; }
  .guide-header h3 { font-size: 15px; }
  .guide-steps { padding: 14px 0 8px; }
  .guide-step { grid-template-columns: 34px 1fr; gap: 8px; }
  .step-number { width: 34px; height: 34px; }
  .guide-line { height: 15px; }
  .step-content strong { font-size: 12px; }
  .step-content span { font-size: 10px; }
  .step-content .score-warning { font-size: 10px; }
  .form-shell iframe { min-height: 0; }
}
