/* Touch play has a real camera viewport. Instrumentation and thumbs occupy
   their own rails, instead of covering a full-height portrait battle. */
@media(pointer:coarse) and (max-width:1100px){
 body.match-active{--battle-top:calc(114px + env(safe-area-inset-top));--battle-bottom:calc(170px + env(safe-area-inset-bottom));--battle-left:0px;--battle-right:0px;--score-top:calc(52px + env(safe-area-inset-top))}
 body.match-active .arena-wrap{background:#08121f}
 body.match-active #arena{top:var(--battle-top);left:var(--battle-left);right:var(--battle-right);bottom:var(--battle-bottom);width:calc(100% - var(--battle-left) - var(--battle-right));height:calc(100% - var(--battle-top) - var(--battle-bottom));object-fit:fill}
 body.match-active #hud{--mobile-player-count:2}
 body.match-active #hud[data-player-count='3']{--mobile-player-count:3}
 body.match-active #hud[data-player-count='4']{--mobile-player-count:4}
 body.match-active #hud .match-top{height:calc(48px + env(safe-area-inset-top));min-height:0;padding:calc(4px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));grid-template-columns:1fr 76px 1fr;gap:4px;background:#08121f;align-items:center}
 body.match-active #hud .match-tools{gap:4px}
 body.match-active #hud .match-tools button{height:44px;min-width:44px;padding:0 4px;font-size:9px;box-shadow:none}
 body.match-active #hud #exitmatch{width:50px}
 body.match-active #hud #pauseMatch{width:44px}
 body.match-active #hud #pauseMatch svg{width:20px;height:20px}
 body.match-active #hud #timer{min-width:0;width:76px;padding:4px 0;font-size:27px;line-height:1;border-width:1px;box-shadow:none;text-align:center}
 body.match-active #hud #matchLabel{padding:0;font-size:8px;letter-spacing:.03em;line-height:1.3;max-width:100px;overflow-wrap:anywhere}
 body.match-active #hud[data-player-count] .fighter-hud{top:var(--score-top);bottom:auto;left:calc(max(6px,env(safe-area-inset-left)) + var(--player-slot) * ((100% - max(6px,env(safe-area-inset-left)) - max(6px,env(safe-area-inset-right))) / var(--mobile-player-count)));right:auto;width:calc((100% - max(6px,env(safe-area-inset-left)) - max(6px,env(safe-area-inset-right))) / var(--mobile-player-count) - 4px);height:54px;min-height:0;min-width:0;display:block;padding:3px 6px 3px;border-bottom-width:2px;background:#13263be8;box-shadow:none;filter:none;overflow:hidden}
 body.match-active #hud .fighter-hud:before{display:none}
 body.match-active #hud .fighter-hud:after{width:2px}
 body.match-active #hud .hud-portrait{display:none}
 body.match-active #hud .hud-readout{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:27px 10px 7px;gap:1px 4px;align-items:center;height:46px}
 body.match-active #hud .hud-player{grid-column:1;grid-row:1;display:block}
 body.match-active #hud .hud-player>b{font-size:12px;line-height:1;padding:2px 3px;min-width:20px;display:block}
 body.match-active #hud .hud-player>span{display:none}
 body.match-active #hud .damage{grid-column:2;grid-row:1;justify-self:end;font-variant-numeric:tabular-nums;font-size:32px;line-height:.85;letter-spacing:-.025em;text-shadow:none}
 body.match-active #hud .damage small{font-size:13px;margin-left:1px}
 body.match-active #hud .hud-name{grid-column:1/-1;grid-row:2;margin:0;font-size:10px;line-height:1;letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.match-active #hud .hud-resources{grid-column:1/-1;grid-row:3;display:flex;flex-wrap:nowrap;min-height:0;height:7px;gap:4px}
 body.match-active #hud .stocks{flex-wrap:nowrap;gap:2px;min-height:0;height:7px;overflow:hidden}
 body.match-active #hud .stocks i{width:7px;height:7px;flex:0 0 7px}
 body.match-active #hud .hud-guard{flex:0 1 38px;min-width:16px;height:6px;gap:2px}
 body.match-active #hud .hud-guard>svg{width:6px;height:7px;flex-basis:6px}
 body.match-active #hud .guard-track{height:4px}
 body.match-active #hud .guard-label{display:none}
 body.match-active #hud[data-player-count='4'] .damage{font-size:25px}
 body.match-active #hud[data-player-count='4'] .hud-readout{column-gap:2px}
 body.match-active #hud[data-player-count='4'] .hud-player>b{font-size:10px;min-width:15px;padding:2px 1px}
 body.match-active #hud[data-player-count='4'] .damage small{font-size:10px}
 body.match-active #hud[data-player-count='4'] .fighter-hud{padding-left:4px;padding-right:4px}
 body.match-active #hud #netStatus{bottom:auto;top:calc(107px + env(safe-area-inset-top));line-height:1;font-size:6px;max-height:7px;overflow:hidden}
 body.match-active #touchControls{--control-size:44px;bottom:0;height:var(--battle-bottom);padding:0;background:#08121f;pointer-events:none}
 body.match-active #touchControls:before{display:none}
 body.match-active #touchControls .touch-stick{width:clamp(96px,26vw,112px);height:clamp(96px,26vw,112px);left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom))}
 body.match-active #touchControls .touch-actions{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:156px;height:144px}
 body.match-active #touchControls .touch-button{width:44px;height:44px;min-width:44px;min-height:44px;border-width:1px;box-shadow:0 2px 0 #030915,inset 0 1px #ffffff40}
 body.match-active #touchControls .touch-button span{font-size:18px}
 body.match-active #touchControls .touch-button small{font-size:6px;letter-spacing:.1px}
 body.match-active #touchControls .touch-button .action{width:18px;height:18px}
 body.match-active #touchControls .recover{right:104px;bottom:96px}
 body.match-active #touchControls .jump{right:52px;bottom:96px}
 body.match-active #touchControls .grab{right:0;bottom:96px}
 body.match-active #touchControls .smash{right:104px;bottom:48px}
 body.match-active #touchControls .shield{right:104px;bottom:0}
 body.match-active #touchControls .special{right:52px;bottom:0}
 body.match-active #touchControls .attack{right:0;bottom:26px;width:52px;height:62px}
 body.match-active #hud .combo-callout{bottom:auto;top:calc(var(--battle-top) + 8px);left:8px;right:auto;width:auto}
 body.match-active #hud .combo-callout.right{left:auto;right:8px}
 body.match-active #hud .combo-callout strong{font-size:22px}
 body.match-active #hud .combo-callout span{font-size:8px}
 body.match-active #hud .stock-banner{top:calc(var(--battle-top) + 4px);font-size:9px;padding:4px 10px}
 body.match-active #hud .battle-moment{top:calc(var(--battle-top) + 15%);font-size:32px}
 body.match-active #hud .match-intro{inset:var(--battle-top) 4% var(--battle-bottom);gap:6px}
 body.match-active #hud #announcer{top:calc(var(--battle-top) + (100% - var(--battle-top) - var(--battle-bottom)) * .5);font-size:48px}
 body.match-active #hud #announcer[data-cue='3'],body.match-active #hud #announcer[data-cue='2'],body.match-active #hud #announcer[data-cue='1']{top:calc(var(--battle-top) + (100% - var(--battle-top) - var(--battle-bottom)) * .72);font-size:42px}
}
@media(pointer:coarse) and (max-width:1100px) and (orientation:landscape){
 body.match-active{--battle-top:calc(108px + env(safe-area-inset-top));--battle-bottom:max(6px,env(safe-area-inset-bottom));--battle-left:calc(max(12px,env(safe-area-inset-left)) + 140px);--battle-right:calc(max(12px,env(safe-area-inset-right)) + 160px)}
 body.match-active #touchControls{height:156px;background:transparent}
 body.match-active #touchControls .touch-stick{width:104px;height:104px}
 body.match-active #hud .match-intro{left:var(--battle-left);right:var(--battle-right)}
}
/* Wide touch screens retain the fallback deck, including full-size utilities. */
@media(pointer:coarse) and (min-width:1101px){
 body.match-active #touchControls .grab,body.match-active #touchControls .recover{width:max(44px,calc(var(--control-size)*.7));height:max(44px,calc(var(--control-size)*.7))}
}
