:root{color-scheme:dark;font-family:"Yu Gothic","Hiragino Kaku Gothic ProN",Meiryo,system-ui,sans-serif;background:#071019;color:#e7f0f2;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-width:320px;background-image:linear-gradient(#3d697e18 1px,transparent 1px),linear-gradient(90deg,#3d697e18 1px,transparent 1px),radial-gradient(ellipse at 54% 7%,#13334490,transparent 53%);background-size:32px 32px,32px 32px,auto}a{color:inherit}button,input{font:inherit}button{min-height:44px;padding:8px 12px;border:1px solid #47717c;border-radius:5px;background:#102a34;color:#e4f2f4;cursor:pointer;font-size:12px}button:hover{background:#1a414d}button:disabled{opacity:.5;cursor:default}button:focus-visible,input:focus-visible,[tabindex]:focus-visible,a:focus-visible{outline:3px solid #f0ba65;outline-offset:3px}[hidden]{display:none!important}.site-frame{width:min(100% - 48px,1480px);margin:auto}.site-header{padding:18px 0 20px;border-bottom:1px solid #203543}.prototype-breadcrumb{color:#9aafb8}.header-row{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:13px}.brand{display:inline-flex;align-items:center;gap:12px;text-decoration:none}.brand-mark{display:grid;width:44px;height:44px;place-items:center;border:1px solid #49cfe1;color:#81eafa;font:700 12px monospace}.brand-copy{display:grid;gap:4px}.brand-copy strong{font-size:16px}.brand-copy small{color:#8ca4b0;font:10px/1.3 monospace;letter-spacing:.09em}.section-nav{display:flex;flex-wrap:wrap;gap:8px 20px}.section-nav a{color:#a9bbc2;font:11px/1.5 monospace;letter-spacing:.1em;text-decoration:none}.hero{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,.75fr);gap:20px;padding:24px 0;align-items:end}.kicker,.status-label{color:#64d6e8;font:10px/1.5 monospace;letter-spacing:.12em;margin:0 0 9px}.hero h1{font-size:clamp(1.8rem,3.2vw,2.9rem);line-height:1.25;margin:0}.hero-subtitle{color:#91a7b2;font:12px/1.5 monospace;margin:9px 0}.hero-lead{color:#c2d0d5;font-size:14px;line-height:1.8;margin:12px 0 0}.status-rack{display:grid;gap:8px;padding:16px 18px;border:1px solid #765d39;background:#211d16d1}.status-rack .status-label{color:#e6b461;margin:0}.status-rack strong{color:#f0c77d;font-size:15px}.status-rack>span:last-child{color:#c8b894;font-size:12px;line-height:1.55}.observatory-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:16px;align-items:start}.observation-panel,.control-panel,.note-card{min-width:0;border:1px solid #2a414e;background:#08131cf0;padding:14px}.panel-heading{display:flex;justify-content:space-between;gap:16px;align-items:end;margin-bottom:14px}.panel-heading .kicker{margin-bottom:5px}h2{font-size:18px;line-height:1.35;margin:0}.bench-tag{font:10px monospace;color:#e6b461}.stage{position:relative;height:clamp(470px,48vw,680px);isolation:isolate;overflow:hidden;border:1px solid #38505c;background:#19323d}canvas{display:block;width:100%;height:100%;touch-action:none}.hud{position:absolute;top:10px;left:10px;right:10px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 10px;padding:8px;background:#071019d9;color:#d8e8e6;font:12px/1.5 monospace;pointer-events:none}.hud strong{color:#f0d28e}.stage-actions{position:absolute;top:82px;left:10px;right:10px;display:flex;flex-wrap:wrap;gap:5px}.stage-actions button{background:#102a34ed}.flight-controls{position:absolute;left:10px;right:10px;bottom:10px;display:flex;justify-content:space-between;align-items:end;pointer-events:none}.flight-controls>*{pointer-events:auto}.collective-box{display:grid;justify-items:center;gap:5px;width:98px;padding:8px;background:#102b35e8;border:1px solid #77999b;border-radius:6px}.collective-box label{font-size:12px;white-space:nowrap}.collective-box output{color:#f0d28e}.collective-box input{writing-mode:vertical-lr;direction:rtl;width:44px;height:120px;margin:0;accent-color:#e6b461;touch-action:none}.collective-box small{font-size:10px;line-height:1.5;text-align:center;color:#b4cbce}.stick-box{display:grid;gap:5px;justify-items:center;color:#d8e8e6;font-size:12px}#stick{position:relative;width:142px;height:126px;border:1px solid #77999b;border-radius:45%;background:radial-gradient(ellipse,#243b43ef,#09151ce8);touch-action:none;user-select:none;cursor:grab}.stick-cross{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font:48px monospace;color:#45616b}#stickKnob{position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%);border-radius:50%;background:#91b5ba;border:2px solid #d4e4dd;pointer-events:none}.pedals{display:flex;gap:5px}.pedals button{width:70px;padding:7px 3px}.stage-screen{position:absolute;inset:6px;z-index:5;display:grid;align-items:center;justify-items:center;padding:14px;background:#0c202af2;overflow:auto;overscroll-behavior:contain;border:1px solid #527883;border-radius:8px}.screen-card{width:100%;max-width:590px;color:#d8eae7}.screen-card h2{font-size:24px}.screen-card p{font-size:13px;line-height:1.7}.screen-card button{width:100%;font-size:15px;background:#dfc17f;border-color:#f0d28e;color:#172931;min-height:48px}.fallback{position:absolute;z-index:10;inset:10px;background:#211911;color:#f0d2a5;padding:20px;font-size:14px;line-height:1.7}.canvas-help,#flightHint{font-size:12px;line-height:1.8;color:#8da2ab}.flight-plan{padding-left:22px;font-size:14px;line-height:2}.flight-plan .done{color:#9bdbb6}.flight-plan .done::after{content:' ✓'}.readout-list{margin:16px 0 0}.readout-list>div{padding:10px 0;border-top:1px solid #283b45}.readout-list dt{color:#849ca5;font:10px monospace}.readout-list dd{margin:5px 0 0;font:12px monospace}.notes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}.note-card{font-size:12px;line-height:1.7;color:#b8c7cc;padding:17px}.note-card h2{font-size:16px;color:#eef3f1}.site-footer{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-top:24px;padding:20px 0 30px;border-top:1px solid #203543;color:#90a6ae;font-size:11px}.site-footer .public-site-footer-nav{flex-basis:100%;font:10px/1.5 monospace}.expanded,.stage:fullscreen{position:fixed;inset:0;z-index:1000;width:100%;height:100dvh!important;border:0}.expanded .hud,.stage:fullscreen .hud{top:max(10px,env(safe-area-inset-top))}.expanded .flight-controls,.stage:fullscreen .flight-controls{bottom:max(10px,env(safe-area-inset-bottom))}body.view-expanded{overflow:hidden}.stage.modal-open .flight-controls{visibility:hidden}.stage.modal-open .stage-actions{visibility:hidden}.stage.modal-open .hud{visibility:hidden}
@media(max-width:1100px){.observatory-layout{grid-template-columns:1fr}.control-panel{padding:16px}.stage{height:clamp(470px,62vw,610px)}}@media(max-width:760px){.site-frame{width:min(100% - 32px,620px)}.header-row{align-items:start;flex-direction:column;gap:15px}.hero{grid-template-columns:1fr;padding:20px 0 14px}.status-rack{padding:10px}.notes{grid-template-columns:1fr}.site-footer{align-items:start;flex-direction:column}}@media(max-width:600px){.observation-panel{padding:8px}.panel-heading h2{font-size:16px}.bench-tag{display:none}.stage{height:500px}.hud{font-size:10px;gap:4px;padding:7px;top:7px;left:7px;right:7px}.stage-actions{top:73px;left:7px;right:7px;gap:4px}.stage-actions button{flex:1 1 29%;padding:6px 4px;font-size:11px}.flight-controls{left:7px;right:7px;bottom:7px}.collective-box{width:88px}.collective-box input{height:108px}.stick-box #stick{width:130px;height:112px}.screen-card h2{font-size:20px}.screen-card p{font-size:12px;line-height:1.6}.stage-screen{padding:12px}}@media(max-height:500px) and (orientation:landscape){.expanded .hud,.stage:fullscreen .hud{grid-template-columns:repeat(6,minmax(0,1fr));font-size:10px;padding:5px}.expanded .stage-actions,.stage:fullscreen .stage-actions{top:43px;left:auto;max-width:calc(100% - 20px);right:10px;flex-wrap:nowrap}.expanded .stage-actions button,.stage:fullscreen .stage-actions button{flex:initial;padding:5px 7px;font-size:11px}.expanded .collective-box input,.stage:fullscreen .collective-box input{height:76px}.expanded .collective-box small,.stage:fullscreen .collective-box small{display:none}.expanded #stick,.stage:fullscreen #stick{width:115px;height:88px}.expanded .stage-screen,.stage:fullscreen .stage-screen{align-items:start}.expanded .screen-card p,.stage:fullscreen .screen-card p{margin:7px 0}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.stage.modal-open .stage-actions{visibility:visible;z-index:6;top:max(12px,env(safe-area-inset-top));right:12px;left:auto;max-width:none}.stage.modal-open .stage-actions button:not(#fullscreenButton):not(#soundButton):not(#viewButton){display:none}.stage.modal-open .stage-actions #fullscreenButton,.stage.modal-open .stage-actions #soundButton,.stage.modal-open .stage-actions #viewButton{flex:initial}.stage.modal-open .screen-card{padding-top:48px}

.cockpit-interior { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.cockpit-interior img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; pointer-events: none; }
.hud, .stage-actions, .flight-controls { z-index: 2; }
.cockpit-status { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 45%; margin: 0; padding: 5px 7px; border: 1px solid #77999b; border-radius: 4px; background: #102b35e8; color: #d8e8e6; font-size: 11px; line-height: 1.5; pointer-events: none; }
.landscape-readouts { display: none; }

#soundButton, #viewButton { min-width: 44px; }
.stage-actions button { min-width: 44px; }

/* Keep normal phone landscape play on one screen; fullscreen keeps its existing rules. */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .stage:not(.expanded):not(:fullscreen) {
    height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  .stage:not(.expanded):not(:fullscreen) .hud {
    top: 7px;
    left: 7px;
    right: 7px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    font-size: 10px;
    line-height: 1.5;
    padding: 5px;
    gap: 4px;
  }
  .stage:not(.expanded):not(:fullscreen) .landscape-readouts {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid #38505c;
    padding-top: 3px;
  }
  .stage:not(.expanded):not(:fullscreen) .stage-actions {
    top: 76px;
    left: auto;
    right: 7px;
    max-width: calc(100% - 14px);
    flex-wrap: nowrap;
    gap: 4px;
  }
  .stage:not(.expanded):not(:fullscreen) .stage-actions button {
    flex: initial;
    min-width: 44px;
    min-height: 44px;
    padding: 5px 7px;
    font-size: 11px;
  }
  .stage:not(.expanded):not(:fullscreen) .flight-controls {
    left: 7px;
    right: 7px;
    bottom: 7px;
  }
  .stage:not(.expanded):not(:fullscreen) .collective-box {
    width: 88px;
    padding: 6px;
    gap: 4px;
  }
  .stage:not(.expanded):not(:fullscreen) .collective-box input {
    width: 44px;
    height: 76px;
  }
  .stage:not(.expanded):not(:fullscreen) #stick {
    width: 115px;
    height: 88px;
  }
  .stage:not(.expanded):not(:fullscreen) .stage-screen {
    align-items: center;
    padding: 10px;
  }
  .stage:not(.expanded):not(:fullscreen) .screen-card {
    padding-top: 0;
  }
  .stage:not(.expanded):not(:fullscreen) .screen-card > .kicker,
  .stage:not(.expanded):not(:fullscreen) .screen-card > h2 {
    padding-right: 245px;
  }
  .stage:not(.expanded):not(:fullscreen) .screen-card > .kicker {
    margin-bottom: 3px;
  }
  .stage:not(.expanded):not(:fullscreen) .screen-card h2 {
    font-size: 18px;
  }
  .stage:not(.expanded):not(:fullscreen) #screenBody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    margin: 8px 0;
  }
  .stage:not(.expanded):not(:fullscreen) .screen-card p {
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
  }
  .stage:not(.expanded):not(:fullscreen).modal-open .stage-actions {
    top: 12px;
    right: 12px;
  }
}

/* Only the crash screen reveals the aircraft and its image-based effects. */
.stage.crash-open #screen {
  inset: auto 12px 12px auto;
  width: min(240px, calc(100% - 24px));
  max-height: calc(100% - 70px);
  padding: 12px;
  align-items: start;
  background: rgba(12, 32, 42, .78);
  border-color: #e0b97c;
}
.stage.crash-open #screen .screen-card { padding-top: 0; }
.stage.crash-open #screen .screen-card > .kicker,
.stage.crash-open #screen .screen-card > h2 { padding-right: 0; }
.stage.crash-open #screen .screen-card h2 { font-size: 17px; }
.stage.crash-open #screen #screenBody { display: block; margin: 7px 0; }
.stage.crash-open #screen .screen-card p { font-size: 12px; margin: 0; }
.stage.crash-open #screen .screen-card button { min-height: 44px; font-size: 13px; }

