/* Compact gameplay fills the stable viewport; menus keep their normal layout. */
.turn-cue { max-width: calc(100% - 24px); }
.turn-cue small { display: block; margin-top: 3px; font-size: .9em; font-weight: 500; color: inherit; }
.turn-cue small:empty { display: none; }
.design-explainer { color: #526958; font-size: 12px; line-height: 1.5; }
.plane-specifications { margin: 12px 0; color: #244c3f; font-size: 12px; }
.plane-specifications summary { cursor: pointer; min-height: 44px; padding: 14px 0; }
.motion-menu { display: none; }
@media (any-pointer: coarse) {
  .motion-menu { display: block; }
  .motion-menu summary { cursor: pointer; padding: 12px; color: #244c3f; }
}

@media (max-width: 980px), (any-pointer: coarse), (max-height: 500px) {
  body.mode-flight { overflow: hidden; }
  body.mode-flight .shell { padding: 0; max-width: none; }
  body.mode-flight .intro,
  body.mode-flight .journey-bar,
  body.mode-flight .controls-strip,
  body.mode-flight .site-footer,
  body.mode-flight .workshop { display: none !important; }
  body.mode-flight main, body.mode-flight .game-layout { display: block; height: auto; }
  body.mode-flight .flight-stage {
    position: fixed; top: 0; left: 0; width: 100%;
    height: calc(100svh - 60px - env(safe-area-inset-bottom));
    min-height: 0; max-height: none; border: 0; border-radius: 0;
    box-shadow: none; contain: layout paint;
  }
  body.mode-flight .topbar {
    position: fixed; right: max(8px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 32;
    display: block; height: 44px; min-height: 0; padding: 0; border: 0;
  }
  body.mode-flight .topbar > :not(.motion-menu) { display: none; }
  body.mode-flight .motion-menu summary {
    box-sizing: border-box; display: grid; place-items: center;
    list-style: none; width: 76px; height: 44px; padding: 0;
    border: 1px solid #91a99c; border-radius: 10px;
    background: #f9fbf4; color: #244c3f; font: 600 12px Arial, sans-serif;
  }
  .motion-menu summary::-webkit-details-marker { display: none; }
  body.mode-flight .motion-menu[open] .motion-controls {
    position: absolute; right: 0; bottom: 54px; display: flex;
    flex-wrap: wrap; justify-content: flex-start; width: min(290px, calc(100vw - 24px));
    padding: 14px; border: 1px solid #91a99c; border-radius: 14px;
    background: #f4f8ef; box-shadow: 0 6px 24px #183d3033;
  }
  body.mode-flight .motion-controls span { flex-basis: 100%; max-width: none; font-size: 12px; }
  body.mode-flight .motion-controls button { min-height: 44px; }
  body.mode-flight .flight-speed-controls {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom)); min-height: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    gap: 6px; flex-wrap: nowrap; justify-content: center;
    background: #eef4eb; border-top: 1px solid #bccdbd;
  }
  body.mode-flight .flight-speed-controls > span,
  body.mode-flight .flight-speed-controls small { display: none; }
  body.mode-flight .flight-speed-controls button { flex: 1; max-width: 130px; height: 44px; min-height: 44px; padding: 8px; border-radius: 10px; }
  body.mode-flight .stage-top { top: max(8px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); }
  body.mode-flight .location-tag { font-size: 8px; padding: 7px 10px; letter-spacing: 1px; }
  body.mode-flight .best-tag { display: none; }
  body.mode-flight .round-button { width: 44px; height: 44px; }
  body.mode-flight[data-world] .flight-stage .flight-hud {
    top: calc(52px + env(safe-area-inset-top)) !important; left: max(10px, env(safe-area-inset-left)) !important;
    width: min(300px, calc(100% - 20px)) !important; max-width: calc(100% - 20px) !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 7px 10px !important;
    border-radius: 10px !important; box-shadow: none !important;
  }
  body.mode-flight[data-world] .flight-stage .flight-hud > div { padding: 0 10px !important; }
  body.mode-flight[data-world] .flight-stage .flight-hud > div > span { display: block; font-size: 9px !important; line-height: 12px; letter-spacing: .3px; white-space: nowrap; }
  body.mode-flight[data-world] .flight-stage .flight-hud b { font-size: 20px !important; margin-top: 3px; }
  body.mode-flight .flight-hud .score-detail { display: none; }
  body.mode-flight[data-world] .flight-stage .level-progress {
    top: calc(111px + env(safe-area-inset-top)) !important; left: max(10px, env(safe-area-inset-left)) !important;
    width: min(300px, calc(100% - 20px)); padding: 6px 10px; box-shadow: none;
  }
  body.mode-flight .level-progress > div { font-size: 9px; }
  body.mode-flight .steering-guide { display: none; }
  body.mode-flight[data-world] .flight-stage .turn-cue { top: calc(159px + env(safe-area-inset-top)) !important; left: 10px; padding: 6px 9px; font-size: 10px; }
  body.mode-flight .stage-bottom { display: none; }
  body.mode-flight .flight-ribbon { left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: 10px; }
  body.mode-flight .flight-energy { width: 112px; padding: 6px 8px; background: var(--flight-ui-surface); }
  body.mode-flight .flight-energy small { display: none; }
  body.mode-flight .health-readout { padding: 4px 0 0; margin: 3px 0 0; border-bottom: 0; }
  body.mode-flight .flight-ribbon > button { min-height: 44px; background: var(--flight-ui-surface); }
  body.mode-flight .game-overlay { overflow-y: auto; padding: 16px; }
  body.mode-flight .overlay-card { width: min(420px, 100%); max-height: calc(100% - 16px); overflow-y: auto; padding: 20px; }
}
@media (any-pointer: coarse) {
  body.mode-flight .flight-speed-controls { padding-right: calc(92px + env(safe-area-inset-right)); }
}
@media (max-height: 500px) {
  body.mode-flight[data-world] .flight-stage .flight-hud { width: 258px !important; }
  body.mode-flight[data-world] .flight-stage .level-progress { top: max(12px, env(safe-area-inset-top)) !important; left: 50% !important; width: min(240px, calc(50% - 68px)); }
  body.mode-flight[data-world] .flight-stage .turn-cue { top: calc(108px + env(safe-area-inset-top)) !important; }
  body.mode-flight .flight-energy { width: 190px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  body.mode-flight .flight-energy progress { grid-row: 2; margin: 0; }
  body.mode-flight .flight-energy .health-readout { grid-column: 2; grid-row: 1 / 3; border: 0; margin: 0; padding: 0; }
}
