/* Narrow portrait uses the scene as the console, including resized desktop windows. */
.hud-pocket-readouts,#screen-play .mars-pause-utilities { display:none; }
@media (max-width:600px) and (orientation:portrait) {
 #game-frame { --console-width:0px;--console-height:0px;--pocket-edge: max(18px,env(safe-area-inset-left));--pocket-right:max(18px,env(safe-area-inset-right));--pocket-bottom:max(24px,env(safe-area-inset-bottom));--pocket-action:clamp(48px,16vw,64px);--pocket-pad:clamp(52px,18vw,72px); }
 .mars-viewport { inset:10px; border-radius:20px; }
 #game-frame.is-arriving .mars-viewport { border-radius:0; }
 #game-frame:not(.is-arriving)::after { content:'';position:absolute;inset:0;z-index:18;border:24px solid transparent;border-image:url('art/hud-metal-frame-v1.webp') 220 stretch;pointer-events:none; }
 .mars-console { inset:0;width:100%;height:100%;padding:0;background:none;box-shadow:none;pointer-events:none; }
 .mars-console::before { display:none; }
 .hud-mission { inset:max(27px,env(safe-area-inset-top)) var(--pocket-right) auto var(--pocket-edge);width:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(78px,26vw,104px);gap:clamp(12px,5vw,24px);align-items:start; }
 .hud-mission-readouts { display:grid;grid-template-columns:1fr 1fr;height:42px;min-height:0;border:0;border-radius:12px 12px 0 0;background:#050d17e8;box-shadow:inset 0 1px #95b4c333,0 2px 8px #0005; }
 .hud-instrument { justify-content:center;flex-wrap:nowrap;gap:3px;padding:5px 3px; }
 .hud-instrument + .hud-instrument { border:0; }
 .hud-instrument strong,.hud-crew strong { font-size:clamp(18px,5.8vw,24px); }
 .hud-depth > svg { width:16px;height:19px;flex-shrink:0;color:#bfd3df; }
 .hud-crew svg { width:14px;height:22px;fill:#c2d5e1; }
 .hud-crew > div { gap:4px; }
 .hud-map-button { width:100%;height:clamp(82px,27vw,108px);min-height:0;margin:0;padding:5px;border:2px solid #71818c;border-radius:12px;background:#050b12db; }
 .hud-map-button canvas { inset:5px;width:calc(100% - 10px);height:calc(100% - 10px); }
 .hud-map-button > span { font-size:0;padding:0; }
 .hud-map-button > span::after { content:'▣';position:absolute;right:0;bottom:calc(clamp(82px,27vw,108px) - 24px);font-size:15px;color:#b9cdda; }
 .hud-map-button kbd { display:none; }
 .hud-location { display:none; }
 .hud-pocket-readouts { position:absolute;left:var(--pocket-edge);right:calc(var(--pocket-right) + clamp(78px,26vw,104px) + clamp(12px,5vw,24px));top:calc(max(27px,env(safe-area-inset-top)) + 42px);height:29px;box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:0 9px 3px;border-radius:0 0 12px 12px;background:#050d17e8;color:#c8d9e7;font:800 clamp(11px,4vw,15px)/1 Arial,sans-serif; }
 .hud-pocket-readouts > span { display:flex;align-items:center;gap:5px;white-space:nowrap; }
 .hud-pocket-readouts svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2; }
 .hud-pocket-readouts .pocket-extra { font-size:10px;color:#e5c592; }
 .hud-pocket-readouts [hidden] { display:none; }
 .hud-vitals { top:calc(max(27px,env(safe-area-inset-top)) + 75px);left:calc(var(--pocket-edge) + 3px);width:calc(100% - var(--pocket-edge) - var(--pocket-right) - clamp(78px,26vw,104px) - clamp(12px,5vw,24px) - 6px);gap:0; }
 .hud-portrait,.hud-jet-row > svg,.hud-jet-label,.hud-health-number { display:none; }
 .hud-vital-bars { flex:1;min-width:0; }
 .hud-hearts { height:14px;gap:1px;align-items:center; }
 .hud-heart { width:14px;height:14px; }
 .hud-life-readout { flex:1;align-items:flex-end; }
 #hud-lives { font-size:7px; }
 .hud-jet-row { margin-top:3px;gap:0; }
 .hud-jet { height:4px;padding:0;border-width:1px;background:#071119;box-shadow:0 1px 4px #000; }
 .hud-radiation { top:calc(max(27px,env(safe-area-inset-top)) + 101px);left:var(--pocket-edge); }
 .mars-console .mars-fps { display:none; }
 #screen-play #game-frame > .game-controls,#screen-play #game-frame > .game-controls.game-controls-share { top:calc(max(27px,env(safe-area-inset-top)) + clamp(82px,27vw,108px) + 8px);right:var(--pocket-right);gap:6px;flex-direction:column; }
 #screen-play #game-frame > .game-controls #btn-pause { order:0; }
 #screen-play #game-frame > .game-controls #btn-mute { order:1; }
 #screen-play #game-frame > .game-controls #btn-master-mute { order:2; }
 #screen-play #game-frame > .game-controls > button { width:44px;height:44px;min-height:44px;flex-basis:44px;padding:11px;border-radius:50%;background:#07131ad9; }
 .mars-console .mars-touch { position:absolute;inset:0;margin:0;padding:0;height:100%;display:block;pointer-events:none; }
 .mars-console .movement-buttons { position:absolute;top:auto;left:var(--pocket-edge);bottom:var(--pocket-bottom);display:grid;grid-template-columns:repeat(2,var(--pocket-pad));grid-template-rows:repeat(2,var(--pocket-pad));gap:clamp(8px,3vw,14px); }
 .mars-console .movement-buttons button { width:var(--pocket-pad);height:var(--pocket-pad);min-height:48px;font-size:clamp(24px,7vw,31px);border-radius:15px;border:2px solid #71818a;background:linear-gradient(145deg,#25374445,#050c1566);box-shadow:inset 0 0 0 2px #050a1040,0 2px 7px #0004;color:#d0deeb; }
 .mars-console .movement-buttons [data-action="left"] { grid-column:1;grid-row:1; }
 .mars-console .movement-buttons [data-action="drop"] { grid-column:1 / 3;grid-row:2;justify-self:center;width:var(--pocket-pad);height:var(--pocket-pad);border-color:#ff9b32;color:#fff3e1;background:linear-gradient(145deg,#46312340,#0a101866);box-shadow:inset 0 0 0 2px #21140e40,0 0 10px #ff8a2840; }
 .mars-console .movement-buttons [data-action="drop"] svg { width:34px;height:34px;stroke-width:4; }
 .movement-buttons [data-action="drop"] .drop-floor { display:none; }
 .mars-console .movement-buttons [data-action="right"] { grid-column:2;grid-row:1; }
 .mars-console .action-buttons { position:absolute;inset:auto var(--pocket-right) var(--pocket-bottom) auto;display:flex;flex-direction:column;width:var(--pocket-action);height:auto;gap:8px; }
 .mars-console .action-buttons > button { position:relative;inset:auto;flex:none;width:var(--pocket-action);height:var(--pocket-action);min-width:48px;min-height:48px;margin:0;padding:4px;border:2px solid #72838d;border-radius:50%;background:linear-gradient(145deg,#192c3845,#040b1366);box-shadow:inset 0 0 0 2px #040b1140,0 2px 6px #0004; }
 .mars-console .mars-touch button.pressed,.mars-console .mars-touch button:active { background:linear-gradient(145deg,#38556599,#091923aa);border-color:#c4edf2; }
 .mars-console .equipment-card::before,.mars-console .equipment-card::after { display:none; }
 .mars-console [data-action="jump"] { order:2;display:flex;justify-content:center;align-items:center; }
 .mars-console [data-action="jump"] svg.jetpack-icon { width:38px;height:40px; }
 .mars-console [data-action="jump"] span,.mars-console .portrait-weapon-label,.mars-console .equipment-title,.mars-console .action-buttons kbd { display:none; }
 .mars-console [data-action="fire"] { order:3;display:flex;justify-content:center; }
 .mars-console [data-action="fire"] .hud-art { position:absolute;top:7px;width:38px;max-width:38px;height:20px;flex-basis:20px; }
 .mars-console [data-action="fire"] .equipment-title { display:none; }
 .mars-console [data-action="fire"] .equipment-amount { position:absolute;bottom:7px;font-size:18px;line-height:18px; }
 .mars-console [data-action="fire"] .hud-laser { left:10px;right:10px;bottom:3px;height:2px; }
 .mars-console [data-action="interact"] { order:0;display:flex;justify-content:center;align-items:center;gap:0; }
 .mars-console [data-action="interact"].is-grenade .hud-context-grenade { display:block;position:absolute;top:5px;width:23px;max-width:23px;height:25px;flex-basis:25px; }
 .mars-console [data-action="interact"] .equipment-status { font-size:9px;line-height:12px;overflow-wrap:anywhere;color:#acede9; }
 .mars-console [data-action="interact"].is-grenade .equipment-status { position:absolute;bottom:5px;font-size:17px;line-height:17px; }
 .mars-console [data-action="interact"]:not(.is-grenade) .equipment-title { display:block;position:static;white-space:normal;font-size:8px;line-height:10px;text-align:center; }
 .mars-console [data-action="interact"]:not(.is-grenade) { flex-direction:column;gap:3px;border-color:#a0e3d5; }
 .mars-console [data-action="grenade"] { display:none; }
 .mars-console .weapon-switch { order:1;display:flex;align-items:center;justify-content:center; }
 .mars-console .portrait-weapon-icon { font-size:29px; }
 #game-frame.has-mission-notice .mars-touch { visibility:hidden; }
 #screen-play .mars-pause-utilities { position:static;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;transform:none;padding:12px 0 0;gap:8px;background:none;border:0; }
 #screen-play .mars-pause-utilities > button { width:44px;height:44px;min-height:44px;flex-basis:44px;border-radius:8px; }
 .mars-tutorial-panel { top:calc(max(27px,env(safe-area-inset-top)) - 19px);bottom:auto;width:calc(100% - var(--pocket-action) - var(--pocket-right) - 28px); }
 html.mars-training .hud-mission-readouts,html.mars-training .hud-pocket-readouts,html.mars-training .hud-radiation { visibility:hidden; }
}
