/* Phone touch layer (mobile-touch.js; owner 2026-11-07). Everything here sits under html.mt-phone, which only a touch phone
   (shorter side <= 500 px) gets, so pad, keyboard, mouse, tablets and desktops are untouched. */
:root{--mt-env-top:env(safe-area-inset-top,0px);--mt-env-right:env(safe-area-inset-right,0px);--mt-env-bottom:env(safe-area-inset-bottom,0px);--mt-env-left:env(safe-area-inset-left,0px)}
#mt-more,#mt-more-sheet{display:none}
html.mt-phone #mt-more:not([hidden]){display:flex;align-items:center;justify-content:center;position:fixed;z-index:60;left:50%;translate:-50% 0;
 bottom:calc(var(--mt-env-bottom) + var(--mt-more-bottom,14px));min-width:76px;height:44px;padding:0 14px;box-sizing:border-box;border:2px solid #f0c05a;border-radius:22px;
 background:#0b1a2ee6;color:#fff3d6;font:400 14px/1 var(--ui-body,monospace);letter-spacing:.02em;touch-action:manipulation;cursor:pointer}
html.mt-phone.mt-more-open #mt-more{display:none}
/* r34pre8 (r34pre6 known issue: a tip's "Got it" on the loading card sat under More at 360x640): More steps aside the moment the
   loading card comes up, not at mobile-touch.js's next layout frame (blocked() hides it there too) */
