/* Overlay the original controls rather than consuming canvas height. */
body.arena-playing .game-view.active.rc12-scene:not(.premium-active){inset:0!important;padding:0!important;gap:0!important;display:flex!important;justify-content:center;align-items:stretch}
body.arena-playing .rc12-scene:not(.premium-active)>.game-header{display:none!important}
body.arena-playing .rc12-scene:not(.premium-active)>.hud-bar{position:absolute;top:calc(48px + env(safe-area-inset-top));left:10px;right:10px;z-index:15;background:#122337aa;pointer-events:none}
body.arena-playing .rc12-scene>.canvas-center{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;margin:0!important;max-width:none!important}
body.arena-playing .rc12-scene>.canvas-center>canvas{max-width:100%!important;max-height:100%!important;object-fit:contain;width:min(100%,calc(var(--arena-vh,100dvh) * var(--rc12-ratio,1)))!important;height:auto!important;aspect-ratio:var(--rc12-ratio,1);border-radius:0!important}
body.arena-playing .rc12-overlay{position:absolute!important;bottom:calc(max(52px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom));left:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));right:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right));z-index:25;display:flex!important;justify-content:space-between;gap:6px;pointer-events:none;margin:0!important;background:transparent!important}
body.arena-playing .rc12-overlay button{pointer-events:auto;min-width:clamp(44px,var(--rc11-size,64px),95px);min-height:clamp(44px,var(--rc11-size,64px),95px);touch-action:none}
body.arena-playing .rc12-overlay.rc12-dual{position:absolute!important;inset:calc(93px + env(safe-area-inset-top)) calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right)) calc(max(52px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom)) calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));flex-direction:column-reverse;justify-content:space-between}
body.arena-playing .rc12-overlay.rc12-dual>div{background:transparent!important;pointer-events:none;display:flex!important;justify-content:space-between!important}
body.arena-playing .rc12-overlay.rc12-dual>div:last-child{transform:rotate(180deg)}
html[data-rc9-pad=transparent] .rc12-overlay{opacity:var(--rc11-opacity,.4)}html[data-rc9-pad=invisible] .rc12-overlay{opacity:0}
body.arena-playing:has(.game-view.active.rc12-scene) #turnBanner{display:none!important}
body.arena-playing #arenaMobileBar{background:#101e32b5;z-index:900;pointer-events:none}body.arena-playing #arenaMobileBar button{pointer-events:auto}
/* Preserve puzzle board dimensions without making a separate bottom control row. */

