/* Existing-system contract: native dark-metal/cyan controls, no new art or motion.
   Variance 2 / motion 1 / density 7. Flight > vitals > actions > status.
   Short landscape viewports use a single action dock and a two-column menu.
   Keep 44px physical touch targets at every supported HUD zoom; safe areas and
   scrolling must survive rotation, browser chrome and an open mission section. */
@media (orientation: landscape) and (max-height: 520px) {
 #menu .menu-inner {display:grid;grid-template-columns:minmax(0, .85fr) minmax(0,1.15fr);grid-template-rows:auto auto auto 1fr;align-items:start;column-gap:28px;row-gap:10px;width:100%;margin:0;padding:16px max(20px,env(safe-area-inset-right)) 16px max(20px,env(safe-area-inset-left));}
 #menu .title-block {grid-column:1;grid-row:1;}
 #menu .game-title {font-size:clamp(32px,5vw,46px);line-height:1.05;}
 #menu .subtitle {font-size:11px;margin-top:8px;letter-spacing:.13em;}
 #menu .menu-primary {grid-column:1;grid-row:2;width:100%;}
 #menu .menu-primary .mbtn {min-height:44px;padding:10px 12px;font-size:13px;}
 #menu .next-target {grid-column:1;grid-row:3;width:100%;padding:8px 10px;}
 #menu .nt-main {font-size:15px;}
 #menu .nt-sub,#menu .nt-label {font-size:11px;}
 #menu .menu-secondary {grid-column:2;grid-row:1 / 5;width:100%;gap:2px 12px;align-self:start;}
 #menu .menu-secondary .mbtn {min-height:44px;padding:8px 0;font-size:12px;letter-spacing:.04em;}
 #menu .menu-footer {grid-column:1;grid-row:4;width:100%;font-size:11px;gap:4px;margin:0;align-self:start;}
 #menu-scene::after {background:linear-gradient(90deg,#030910ed,#030910ba 70%,#03091065);}
 #hangar .panel {max-height:calc(100dvh - 16px);overflow-y:auto;margin-block:8px;flex-shrink:0;}
 #loadout {padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left));}
 #loadout .loadout-panel.hangar-ready {width:100%;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:12px;}
 .hangar-ready h2 {font-size:20px;letter-spacing:.12em;}
 .hangar-caption {margin:4px 0 8px;font-size:12px;}
 .hangar-ready .loadout-equipment {grid-template-columns:minmax(0,1.1fr) repeat(2,minmax(0,1fr));grid-template-rows:auto;gap:12px;margin-bottom:8px;}
 .hangar-ship,.hangar-weapon,.hangar-core {grid-row:1;grid-column:auto;}
 .hangar-ready .equipment-label {font-size:11px;margin-bottom:4px;}
 .hangar-ready .car-center,.hangar-ready .hangar-ship .car-center {display:grid;grid-template-columns:40% minmax(0,1fr);min-height:120px;gap:6px;text-align:left;padding:0;align-content:center;}
 #loadout .hangar-ready canvas.ship-mini,#loadout .hangar-ready .hangar-ship canvas.ship-mini {width:100%;max-width:108px;height:auto;margin:0;}
 .hangar-ready .car-name,.hangar-ready .hangar-ship .car-name {font-size:13px;line-height:1.3;letter-spacing:.03em;}
 .hangar-ready .car-sub,.hangar-ready .hangar-ship .car-sub {font-size:12px;line-height:1.4;margin-top:4px;}
 .hangar-item-status,.hangar-ready .hangar-ship .hangar-item-status {font-size:11px;line-height:1.3;margin:5px 0;}
 .hangar-ready .hangar-thumbnails {grid-template-columns:repeat(3,minmax(44px,1fr));gap:4px;margin-top:4px;padding-top:0;}
 .hangar-thumb {min-height:44px;padding:2px 2px 16px;}
 .hangar-thumb-art {width:30px;height:30px;}
 .hangar-thumb-lock {font-size:12px;bottom:2px;}
 .hangar-ready .loadout-actions {flex-wrap:nowrap;padding-top:8px;gap:8px;}
 .hangar-equipped {flex:1 1 0;gap:2px;}
 .hangar-equipped > span {font-size:10px;}
 .hangar-equipped strong {font-size:11px;line-height:1.3;}
 .hangar-ready #ld-launch {flex:0 1 140px!important;}
 .hangar-ready #ld-back,.hangar-ready #ld-launch,.hangar-ready #ld-practice {min-height:44px;padding:8px 12px;font-size:12px;}
 body.touch:not(.practicing) #hud-bottom {display:grid;grid-template-columns:minmax(0,1fr) calc(72px / var(--hud-scale,1));left:50%;transform:translateX(-50%);width:min(calc(460px / var(--hud-scale,1)),calc(100% - 180px / var(--hud-scale,1) - env(safe-area-inset-left) - env(safe-area-inset-right)));gap:3px;bottom:calc(5px + env(safe-area-inset-bottom));}
 body.touch:not(.practicing) #hud-bottom #onb-hint {grid-column:1 / -1;grid-row:1;max-width:100%;font-size:11px;padding:2px 4px;line-height:1.2;letter-spacing:0;}
 body.touch:not(.practicing) #combo-ready {grid-column:1 / -1;grid-row:2;font-size:11px;line-height:1.2;max-height:1.2em;}
 body.touch:not(.practicing) #ability-row {grid-column:1;grid-row:3;display:block;}
 body.touch:not(.practicing) .active-abilities {grid-template-columns:minmax(0,1fr) minmax(0,.8fr) minmax(0,1.4fr) minmax(0,1fr);gap:3px;}
 body.touch:not(.practicing) #ability-row .active-slot {height:calc(44px / var(--hud-scale,1));min-height:calc(44px / var(--hud-scale,1));min-width:calc(44px / var(--hud-scale,1));padding:2px;gap:1px;}
 body.touch:not(.practicing) .active-slot .ability-name {font-size:11px;margin:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;}
 body.touch:not(.practicing) .active-slot .ability-status {font-size:10px;letter-spacing:0;}
 body.touch:not(.practicing) .active-slot .ability-key,body.touch:not(.practicing) .active-slot canvas {display:none;}
 body.touch:not(.practicing) .passive-abilities {display:none;}
 body.touch:not(.practicing) #flight-footer {display:contents;}
 body.touch:not(.practicing) #ultimate-btn {grid-column:2;grid-row:3;height:calc(44px / var(--hud-scale,1));min-height:calc(44px / var(--hud-scale,1));min-width:44px;padding:2px;align-items:center;text-align:center;gap:1px;}
 body.touch:not(.practicing) #ultimate-btn svg {position:static;transform:none;width:16px;height:16px;}
 body.touch:not(.practicing) #ultimate-btn .ultimate-name {display:none;}
 body.touch:not(.practicing) #ultimate-status {font-size:10px;}
 body.touch:not(.practicing) #xp-wrap {grid-column:1 / -1;grid-row:4;}
 body.touch:not(.practicing) .xp-labels {display:none;}
 body.touch:not(.practicing) .xp-bar {height:3px;}
 body.touch #btn-pause {width:calc(44px / var(--hud-scale,1));height:calc(44px / var(--hud-scale,1));min-width:calc(44px / var(--hud-scale,1));min-height:calc(44px / var(--hud-scale,1));}
 body.touch #dash-btn {width:56px;height:56px;right:calc(10px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));font-size:12px;}
 body.touch:not(.practicing) #minimap {width:calc(48px / var(--hud-scale,1));height:calc(48px / var(--hud-scale,1));right:calc(14px + env(safe-area-inset-right));bottom:calc(84px + env(safe-area-inset-bottom));}
 #hud-tl {width:min(150px,22%);}
 #hud-tc {max-width:42%;}
 #timer {display:inline-block;font-size:16px;}
 #level-chip {font-size:11px;margin-left:6px;}
 #combat-rhythm {margin-top:2px;font-size:10px;}
 #mutbar {gap:3px;margin-top:2px;}
 .mutchip,.objchip {font-size:10px;letter-spacing:.04em;}
 #bossbar {width:100%;}
 #boss-name {letter-spacing:.1em;font-size:11px;}
 #announce {top:calc(76px + env(safe-area-inset-top));left:calc(14px + env(safe-area-inset-left));transform:none;width:min(170px,23%);align-items:flex-start;gap:3px;}
 #announce .ann {text-align:left;white-space:normal;overflow-wrap:anywhere;letter-spacing:.04em;font-size:12px;line-height:1.3;}
 #announce .ann.sub {font-size:11px;letter-spacing:0;}
}