html.mt-phone body.shell-loading #mt-more{display:none}
/* r23pre2 LOW: phone landscape, More sat over the Pets dialog's Close button; the dialog has its own Close */
html.mt-phone:has(#hub-pets-picker) #mt-more{display:none}
html.mt-phone #mt-more-sheet:not([hidden]){display:block;position:fixed;inset:0;z-index:1;background:#0410208c}
html.mt-phone .mt-sheet-bar{position:absolute;left:50%;translate:-50% 0;top:calc(var(--mt-env-top) + 96px);display:flex;align-items:center;gap:12px;padding:6px 8px 6px 14px;
 border:2px solid #f0c05a;border-radius:12px;background:#0b1a2ef2;color:#fff3d6;font:400 14px/1.2 var(--ui-body,monospace);z-index:61;white-space:nowrap}
html.mt-phone .mt-sheet-bar button,html.mt-phone .mt-extra{min-height:44px;min-width:64px;padding:0 12px;border:2px solid #f0c05a;border-radius:10px;background:#183054;color:#fff3d6;font:inherit;font-size:14px}
html.mt-phone .mt-sheet-extra{position:absolute;left:50%;translate:-50% 0;top:calc(var(--mt-env-top) + 160px);display:flex;gap:10px;z-index:61}
html.mt-phone.mt-landscape .mt-sheet-bar{top:calc(var(--mt-env-top) + 64px)}
html.mt-phone.mt-landscape .mt-sheet-extra{top:calc(var(--mt-env-top) + 124px)}

/* advanced controls wait behind More: extra context chips, the weapon hotbar, Score / Map / View */
html.mt-phone:not(.mt-more-open) [data-mt-more]{display:none!important}
html.mt-phone:not(.mt-more-open):is([data-mt-mode=battle],[data-mt-mode=conquest],[data-mt-mode=lastlight]) #hud-hotbar,
html.mt-phone:not(.mt-more-open):is([data-mt-mode=battle],[data-mt-mode=conquest],[data-mt-mode=lastlight]) #match-hud .h2-hot,
html.mt-phone:not(.mt-more-open):is([data-mt-mode=battle],[data-mt-mode=conquest],[data-mt-mode=lastlight]) #match-hud .h2-sys button:not([data-act=menu]),
html.mt-phone:not(.mt-more-open)[data-mt-mode=speedway] #speedway-hud .h2-sys button:not([data-act=menu]),
html.mt-phone:not(.mt-more-open):is([data-mt-mode=battle],[data-mt-mode=lastlight]) #overview{display:none!important}
html.mt-phone.mt-more-open #hud-hotbar,html.mt-phone.mt-more-open #match-hud .h2-hot{z-index:62}

/* the three context buttons read as one cluster: the same tile size, never below 44 px, labels at 12 px or more */
html.mt-phone [data-mt]{min-width:48px;min-height:48px}
html.mt-phone [data-mt] :is(small,span,i,b){font-size:max(12px,1em)}

/* Speedway: the steer stick on the left, Boost on the right, More between them */
html.mt-phone .sw-pad .sw-stick{display:block}
html.mt-phone[data-mt-mode=speedway]{--mt-more-bottom:62px}

/* HUD readability in both orientations: keep fixed HUD layers inside the safe area. The MOVE pad (its footer) and FIRE
   already take the inset in their own offsets (style.css, battle.css, conquest.css): no second inset here (r29 LOW-23) */
html.mt-phone body{padding:0}
/* Conquest: the squad bar waits behind More (the chips' first action stays as the special) */
html.mt-phone:not(.mt-more-open)[data-mt-mode=conquest] #conquest-hud .cq-squads{display:none!important}
html.mt-phone.mt-more-open[data-mt-mode=conquest] #conquest-hud .cq-squads{z-index:62}
/* Aerie Plaza: Sparring, People, Servers and the camera turn wait behind More; the stick walks, the signs take taps */
html.mt-phone:not(.mt-more-open)[data-mt-mode=plaza] :is(#hub-spar,#hub-people,#hub-servers,.compass){display:none!important}
html.mt-phone.mt-more-open[data-mt-mode=plaza] :is(#hub-spar,#hub-people,#hub-servers,.compass){z-index:62}
html.mt-phone body:is(.mode-hub,.shell-title,.shell-lobby) #defense-panel{display:none}
/* Beauty Pageant build: the dock keeps its catalog; tools and the long hint wait behind More (tap-to-place needs neither:
   tap a piece, tap the plot; a two-finger twist turns it). More sits beside the plot arrows, clear of the dock. */
html.mt-phone:not(.mt-more-open)[data-mt-mode=pageant] #pageant-place :is(.pp-tools,.pp-hint){display:none!important}
html.mt-phone[data-mt-mode=pageant] #mt-more:not([hidden]){left:auto;translate:none;right:calc(var(--mt-env-right) + 8px);bottom:auto;top:calc(var(--mt-env-top) + 204px)}
html.mt-phone.mt-landscape[data-mt-mode=pageant] #mt-more:not([hidden]){top:auto;bottom:calc(var(--mt-env-bottom) + 160px)}
/* portrait: the theme cards start under the roster row, and eight roster heads fit a 360 px screen */
html.mt-phone.mt-portrait body.in-pageant .h2-themes{top:calc(var(--h2-pad,8px) + 200px)!important}
html.mt-phone.mt-portrait body.in-pageant .h2-roster{gap:0!important}
html.mt-phone.mt-portrait body.in-pageant .h2-rp .face{width:30px!important;height:30px!important;padding:2px!important}
/* toasts ride over the bottom controls on a phone: the words pass taps through, only their own buttons take them */
html.mt-phone :is(.cu-toasts,.cu-toast){pointer-events:none}
html.mt-phone .cu-toast :is(button,a[href]){pointer-events:auto}
/* r22pre3 LOW (phone plaza, landscape): the bottom message box sat under the More button; it now ends above it */
html.mt-phone.mt-landscape body.mode-hub:not(.in-battle) #message{bottom:calc(var(--mt-env-bottom) + var(--mt-more-bottom,14px) + 52px);top:auto}
/* r24 (r23pre4 LOW): on a landscape phone the toasts covered the bottom of the Pets dialog. While it is open the dialog
   sits on the left and the toasts stack top right, beside it */
html.mt-landscape:has(#hub-pets-picker) #hub-pets-picker{left:calc(8px + env(safe-area-inset-left,0px));transform:translateY(-50%);max-width:calc(60vw - 16px)}
html.mt-landscape:has(#hub-pets-picker) .cu-toasts{left:auto;right:calc(8px + env(safe-area-inset-right,0px));top:calc(8px + env(safe-area-inset-top,0px));bottom:auto;translate:none;width:auto;max-width:calc(40vw - 16px)}
html.mt-landscape:has(#hub-pets-picker) .cu-toast{box-sizing:border-box;max-width:100%}