/* RC12 follow-up: board pieces and game controls remain within the game stage. */
.rc12-board-art{display:block;width:100%;height:100%;max-width:140px;max-height:140px;overflow:visible;pointer-events:none;filter:drop-shadow(0 3px 2px #0004)}
#memoryGrid .rc12-card,#bombGrid .rc12-chest{padding:3px!important;background:transparent!important;border:0!important;box-shadow:none!important;perspective:700px;aspect-ratio:1/1.1}
#memoryGrid .rc12-matched{filter:drop-shadow(0 0 8px #65d3a8)}
#memoryGrid,#bombGrid,#shipsGrid{padding:12px;border:3px solid #a47c4a;border-radius:12px;box-shadow:0 8px 0 #493624,inset 0 0 22px #0005;max-width:min(86vw,500px);margin:auto}
#memoryGrid{background:repeating-linear-gradient(8deg,#2c574c 0 3px,#2f5c50 3px 6px)}#bombGrid{background:repeating-linear-gradient(3deg,#6a452b 0 15px,#765037 16px 18px)}
#shipsGrid{background:linear-gradient(150deg,#2e7190,#174963);border-color:#8ebac8}#shipsGrid .cell-box{background:#ffffff12;border:1px solid #a5d9e150;aspect-ratio:1;position:relative}#shipsGrid .cell-box.safe{background:#234a60}
#game-c4 .c4-board{position:relative;overflow:hidden;background:linear-gradient(135deg,#346baf,#1b376b)!important;box-shadow:0 12px 0 #142a50,0 20px 18px #0008,inset 0 2px 0 #9bbdff;border:4px solid #517fb2}
#game-c4 .c4-cell{background:#102b4b;box-shadow:inset 0 5px 8px #0008;border-radius:50%;border:2px solid #6389be;position:relative}#game-c4 .c4-cell.p1{background:radial-gradient(circle at 35% 24%,#b9ebff,#3a9ddf 45%,#1e5a9c 75%);box-shadow:inset 0 -4px 0 #154a83,0 3px 4px #0005}#game-c4 .c4-cell.p2{background:radial-gradient(circle at 35% 24%,#ffc5bb,#e95e67 45%,#a52b41 75%);box-shadow:inset 0 -4px 0 #8e2538,0 3px 4px #0005}#game-c4 .rc12-winning{outline:4px solid #f9da70;outline-offset:-5px;z-index:1}
#diceFace{width:clamp(110px,28vw,180px);height:clamp(110px,28vw,180px);margin:16px auto!important;perspective:800px}#diceFace svg{max-width:none;max-height:none}
body.arena-playing .game-view.active .v9-stage{flex:1;min-height:0}body.arena-playing .game-view.active .v9-controls{left:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));right:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right));bottom:calc(var(--rc11-offset,56px) + env(safe-area-inset-bottom));}
body.arena-playing .v9-controls .v10-stick{width:var(--rc11-size,64px);height:var(--rc11-size,64px);min-width:var(--rc11-size,64px);opacity:1!important}html[data-rc9-pad=invisible] body.arena-playing .v9-controls{opacity:0!important}html[data-rc9-pad=transparent] body.arena-playing .v9-controls{opacity:var(--rc11-opacity,.4)!important}
body.arena-playing .game-view.active.rc12-board{inset:0!important;display:flex!important;justify-content:center;align-items:stretch;padding:calc(65px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom))!important;min-height:0;overflow:hidden}
body.arena-playing .rc12-board>.game-header{display:none!important}body.arena-playing .rc12-board>.hud-bar{position:absolute;top:calc(46px + env(safe-area-inset-top));left:8px;right:8px;z-index:10;margin:0}
@media (orientation:landscape) and (max-height:600px){#memoryGrid,#bombGrid,#shipsGrid{max-width:min(60vw,calc(100dvh - 100px));gap:4px;padding:5px}#game-c4 .c4-board{max-width:min(70vw,calc((100dvh - 100px)*1.18));margin:auto}.rc12-board-art{max-height:100%}}

body.arena-playing .rc12-scene .v9-help,body.arena-playing .rc12-scene .v8-keyhint{display:none!important}body.arena-playing .rc12-scene .v9-stage,body.arena-playing .rc12-scene .v8-stage{border:0!important;max-width:none!important;width:100%;height:100%;min-height:0;position:absolute;inset:0;overflow:hidden}body.arena-playing .rc12-scene #v9Mount,body.arena-playing .rc12-scene .v8-mount{position:absolute;inset:0}body.arena-playing .rc12-scene #v9ModelStatus{position:absolute;top:85px;left:10px;right:10px;z-index:5;pointer-events:none}body.arena-playing .rc12-scene .v9-controls,body.arena-playing .rc12-scene .v8-control{max-width:none!important;margin:0!important;z-index:30}body.arena-playing .rc12-scene .v9-controls [hidden]{display:none!important}body.arena-playing .v9-controls button[data-key]{min-width:var(--rc11-size,64px);min-height:var(--rc11-size,64px)}@media(pointer:coarse) and (orientation:portrait){body.arena-playing .v9-controls #v9P2:not([hidden]){position:absolute;top:calc(-100dvh + 200px + var(--rc11-offset,56px));left:0;right:0;transform:rotate(180deg);justify-content:space-between;pointer-events:none}body.arena-playing .v9-controls #v9P2:not([hidden]) button{pointer-events:auto}}

#shipsGrid.rc12-treasure{background:repeating-linear-gradient(20deg,#dbc38f 0 25px,#d4b87e 25px 26px);border-color:#946b3d}#shipsGrid.rc12-treasure .cell-box{background:#69432113;color:#493522;border-color:#9c773c80}#shipsGrid .cell-box:not([data-hit])::after{content:attr(aria-label);position:absolute;top:3px;left:4px;font-size:11px;color:#d2eff3}#shipsGrid.rc12-treasure .cell-box:not([data-hit])::after{color:#60432b}

#game-c4 .c4-cell.p1,#game-c4 .c4-cell.p2{background:#102b4b;box-shadow:inset 0 5px 8px #0008}#game-c4 .rc12-c4-disk{position:absolute;inset:4%;border-radius:50%;box-shadow:inset 0 -4px 0 #0004,0 3px 4px #0005;pointer-events:none}#game-c4 .p1 .rc12-c4-disk{background:radial-gradient(circle at 35% 24%,#b9ebff,#3a9ddf 45%,#1e5a9c 75%)}#game-c4 .p2 .rc12-c4-disk{background:radial-gradient(circle at 35% 24%,#ffc5bb,#e95e67 45%,#a52b41 75%)}

/* Position the v9 control plane against the stage, not the previous footer. */
body.arena-playing .rc12-scene .v9-stage>.v9-controls{position:absolute!important;inset:0!important;width:100%;display:block!important;pointer-events:none;opacity:1!important}
body.arena-playing .rc12-scene .v9-controls>.v9-pad,body.arena-playing .rc12-scene .v9-controls>.v10-stick{position:absolute;left:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));bottom:calc(max(65px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom));pointer-events:auto}
body.arena-playing .rc12-scene .v9-controls>.v9-act:not(#v9P2){position:absolute;right:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right));bottom:calc(max(65px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom));max-width:56%;pointer-events:none;flex-wrap:wrap}
body.arena-playing .rc12-scene .v9-controls>.v9-act button{pointer-events:auto}
body.arena-playing .rc12-scene .v9-controls>#v9P2:not([hidden]){position:absolute;top:calc(76px + env(safe-area-inset-top));left:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));right:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right));bottom:auto;justify-content:space-between!important;pointer-events:none;margin:0}
@media(pointer:coarse) and (orientation:portrait){body.arena-playing .rc12-scene .v9-controls>#v9P2:not([hidden]){transform:rotate(180deg)}}
html[data-rc9-pad=transparent] body.arena-playing .rc12-scene .v9-stage>.v9-controls>*{opacity:var(--rc11-opacity,.4)!important}
html[data-rc9-pad=invisible] body.arena-playing .rc12-scene .v9-stage>.v9-controls>*{opacity:0!important}

#shipsGrid.rc12-fleet{display:flex!important;flex-direction:column;gap:6px;width:min(94vw,calc((100dvh - 110px)*.92));max-width:580px;margin:auto;padding:8px;background:linear-gradient(150deg,#15394c,#24687b);border:3px solid #92b1b5;border-radius:14px;box-shadow:0 8px 0 #0b3445,inset 0 0 24px #143746} .fleet-status{text-align:center;font-weight:800;color:#e7f6f8;font-size:clamp(12px,2.7vw,17px)}.fleet-tools{display:flex;justify-content:center;flex-wrap:wrap;gap:5px}.fleet-tools button{padding:7px 9px;background:#174859;color:#fff;border:1px solid #95bfcb;border-radius:8px;touch-action:manipulation}.fleet-tools button:disabled{opacity:.35}.fleet-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}.fleet-cell{aspect-ratio:1;min-width:0;min-height:0;padding:0;border:1px solid #83a9b666;border-radius:4px;background:repeating-linear-gradient(170deg,#397f97 0 8px,#438aa0 9px 10px);color:#e0f5ff;font-size:clamp(9px,2.5vw,16px);touch-action:manipulation;cursor:pointer}.fleet-cell.ship{background:linear-gradient(#d7e7eb,#596f81 47%,#243c49 48%,#8295a1);color:#fff}.fleet-cell.hit{background:radial-gradient(#ffde93,#a34b3b);color:#fff}.fleet-cell.miss{background:#255668;color:#bcf4ff}.fleet-cell.sunk{background:#3c414c;color:#f5a68d}.fleet-cell.hit,.fleet-cell.sunk{animation:rc12-fleet-hit .35s ease-out}@keyframes rc12-fleet-hit{from{transform:scale(.6)}to{transform:scale(1)}}

/* TEST4: use the actual legacy viewport, and leave bottom-right badge clearance. */
body.arena-playing .rc12-scene .rc12-viewport{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;min-height:0!important;margin:0!important;border-radius:0!important;overflow:hidden}body.arena-playing .rc12-scene .rc12-viewport>canvas{display:block;width:100%!important;height:100%!important}body.arena-playing .rc12-bound-control{touch-action:none;min-width:clamp(44px,var(--rc11-size,64px),95px);min-height:clamp(44px,var(--rc11-size,64px),95px)}html[data-rc9-pad=transparent] body.arena-playing .rc12-viewport .rc12-bound-control{opacity:var(--rc11-opacity,.4)}html[data-rc9-pad=invisible] body.arena-playing .rc12-viewport .rc12-bound-control{opacity:0}
@media(pointer:coarse){body.arena-playing .rc12-scene .v9-controls>.v9-act:not(#v9P2),body.arena-playing .rc12-overlay{bottom:calc(max(104px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom))}}

/* Group A: actual legacy stage hosts, explicit original panels; no extra footer. */
body.arena-playing .rc12-legacy-stage>.v8-stage:has(.v8-mount[hidden]){background:transparent!important;pointer-events:none}
body.arena-playing .rc12-legacy-stage>.v8-stage:has(.v8-mount[hidden]) .v8-stage-caption button{pointer-events:auto}
body.arena-playing .rc12-legacy-stage>.rc12-explicit-panel{z-index:35;margin:0!important}
body.arena-playing .rc12-legacy-stage>.v8-control{position:absolute!important;inset:calc(90px + env(safe-area-inset-top)) calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right)) calc(max(104px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom)) calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left));display:flex;align-items:flex-end;justify-content:space-between;pointer-events:none;z-index:35;max-width:none!important;width:auto!important}
body.arena-playing .rc12-legacy-stage>.v8-control button{pointer-events:auto;min-width:var(--rc11-size,64px);min-height:var(--rc11-size,64px)}
body.arena-playing #game-pong .v8-control>.p2{align-self:flex-start;transform:rotate(180deg)}
body.arena-playing #game-bricks .v8-control{justify-content:center}
body.arena-playing .rc12-explicit-panel button{font-size:clamp(12px,2.6vw,17px);min-width:clamp(44px,var(--rc11-size,64px),95px);min-height:clamp(44px,var(--rc11-size,64px),95px)}
body.arena-playing .rc12-viewport :is(.vox-act-btn,#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){width:var(--rc11-size,64px)!important;min-width:44px;height:var(--rc11-size,64px)!important;min-height:44px;touch-action:none}
body.arena-playing .rc12-viewport :is(#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){left:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-left))!important;bottom:calc(max(65px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom))!important}
body.arena-playing .rc12-viewport :is(.vox-act-btn[style*="position:absolute"]){right:calc(var(--rc12-horizontal,12px) + env(safe-area-inset-right))!important;bottom:calc(max(104px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom))!important}
html[data-rc9-pad=transparent] body.arena-playing .rc12-viewport :is(.vox-act-btn,#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){opacity:var(--rc11-opacity,.4)}
html[data-rc9-pad=invisible] body.arena-playing .rc12-viewport :is(.vox-act-btn,#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){opacity:0}
body.arena-playing .rc12-board{justify-content:center;overflow:hidden;touch-action:manipulation}
body.arena-playing .rc12-board>.v8-exit{display:none!important}
body.arena-playing .rc12-board :is(.ttt-board,.sim-grid,#mxGrid){width:min(88vw,calc(var(--arena-vh,100dvh) - 115px),460px);max-width:none!important}

/* Uniform backing-buffer camera; these five real classic canvases now fill their scene. */
body.arena-playing .rc12-legacy-stage>canvas:is(#headballCanvas,#coopCanvas,#spaceCanvas,#bricksCanvas,#pongCanvas):not(.v8-original-hidden){width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;aspect-ratio:auto;object-fit:fill;touch-action:none}
body.arena-playing .rc12-scene .v9-controls>#v9P2:not([hidden]){top:calc(clamp(40px,var(--rc11-offset,56px),22dvh) + 20px + env(safe-area-inset-top))}
body.arena-playing .rc12-overlay.rc12-dual{top:calc(clamp(56px,var(--rc11-offset,56px),22dvh) + 28px + env(safe-area-inset-top))}

/* A3: direct board stage has independent HUD and measured available area. */
body.arena-playing .game-view.active.rc12-board-a3{display:flex!important;flex-direction:column!important;justify-content:stretch!important;padding:calc(55px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;gap:6px;box-sizing:border-box;overflow:hidden!important}
body.arena-playing .rc12-board-a3>.hud-bar{position:static!important;flex:0 0 auto;min-height:0;max-width:100%;font-size:clamp(11px,2.5vw,16px);flex-wrap:wrap;gap:4px;margin:0!important;padding:4px 8px!important}
.rc12-board-stage{flex:1 1 0;min-height:0;min-width:0;width:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:manipulation;--board-unit:56px}
body.arena-playing .rc12-board-stage :is(#bombGrid,#memoryGrid,#mxGrid,#shipsGrid:not(.rc12-fleet),#tttBoard,.sim-grid,#c4Board){width:calc(var(--board-unit)*4)!important;max-width:none!important;margin:0!important;padding:4px!important;gap:3px!important;box-sizing:border-box}
body.arena-playing .rc12-board-stage #c4Board{width:calc(var(--board-unit)*7)!important}body.arena-playing .rc12-board-stage #tttBoard{width:calc(var(--board-unit)*3)!important}body.arena-playing .rc12-board-stage .sim-grid{width:calc(var(--board-unit)*2)!important}
body.arena-playing .rc12-board-stage :is(.cell-box,.c4-cell,.ttt-cell,.sim-btn){min-width:0!important;min-height:0!important;height:auto!important;aspect-ratio:1;touch-action:manipulation}body.arena-playing .rc12-board-stage :is(.cell-box,.c4-cell,.ttt-cell,.sim-btn,button):focus-visible{outline:3px solid #fff5aa;outline-offset:-3px}
body.arena-playing .rc12-board-stage #shipsGrid.rc12-fleet{width:calc(var(--board-unit)*8)!important;max-width:none!important;margin:0!important;padding:4px!important;gap:3px!important}body.arena-playing .rc12-board-stage .fleet-tools button{padding:3px 6px;font-size:clamp(10px,2vw,15px)}
.rc12-board-stage[data-board=dice]>div,.rc12-board-stage[data-board=math]>div{width:min(100%,600px);padding:4px!important;max-height:100%;box-sizing:border-box}.rc12-board-stage #diceFace{font-size:clamp(32px,15dvh,92px)!important;margin-bottom:8px!important}.rc12-board-stage #diceFace svg{height:clamp(55px,35dvh,170px);width:auto}.rc12-board-stage #mathQuestion{font-size:clamp(18px,6dvh,36px)!important;margin-bottom:6px!important}.rc12-board-stage #mathOptions{max-width:none!important;gap:5px!important}.rc12-board-stage #mathOptions button{padding:clamp(4px,2dvh,16px)!important}.rc12-board-stage[data-board=dice] button{padding:clamp(5px,2dvh,14px) clamp(8px,3vw,22px)!important;white-space:normal}
@media(orientation:landscape) and (max-height:480px){.rc12-board-stage[data-board=dice]>div{display:flex;align-items:center;justify-content:center;gap:12px}.rc12-board-stage[data-board=math]>div{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px}.rc12-board-stage #diceFace{margin:0!important}.rc12-board-stage #mathQuestion{margin:0!important}}

#arenaPadBtn[hidden]{display:none!important}

/* A5: keep the second driver's steering separate from throttle in their own orientation. */
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2:not([hidden]){display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end!important;max-width:none}
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2 [data-key=ArrowLeft]{order:0}
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2 [data-key=ArrowRight]{order:1;margin-right:auto}
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2 [data-key=ArrowUp]{order:2;background:#256c45}
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2 [data-key=ArrowDown]{order:3;background:#9c3447}
body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2 [data-key=Enter]{order:4}
@media(pointer:coarse) and (max-width:480px){body.arena-playing #game-v9play[data-rc9-drive=true] #v9P2:not([hidden]) button{font-size:clamp(9px,2.8vw,13px);padding:5px;min-width:min(var(--rc11-size,64px),17vw)}}

/* A6: native actions and their actual containers use the shared control settings. */
body.arena-playing .rc12-viewport :is(#voxMobileUI,#voxActionBtns){pointer-events:none}
body.arena-playing .rc12-viewport :is(#voxJoyZone,.vox-act-btn){pointer-events:auto}
body.arena-playing .rc12-viewport .vox-act-btn{min-width:44px;min-height:44px}

/* A6 native overlay layout: resize the actual action clusters and keep thumb centers aligned. */
body.arena-playing .rc12-viewport{--native-pad-size:clamp(44px,var(--rc11-size,64px),min(95px,20vw));--native-pad-edge:clamp(4px,var(--rc12-horizontal,12px),12vw)}
body.arena-playing .rc12-viewport :is(.vox-act-btn,#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){width:var(--native-pad-size)!important;height:var(--native-pad-size)!important;min-width:44px!important;min-height:44px!important}
body.arena-playing .rc12-viewport :is(#voxJoyZone,#snpJoy,#tnkJoy,#tdJoy){left:calc(var(--native-pad-edge) + env(safe-area-inset-left))!important}
body.arena-playing .rc12-viewport :is(#voxJoyKnob,#snpKnob,#tnkKnob,#tdKnob){width:42%!important;height:42%!important;left:29%!important;top:29%!important;margin:0!important}
body.arena-playing .rc12-viewport > div:has(> .vox-act-btn),body.arena-playing #voxViewport .vox-mob-btns{position:absolute!important;right:calc(var(--native-pad-edge) + env(safe-area-inset-right))!important;bottom:calc(max(104px,var(--rc11-offset,56px)) + env(safe-area-inset-bottom))!important;max-width:58%;flex-wrap:wrap;justify-content:flex-end;pointer-events:none}
body.arena-playing .rc12-viewport .vox-act-btn{pointer-events:auto;font-size:clamp(10px,2.7vw,14px);line-height:1.1}
body.arena-playing #game-templerun3d #templeHost{position:absolute!important;inset:0!important;height:100%!important;width:100%!important;min-height:0!important;border-radius:0!important}
body.arena-playing #game-templerun3d>button{display:none!important}

/* E: projected physical cube and treasure relief. */
.rc12-dice-table{height:100%;width:100%;position:relative;overflow:hidden;background:radial-gradient(ellipse,#47775d,#183b34);border:4px solid #805a35;border-radius:16px;box-shadow:inset 0 0 18px #102920;box-sizing:border-box}.rc12-dice-camera{position:absolute;inset:0;display:grid;place-items:center;perspective:500px;transform:rotateX(-30deg);transform-style:preserve-3d}.rc12-dice-cube{--die-half:clamp(10px,2.6dvh,20px);width:calc(var(--die-half)*2);height:calc(var(--die-half)*2);position:relative;transform-style:preserve-3d}.rc12-dice-face{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:10%;gap:7%;background:linear-gradient(130deg,#fff9e6,#b9b4a4);border:1px solid #867f6c;border-radius:9%;backface-visibility:hidden;box-sizing:border-box}.rc12-dice-face i{border-radius:50%}.rc12-dice-face i.pip{background:#293846;box-shadow:inset 0 1px 2px #07121e}.rc12-goldburst{position:relative;overflow:visible!important}.rc12-goldburst:after{content:'✦ ● ✧ ● ✦';position:absolute;left:0;right:0;top:12%;color:#ffcf60;text-shadow:0 0 6px #fff3a1;pointer-events:none;animation:rc12gold .65s ease-out both}@keyframes rc12gold{from{transform:translateY(12px) scale(.4);opacity:1}to{transform:translateY(-35px) scale(1.3);opacity:0}}#shipsGrid.rc12-treasure{background:radial-gradient(ellipse at 30% 30%,#e8d6a1,#9c744c);border:5px solid #725236;box-shadow:inset 0 0 25px #71522a,0 5px 0 #493a30}.fleet-cell.rc12-sinking{animation:rc12sink .65s ease-out both}@keyframes rc12sink{0%{transform:translateY(-3px) rotate(-9deg);background:#c3844c;box-shadow:0 0 12px #f7c17a}100%{transform:none;opacity:.7}}

#shipsGrid.rc12-treasure{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Crect width='400' height='400' fill='%23b6d0cb'/%3E%3Cpath d='M27 52Q61 20 109 34T184 80Q206 120 175 153T201 225Q226 290 165 334T59 348Q2 317 23 254T17 160Q-8 91 27 52Z M276 53Q350 26 375 94T351 188Q300 211 279 164T276 53Z M286 265Q349 232 385 293T334 373Q264 380 286 265Z' fill='%23dcca91' stroke='%23a9854f' stroke-width='5'/%3E%3Cpath d='M46 76L113 115 91 195 173 257 135 314 M303 88L350 133 M307 305L351 338' fill='none' stroke='%23996e48' stroke-width='3' stroke-dasharray='7 8'/%3E%3Cpath d='M209 50v50m-25-25h50m-25-25 7 25-7 25-7-25Z' fill='%23677d76' stroke='%23596a5c'/%3E%3C/svg%3E");background-size:100% 100%}#shipsGrid.rc12-treasure .cell-box{background:#a37f4933;border-color:#81623a66}#shipsGrid.rc12-treasure .cell-box.safe{background:#bba65c55}.fleet-cell.ship,.fleet-cell.hit,.fleet-cell.sunk{position:relative}.fleet-cell.ship:after,.fleet-cell.hit:after,.fleet-cell.sunk:after{content:'';position:absolute;inset:19% 14%;border-radius:45% 45% 20% 20%;background:linear-gradient(90deg,#203c50 0 18%,#9eafb1 19% 36%,#e0d9be 37% 63%,#9eafb1 64% 81%,#203c50 82%);box-shadow:0 2px 3px #102635;pointer-events:none}.fleet-cell.hit:after{background:radial-gradient(circle at 45% 50%,#f6cb7d,#aa6a45 44%,#435363 46%)}.fleet-cell.sunk:after{opacity:.55;transform:rotate(-18deg) scale(.85);background:linear-gradient(90deg,#344b57,#65777b,#344b57)}

/* G1: native routes have a real top chrome boundary instead of overlaying the
   main title on the game's own status/control layer. Premium has its own chrome. */
html body.arena-playing .game-view.active.rc12-scene:not(.premium-active),
html body.arena-playing .game-view.active:has(.v9-stage,.v8-stage):not(.premium-active){
 inset:calc(44px + env(safe-area-inset-top,0px)) 0 0!important;height:auto!important;
}
html body.arena-playing .game-view.active.rc12-board-a3:not(.premium-active){
 inset:calc(44px + env(safe-area-inset-top,0px)) 0 0!important;padding-top:6px!important;height:auto!important;
}
body.arena-playing .rc12-scene:not(.premium-active)>.hud-bar,
body.arena-playing .rc12-scene:not(.premium-active) :is(.v9-hud,.v8-stage-caption){top:4px;z-index:15}
body.arena-playing .rc12-scene:not(.premium-active) :is(.rc12-overlay.rc12-dual,.rc12-legacy-stage>.v8-control){top:clamp(34px,8dvh,64px)}
body.arena-playing .rc12-scene:not(.premium-active) .v9-controls>#v9P2:not([hidden]){top:clamp(36px,9dvh,70px)}
body.arena-playing #arenaMobileBar{background:#11283d;pointer-events:auto}
body.arena-playing .game-view.active.premium-active{inset:0!important;height:auto!important}
body.arena-playing .premium-frame{position:absolute;inset:0;width:100%!important;height:100%!important;max-height:none!important;min-height:0!important;border:0!important;border-radius:0!important}
body.arena-playing:has(.game-view.active.premium-active) :is(#turnBanner,#arenaFullNotice),html:not(.rc12-g2-playing) body.arena-playing:has(.game-view.active.premium-active) #arenaMobileBar{display:none!important}
body.arena-playing:has(.game-view.active.rc12-board-a3) #turnBanner{display:none!important}

body.arena-playing .rc12-scene:not(.premium-active) :is(.rc12-overlay.rc12-dual,.rc12-legacy-stage>.v8-control){top:max(34px,calc(var(--rc12-hud-height,28px) + 12px))}
body.arena-playing .rc12-scene:not(.premium-active) .v9-controls>#v9P2:not([hidden]){top:max(36px,calc(var(--rc12-hud-height,28px) + 12px))}