@media (max-width: 900px) and (orientation: portrait) {
  .stage.crash-open #screen {
    top: 68px;
    bottom: auto;
  }
}
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .stage.crash-open #screen {
    width: min(180px, calc(100% - 24px));
  }
}
.cockpit-instruments { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Landing results use the existing screen scroll, including short landscape stages. */
.stage.modal-open .stage-screen:has(.landing-values) { align-items: start; }
.landing-values { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.landing-values div { min-width: 0; }
.landing-values dt { font-size: 11px; }
.landing-values dd { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.landing-score { font-weight: bold; }
.stage #screen #screenBody:has(.landing-values) { display: block; }
.course-choice { display: grid; gap: 5px; grid-column: 1 / -1; font-size: 13px; }
.course-choice select { width: 100%; min-height: 44px; padding: 8px; background: #102a34; color: #e4f2f4; border: 1px solid #77999b; font: inherit; }
#courseHeadingHud { grid-column: 1 / -1; color: #f0d28e; }
.stage.side-course .stage-actions { top: 108px; }
.stage.side-course.modal-open .stage-actions { top: 12px; }
@media(max-width:600px) { .stage.side-course .stage-actions { top: 96px; } }
@media(max-height:500px) and (orientation:landscape) { .stage.side-course:not(.expanded):not(:fullscreen):not(.modal-open) .stage-actions { top: 98px; } .stage.side-course.expanded .stage-actions,.stage.side-course:fullscreen .stage-actions { top: 63px; } .stage.side-course.modal-open .stage-actions { top: 12px; } }
.stage.crash-open .landing-values { grid-template-columns: 1fr; gap: 5px; }
.stage.crash-open #screen .screen-card p { margin: 7px 0; }
