:root {
  color-scheme: dark;
  font: 16px/1.45 "DM Sans", "Segoe UI", Arial, sans-serif;
  color: #f4f6f0;
  background: #10252b;
  --mint: #b3e5c7;
  --ink: #142426;
  --snow: #f4f6f0;
  --muted: #bccdc9;
  --line: #68817f;
  --gutter: clamp(1rem, 4.5vw, 4.5rem);
  --edge-bottom: max(1rem, env(safe-area-inset-bottom));
}
*, *::before, *::after { box-sizing: border-box; }
html, body, main { margin: 0; height: 100%; width: 100%; overflow: hidden; }
main { position: relative; isolation: isolate; background: #335860; }
#view { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #ffe5a5; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
h1,h2,p,fieldset,legend { margin: 0; }
fieldset,legend { padding: 0; border: 0; min-width: 0; }
svg { flex: none; }
button svg,.comfort svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,#0a1c22dd, #0b2025a6 26%, #0b202512 70%),linear-gradient(0deg,#07171cce,transparent 26%),linear-gradient(180deg,#11242b70, transparent 18%); }
main:is([data-phase="flying"],[data-phase="canopy"]) .shade { background: linear-gradient(0deg,#0a181e57,transparent 19%, transparent 84%,#13272a36); }
header,.foot,#entry,#instruments,#gate,#touchpad,#notice { position: absolute; }
header { inset: 0 0 auto; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: max(1rem, env(safe-area-inset-top)) var(--gutter) .75rem; gap: .65rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; line-height: 1; font-size: clamp(.95rem,1.45vw,1.36rem); font-weight: 850; letter-spacing: .13em; text-shadow: 0 1px 6px #08171d99; }
.brand svg { width: 2.35rem; height: 1.65rem; color: var(--mint); }
nav,.actions,.route-data,.foot,.overline,#instruments,#gate,.result-links { display: flex; align-items: center; }
nav { gap: .4rem; }
nav button,.glass,.primary,.close { font-weight: 670; border-radius: .34rem; }
nav button { min-height: 42px; border: 1px solid #cadbd36b; color: var(--snow); background: #102329cb; padding: .48rem .82rem; font-size: .875rem; display: inline-flex; align-items:center; justify-content: center; gap: .45rem; }
nav svg { height: 17px; width: 17px; }
#perspective[aria-pressed="true"] { border-color: var(--mint); }
nav button:hover, .glass:hover { background: #203c41; }
.text-action { display: inline-flex; align-items: center; justify-content: center; gap: .43rem; min-height: 44px; border: 0; padding: .3rem 0; color: var(--snow); background: transparent; font-size: .9rem; font-weight: 650; }
.text-action svg { width: 19px; height: 19px; }
.text-action:hover { text-decoration: underline; text-underline-offset: 4px; }

#entry { left: var(--gutter); top: max(5.5rem, 16vh); bottom: max(4.2rem, 7vh); width: min(39rem, calc(100% - var(--gutter) * 2)); display: flex; flex-flow: column; align-items: flex-start; justify-content: safe center; overflow: auto; overscroll-behavior: contain; padding: .2rem .35rem .2rem .12rem; }
#entry > * { flex-shrink: 0; }
#course-select { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-items: stretch; padding: 3px; margin-bottom: clamp(.8rem,2.5vh,2rem); background: #112428cf; border: 1px solid #c0d6cf80; border-radius: .45rem; }
#course-select label,.choice-row label { position: relative; cursor: pointer; }
#course-select input,.choice-row input { position: absolute; inset: 0; height: 100%; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
#course-select label span { display: block; padding: .45rem .86rem; min-height: 34px; font-size: .875rem; font-weight: 650; border-radius: .23rem; }
#course-select input:checked + span { background: #f0f1e6; color: #192c30; text-shadow: none; }
#course-select input:focus-visible + span,.choice-row input:focus-visible + span { outline: 3px solid #ffe4a5; outline-offset: 1px; }
.overline { gap: .62rem; margin: 0 0 .42rem; color: #f1f1e9; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 720; }
.overline i { display: inline-block; height: 3px; width: 1.45rem; background: var(--mint); }
h1 { font-size: clamp(4.2rem,9.1vw,9rem); line-height: .96; font-weight: 760; letter-spacing: -.075em; }
h1 span:last-child { color: var(--mint); }
#course-name { color: var(--snow); }
#game:is([data-course="feuerschlund"],[data-course="caille"]) h1 { font-size: clamp(3.1rem,7.3vw,7.7rem); }
#brief { max-width: 39ch; margin: .85rem 0 .35rem; font-size: clamp(1rem,1.2vw,1.17rem); color: #f4f4ea; }
.route-data { flex-wrap: wrap; gap: 0; margin: .45rem 0 .25rem; }
.route-data > span, #entry-mode { display: grid; gap: .16rem; text-align: left; align-content: center; padding: .12rem 1rem; }
.route-data > span:first-child { padding-left: 0; }
.route-data > :where(span,button) + :where(span,button) { border-left: 1px solid #c1d7ce77; }
.route-data small { display: block; font-size: .75rem; color: #d3e2dc; line-height: 1.2; }
.route-data strong { font-size: 1.02rem; line-height: 1.22; font-weight: 700; font-variant-numeric: tabular-nums; }
#entry-mode { align-self: stretch; background: transparent; border: 0; border-left: 1px solid #c1d7ce77; border-radius: 0; color: var(--mint); }
#entry-mode > span { display: flex; align-items: center; gap: .27rem; }
#entry-mode svg { width: 14px; height: 14px; }
#entry-mode:hover strong { text-decoration: underline; }
#mode-hint { max-width: 52ch; margin: .15rem 0; padding-left: .7rem; border-left: 2px solid var(--mint); font-size: .88rem; color: #e3f0e9; }
.entry-secondary { display: flex; align-items: center; gap: 1.2rem; }
.entry-secondary .text-action { min-height: 42px; color: var(--snow); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: #a7c5b999; }
.actions { flex-wrap: wrap; gap: .55rem; }
#entry .actions { margin-top: .7rem; }
.primary,.glass { min-height: 46px; padding: .65rem 1.24rem; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 1px solid transparent; font-size: 1rem; }
.primary { color: #102324; background: var(--mint); }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.glass { background: #12282ed6; border-color: #ccddd68a; }
.visor { width: 21px; height: 14px; border: 2px solid currentColor; border-radius: 4px 4px 6px 6px; position: relative; }
.visor::before,.visor::after { content: ""; position: absolute; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.visor::before { left: 3px; }.visor::after { right: 3px; }
#help { color: #e8f1e9; margin-top: .18rem; }
.comfort { display: flex; align-items: flex-start; gap: .55rem; max-width: 47ch; margin: clamp(.6rem,1.6vh,1rem) 0 0; color: #e1e8dc; font-size: .875rem; line-height: 1.38; }
.comfort svg { width: 18px; height: 18px; margin-top: 1px; color: #ffcf97; }

.foot { z-index: 2; inset: auto var(--gutter) var(--edge-bottom); gap: .82rem; color:#edf3ed; font-size: .84rem; text-shadow: 0 1px 4px #102126; }
.route-name { display: inline-flex; align-items: center; gap: .55rem; font-weight: 680; }
.route-name i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--mint); }
.progress { overflow: hidden; flex: 1; height: 3px; background: #d1ded082; }
#progress { height: 100%; width: 0; background: var(--mint); }
#distance { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
#instruments { left: var(--gutter); bottom: calc(2.5rem + var(--edge-bottom)); gap: .94rem; padding: .57rem .85rem; border-left: 3px solid var(--mint); border-radius: .18rem; background: #0e252bdc; }
#instruments small { font-size: .72rem; font-weight: 600; letter-spacing: .065em; color: #ccded7; text-transform: uppercase; }
#instruments strong { margin-right: 3px; font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
#instruments p { line-height: 1; }
#instruments p span { font-size: .76rem; color: #e0eae3; }
#gate { top: 5.3rem; left: 50%; transform: translateX(-50%); justify-content: center; gap: .58rem; padding: .35rem .73rem; background: #12272bd9; border: 1px solid #c2d2ca66; border-radius: 30px; font-size: .88rem; white-space: nowrap; }
#gate-dir { width: 8px; height: 8px; border-top: 2px solid var(--mint); border-right: 2px solid var(--mint); transform: rotate(-45deg); }
#touchpad { width: 100px; height: 100px; right: var(--gutter); bottom: calc(2.2rem + var(--edge-bottom)); border-radius: 50%; border: 1px solid #e8f1e5aa; background: #1b353d6b; touch-action: none; display: grid; place-items: center; }
#touchpad span { width: 31px; height: 31px; border: 1px solid #fff9; border-radius: 50%; background: #e9f0e65e; pointer-events: none; }
#notice { z-index: 5; top: 4.8rem; right: var(--gutter); width: max-content; max-width: min(27rem,calc(100% - var(--gutter) * 2)); background: #172c32f5; border: 1px solid #d3b57e; padding: .7rem 1rem; border-radius: .35rem; font-size: .92rem; }

#overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 4.2rem var(--gutter) 2.6rem; background: #091a2066; }
.overlay-card,dialog { color:var(--snow); background: #14282d; border: 1px solid #8ba29d80; border-radius: .7rem; box-shadow: 0 22px 65px #07131945; }
.overlay-card { width: min(100%,34rem); max-height: 100%; overflow: auto; padding: clamp(1.25rem,3.4vw,2.4rem); }
#result-title { font-size: clamp(2.2rem,4.8vw,3.7rem); font-weight: 730; line-height: 1.02; letter-spacing: -.055em; }
#result-text { color: #d8e5df; margin: .8rem 0 1.3rem; }
.passage-summary { margin: 0 0 .55rem; color: #b6efda; font-weight: 670; }
.passage-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin: 0 0 .95rem; }
.passage-cards figure { margin: 0; min-width: 0; padding: .48rem; border: 1px solid #537571; border-radius: .4rem; }
.passage-cards figcaption { font-size: .9rem; font-weight: 670; margin-bottom: .25rem; }
.passage-cards canvas { display: block; width: 100%; height: auto; border-radius: .18rem; }
.passage-cards p { margin: .32rem 0 0; font-size: .82rem; color: #d2e2dc; }
.result-links { margin-top: .6rem; gap: 1.2rem; }
.result-links .text-action { color: #d4e4da; font-size: .88rem; }
noscript { position: absolute; left: var(--gutter); top: 4.7rem; padding: .5rem; background: #15272b; }
dialog { --dialog-bg: #14282d; width: min(29rem, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #657f7e #182d31; }
dialog::backdrop { background: #08181dcc; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.12rem 1.4rem .9rem; }
.dialog-head h2 { font-size: 1.62rem; line-height: 1.18; font-weight: 710; letter-spacing: -.04em; }
.close { min-height: 42px; min-width: 42px; display: grid; place-items: center; border: 1px solid #78908d78; background: #1e3439; }
.close:hover { background: #30464b; }
.close svg { width: 19px; height: 19px; }
.page-tabs { display: flex; padding: 0 1.4rem; gap: 1.1rem; border-bottom: 1px solid #6a878456; }
.page-tabs button { border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: .58rem .1rem; min-height: 43px; background: transparent; color: #bed1c9; font-size: .95rem; font-weight: 650; }
.page-tabs button[aria-selected="true"] { color: var(--snow); border-bottom-color: var(--mint); }
.menu-page { padding: 1.16rem 1.4rem .5rem; }
.field-group + .field-group { margin-top: 1.45rem; }
.field-group legend { margin-bottom: .62rem; font-size: 1.05rem; font-weight: 700; }
.choice-row { display: grid; gap: .5rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.choice-row label { display: block; }
.choice-row label > span { height: 100%; display: block; padding: .6rem .78rem; border: 1px solid #6a8582; border-radius: .35rem; background: #182f34; color: #e4ece5; font-size: .97rem; font-weight: 600; text-align: center; line-height: 1.3; }
.choice-row input:checked + span { color: #14272a; border-color: var(--mint); background: var(--mint); }
.mode-options { grid-template-columns: minmax(0,1fr); }
.mode-options label > span {
  display: grid; align-items: center; grid-template-columns: minmax(7.8rem,.85fr) minmax(0,1.3fr);
  gap: .75rem; text-align: left; padding: .62rem .75rem;
}
.mode-options label small { margin-top: 0; }
@media (max-width: 380px) {
  .mode-options label > span { grid-template-columns: 1fr; gap: .12rem; }
}
.mode-options strong,.feedback-options strong { display: block; font-weight: 710; }
.mode-options small,.feedback-options small { display: block; margin-top: .2rem; color: #c3d6cf; font-size: .875rem; font-weight: 440; line-height: 1.35; }
.mode-options input:checked + span small { color: #233a3c; }
.feedback-options label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding: .52rem 0; border-top: 1px solid #647f7b59; cursor: pointer; }
.feedback-options input { appearance: none; flex: none; width: 43px; height: 25px; margin: 0; border: 1px solid #a7bcb7; border-radius: 18px; background: #22393c; cursor: pointer; }
.feedback-options input::before { content: ""; display: block; width: 17px; height: 17px; margin: 3px; border-radius: 50%; background: #bdcbc5; }
.feedback-options input:checked { border-color: var(--mint); background: var(--mint); }
.feedback-options input:checked::before { transform: translateX(18px); background: #193032; }
.field-hint,.tutorial-comfort { font-size: .875rem; color: #c6d8d1; line-height: 1.4; }
.field-hint { margin-top: .75rem; }
.camera-sliders { margin-top: .9rem; }
.camera-sliders label { display: flex; justify-content: space-between; gap: .75rem; padding-top: .3rem; font-size: .95rem; font-weight: 620; }
.camera-sliders output { color: var(--mint); font-weight: 650; font-variant-numeric: tabular-nums; }
.camera-sliders input[type="range"] { width: 100%; min-height: 34px; accent-color: var(--mint); margin: 0; padding: 0; cursor: pointer; }
.camera-sliders:disabled { opacity: .47; }
.camera-sliders:disabled input { cursor: default; }
#reset-camera { color: #e2ede7; font-size: .875rem; }
#guide[data-page="camera"] { margin: auto max(1rem, var(--gutter)) auto auto; width: min(24rem,42vw); }
#guide[data-page="camera"]::backdrop { background: #08181d28; }
main:has(#guide[open][data-page="camera"]) :is(#overlay,#entry,header,.foot,#gate,#touchpad,#canopy-action,#instruments) { visibility: hidden; }
.tutorial-devices { grid-template-columns: repeat(3,minmax(0,1fr)); }
#tutorial-steps { margin: .85rem 0 0; padding: 0; list-style: none; counter-reset: steps; }
#tutorial-steps li { counter-increment: steps; display: grid; grid-template-columns: 2.08rem 1fr; column-gap: .4rem; align-content: start; padding: .68rem 0; border-bottom: 1px solid #647f7b59; }
#tutorial-steps li::before { content: counter(steps,decimal-leading-zero); grid-row: span 2; color: var(--mint); font-size: .83rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; font-weight: 720; padding-top: .13rem; }
#tutorial-steps strong { font-size: 1rem; font-weight: 690; }
#tutorial-steps span { font-size: .94rem; color: #d4e2db; line-height: 1.4; }
.tutorial-comfort { margin: .85rem 0 .1rem; padding-left: .65rem; border-left: 2px solid #d7b37f; }
dialog footer { display: flex; justify-content: flex-end; padding: .65rem 1.4rem 1.12rem; }
dialog footer button { min-width: 6.2rem; }
#guide footer { flex-wrap: wrap; align-items: center; gap: .55rem 1rem; }
#guide footer a { margin-inline-end: auto; }
@media (min-width: 900px) {
  #entry { left: clamp(3rem,5.6vw,6.25rem); }
}
@media (max-width: 680px) {
  #entry { top: 4.7rem; bottom: 3.35rem; }
  .shade { background: linear-gradient(90deg,#0c2026b8,#0c20265b 90%), linear-gradient(0deg,#0a191ed9 0%,#10252844 63%,transparent 80%); }
  h1 { font-size: clamp(3.6rem,14vw,5.6rem); }
  #game:is([data-course="feuerschlund"],[data-course="caille"]) h1 { font-size: clamp(2.8rem,11.3vw,4.8rem); }
  .brand { gap: .4rem; font-size: .98rem; letter-spacing: .09em; }
  .brand svg { width: 1.7rem; }
  nav { gap: .28rem; }
  nav button { padding: .4rem .56rem; }
  #perspective { width: 42px; padding: 0; }
  #view-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  #brief { max-width: 32ch; }
  .comfort { max-width: 42ch; }
  #gate { top: 4.5rem; }
  #touchpad { width: 85px; height: 85px; }
  #instruments { gap: .58rem; padding: .5rem .55rem; }
  #instruments small { font-size: .66rem; }
  #instruments strong { font-size: 1.22rem; }
  #guide[data-page="camera"] { inset: .4rem 0 auto; margin: 0 auto; width: min(29rem,calc(100vw - .8rem)); max-height: 51dvh; }
  #guide[data-page="camera"] .dialog-head { padding-top: .4rem; padding-bottom: .1rem; }
  #guide[data-page="camera"] .menu-page { padding-top: .55rem; }
}
@media (max-height: 545px) and (min-width: 640px) {
  #entry { inset-block: 3.65rem 1.9rem; width: min(76vw,45rem); }
  header { padding-top: .38rem; padding-bottom: .3rem; }
  #course-select { margin-bottom: .32rem; }
  #course-select label span { min-height: 28px; padding-top: .22rem; padding-bottom: .22rem; }
  h1,#game:is([data-course="feuerschlund"],[data-course="caille"]) h1 { font-size: 2.9rem; }
  .overline { margin-bottom: .1rem; }
  #brief { margin: .26rem 0 0; max-width: 56ch; font-size: .94rem; }
  #entry .actions { margin-top: .24rem; }
  .route-data { min-height: 28px; }
  #help { min-height: 32px; }
  .comfort { margin: .18rem 0 0; max-width: 68ch; font-size: .8rem; }
  #overlay { padding-block: 3.6rem 1.85rem; }
  .overlay-card { padding: 1rem 1.35rem; }
  #result-title { font-size: 2rem; }
  #result-text { margin: .5rem 0 .7rem; }
  #gate { top: 3.65rem; }
  #guide[data-page="camera"] { width: min(22rem,45vw); max-height: calc(100dvh - .6rem); inset: .3rem .4rem auto auto; margin: 0; }
}
@media (max-width: 365px) {
  :root { --gutter: .7rem; }
  .brand { font-size: .88rem; }
  nav button { font-size: .83rem; }
  #instruments { gap: .35rem; }
  .primary,.glass { padding-inline: .94rem; }
  .page-tabs { gap: .8rem; }
  .dialog-head,.menu-page,.page-tabs,dialog footer { padding-inline: 1rem; }
}
@media (forced-colors: active) {
  .choice-row input:checked + span, #course-select input:checked + span { outline: 2px solid Highlight; }
  .feedback-options input:checked::before { background: Highlight; }
}

#result-stats { margin: .65rem 0 1rem; color: #b5ccc5; font-size: .9rem; font-variant-numeric: tabular-nums; }
.result-links { flex-wrap: wrap; column-gap: 1.05rem; row-gap: .1rem; }
@media (prefers-reduced-motion: no-preference) {
  main[data-phase="crashed"] .overlay-card { animation: reveal-result .45s ease-out; }
}
@keyframes reveal-result { from { opacity: 0; } to { opacity: 1; } }

#geo-info a, #geo-credit { color:#e6f1dc; text-underline-offset:.2em; }
#geo-credit { font-size:.76rem; white-space:nowrap; }
#course-loading { position:absolute; z-index:8; top:4.8rem; right:var(--gutter); padding:.7rem .9rem; border-radius:.35rem; color:#f1f5ea; background:#14292ef5; font-size:.9rem; }
@media(max-width:480px) {
  #course-select label span {padding-inline:.5rem;}
  #geo-credit {font-size:.72rem;}
  .foot {gap:.44rem;}
}
#canopy-action { position:absolute; right:var(--gutter); bottom:calc(2.5rem + var(--edge-bottom)); z-index:2; display:flex; align-items:center; gap:.45rem; min-height:44px; background:#142b31eb; }
#gate.deploy-prompt, #canopy-action.deploy-prompt {
  background: #34291e; border: 1px solid #f7c782; color: #ffdfaa;
}
#canopy-action svg { width:1.25rem; height:1.25rem; }
#game:has(#touchpad:not([hidden])) #canopy-action { bottom:calc(9rem + var(--edge-bottom)); }
#tutorial-canopy { margin:.8rem 0; line-height:1.45; }
@media(max-width:480px) {
  #touchpad { bottom:calc(6.6rem + var(--edge-bottom)); }
  #canopy-action { font-size:.85rem; padding:.4rem .6rem; }
  #game:has(#touchpad:not([hidden])) #canopy-action { bottom:calc(12.45rem + var(--edge-bottom)); }
}
@media(max-width:500px) {
  #course-select { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); max-width:100%; }
  #course-select label span { text-align:center; padding-inline:.4rem; }
}

@media (min-width:681px) and (min-height:546px) and (max-height:810px) {
  #entry { top:4.65rem; bottom:3rem; }
  #course-select { margin-bottom:.65rem; }
}
#plan-mode-suggestion { margin-inline-start:.35rem; font-size:.86rem; font-weight:500; color:var(--deck-light); }
#flight-picker { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem .85rem; margin:.7rem 0 .05rem; padding:0; border:0; }
.activity-choice { display:flex; background:#10272ce8; border:1px solid #92b6ad; border-radius:.35rem; padding:2px; }
.activity-choice label { position:relative; cursor:pointer; }
.activity-choice input { position:absolute; width:100%; height:100%; inset:0; margin:0; opacity:0; cursor:pointer; }
.activity-choice span { display:block; padding:.42rem .8rem; border-radius:.22rem; color:#e6f0e9; font-size:.92rem; font-weight:680; }
.activity-choice input:checked + span { background:var(--mint); color:#142c2e; }
.activity-choice input:focus-visible + span { outline:3px solid #ffe5a5; outline-offset:2px; }
.flight-option { display:flex; align-items:center; gap:.42rem; }
.flight-option small, #assist-field { color:var(--snow); font-size:.84rem; }
.flight-option select { color-scheme:dark; background:#142b30; color:var(--snow); border:1px solid #8daaa2; border-radius:.3rem; font:inherit; font-size:.87rem; padding:.43rem .35rem; max-width:12.5rem; }
.flight-option select:focus-visible { outline:3px solid #ffe5a5; outline-offset:2px; }
#assist-field { display:inline-flex; align-items:center; gap:.35rem; background:#122c30c9; border-radius:.3rem; padding:.45rem .5rem; }
#assist-toggle { accent-color:var(--mint); }
@media (max-width:480px) {
  #flight-plan #exit-field:has(optgroup) { display:grid; justify-content:stretch; gap:.25rem; }
  #flight-plan #exit-field:has(optgroup) select { width:100%; min-width:0; }
}
@media(max-width:500px) { #flight-picker { gap:.42rem .65rem; } .flight-option { gap:.3rem; } }

#discovery-panel { width: min(30rem,calc(100% - 2rem)); }
.discovery-body { padding: 0 1.4rem 1.4rem; }
#discovery-course { margin: 0 0 .75rem; color: #c8dcd5; }
#discovery-map { display: block; width: 100%; height: clamp(8rem,23vh,12rem); border: 1px solid #4d6d6c; border-radius: .45rem; }
.discovery-labels { margin: 1rem 0 .32rem; display:flex; align-items:center; justify-content:space-between; gap:.6rem; font-size:.9rem; }
#discovery-status { color: #c3d5d0; }
#discovery-name { margin:0; font-size:clamp(1.3rem,4vw,1.7rem); line-height:1.15; }
#discovery-hint { line-height:1.45; margin:.5rem 0 .7rem; color:#d9e8e3; }
#discovery-exit { margin:0 0 1rem; color:#c8dcd5; }
#discovery-select { margin:0 0 .65rem; width:100%; }
#discovery-close { font-size:1.5rem; }
#new-discovery { color:var(--mint);margin:.55rem 0 .8rem;font-weight:650; }
.entry-secondary { flex-wrap:wrap; }

/* Playback shares the flight scene. Its transport is the only active flight navigation. */
body.replaying #game :is(#overlay, #entry, #instruments, #gate, #touchpad, #canopy-action, .foot),
body.replaying #game > header nav,
body.replaying #game > .shade { display: none; }
#replay-controls {
  position: absolute; z-index: 5; inset: auto 0 var(--edge-bottom); margin: 0 auto;
  width: min(32rem, calc(100% - 1.25rem)); padding: .55rem .85rem .7rem;
  display: grid; gap: .1rem; color: #f4f6ed; background: #162024f5;
  border: 1px solid #74827d; border-top: 2px solid var(--deck-signal, #d9f548);
  border-radius: .55rem; box-shadow: 0 .35rem 1.5rem #06101655;
}
.replay-heading, .replay-actions { display: flex; align-items: center; gap: .6rem; }
.replay-heading h2 { font-weight: 750; font-size: 1.18rem; line-height: 1.2; }
.replay-clock { color: #c6d1ce; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
#replay-controls button {
  border: 1px solid #73837e; border-radius: .3rem; padding: .28rem .72rem;
  background: #273136; font-size: .94rem; font-weight: 650; min-height: 2.75rem;
}
#replay-controls button:hover { background: #354144; }
#replay-controls #replay-exit { margin-left: auto; }
#replay-controls #replay-toggle {
  background: var(--deck-signal, #d9f548); border-color: var(--deck-signal, #d9f548);
  color: #18221a; min-width: 6.8rem;
}
#replay-position { width: 100%; margin: 0; height: 1.65rem; accent-color: var(--deck-signal, #d9f548); cursor: pointer; }
#replay-controls .replay-actions { display: grid; grid-template-columns: auto minmax(5rem, 1fr) auto; }
@media (max-width: 480px) {
  #replay-controls .replay-actions { grid-template-columns: auto 1fr; gap: .12rem .5rem; }
  #replay-position { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 420px) {
  #replay-controls { padding: .32rem .6rem .5rem; }
  .replay-heading { flex-wrap: wrap; gap: .2rem .45rem; }
  .replay-heading h2 { font-size: 1rem; }
  .replay-clock { font-size: .84rem; }
  #replay-controls button { font-size: .875rem; }
}
#replay-controls { width: min(36rem, calc(100% - 1.25rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.replay-camera-picker { position: relative; display: block; width: 11rem; min-width: 0; }
.replay-camera-picker > span { position: absolute; top: .14rem; left: .63rem; font-size: .74rem; color: #c6d1ce; pointer-events: none; }
.replay-camera-picker::after { content: ''; position: absolute; right: .65rem; top: 44%; width: .45rem; height: .45rem; border: solid #d6dfd8; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
#replay-view {
  appearance: none; width: 100%; min-height: 2.75rem; font: inherit; font-size: .94rem; font-weight: 650;
  padding: 1rem 1.6rem .08rem .63rem; color: inherit; background: #273136; border: 1px solid #73837e; border-radius: .3rem; cursor: pointer;
}
#replay-view:focus-visible, #replay-orbit summary:focus-visible, #view.orbit-enabled:focus-visible { outline: 3px solid #ffe5a5; outline-offset: -3px; }
body.replaying #game > header { pointer-events: none; }
#view.orbit-enabled { cursor: grab; }
#view.orbit-enabled:active { cursor: grabbing; }
#replay-shot { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: .12rem .5rem; padding: .27rem 0 .07rem; font-size: .875rem; line-height: 1.25; }
#replay-shot span { color: #c6d1ce; }
#replay-shot strong { color: #f4f6ed; font-weight: 650; }
#replay-controls #replay-passage { justify-self: end; margin-top: .22rem; }
#replay-orbit { margin-top: .25rem; border-top: 1px solid #65736b; }
#replay-orbit summary { min-height: 2.75rem; display: flex; gap: .5rem; align-items: center; cursor: pointer; list-style: none; font-size: .9rem; }
#replay-orbit summary::-webkit-details-marker { display: none; }
#replay-orbit summary span { margin-left: auto; color: #c6d1ce; }
#replay-orbit summary::after { content: ''; width: .45rem; height: .45rem; border: solid #d6dfd8; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -.18rem .2rem 0; }
#replay-orbit[open] summary::after { transform: rotate(225deg); margin-top: .18rem; }
#replay-orbit-guide { font-size: .875rem; color: #d0d9d3; margin: 0 0 .5rem; }
#replay-orbit-values { margin: 0 0 .45rem; color: #e8efdd; font-size: .875rem; font-variant-numeric: tabular-nums; }
.orbit-steps { display: grid; gap: .35rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
#replay-controls .orbit-steps button { min-width: 0; padding-inline: .18rem; font-size: .875rem; }
@media (max-width: 480px) {
  .replay-camera-picker { width: 100%; }
  .orbit-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (forced-colors: active) {
  .replay-camera-picker::after, #replay-orbit summary::after { border-color: ButtonText; }
}
