/* Playgama mobile revision: one viewport, safe edges, independent thumb controls. */
:root {
 --safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);
 --safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);
 --viewport-height:100dvh;--viewport-width:100vw;
}
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
#app{position:fixed;left:var(--safe-left);top:var(--safe-top);width:calc(var(--viewport-width) - var(--safe-left) - var(--safe-right));height:calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom));overflow:hidden;isolation:isolate}
#app .arena{width:100%;height:100%;min-height:0;margin:0}
#preloader{padding:max(20px,var(--safe-top)) max(20px,var(--safe-right)) max(20px,var(--safe-bottom)) max(20px,var(--safe-left))}
.touch-instructions{display:none}
#app .touch-controls{display:none}
body[data-input="touch"]{user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
body[data-input="touch"] #app footer,
body[data-input="touch"] .desktop-instructions,
body[data-input="touch"] .move-label kbd,
body[data-input="touch"] #specialMeter{display:none!important}
body[data-input="touch"] .touch-instructions{display:block}
body[data-input="touch"][data-screen="playing"] header{display:none}
body[data-input="touch"] button,body[data-input="touch"] select{touch-action:manipulation}
body[data-input="touch"] #game{touch-action:none}
body[data-input="touch"] header{top:8px;right:12px;gap:8px}
body[data-input="touch"] header .utility{min-height:44px;padding:8px 12px;font-size:14px}
body[data-input="touch"][data-screen="playing"] #app .touch-controls{
 display:flex;position:absolute;inset:auto 14px 12px;align-items:flex-end;justify-content:space-between;
 height:auto;gap:16px;pointer-events:none;z-index:5;
 --pad:clamp(104px,28dvh,128px);--hit:clamp(56px,16dvh,64px);
}
.movement-controls{display:flex;flex:0 0 auto;align-items:center;flex-direction:column;gap:5px}
#moveStick{position:relative;display:grid;place-items:center;width:var(--pad);height:var(--pad);border-radius:50%;border:2px solid #d9dac980;background:radial-gradient(circle,#243740a6 0 30%,#08151ab8 31% 100%);box-shadow:inset 0 0 0 7px #d9dac90a,0 4px 18px #0004;pointer-events:auto;touch-action:none}
.stick-knob{display:block;width:44%;height:44%;border-radius:50%;background:radial-gradient(circle at 35% 28%,#e0d5ba,#a89c84);box-shadow:0 3px 9px #0007,inset 0 0 0 3px #26373b,inset 0 0 0 4px #bdae8e;pointer-events:none;will-change:transform}
.stick-direction{position:absolute;font:700 11px var(--copy);color:#e5dfc9b3;pointer-events:none}
.stick-direction.up{top:6px}.stick-direction.down{bottom:6px}.stick-direction.left{left:6px}.stick-direction.right{right:6px}
#moveStick.pressed{border-color:#eee2c7;background-color:#31495388}
.touch-caption{font:700 11px/1 var(--copy);letter-spacing:1.6px;color:#e3dfd1;text-shadow:0 2px 4px #000}
.touch-actions{display:grid;flex:0 0 auto;grid-template-columns:repeat(3,var(--hit));grid-template-rows:var(--hit) var(--hit);gap:8px;align-self:flex-end}
#app .touch-controls .touch-actions button{
 position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
 width:100%;height:100%;min-height:48px;min-width:48px;margin:0;padding:4px;
 background:linear-gradient(145deg,#30454dee,#15242df0);color:#f6ecdb;border:1px solid #a3adb19c;border-bottom:3px solid #050e14;
 border-radius:16px;box-shadow:inset 0 0 0 3px #07101538,0 3px 9px #0004;
 font:700 13px/1.1 var(--copy);letter-spacing:.1px;overflow-wrap:normal;
 pointer-events:auto;touch-action:none;transition:background .08s,border-color .08s;
}
#app .touch-controls .touch-actions button span{display:block;white-space:nowrap}
#app .touch-controls .touch-actions button small{font:700 9px/1.1 var(--copy);letter-spacing:.15px;color:#c2cbd0;white-space:nowrap}
#app .touch-controls .touch-actions .touch-special{grid-column:1;grid-row:1;border-color:#e6bd75;background:linear-gradient(145deg,#79572de8,#3b2a19ee);color:#ffdf9e!important}
#app .touch-controls .touch-actions .touch-special small{color:#ffdf9e}
#app .touch-controls .touch-actions .touch-special.recharging{border-color:#777b76;background:#253135ee;color:#a7b1b6!important}
#app .touch-controls .touch-actions .touch-guard{grid-column:2/4;grid-row:1;border-radius:18px;font-size:15px;background:linear-gradient(145deg,#4c666edb,#1c3039f0)}
#app .touch-controls .touch-actions .touch-guard small{font-size:10px}
#app .touch-controls .touch-actions button.pressed{background:#b14c36;border-color:#ffe2b8;color:#fff}
.ringside-camera .touch-controls *{pointer-events:none!important}
body[data-input="touch"] .hud{
 top:10px;left:12px;right:70px;transform:none;width:auto;max-width:none;
 display:grid;grid-template-columns:minmax(0,1fr) 76px minmax(0,1fr);gap:0;align-items:stretch;
}
body[data-input="touch"] .hud .fighter-info{width:auto;min-width:0;padding:6px 9px 5px;border-top-width:2px}
body[data-input="touch"] .hud .names{font-size:clamp(13px,2vw,19px);line-height:20px;gap:5px;white-space:nowrap;overflow-wrap:normal;min-width:0}
body[data-input="touch"] .hud .names>span{overflow:hidden;text-overflow:ellipsis;min-width:0}
body[data-input="touch"] .hud .names b{font-size:11px;flex-shrink:0}
body[data-input="touch"] .hud .health{height:5px;margin-top:3px}
body[data-input="touch"] .hud .stamina{height:3px;margin-top:4px}
body[data-input="touch"] .hud .tiny{font-size:10px;margin-top:3px;line-height:12px}
body[data-input="touch"] .hud .round{width:76px;min-width:0;padding:5px 3px;display:flex;flex-direction:column;justify-content:center}
body[data-input="touch"] .hud .round span{font:700 10px/1.15 var(--copy);max-width:none;white-space:normal;letter-spacing:0}
body[data-input="touch"] .hud .round strong{font-size:26px;line-height:1.15}
body[data-input="touch"] .hud .round small{display:block;font:700 9px/1.15 var(--copy);margin-top:2px}
body[data-input="touch"] .hud .round small:empty{display:none}
body[data-input="touch"] .combat-cue{top:calc(100% + 5px);font-size:11px;line-height:1.15;max-width:100%;white-space:normal;text-shadow:0 2px 3px #000}
body[data-input="touch"] #pause{top:10px;right:12px;width:48px;height:48px;min-width:48px;min-height:48px;z-index:6;border:1px solid #81949788;border-radius:12px;font:700 22px var(--copy);background:#14252de8}
body[data-input="touch"] #impact{left:154px;right:220px;bottom:42px;padding:0 4px;font:400 clamp(16px,2.3vw,26px)/1.15 var(--display);overflow-wrap:anywhere}
body[data-input="touch"] #toast{left:154px;right:220px;bottom:17px;padding:0 4px;font:700 12px/1.2 var(--copy);letter-spacing:0;overflow-wrap:anywhere}
body[data-input="touch"].ringside-camera #impact{left:12px;right:12px;bottom:22px}
body[data-input="touch"] .vignette{box-shadow:inset 0 0 100px 25px #03080b38}
body[data-input="touch"] #pausePanel .dialog{width:min(430px,100%)}
body[data-input="touch"] #pausePanel .dialog>button{min-height:48px;font-size:18px;margin-top:8px;padding:8px 40px}
body[data-input="touch"] .pause-utilities.touch-instructions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
body[data-input="touch"] #pausePanel .pause-utilities button{min-height:44px;margin:0;padding:8px;font-size:14px}
body[data-input="touch"] #bracketStart{min-height:46px}
body[data-input="touch"] #helpPanel .control-list{margin:0 0 12px;gap:0 18px}
body[data-input="touch"] #helpPanel .control-list>div{padding:9px 0;align-items:start}
body[data-input="touch"] #helpPanel .control-list dt{font-size:13px;flex:0 0 100px}
body[data-input="touch"] #helpPanel .control-list dd{font-size:14px;text-align:right;color:#efe2c6}
body[data-input="touch"] #helpPanel .help-copy p{font-size:15px;line-height:1.35}
body[data-input="touch"] #helpPanel #closeHelp{min-height:44px}
/* Menu targets keep their physical size; only catalogue/article content scrolls. */
body[data-input="touch"] #intro .main-menu{gap:8px;width:100%}
body[data-input="touch"] #intro .main-menu button{min-height:46px;height:46px;font-size:clamp(16px,2.5vw,24px);padding:8px 12px}
body[data-input="touch"] #intro .title-stack{padding:54px 18px 32px;margin:0;width:min(720px,100%);height:100%;max-height:100%;justify-content:center}
body[data-input="touch"] #intro .title-stack h1{width:100%;margin:0 0 10px}
body[data-input="touch"] #intro .main-menu{max-width:390px}
body[data-input="touch"] .studio-brand{font-size:12px;bottom:8px}
body[data-input="touch"] #selectPanel .back,body[data-input="touch"] #shopBack,body[data-input="touch"] #bracketBack{min-height:44px;padding:8px 0;font-size:15px}
body[data-input="touch"] #selectPanel #roster button{min-height:44px;padding:6px 9px}
body[data-input="touch"] #selectPanel #roster strong{font-size:14px;line-height:1.2}
body[data-input="touch"] #selectPanel .select-actions{gap:8px}
body[data-input="touch"] #selectPanel .select-actions select,body[data-input="touch"] #selectPanel .customize-link{min-height:44px;font-size:14px}
body[data-input="touch"] #selectPanel .select-actions #confirmFighter{min-height:48px;font-size:19px;padding:9px 16px 9px 38px}
body[data-input="touch"] #shopPanel .shop-heading{gap:12px;flex-wrap:nowrap}
body[data-input="touch"] #shopPanel .shop-heading h2{font-size:clamp(18px,3vw,27px)}
body[data-input="touch"] #shopBack{flex-basis:auto;flex-shrink:0}
body[data-input="touch"] #shopPanel .shop-tabs button{min-height:44px;font-size:13px;padding:7px 4px}
body[data-input="touch"] #shopPanel .shop-item{min-height:56px;padding:8px 4px}
body[data-input="touch"] #shopPanel .shop-item strong{font-size:14px}
body[data-input="touch"] #shopPanel .shop-purchase .primary{min-height:46px;font-size:17px;padding:8px 12px 8px 35px}
body[data-input="touch"] #end .result-actions button{min-height:46px;font-size:13px}
@media(orientation:landscape){
 body[data-input="touch"] #intro .title-stack{display:grid;grid-template-columns:1fr 1fr;gap:22px;padding-top:48px;padding-bottom:28px;align-items:center}
 body[data-input="touch"] #intro .title-stack h1 img{max-height:calc(var(--viewport-height) - 100px)}
 body[data-input="touch"] #selectPanel{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:6px 18px;padding:8px 14px;grid-template-areas:'heading details' 'preview details' 'roster actions'}
 body[data-input="touch"] #selectPanel .select-heading h2{font-size:clamp(17px,2.6vw,26px);margin:2px 0}
 body[data-input="touch"] #selectPanel .select-heading>span{display:none}
 body[data-input="touch"] #selectPanel .select-name h3{font-size:clamp(19px,3vw,30px);margin:4px 0}
 body[data-input="touch"] #selectPanel .fighter-details{align-self:center;background:none;border:0;overflow:auto;max-height:100%;gap:0;padding:0}
 body[data-input="touch"] #selectPanel .fighter-stats{display:none}
 body[data-input="touch"] #selectPanel .move-detail h3{font-size:20px;margin:5px 0}
 body[data-input="touch"] #selectPanel .move-detail p{font-size:15px;line-height:1.3;margin:4px 0 6px}
 body[data-input="touch"] #selectPanel .move-detail small,body[data-input="touch"] #selectPanel .move-label{font-size:12px}
 body[data-input="touch"] #selectPanel .select-actions .difficulty-label{font-size:0}
 body[data-input="touch"] #shopPanel{padding:8px 14px;gap:6px 20px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
 body[data-input="touch"] #shopPanel .shop-browser{background:#0a1724e8;padding:8px 12px;border-radius:8px}
 body[data-input="touch"] #shopPanel .shop-purchase{gap:3px;padding-top:4px}
}
@media(orientation:portrait){
 body[data-input="touch"][data-screen="playing"] #app .touch-controls{inset:auto 12px 14px;--pad:112px;--hit:56px}
 body[data-input="touch"] .hud{left:8px;right:62px;grid-template-columns:minmax(0,1fr) 62px minmax(0,1fr)}
 body[data-input="touch"] .hud .fighter-info{padding:5px 5px 4px}
 body[data-input="touch"] .hud .names{font-size:12px;line-height:20px}
 body[data-input="touch"] .hud .names b{display:none}
 body[data-input="touch"] .hud .round{width:62px}
 body[data-input="touch"] #pause{right:7px}
 body[data-input="touch"] #impact{left:12px;right:12px;bottom:185px;font-size:20px}
 body[data-input="touch"] #toast{left:12px;right:12px;bottom:158px;font-size:13px}
 body[data-input="touch"] #intro .title-stack h1 img{max-height:30dvh}
 body[data-input="touch"] #selectPanel{padding:8px 12px;gap:6px;grid-template-rows:auto minmax(30px,1fr) auto auto auto}
 body[data-input="touch"] #selectPanel .select-heading h2{font-size:19px}
 body[data-input="touch"] #selectPanel .select-name h3{font-size:24px}
 body[data-input="touch"] #selectPanel .fighter-details{padding:8px 10px}
 body[data-input="touch"] #selectPanel .move-detail p{font-size:15px}
 body[data-input="touch"] #shopPanel{padding:8px 12px;gap:8px;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(45px,18%) minmax(0,1fr);overflow:hidden}
 body[data-input="touch"] #shopPanel .shop-heading h2{font-size:19px}
 body[data-input="touch"] #shopPanel .shop-heading #wallet{font-size:16px}
 body[data-input="touch"] #shopPanel .shop-browser{background:#0a1724e8;padding:10px;border-radius:8px}
 body[data-input="touch"] #helpPanel .control-list{display:block}
 body[data-input="touch"] #bracketPanel{padding:8px 12px}
}
@media(max-width:370px) and (orientation:portrait){
 body[data-input="touch"][data-screen="playing"] #app .touch-controls{inset:auto 8px 12px;--pad:94px;--hit:50px;gap:8px}
 .touch-actions{gap:6px}
 #app .touch-controls .touch-actions button{font-size:12px}
 body[data-input="touch"] #selectPanel .move-detail h3{font-size:18px;margin:4px 0}
 body[data-input="touch"] #selectPanel .move-detail p{font-size:14px}
}
@media(max-height:560px) and (orientation:portrait){
 body[data-input="touch"] #selectPanel{grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:4px;padding-block:6px}
 body[data-input="touch"] #selectPanel .select-heading h2{font-size:17px;margin:0}
 body[data-input="touch"] #selectPanel .select-name{display:none}
 body[data-input="touch"] #selectPanel .fighter-details{padding:5px 8px}
 body[data-input="touch"] #selectPanel .move-detail h3{font-size:17px;margin:3px 0}
 body[data-input="touch"] #selectPanel .move-detail p{font-size:14px;line-height:1.2;margin-bottom:4px}
 body[data-input="touch"] #selectPanel .move-detail small{font-size:11px}
 body[data-input="touch"] #selectPanel .select-actions{gap:5px}
}
@media(max-height:330px) and (orientation:landscape){
 body[data-input="touch"] #intro .title-stack{padding:12px 16px 24px}
 body[data-input="touch"][data-screen="menu"] header{display:none}
 body[data-input="touch"] #intro .main-menu{gap:5px}
 body[data-input="touch"] #intro .main-menu button{min-height:44px;height:44px;font-size:16px}
 body[data-input="touch"] #selectPanel .select-name>span{display:none}
 body[data-input="touch"] #selectPanel .select-heading h2{font-size:17px}
 body[data-input="touch"] #selectPanel .move-detail p{font-size:14px}
 body[data-input="touch"] #selectPanel .move-detail h3{font-size:18px}
 body[data-input="touch"] #pausePanel .dialog{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;padding:10px}
 body[data-input="touch"] #pausePanel h2{grid-column:1/-1;font-size:23px;margin:0}
 body[data-input="touch"] #pausePanel .dialog>button{margin:0;font-size:15px;padding:8px}
 body[data-input="touch"] #pausePanel .pause-utilities{grid-column:1/-1;margin:0}
}
