:root {
  --bg: #03101b;
  --panel: rgba(6, 20, 33, .97);
  --line: #294965;
  --line-bright: #3c6585;
  --text: #eaf2ff;
  --muted: #8fa3ba;
  --amber: #ffb020;
  --cyan: #31ddfb;
  --green: #4ae9a1;
  --red: #ff6677;
  --font-display: "Rajdhani", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font-family: var(--font-display); }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.arcade-nav { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 5vw, 78px); border-bottom: 1px solid rgba(255,176,32,.23); background: rgba(3,17,28,.97); box-shadow: 0 12px 38px rgba(0,0,0,.22); }
.arcade-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 700 14px/1 var(--font-mono); letter-spacing: .19em; }
.arcade-brand img { width: 58px; height: 50px; object-fit: contain; filter: drop-shadow(0 0 9px rgba(49,221,251,.2)); }
.arcade-brand strong { color: var(--amber); }
.all-missions { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--amber); border-radius: 0; background: linear-gradient(180deg,#ffd06b,var(--amber)); color: #171000; box-shadow: 0 0 16px rgba(255,176,32,.2),inset 0 1px rgba(255,255,255,.35); text-decoration: none; font: 700 11px/1 var(--font-mono); letter-spacing: .09em; }

.app-stage { min-height: calc(100vh - 82px); padding: clamp(28px,4vw,58px) clamp(10px,3vw,42px) 72px; background: radial-gradient(circle at 50% 0,rgba(28,151,188,.18),transparent 34rem),linear-gradient(rgba(29,78,102,.13) 1px,transparent 1px),linear-gradient(90deg,rgba(29,78,102,.13) 1px,transparent 1px),linear-gradient(180deg,#061723,#020a11 76%); background-size: auto,72px 72px,72px 72px,auto; }
.app { width: min(1500px,100%); margin: 0 auto; }
.app-header { margin-bottom: 28px; text-align: center; }
.mission-id, .panel-kicker { margin: 0; color: var(--amber); font: 700 12px/1.2 var(--font-mono); letter-spacing: .15em; }
.app-header h1 { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 9px; color: var(--cyan); font-size: clamp(30px,4.2vw,58px); line-height: 1; letter-spacing: .035em; text-transform: uppercase; }
.brand-hair { width: clamp(24px,5vw,86px); height: 1px; background: linear-gradient(90deg,transparent,var(--cyan)); opacity: .48; }
.brand-hair:last-child { transform: scaleX(-1); }
.subtitle { margin: 0; color: var(--muted); font: 700 12px/1.4 var(--font-mono); letter-spacing: .13em; }

.trainer-modes { width: min(590px,100%); margin: 0 auto 28px; display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; padding: 7px; border: 1px solid var(--line); background: #061522; }
.mode-btn { min-height: 58px; padding: 9px; border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font: 700 12px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.mode-btn.active { color: #111000; border-color: #ffd372; background: linear-gradient(180deg,#ffd06b,#f3a016); box-shadow: 0 0 18px rgba(255,176,32,.25),inset 0 1px rgba(255,255,255,.42); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.panel { border: 1px solid var(--line); background: var(--panel); box-shadow: inset 0 0 42px rgba(30,96,125,.04),0 20px 55px rgba(0,0,0,.23); }
.workspace { display: grid; grid-template-columns: minmax(440px,.9fr) minmax(560px,1.1fr); gap: 18px; align-items: start; }
.workspace > * { min-width: 0; }
.altitude-panel, .decision-panel, .lesson-panel { padding: clamp(18px,2.2vw,30px); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 7px 0 0; font-size: clamp(25px,2.4vw,35px); line-height: 1.02; }
.challenge-module-heading { display: none; }
.altitude-badge { flex: none; min-width: 126px; padding: 11px 13px; border: 1px solid var(--line-bright); color: var(--muted); font: 700 12px/1 var(--font-mono); text-align: center; }
.altitude-badge b { color: var(--cyan); font-size: 17px; }

.altitude-visual { margin-top: 18px; padding: 22px 17px; border: 1px solid #25445f; background: radial-gradient(circle at 40% 45%,rgba(23,81,105,.26),transparent 53%),#04111d; }
.mode-challenge .altitude-visual { display: none; }
.altitude-track { position: relative; height: 450px; padding-left: 118px; overflow: hidden; }
.altitude-track::before { content: ""; position: absolute; left: 82px; top: 6px; bottom: 6px; width: 3px; background: #526d85; box-shadow: 0 0 8px rgba(49,221,251,.13); }
.scale-tick { position: absolute; left: 0; width: 68px; transform: translateY(-50%); color: #8398ae; font: 700 11px/1 var(--font-mono); text-align: right; }
.scale-tick::after { content: ""; position: absolute; left: 74px; top: 50%; width: 13px; height: 2px; background: #7990a7; transform: translateY(-50%); }
.tick-17500 { top: 6%; }
.tick-15000 { top: 35.33%; }
.tick-14000 { top: 47.07%; }
.tick-12500 { top: 64.67%; }
.tick-10000 { top: 94%; }
.rules-legend { position: relative; height: 100%; padding-left: 12px; }
.rules-title { position: absolute; top: 3%; left: 12px; margin: 0; color: var(--muted); font: 700 11px/1 var(--font-mono); letter-spacing: .09em; }
.legal-rules { position: absolute; inset: 0 0 0 12px; }
.band, .guidance-card { position: absolute; left: 0; right: 0; min-width: 0; min-height: 46px; padding: 4px 10px; border: 1px solid rgba(143,163,186,.2); background: rgba(9,28,43,.84); transform: translateY(-50%); transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.band::before, .guidance-card::before { content: ""; position: absolute; left: -49px; top: 50%; width: 48px; height: 1px; background: #526d85; transform: translateY(-50%); transition: background .2s ease, box-shadow .2s ease; }
.band.active::before, .guidance-card.active::before { background: var(--green); box-shadow: 0 0 8px rgba(74,233,161,.7); }
.band-occupants { top: 35.33%; }
.band-crew-now { top: 47.07%; }
.band-crew-timed { top: 64.67%; }
.band span, .band b { display: block; font-family: var(--font-mono); }
.band span, .guidance-card span { color: var(--muted); font: 700 11px/1.25 var(--font-mono); }
.band b { margin-top: 3px; color: var(--text); font-size: 12px; line-height: 1.25; }
.band-occupants b, .band-crew-now b, .band-crew-timed b { color: #aebed0; }
.band em, .guidance-card em { position: absolute; top: 6px; right: 7px; padding: 3px 5px; border: 1px solid currentColor; color: var(--green); font: normal 700 9px/1 var(--font-mono); letter-spacing: .06em; opacity: 0; transform: translateY(-3px); transition: opacity .2s ease, transform .2s ease; }
.band > span, .guidance-card > span { padding-right: 66px; }
.band.active em, .guidance-card.active em { opacity: 1; transform: translateY(0); }
.band.active, .guidance-card.active { border-color: rgba(74,233,161,.9); background: rgba(74,233,161,.1); box-shadow: inset 0 0 24px rgba(74,233,161,.08),0 0 16px rgba(74,233,161,.2); }
.band.active b, .guidance-card.active b { color: var(--green); }
.band mark, .guidance-card mark { display: inline-block; margin-right: 6px; padding: 2px 4px; border: 1px solid rgba(255,176,32,.55); background: rgba(255,176,32,.08); color: var(--amber); font: inherit; }
.guidance-card { top: 94%; left: 12px; border-color: rgba(49,221,251,.28); background: rgba(49,221,251,.055); }
.guidance-card span, .guidance-card b { display: block; font-family: var(--font-mono); }
.guidance-card mark { border-color: rgba(49,221,251,.5); background: rgba(49,221,251,.08); color: var(--cyan); }
.guidance-card b { margin-top: 3px; color: #aebed0; font-size: 12px; line-height: 1.25; }
.altitude-marker { position: absolute; z-index: 3; left: 73px; width: 31px; top: 57%; height: 20px; transform: translateY(-50%); transition: top .22s ease; pointer-events: none; }
.altitude-marker::before { content: ""; position: absolute; z-index: 2; left: 5px; top: 50%; width: 8px; height: 8px; border: 2px solid #04111d; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(74,233,161,.8); transform: translateY(-50%); }
.marker-line { position: absolute; left: 0; top: 50%; width: 21px; height: 3px; background: var(--green); box-shadow: 0 0 10px rgba(74,233,161,.75); transform: translateY(-50%); }
.marker-pointer { position: absolute; right: 0; top: 50%; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--green); transform: translateY(-50%); filter: drop-shadow(0 0 5px rgba(74,233,161,.65)); }
.scenario-facts { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 12px; border: 1px solid var(--line); }
.scenario-facts span { min-width: 0; padding: 12px 8px; border-right: 1px solid var(--line); text-align: center; }
.scenario-facts span:last-child { border: 0; }
.scenario-facts small, .scenario-facts b { display: block; font-family: var(--font-mono); }
.scenario-facts small { color: var(--muted); font-size: 11px; }
.scenario-facts b { margin-top: 6px; color: var(--cyan); font-size: 12px; line-height: 1.25; }
.challenge-altitude-fact { display: none; }
.altitude-note { margin: 13px 0 0; color: var(--muted); font-size: 15px; text-align: center; }
.mode-challenge .altitude-note { display: none; }

.mode-challenge .workspace { display: block; }
.mode-challenge .altitude-panel,
.mode-challenge .decision-panel { width: min(1120px,100%); margin-inline: auto; }
.mode-challenge .altitude-panel { padding-bottom: 0; border-bottom: 0; box-shadow: 0 20px 55px rgba(0,0,0,.23); }
.mode-challenge .decision-panel { padding-top: 0; border-top: 0; box-shadow: none; }
.mode-challenge .challenge-module-heading { display: flex; }
.mode-challenge .altitude-heading { display: none; }
.mode-challenge .challenge-altitude-fact { display: block; }
.mode-challenge .scenario-facts { grid-template-columns: repeat(4,1fr); margin-top: 18px; }
.mode-challenge #challenge-panel > .instruction { margin-top: 0; padding-top: 18px; }

.explore-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #284864; }
.explore-controls fieldset:first-child { grid-column: 1 / -1; }
legend { padding: 0 8px; color: var(--cyan); font: 700 12px/1 var(--font-mono); letter-spacing: .07em; }
.range-output { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font: 700 12px/1 var(--font-mono); }
.range-output b { color: var(--amber); font-size: 16px; }
input[type="range"] { width: 100%; height: 24px; margin: 14px 0 0; accent-color: var(--amber); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: #6f859d; font: 700 11px/1 var(--font-mono); }
.choice-grid { display: grid; gap: 7px; }
.choice-grid.four { grid-template-columns: repeat(4,1fr); }
.choice-grid.three { grid-template-columns: repeat(3,1fr); }
.choice-grid.two { grid-template-columns: repeat(2,1fr); }
.choice-grid button { min-height: 52px; padding: 8px; border: 1px solid #355774; border-radius: 0; background: #081a2a; color: var(--muted); font: 700 12px/1.25 var(--font-mono); cursor: pointer; }
.choice-grid button:hover { border-color: var(--cyan); color: var(--text); }
.choice-grid button.selected { border-color: var(--amber); color: var(--amber); background: rgba(255,176,32,.08); box-shadow: inset 4px 0 var(--amber); }
.choice-grid button.correct { border-color: var(--green); color: #051910; background: var(--green); box-shadow: none; }
.choice-grid button.incorrect { border-color: var(--red); color: #fff; background: rgba(255,102,119,.22); box-shadow: none; }

.verdict-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 15px; }
.verdict-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); background: #071725; }
.verdict-grid article:first-child { border-left: 4px solid var(--amber); }
.verdict-grid article:nth-child(2) { border-left: 4px solid var(--cyan); }
.verdict-grid article.recommendation { grid-column: 1 / -1; border-left: 4px solid var(--green); background: rgba(74,233,161,.055); }
.verdict-grid span, .verdict-grid strong { display: block; font-family: var(--font-mono); }
.verdict-grid span { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.verdict-grid strong { margin-top: 9px; color: var(--text); font-size: 15px; line-height: 1.3; }
.verdict-grid p { margin: 8px 0 0; color: #9eb0c2; font-size: 15px; line-height: 1.35; }

.instruction { margin: 17px 0 15px; color: #b4c3d3; font-size: 17px; line-height: 1.45; }
.threshold-alert { margin: 0 0 17px; padding: 15px 17px; border: 1px solid rgba(255,176,32,.65); border-left: 5px solid var(--amber); background: rgba(255,176,32,.08); }
.threshold-alert strong { display: block; color: var(--amber); font: 700 13px/1 var(--font-mono); letter-spacing: .1em; }
.threshold-alert p { margin: 8px 0 0; color: var(--text); font-size: 17px; line-height: 1.4; }
.threshold-alert b { color: var(--amber); font-family: var(--font-mono); }
.new-btn { flex: none; min-height: 44px; padding: 0 14px; border: 1px solid var(--amber); border-radius: 0; background: linear-gradient(180deg,#ffd06b,var(--amber)); color: #171000; box-shadow: 0 0 16px rgba(255,176,32,.28); font: 700 11px/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; }
.new-btn::after { content: " \2192"; }
.answer-block { margin-top: 13px; }
.submit-btn { width: 100%; min-height: 58px; margin-top: 16px; border: 1px solid var(--amber); border-radius: 0; background: linear-gradient(180deg,#ffd06b,var(--amber)); color: #171000; font: 700 12px/1 var(--font-mono); letter-spacing: .09em; cursor: pointer; }
.submit-btn:disabled { border-color: #30465c; background: #111d29; color: #607286; cursor: not-allowed; }
.feedback { margin-top: 12px; padding: 15px; border-left: 4px solid var(--green); background: rgba(74,233,161,.07); }
.feedback.wrong { border-color: var(--red); background: rgba(255,102,119,.07); }
.feedback strong { display: block; color: var(--green); font: 700 13px/1 var(--font-mono); }
.feedback.wrong strong { color: var(--red); }
.feedback p { margin: 8px 0 0; color: #b4c3d3; font-size: 16px; line-height: 1.4; }
.feedback-intro { color: var(--text) !important; }
.feedback-decisions { margin-top: 13px; border: 1px solid var(--line); background: rgba(4,17,29,.48); }
.feedback-answer { padding: 13px 15px; border-top: 1px solid var(--line); }
.feedback-answer:first-child { border-top: 0; }
.feedback-answer > span { display: block; color: var(--muted); font: 700 11px/1.3 var(--font-mono); letter-spacing: .07em; }
.feedback-answer > b { display: block; margin-top: 6px; color: var(--green); font: 700 15px/1.35 var(--font-mono); }
.feedback-answer p { margin-top: 6px; }
.next-question-btn { width: 100%; min-height: 58px; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border: 1px solid var(--amber); border-radius: 0; background: linear-gradient(180deg,#ffd06b,var(--amber)); color: #171000; box-shadow: 0 0 16px rgba(255,176,32,.2); font: 700 12px/1 var(--font-mono); letter-spacing: .09em; cursor: pointer; }
.next-question-btn span:last-child { font-size: 18px; }
.progress-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 12px; border: 1px solid var(--line); }
.progress-strip span { padding: 11px 5px; border-right: 1px solid var(--line); text-align: center; }
.progress-strip span:last-child { border: 0; }
.progress-strip small, .progress-strip b { display: block; font-family: var(--font-mono); }
.progress-strip small { color: var(--muted); font-size: 11px; }
.progress-strip b { margin-top: 5px; color: var(--cyan); font-size: 13px; }

.lesson-panel { margin-top: 18px; }
.scope-badge { align-self: center; color: var(--cyan); font: 700 12px/1.3 var(--font-mono); letter-spacing: .07em; text-align: right; }
.lesson-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; margin-top: 18px; }
.lesson-grid article { min-height: 170px; padding: 17px; border: 1px solid var(--line); background: #071725; }
.lesson-grid article > span { color: var(--amber); font: 700 12px/1 var(--font-mono); }
.lesson-grid strong { display: block; margin: 11px 0 7px; font-size: 20px; line-height: 1.1; }
.lesson-grid p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.42; }
.memory-strip { display: grid; grid-template-columns: auto 1fr; gap: 15px; margin-top: 14px; padding: 14px 16px; border-left: 4px solid var(--cyan); background: rgba(49,221,251,.07); }
.memory-strip b { color: var(--cyan); font: 700 12px/1.4 var(--font-mono); }
.memory-strip span { color: #b8c7d7; font-size: 17px; line-height: 1.35; }
.source-note { margin: 17px 0 0; color: #7f94ab; font-size: 13px; line-height: 1.5; }
.source-note strong { color: #acbdcf; font: 700 11px/1 var(--font-mono); letter-spacing: .05em; }
.source-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 0; }
.source-links a { color: var(--cyan); font: 700 12px/1.3 var(--font-mono); text-underline-offset: 3px; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .altitude-track { height: 450px; }
}

@media (max-width: 760px) {
  .arcade-nav { min-height: 84px; padding: 9px 14px; }
  .arcade-brand { flex-direction: column; gap: 2px; font-size: 11px; }
  .arcade-brand img { width: 94px; height: 48px; }
  .all-missions { min-height: 46px; padding: 0 12px; }
  .app-stage { padding: 20px 10px 50px; }
  .app-header { margin-bottom: 17px; }
  .brand-hair { display: none; }
  .app-header h1 { margin: 8px 0 5px; font-size: 30px; }
  .trainer-modes { margin-bottom: 14px; padding: 4px; }
  .mode-btn { min-height: 48px; }
  .altitude-panel, .decision-panel, .lesson-panel { padding: 13px; }
  .altitude-visual { padding: 14px 10px; }
  .altitude-track { height: 520px; padding-left: 104px; }
  .altitude-track::before { left: 70px; }
  .scale-tick { width: 56px; font-size: 10px; }
  .scale-tick::after { left: 62px; width: 13px; }
  .rules-legend { padding-left: 6px; }
  .rules-title { left: 6px; font-size: 10px; }
  .legal-rules { left: 6px; }
  .band, .guidance-card { min-height: 50px; padding: 4px 6px; }
  .band::before, .guidance-card::before { left: -41px; width: 40px; }
  .band span { font-size: 10px; }
  .band b { font-size: 10px; }
  .band mark, .guidance-card mark { margin-right: 4px; padding: 2px 3px; }
  .band em, .guidance-card em { top: 5px; right: 5px; padding: 2px 3px; font-size: 8px; }
  .band > span, .guidance-card > span { padding-right: 52px; }
  .guidance-card { left: 6px; }
  .guidance-card b { font-size: 10px; }
  .altitude-marker { left: 61px; width: 30px; }
  .scenario-facts small { font-size: 10px; }
  .scenario-facts b { font-size: 11px; }
  .mode-challenge .scenario-facts { grid-template-columns: repeat(2,1fr); }
  .mode-challenge .scenario-facts span:nth-child(2) { border-right: 0; }
  .mode-challenge .scenario-facts span:nth-child(3) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .mode-challenge .scenario-facts span:last-child { border-top: 1px solid var(--line); border-right: 0; }
  .explore-controls { grid-template-columns: 1fr; }
  .explore-controls fieldset:first-child { grid-column: auto; }
  .choice-grid.four { grid-template-columns: repeat(2,1fr); }
  .verdict-grid { grid-template-columns: 1fr; }
  .verdict-grid article.recommendation { grid-column: auto; }
  .lesson-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 500px) {
  .app-header .subtitle { display: none; }
  .panel-heading { gap: 9px; }
  .panel-heading h2 { font-size: 23px; }
  .altitude-badge { min-width: 105px; padding-inline: 7px; }
  .altitude-badge b { font-size: 14px; }
  .altitude-track { height: 600px; }
  .scenario-facts { grid-template-columns: 1fr 1fr; }
  .scenario-facts span:nth-child(2) { border-right: 0; }
  .scenario-facts span:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .mode-explore .scenario-facts span:nth-child(2) { border-right: 1px solid var(--line); }
  .mode-explore .scenario-facts span:nth-child(3) { border-right: 0; }
  .mode-challenge .scenario-facts span:nth-child(3) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .mode-challenge .scenario-facts span:last-child { grid-column: auto; border-top: 1px solid var(--line); border-right: 0; }
  .mode-challenge .challenge-module-heading { align-items: flex-start; }
  .new-btn { padding-inline: 9px; }
  .choice-grid.three { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-grid article { min-height: 0; }
  .memory-strip { grid-template-columns: 1fr; gap: 6px; }
}
