[hidden]{display:none!important}
html.arena-playing,body.arena-playing{height:100%;overflow:hidden!important;overscroll-behavior:none}
body.arena-playing .container{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;height:var(--arena-vh,100dvh);padding:0!important;margin:0!important;overflow:hidden;touch-action:none}
body.arena-playing .container>.top-bar,body.arena-playing .v8-toolbar,body.arena-playing #menuView{display:none!important}
body.arena-playing #turnBanner{display:block!important;margin:0 8px 4px;padding:6px 10px;font-size:14px;font-weight:800;line-height:1.25;text-align:center;border-radius:10px;flex:none}
#arenaMobileBar{position:fixed;top:0;left:0;right:0;z-index:900;box-sizing:border-box;display:flex;align-items:center;gap:5px;padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));background:#0b1425;height:calc(44px + env(safe-area-inset-top));color:#f1f5ff}
#arenaMobileTitle{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800;font-size:14px}
#arenaMobileBar button,#arenaPauseMenu button{background:#24364c;color:white;border:1px solid #546983;border-radius:9px;min-width:44px;min-height:40px;font:inherit;cursor:pointer}
body.arena-playing .game-view.active{position:absolute!important;inset:calc(44px + env(safe-area-inset-top)) 0 0!important;width:100%;height:auto;max-width:none;border:0;border-radius:0;box-shadow:none;padding:5px max(6px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:stretch;gap:4px;overflow:hidden;touch-action:none}
body.arena-playing .game-view.active .game-header{flex:0 0 auto;margin:0;padding:2px;gap:4px;justify-content:center}body.arena-playing .game-header h3{font-size:13px;margin:0}body.arena-playing .game-header .btn,body.arena-playing .game-header small,body.arena-playing .v9-help,body.arena-playing .v8-keyhint{font-size:11px}body.arena-playing .game-header .btn{padding:4px 7px}body.arena-playing .hud-bar{margin:0;padding:3px;font-size:12px}
body.arena-playing .game-view.active :is(#voxViewport,#snpViewport,#arcViewport,#varViewport,#obyViewport,#tnkViewport,#tdViewport,#mc3dContainer,#gta3dContainer,#tunnel3dContainer,#bowling3dContainer,#derby3dContainer,#templeHost){flex:1 1 0;min-height:0!important;height:auto!important;max-height:none!important;width:100%!important;border-radius:6px!important;overflow:hidden}
body.arena-playing .game-view.active :is(.v9-stage,.v8-stage){display:flex;flex-direction:column;flex:1 1 0;min-height:0;max-width:none;margin:0;width:100%;border-radius:6px}
body.arena-playing :is(#v9Mount,.v8-mount){flex:1 1 0;min-height:0;height:auto;width:100%;overflow:hidden}body.arena-playing :is(#v9Mount,.v8-mount) canvas{height:100%!important;width:100%!important;max-height:none!important;display:block}
body.arena-playing .v9-hud{flex:0 0 auto;min-height:0;padding:4px;font-size:11px}body.arena-playing .v8-stage-caption{flex:0 0 auto;padding:3px 6px}
body.arena-playing .canvas-center{flex:1 1 0;min-height:0;justify-content:center}body.arena-playing canvas.game-cv{object-fit:contain;max-height:100%;max-width:100%;height:auto;width:auto;min-height:0}
body.arena-playing :is(.v9-controls,.v8-control,.gta-pad,.mc-controls-grid){flex:0 0 auto;gap:4px;margin:0 auto;max-width:100%;justify-content:center}body.arena-playing :is(.v9-act,.v9-pad){gap:3px}body.arena-playing :is(.v9-act button,.v9-pad button,.v8-control .btn,.mc-key){min-height:32px;min-width:34px;font-size:11px;padding:4px 6px}body.arena-playing .v9-pad{grid-template-columns:repeat(3,34px)}body.arena-playing .v10-stick{width:var(--stick-size,76px);height:var(--stick-size,76px);opacity:var(--stick-opacity,.85)}body.arena-playing .v10-stick span{width:38%;height:38%}
body.arena-playing .game-view.active :is(.ttt-board,.c4-board,.sim-grid,.grid-4){width:min(90vw,calc(var(--arena-vh,100dvh)*.55),390px);margin:4px auto;gap:5px}body.arena-playing .v8-exit{display:none!important}body.arena-playing #game-templerun3d>button{display:none}
#arenaPauseMenu{position:fixed;inset:0;z-index:1001;background:#030812da;display:flex;align-items:center;justify-content:center;padding:12px;overscroll-behavior:contain}#arenaPauseMenu section{width:min(440px,100%);max-height:100%;overflow:auto;touch-action:pan-y;overscroll-behavior:contain;background:#101e32;color:white;border:1px solid #59718e;border-radius:14px;padding:12px;display:grid;gap:7px}#arenaPauseMenu h2{margin:0;font-size:18px}#arenaPauseMenu label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}#arenaPauseMenu input{width:48%;touch-action:pan-x}#arenaPauseMenu select{max-width:50%;background:#24364c;color:white}#arenaPauseMenu small{color:#f4c76c}
@media(pointer:coarse){body.arena-playing .v9-pad{display:none}body.arena-playing .v9-controls{justify-content:space-between;width:100%}body.arena-playing .v9-act{flex:1;justify-content:center}body.arena-playing .v9-act button{min-height:40px}body.arena-playing .v10-stick{display:block}}
@media(max-height:480px){body.arena-playing .v9-controls{position:absolute;bottom:max(7px,env(safe-area-inset-bottom));left:8px;right:8px;width:auto;pointer-events:none;justify-content:space-between}body.arena-playing .v9-controls>*{pointer-events:auto}body.arena-playing .v9-act{flex:0 1 auto}body.arena-playing .v9-act button{background:#16283bd9}body.arena-playing .v9-help{display:none}}
#arenaRotateHint{font-size:10px;color:#f4c76c;white-space:nowrap}

/* V12 turn banner has its own reserved row; no overlap with game or controls. */
body.arena-playing #turnBanner{position:absolute;top:calc(44px + env(safe-area-inset-top));left:0;right:0;height:30px;margin:0 6px!important;padding:5px 8px!important;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;z-index:104;box-sizing:border-box}
body.arena-playing .game-view.active{inset:calc(74px + env(safe-area-inset-top)) 0 0!important}

/* V12.1: explicit touch targets, physical gamepad status and editable pause controls. */
#arenaMobileBar button{flex:0 0 44px;touch-action:manipulation;pointer-events:auto;padding:0}
#arenaPadBtn[aria-pressed=true],#arenaPadMenu[aria-pressed=true]{background:#076f79;color:#fff}
#arenaPauseMenu :is(input,textarea,select){user-select:auto;-webkit-user-select:auto;-webkit-touch-callout:default}
@media(max-width:480px){#arenaRotateHint{display:none}#arenaMobileBar{gap:3px}#arenaMobileTitle{min-width:0;font-size:12px}}
/* Apply visual viewport offsets even before native fullscreen completes. */
body.arena-playing .container{top:var(--arena-screen-top,0px);left:var(--arena-screen-left,0px);right:auto;bottom:auto;width:var(--arena-screen-width,100vw)}
body.arena-playing #arenaMobileBar{top:var(--arena-screen-top,0px);left:var(--arena-screen-left,0px);right:auto;width:var(--arena-screen-width,100vw)}
