:root {
  color-scheme: light;
  font-family: "Avenir Next", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  --ink: #14384a;
  --navy: #173e52;
  --teal: #087f86;
  --cyan: #38d7dc;
  --cream: #fff9e9;
  --coral: #ff725c;
  --gold: #ffd653;
  --green: #1e9e67;
}

* { box-sizing: border-box; }
html, body { min-width: 1100px; min-height: 720px; margin: 0; overflow: hidden; }
body { color: var(--ink); background: #d6f6f5; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.lesson { width: 100vw; height: 100vh; padding: 14px; }
.launch-world {
  position: relative; width: 100%; height: 100%; min-height: 690px; overflow: hidden;
  border-radius: 30px; background: url("art/backdrop-01.webp") center 54% / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 16px 45px rgba(18,73,83,.16);
}
.sky-wash { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(227,255,255,.27), rgba(13,94,90,.04) 65%, rgba(9,56,43,.17)); pointer-events: none; }

.flight-hud { position: absolute; z-index: 20; top: 18px; left: 20px; right: 20px; height: 64px; display: flex; align-items: center; gap: 16px; }
.mission-chip, .difficulty-card, .scoreboard { backdrop-filter: blur(13px); background: rgba(255,252,238,.9); border: 1px solid rgba(255,255,255,.78); box-shadow: 0 9px 22px rgba(22,65,74,.15); }
.mission-chip { min-width: 174px; padding: 10px 18px; border-radius: 18px; display: grid; }
.mission-chip span, .difficulty-card span, .scoreboard span { font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; color: #5d7b80; }
.mission-chip strong { font-size: 17px; }
.campaign-track { display: flex; align-items: center; flex: 1; max-width: 330px; }
.campaign-track i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; color: #66858a; background: rgba(255,255,255,.78); border: 3px solid rgba(255,255,255,.88); box-shadow: 0 5px 12px rgba(20,64,71,.12); transition: .2s ease-out; }
.campaign-track i.is-current { color: white; background: var(--coral); transform: scale(1.12); }
.campaign-track i.is-complete { color: white; background: var(--green); }
.campaign-track b { height: 5px; flex: 1; background: rgba(255,255,255,.72); }
.difficulty-card { width: 220px; padding: 9px 14px; border-radius: 16px; display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; }
.difficulty-card > i { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 9px; background: #d8e8e6; }
.difficulty-card > i b { display: block; height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--coral)); transition: width .25s ease-out; }
.difficulty-card > strong { grid-column: 1 / -1; font-size: 12px; }
.scoreboard { margin-left: auto; display: flex; border-radius: 18px; padding: 7px 9px; }
.scoreboard div { min-width: 68px; text-align: center; padding: 2px 12px; border-right: 1px solid #d8e4df; display: grid; }
.scoreboard div:last-child { border: 0; }
.scoreboard strong { font-size: 18px; }
.scoreboard em { color: var(--coral); font-style: normal; }

.mission-card { position: absolute; z-index: 12; top: 96px; left: 32px; width: 360px; display: flex; gap: 12px; align-items: flex-start; }
.mission-copy { padding: 15px 18px 16px; border-radius: 20px; background: rgba(255,249,233,.92); box-shadow: 0 12px 28px rgba(16,67,75,.17); border: 1px solid rgba(255,255,255,.75); }
.mission-copy span, .equation-card span, .explain-panel span { display: block; color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mission-copy h1 { margin: 3px 0 4px; font-size: 25px; line-height: 1; letter-spacing: -.03em; }
.mission-copy p { margin: 0; font-size: 13px; line-height: 1.35; color: #48666b; }
.equation-card { flex: 0 0 210px; padding: 13px 15px; border: 2px solid rgba(255,214,83,.8); border-radius: 18px; background: rgba(22,62,82,.92); box-shadow: 0 10px 24px rgba(10,44,59,.25); color: white; }
.equation-card span { color: #85edf0; }
.equation-card strong { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }

.flight-stage { position: absolute; z-index: 5; top: 118px; left: 2%; right: 2%; height: calc(100% - 310px); min-height: 370px; overflow: visible; }
.flight-stage svg { width: 100%; height: 100%; overflow: visible; }
.foreground-hill { fill: rgba(21,105,65,.68); stroke: rgba(255,255,255,.36); stroke-width: 3; }
.trajectory-shadow { fill: none; stroke: rgba(18,53,64,.28); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 22; }
.trajectory-path { fill: none; stroke: #fffdf1; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 22; filter: drop-shadow(0 2px 2px rgba(10,63,68,.35)); transition: opacity .15s; }
.quadratic-curve { fill: none; stroke: var(--gold); stroke-width: 3; opacity: 0; }
.quadratic-curve.is-visible { opacity: .95; }
.apex-marker { transform-box: fill-box; transform-origin: center; }
.apex-marker circle { fill: rgba(23,62,82,.9); stroke: #fff; stroke-width: 3; }
.apex-marker path { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.apex-marker text { text-anchor: middle; font-size: 11px; font-weight: 900; fill: var(--navy); paint-order: stroke; stroke: #fff; stroke-width: 4; }
.target { transition: transform .28s ease-out; }
.target-pulse { fill: rgba(255,214,83,.25); stroke: rgba(255,255,255,.78); stroke-width: 2; animation: targetPulse 1.8s ease-in-out infinite; }
.target-outer { fill: url(#targetGlow); stroke: #fff9e9; stroke-width: 6; }
.target-inner { fill: var(--navy); stroke: #fff; stroke-width: 4; }
.target path { fill: var(--coral); stroke: #fff; stroke-width: 3; stroke-linejoin: round; }
.obstacle { display: none; filter: drop-shadow(0 8px 6px rgba(28,36,77,.25)); }
.obstacle.is-visible { display: block; }
.projectile { filter: drop-shadow(0 6px 6px rgba(17,47,54,.3)); transform-box: fill-box; transform-origin: center; }
#launcher { opacity: 0; }
.launcher-art { position: absolute; left: 1.7%; bottom: -6px; width: 17.5%; height: auto; pointer-events: none; filter: drop-shadow(0 12px 9px rgba(14,52,47,.3)); transform-origin: 22% 75%; }
.launcher-art.is-firing { animation: launcherKick .32s ease-out; }
.wind-ribbon { position: absolute; top: 40px; right: 6%; display: flex; gap: 8px; opacity: .62; }
.wind-ribbon i { width: 38px; height: 4px; border-radius: 5px; background: rgba(255,255,255,.75); animation: wind 2.6s ease-in-out infinite; }
.wind-ribbon i:nth-child(2) { width: 20px; animation-delay: -.7s; }.wind-ribbon i:nth-child(3) { width: 55px; animation-delay: -1.3s; }
.result-banner { position: absolute; top: 19%; left: 50%; translate: -50% -12px; opacity: 0; padding: 10px 18px; border-radius: 999px; color: white; background: rgba(23,62,82,.92); font-size: 15px; font-weight: 900; box-shadow: 0 10px 24px rgba(16,51,65,.2); transition: .18s ease-out; pointer-events: none; }
.result-banner.is-showing { translate: -50% 0; opacity: 1; }
.result-banner.is-hit { background: var(--green); }
.flight-stage.is-miss { animation: stageShake .34s ease-out; }
.impact-burst { opacity: 0; fill: var(--gold); stroke: #fff; stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.impact-burst.is-showing { animation: impact .58s ease-out; }

.control-deck { position: absolute; z-index: 25; left: 50%; bottom: 18px; translate: -50% 0; width: min(960px, 75vw); height: 195px; padding: 14px 22px; display: grid; grid-template-columns: 260px 1fr 260px; align-items: center; gap: 22px; border-radius: 28px; background: rgba(255,249,233,.94); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 20px 50px rgba(12,63,66,.22); backdrop-filter: blur(14px); }
.dial-control { height: 100%; display: grid; grid-template-columns: 105px 1fr; grid-template-rows: auto 1fr auto; column-gap: 12px; padding: 9px 8px; border-radius: 20px; transition: opacity .2s; }
.dial-control.is-locked { opacity: .45; }
.dial-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; }
.dial-heading span { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.dial-heading strong { font-size: 25px; color: var(--teal); }
.dial-visual { grid-row: 2 / 4; width: 105px; height: 105px; align-self: center; }
.dial-visual svg { width: 100%; height: 100%; overflow: visible; }
.dial-visual circle:first-child { fill: #edf4e8; stroke: #d6e3db; stroke-width: 4; }
.dial-visual path { fill: none; stroke: var(--coral); stroke-width: 7; stroke-linecap: round; }
.power-dial path { stroke: var(--cyan); }
.dial-visual line { stroke: var(--navy); stroke-width: 6; stroke-linecap: round; transform-origin: 50px 50px; transition: transform .08s linear; }
.dial-visual circle:last-child { fill: var(--gold); stroke: white; stroke-width: 3; }
.dial-control input { align-self: end; width: 100%; height: 36px; accent-color: var(--coral); cursor: grab; }
.dial-control input:active { cursor: grabbing; }
.dial-control small { align-self: start; color: #718587; font-size: 11px; font-weight: 700; }
.launch-center { display: grid; justify-items: center; gap: 10px; }
.coach-bubble { display: flex; align-items: center; width: 280px; min-height: 73px; padding: 7px 13px 7px 7px; border-radius: 20px; background: white; box-shadow: 0 7px 18px rgba(20,64,70,.12); }
.coach-bubble img { width: 64px; height: 64px; object-fit: contain; object-position: center bottom; margin-right: 8px; transition: transform .2s ease-out; }
.coach-bubble img.is-cheering { animation: coachCheer .65s ease-out; }
.coach-bubble p { margin: 0; font-size: 12px; line-height: 1.35; font-weight: 750; color: #456268; }
.launch-button { min-width: 230px; height: 58px; padding: 0 24px; border: 0; border-radius: 19px; display: flex; align-items: center; justify-content: center; gap: 14px; color: white; background: linear-gradient(135deg, #ff735c, #f04d47); box-shadow: 0 8px 0 #b83232, 0 14px 25px rgba(181,50,50,.25); font-size: 18px; font-weight: 950; cursor: pointer; transition: transform .12s ease-out, box-shadow .12s ease-out; }
.launch-button:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #b83232, 0 17px 28px rgba(181,50,50,.25); }
.launch-button:active { transform: translateY(6px); box-shadow: 0 2px 0 #b83232; }
.launch-button:focus-visible, .explain-choices button:focus-visible, input:focus-visible { outline: 4px solid #0a6f75; outline-offset: 3px; }
.launch-button:disabled { cursor: wait; opacity: .68; }

.explain-panel { position: absolute; z-index: 40; left: 50%; top: 50%; translate: -50% -50%; width: 650px; padding: 20px; border-radius: 25px; background: rgba(255,249,233,.98); box-shadow: 0 24px 80px rgba(10,48,54,.35); border: 2px solid white; }
.explain-panel > div:first-child { margin-bottom: 13px; }.explain-panel > div strong { font-size: 20px; }
.explain-choices { display: grid; gap: 9px; }
.explain-choices button { min-height: 51px; padding: 9px 14px; border: 2px solid #d8e6de; border-radius: 15px; text-align: left; color: var(--ink); background: white; font-weight: 800; cursor: pointer; transition: .14s ease-out; }
.explain-choices button:hover { border-color: var(--cyan); transform: translateX(4px); }
.explain-choices button small { display: block; color: #6f8586; font-weight: 650; }

.celebration { position: absolute; z-index: 50; inset: 0; overflow: hidden; pointer-events: none; }
.celebration i { position: absolute; top: 45%; left: 50%; width: 10px; height: 22px; border-radius: 4px; opacity: 0; background: var(--coral); }
.celebration i:nth-child(2n) { background: var(--gold); }.celebration i:nth-child(3n) { background: var(--cyan); }
.celebration.is-showing i { animation: confetti .9s ease-out forwards; }
.celebration i:nth-child(1) { --x:-290px;--y:-230px;--r:120deg }.celebration i:nth-child(2) { --x:-210px;--y:-310px;--r:220deg }.celebration i:nth-child(3) { --x:-110px;--y:-250px;--r:310deg }.celebration i:nth-child(4) { --x:-25px;--y:-340px;--r:170deg }.celebration i:nth-child(5) { --x:85px;--y:-290px;--r:260deg }.celebration i:nth-child(6) { --x:170px;--y:-330px;--r:120deg }.celebration i:nth-child(7) { --x:250px;--y:-230px;--r:290deg }.celebration i:nth-child(8) { --x:320px;--y:-280px;--r:190deg }
.toast { position: absolute; z-index: 60; left: 50%; bottom: 226px; translate: -50% 12px; opacity: 0; padding: 11px 18px; border-radius: 999px; color: white; background: rgba(23,62,82,.94); font-size: 13px; font-weight: 850; transition: .18s ease-out; pointer-events: none; }
.toast.is-showing { translate: -50% 0; opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes targetPulse { 50% { r: 45px; opacity: .28; } }
@keyframes launcherKick { 45% { transform: rotate(-5deg) translateX(-5px); } }
@keyframes wind { 50% { transform: translateX(18px); opacity: .25; } }
@keyframes stageShake { 25% { transform: translateX(-7px); } 60% { transform: translateX(6px); } 85% { transform: translateX(-3px); } }
@keyframes impact { 0% { opacity: 1; transform: scale(.25) rotate(0); } 55% { opacity: 1; transform: scale(1.25) rotate(18deg); } 100% { opacity: 0; transform: scale(1.7) rotate(35deg); } }
@keyframes coachCheer { 35% { transform: translateY(-10px) rotate(-6deg) scale(1.08); } 70% { transform: translateY(0) rotate(4deg); } }
@keyframes confetti { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x),var(--y)) rotate(var(--r)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
