/* Shared controller shell. Portrait follows the board; landscape packs tools
   and controls into the space left by a board fitted to the whole viewport. */
.arcade-page .iatpm-pad-action-zone{display:flex;flex-direction:column;justify-content:center;gap:6px;min-width:0;width:100%;position:relative;grid-column:2;grid-row:1/-1}
.arcade-page .iatpm-pad-action-zone :is(.iatpm-pad-actions,.iatpm-pad-extras){padding:0;margin:0}
.arcade-page .pad-meta{display:contents}
.arcade-page .pad-layout-button{display:none}
.arcade-page .pad-lobby-adjust{display:none}
.arcade-page .has-pad-layout.is-expanded .pad-lobby-adjust{display:block;min-height:44px;touch-action:manipulation}
.arcade-page .has-pad-layout.is-expanded .pad-lobby-adjust:focus-visible{outline:3px solid currentColor;outline-offset:3px}
.arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay{position:absolute!important;inset:var(--pad-lobby-top,44px) 0 0!important;z-index:20;box-sizing:border-box;padding:12px!important;align-items:safe center;overflow:auto}
.arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket){margin-block:auto}
@media(max-height:600px){
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px;width:min(380px,100%);flex-basis:auto;padding:14px 18px;transform:none}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket)>:not(button){grid-column:1/-1}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket)>h2{font-size:clamp(32px,11dvh,48px);line-height:.95;margin:4px 0}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket)>p{font-size:10px;line-height:1.35;margin:0 0 4px}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay>:is(.tumble-menu,.oven-ticket,.quest-ticket,.cf-ticket)>button{grid-column:auto;width:100%;min-height:44px;margin:0;padding:8px 4px;font-size:10px;line-height:1.3}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay .oven-ticket-rule{padding:3px 0;margin:0;font-size:9px;line-height:1.3}
 .arcade-page .has-pad-layout.is-expanded .pad-lobby-overlay :is(.tumble-menu-foot,.quest-ticket-foot,small){margin:2px 0 0;font-size:7px;line-height:1.3}
}
.arcade-page .has-pad-layout .pad-drag-handle{display:none}
@media(pointer:coarse){.arcade-page .has-pad-layout .pad-layout-button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:2px 4px;gap:2px;font:700 9px/1.15 var(--body)}}
.arcade-page .pad-layout-button b{font:normal 19px/1 var(--body)}
.arcade-page dialog.pad-layout-dialog{position:fixed;box-sizing:border-box;width:min(380px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px);margin:auto;padding:22px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);font:14px/1.5 var(--body);overflow:auto;z-index:60;box-shadow:0 18px 80px #0005}
.arcade-page dialog.pad-layout-dialog::backdrop{background:#10241dba;backdrop-filter:blur(5px)}
.arcade-page dialog.pad-layout-dialog h2{font:900 30px/1.1 var(--display);margin:0 0 20px}
.arcade-page dialog.pad-layout-dialog h3{font:700 13px/1.4 var(--body);margin:18px 0 6px}
.arcade-page dialog.pad-layout-dialog p{font:13px/1.5 var(--body);margin:8px 0 12px;color:var(--muted)}
.pad-layout-dialog fieldset{border:0;margin:0;padding:0;min-width:0}
.pad-layout-dialog legend{font-weight:700;margin-bottom:8px}
.pad-layout-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.pad-layout-choices label{display:grid;grid-template-columns:16px minmax(0,1fr);align-content:center;align-items:center;gap:2px 7px;min-height:56px;padding:6px;border:1px solid var(--line);border-radius:6px;cursor:pointer;font:700 12px/1.3 var(--body)}
.pad-layout-choices input{grid-column:1;grid-row:1/3}
.pad-layout-choices small{grid-column:2;font:10px/1.3 var(--body);color:var(--muted)}
.pad-layout-choices label:has(:checked){border:2px solid var(--accent);background:var(--soft)}
.pad-layout-choices input{accent-color:var(--accent);margin:0;width:16px;height:16px;flex:none}
.arcade-page .pad-layout-dialog button{min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:var(--ink);font:700 13px/1.3 var(--body);cursor:pointer}
.arcade-page .pad-layout-dialog .pad-layout-adjust{width:100%;border-color:var(--accent);background:var(--accent);color:var(--paper)}
.pad-layout-footer{display:flex;justify-content:space-between;gap:8px;margin-top:20px}
.arcade-page .pad-layout-dialog button:focus-visible,.pad-layout-choices input:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.arcade-page .has-pad-layout{--pad-scale:1;--pad-safe-top:env(safe-area-inset-top,0px);--pad-safe-bottom:env(safe-area-inset-bottom,0px);--pad-safe-left:env(safe-area-inset-left,0px);--pad-safe-right:env(safe-area-inset-right,0px)}
.arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded{display:flex!important;flex-direction:column;align-items:stretch;grid-template-rows:none!important;grid-template-columns:none!important;box-sizing:border-box;min-height:0;background:var(--panel);padding:env(safe-area-inset-top,0px) var(--pad-safe-right) env(safe-area-inset-bottom,0px) var(--pad-safe-left);border:0;box-shadow:none}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-toolbar,.tumble-hud,.tumble-duelbar,.oven-toolbar,.oven-hud,.quest-toolbar,.quest-hud,.quest-level-strip,.cf-toolbar,.cf-hud,.cf-room-bar){flex:none;box-sizing:border-box}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-workspace,.oven-stage-wrap,.quest-stage,.cf-stage){flex:0 1 auto;width:100%;height:auto;min-height:0;max-height:none;box-sizing:border-box;overflow:hidden}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-workspace{aspect-ratio:3/4;grid-template-columns:minmax(0,1fr)}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded.is-duel .tumble-workspace{aspect-ratio:1.275;grid-template-columns:minmax(0,1fr) minmax(0,.7fr)}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded .oven-stage-wrap{aspect-ratio:13/11}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-stage{aspect-ratio:1}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-screen,.oven-screen,.quest-stage){align-items:flex-start}
.arcade-page .has-pad-layout.is-expanded .iatpm-pad{flex:1 0 176px;align-content:start;min-height:176px;padding:10px 12px;background:transparent!important;border:0!important}
.arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone{width:132px;flex:none}
.arcade-page .has-pad-layout .pad-action-row{position:relative;display:grid;min-width:0;width:100%;padding:0;gap:6px}
.arcade-page .has-pad-layout .pad-secondary-row.iatpm-pad-extras{display:flex}
.arcade-page .has-pad-layout.is-expanded .pad-positioned{position:absolute!important;left:var(--pad-group-x)!important;top:var(--pad-group-y)!important;right:auto!important;bottom:auto!important;width:var(--pad-group-width)!important;box-sizing:border-box;transform:scale(var(--pad-scale,1))!important;transform-origin:top left;grid-row:auto!important;grid-column:auto!important;margin:0!important;padding:0;z-index:15}
.arcade-page .has-pad-layout:not(.pad-adjusting):has(:is(.tumble-overlay,.oven-overlay,.quest-overlay,.cf-overlay):not([hidden])) .pad-positioned{visibility:hidden;pointer-events:none}
.arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){display:flex;flex:none;min-height:26px;box-sizing:border-box;padding:5px 12px;border:0;background:var(--soft);color:var(--ink);font:11px/1.45 var(--body);gap:4px 10px}
.arcade-page :is(.tumble-cabinet,.quest-machine).has-pad-layout.is-expanded :is(.tumble-statusbar,.quest-status) p{margin:0;font:inherit;color:inherit}
.arcade-page .has-pad-layout.is-expanded .oven-status-strip{flex-direction:column;gap:2px}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded :is(.oven-status,.oven-equipment){display:flex;flex:none;min-height:0;padding:0;border:0;background:transparent;color:inherit;font-size:inherit;line-height:inherit}
.arcade-page .has-pad-layout.is-expanded .oven-equipment{justify-content:space-between;gap:6px;font-size:8px}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));height:48px;min-height:0;padding:5px 12px;gap:8px}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-symbol-key{display:none}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-status>p{display:block;flex:1}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-status>button{min-height:44px}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud strong{font:700 23px/1 var(--display)}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud span{font:700 8px/1.2 var(--body);letter-spacing:.3px;white-space:nowrap;margin:0 0 2px}
.arcade-page .quest-machine.has-pad-layout.is-expanded .quest-level-strip{height:22px;padding:3px 12px;font-size:10px;line-height:16px}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded .oven-hud{height:52px;padding:6px 12px;gap:8px}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded .oven-hud strong{font-size:25px;line-height:1;margin-top:2px}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded .oven-hud span{font-size:7px;line-height:9px}
.arcade-page .oven-cabinet.has-pad-layout.is-expanded .oven-hud #oven-lives{font-size:18px;line-height:25px}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud{height:80px;display:grid;grid-template-columns:1.4fr 1fr 1fr;grid-template-rows:30px 38px;padding:4px 8px;gap:4px 8px}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud>div{gap:0;padding-right:6px}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud strong{font-size:20px;line-height:22px;margin:0}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud span{font-size:7px;line-height:8px}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-rail{display:grid;grid-column:1/-1;grid-row:2;grid-template-columns:90px minmax(0,1fr) 64px;gap:8px;padding:0;border:0;background:transparent;min-height:0}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain strong{font:italic 17px/18px Georgia,serif}
.arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain small{font-size:8px;line-height:9px;margin:0}
@media(orientation:portrait){
 .arcade-page .has-pad-layout.pad-custom-position .iatpm-pad{position:static}
 .arcade-page dialog.pad-layout-dialog fieldset{display:none}
}
@media(orientation:portrait) and (max-height:600px){
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad{flex-basis:148px;min-height:148px;padding-block:8px}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone{display:flex;flex-direction:row;gap:0;align-items:center}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone :is(.iatpm-pad-actions,.iatpm-pad-extras){display:contents}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone .pad-action-row{display:contents}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone button:not(.pad-drag-handle){flex:1;min-width:44px;min-height:44px;height:44px;padding:3px 2px;display:flex;flex-direction:column;gap:1px;border-radius:9px;font-size:9px}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad-action-zone button b{font-size:18px}
 .arcade-page .has-pad-layout.is-expanded .quest-hud{height:42px;padding:3px 10px}
 .arcade-page .has-pad-layout.is-expanded .quest-level-strip{height:20px;padding-block:2px}
 .arcade-page .has-pad-layout.is-expanded .oven-hud{height:48px;padding:4px 8px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){padding:3px 8px;font-size:10px;line-height:1.4;min-height:24px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .iatpm-pad{flex-basis:148px;min-height:148px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud{height:66px;grid-template-rows:26px 32px;gap:2px 6px;padding:3px 8px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-next{grid-template-rows:8px 20px;gap:2px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-next>canvas{width:32px;height:20px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain strong{font-size:12px;line-height:12px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain :is(span,small){font-size:7px;line-height:8px}
}
/* Full-height playfield, with compact information in the actual spare space. */
@media(orientation:landscape){
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded{display:block!important;padding:0!important;isolation:isolate;background:#1d3029;--ink:#f6edd8;--muted:#b9c5b2;--line:#617163;--panel:#263e32;--soft:#354c3e;--accent:#e2bd77;--paper:#1d3029}
 :root[data-theme=dark] .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded{background:#12241d;--panel:#1c3328;--soft:#2c4435;--line:#4b6252}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-workspace,.oven-stage-wrap,.quest-stage,.cf-stage){position:absolute!important;left:var(--pad-board-x);top:var(--pad-board-y);width:var(--pad-board-width);height:var(--pad-board-height);max-height:none;aspect-ratio:auto;min-height:0;margin:0;border:0;outline:1px solid #e9cf8b42;border-radius:5px;box-shadow:0 4px 18px #08140c55;background:#173b31;overflow:hidden}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .pad-meta{display:block;position:absolute;left:var(--pad-meta-x);top:var(--pad-meta-y);width:var(--pad-meta-width);max-height:var(--pad-meta-height);overflow:auto;scrollbar-width:thin;scrollbar-color:#73806a transparent;box-sizing:border-box;container-type:inline-size}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar){position:absolute!important;left:var(--pad-tools-x)!important;top:var(--pad-tools-y)!important;right:auto!important;bottom:auto!important;width:var(--pad-tools-width)!important;z-index:25!important}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad{display:contents;position:static;min-height:0;padding:0;border:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.iatpm-pad-wheel,.iatpm-pad-action-zone){position:absolute;flex:none;grid-row:auto;grid-column:auto;z-index:15}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-wheel{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);width:132px;height:132px;margin:0;--pad-hit-height:132px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-action-zone{display:contents!important}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .pad-action-row{width:132px;min-height:44px;display:flex;align-items:stretch;gap:5px;padding:0;box-sizing:border-box}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .pad-action-row>button:not(.pad-drag-handle){flex:1;min-width:44px;min-height:44px;width:100%;margin:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .pad-primary-row{grid-template-columns:minmax(0,1fr)}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:100%;padding:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-actions.pad-primary-row{display:flex;width:132px;grid-template-columns:none}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-action{min-height:44px;flex-direction:column;padding:3px 2px;gap:1px;font-size:10px;line-height:1.2;border-radius:12px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-action:only-child{grid-column:1/-1}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-action b{font-size:18px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-extras{display:flex;min-height:44px;gap:5px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-extras button{padding:2px;font-size:10px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-extras button{background:#f3e3bd;color:#273d31;border-color:#d4c39c}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .iatpm-pad-action:disabled{background:#405648;color:#bbc8b6;border-color:#6d806b;opacity:.85}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.quest-hud,.oven-hud,.tumble-hud,.cf-hud){height:auto;background:transparent;color:var(--ink);border:0;padding:4px 0 10px;gap:8px;min-height:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.quest-hud,.oven-hud,.tumble-hud,.cf-hud)>div{border:0;padding:0;min-width:0;text-align:left}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.quest-hud,.oven-hud,.tumble-hud,.cf-hud) span{font:700 8px/1.2 var(--body);color:var(--muted);letter-spacing:.5px;margin:0 0 3px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.quest-hud,.oven-hud,.tumble-hud,.cf-hud) strong{font:700 25px/1 var(--display);color:var(--ink);margin:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .quest-hud{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding-bottom:12px}
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-status>button{width:100%;max-width:none;margin-top:6px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .quest-level-strip{height:auto;min-height:0;padding:8px 0;border-top:1px solid var(--line);background:transparent;display:flex;flex-wrap:wrap;gap:4px 10px;font:700 11px/1.4 var(--body);color:var(--ink)}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .quest-level-strip #quest-par{display:inline;color:var(--muted);font-size:9px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .oven-hud{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 8px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .oven-hud #oven-lives{font-size:15px;line-height:25px;color:#e68a6d}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud{display:grid;grid-template-columns:1.4fr 1fr 1fr;grid-template-rows:auto auto;gap:10px 8px;padding:4px 0}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-rail{grid-row:2;grid-column:1/-1;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:8px;padding:10px 0 0;border-top:1px solid var(--line);color:var(--ink)}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-next{display:grid;grid-template-columns:32px minmax(0,1fr);gap:4px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-next>canvas{width:32px;height:22px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-queue canvas{width:20px;height:auto}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain{grid-column:1/-1;display:flex;flex-direction:row;justify-content:flex-start;align-items:baseline;gap:7px;text-align:left;min-height:22px}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain strong{font:italic 20px/1 Georgia,serif;color:#edc997}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-chain :is(span,small){font:9px/1.4 var(--body);margin:0;color:var(--muted)}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-recipe{color:var(--ink);background:transparent}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud .tumble-recipe-item b{color:var(--ink)}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .tumble-duelbar{display:flex;flex-wrap:wrap;gap:4px;padding:6px 0;background:transparent;color:var(--ink);border:0}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){position:absolute;left:var(--pad-status-x);top:var(--pad-status-y);width:var(--pad-status-width);height:var(--pad-status-height);min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#73806a transparent;display:block;padding:8px 0 0;border-top:1px solid var(--line);background:transparent;color:var(--muted);font:11px/1.45 var(--body);box-sizing:border-box}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.quest-status,.tumble-statusbar)>span{display:none}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .oven-equipment{flex-wrap:wrap;margin-bottom:5px;font-size:8px}
 .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded .oven-status{font-size:11px;line-height:1.45}
 .arcade-page .has-pad-layout .iatpm-pad-action-zone>.pad-drag-handle{display:none!important}
 .arcade-page dialog.pad-layout-dialog h3{display:none}
 .arcade-page dialog.pad-layout-dialog{width:min(600px,calc(100% - 24px));padding:16px}
 .arcade-page dialog.pad-layout-dialog h2{font-size:26px;margin-bottom:12px}
 .arcade-page dialog.pad-layout-dialog>p{display:none}
 .arcade-page dialog.pad-layout-dialog .pad-layout-choices{grid-template-columns:repeat(4,minmax(0,1fr))}
 .arcade-page dialog.pad-layout-dialog .pad-layout-adjust{margin-top:12px}
 .arcade-page dialog.pad-layout-dialog .pad-layout-footer{margin-top:12px}
 html:lang(zh) .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.iatpm-pad-action,.iatpm-pad-extras button){font-size:12px}
}
@container(max-width:150px){
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud{grid-template-columns:minmax(0,1fr);gap:5px;padding:2px 0 8px}
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud>div{display:flex;align-items:baseline;justify-content:space-between;gap:3px;min-height:22px}
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud span{font-size:7px;letter-spacing:0;max-width:52%;margin:0}
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud strong{font-size:21px;white-space:nowrap}
 .arcade-page .quest-machine.has-pad-layout.is-expanded .quest-hud strong small{font-size:9px;white-space:nowrap}
 .arcade-page .tumble-cabinet.has-pad-layout.is-expanded .tumble-hud strong{font-size:16px}
}
/* Live fitting: actual controls remain touchable; small grips move the groups. */
.arcade-page .has-pad-layout .pad-live-editor[hidden]{display:none!important}
.arcade-page .has-pad-layout .pad-live-editor{position:absolute;left:var(--pad-editor-x,8px);top:var(--pad-editor-top,46px);width:var(--pad-editor-width,calc(100% - 16px));z-index:30;display:grid;grid-template-columns:auto minmax(64px,1fr) 42px;align-items:center;gap:2px 8px;padding:5px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);box-shadow:0 3px 12px #0003;font:700 11px/1.3 var(--body);box-sizing:border-box}
.arcade-page .pad-live-editor input{width:100%;min-width:0;height:44px;margin:0;accent-color:var(--accent);touch-action:pan-x}
.arcade-page .pad-live-editor output{font:700 12px/1 var(--body);text-align:right}
.arcade-page .pad-live-editor .pad-live-instruction{grid-column:1/-1;margin:0;font:10px/1.4 var(--body)}
.arcade-page .pad-live-editor.pad-editor-narrow{grid-template-columns:minmax(0,1fr) 42px}
.arcade-page .pad-live-editor.pad-editor-narrow input{grid-column:1/-1;grid-row:2}
.arcade-page .pad-live-editor.pad-editor-narrow output{grid-column:2;grid-row:1}
.arcade-page .has-pad-layout.pad-adjusting .pad-drag-handle{display:grid;position:absolute;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;left:calc(50% - 22px);top:calc(50% - 22px);margin:0;padding:0;background:var(--pad-paper,#fff1d3);color:var(--pad-ink,#273d31);border:1px dashed var(--pad-sauce,#a93625);border-radius:10px;font:26px/1 var(--body);touch-action:none;cursor:grab;z-index:2}
.arcade-page .has-pad-layout.pad-adjusting .iatpm-pad-action-zone .pad-drag-handle{top:-44px}
@media(orientation:landscape){
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row>.pad-drag-handle{display:grid;left:-44px;right:auto;top:0;border-style:solid;border-radius:8px 0 0 8px;box-shadow:0 2px 8px #0003;font:26px/1 var(--body)}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-side=left]>.pad-drag-handle{left:auto;right:-44px;border-radius:0 8px 8px 0}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-grip]>.pad-drag-handle{left:var(--pad-grip-x)!important;right:auto!important;top:var(--pad-grip-y)!important;bottom:auto!important;width:44px;height:44px;box-sizing:border-box;transform:none!important;border-radius:8px}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-grip=left]>.pad-drag-handle{border-radius:8px 0 0 8px}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-grip=right]>.pad-drag-handle{border-radius:0 8px 8px 0}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-grip=top]>.pad-drag-handle{border-radius:8px 8px 0 0}
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting .pad-action-row[data-pad-grip=bottom]>.pad-drag-handle{border-radius:0 0 8px 8px}
 .arcade-page .has-pad-layout.pad-adjusting .iatpm-pad-wheel>.pad-drag-handle{display:grid}
}
@media(orientation:portrait){.arcade-page .has-pad-layout.pad-adjusting .pad-action-row>.pad-drag-handle{display:none}}
.arcade-page .has-pad-layout.pad-adjusting .iatpm-pad button.is-testing{filter:brightness(1.18);outline:3px solid var(--pad-sauce,#a93625);outline-offset:2px}
.arcade-page .has-pad-layout.pad-adjusting .pad-layout-button{z-index:35}
.arcade-page .has-pad-layout.pad-adjusting :is(.tumble-overlay,.oven-overlay,.quest-overlay,.cf-overlay){visibility:hidden!important;pointer-events:none!important}
html:lang(zh) .arcade-page :is(.tumble-cabinet,.oven-cabinet,.quest-machine,.cf-cabinet).has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){font-size:12px;line-height:1.45}
@media(prefers-reduced-motion:reduce){.arcade-page .has-pad-layout *{scroll-behavior:auto}}

/* Shared controls retain readable, root-scaled text; metadata scrolls before
   reducing the board or suppressing instructions. */
.arcade-page .has-pad-layout{--pad-caption:.75rem}
html:lang(zh) .arcade-page .has-pad-layout{--pad-caption:.875rem}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud) :is(span,small),
.arcade-page .has-pad-layout.is-expanded :is(.quest-level-strip,.oven-equipment,.tumble-chain small,.tumble-recipe,.pad-live-instruction),
.arcade-page .has-pad-layout .iatpm-pad :is(.iatpm-pad-action,.iatpm-pad-extras button){font-size:var(--pad-caption)!important;line-height:1.3!important;white-space:normal}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){font-size:var(--pad-caption)!important;line-height:1.4!important}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar) p{font:inherit;margin:0}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud){height:auto!important;min-height:48px;grid-template-rows:auto!important}
.arcade-page .has-pad-layout.is-expanded :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud) span{white-space:normal}
.arcade-page .has-pad-layout .iatpm-pad-action{height:auto!important;max-height:none!important}
.arcade-page .has-pad-layout .pad-live-editor{font-size:var(--pad-caption);line-height:1.4}
.arcade-page .has-pad-layout .pad-live-instruction{font-size:var(--pad-caption)}
.arcade-page .has-pad-layout .pad-lobby-overlay :is(p,small,.oven-ticket-rule),
.arcade-page .has-pad-layout .pad-lobby-overlay button{font-size:var(--pad-caption)!important;line-height:1.4!important}
.arcade-page .has-pad-layout .pad-layout-dialog :is(p,button,label,small,h3){font-size:max(var(--pad-caption),.875rem);line-height:1.4}
.arcade-page .cf-cabinet.has-pad-layout .cf-actions{grid-template-columns:132px minmax(96px,144px)}
.arcade-page .cf-cabinet.has-pad-layout.is-expanded .cf-stage{aspect-ratio:6/11}
.arcade-page .cf-cabinet.has-pad-layout .cf-room-bar{flex-wrap:wrap;height:auto;min-height:44px}
.arcade-page .cf-cabinet.has-pad-layout .cf-room-bar button{min-height:44px;white-space:normal}
@media(orientation:portrait){
 .arcade-page .has-pad-layout.is-expanded{overflow-y:auto!important}
 .arcade-page .has-pad-layout.is-expanded :is(.tumble-workspace,.oven-stage-wrap,.quest-stage,.cf-stage){min-height:132px;flex-shrink:1}
 .arcade-page .has-pad-layout.is-expanded .iatpm-pad{flex-shrink:0}
}
@media(orientation:landscape){
 .arcade-page .cf-cabinet.has-pad-layout.is-expanded .cf-hud{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .arcade-page .cf-cabinet.has-pad-layout.is-expanded .cf-hud strong{font:700 1.5rem/1 var(--display)}
 .arcade-page .cf-cabinet.has-pad-layout.is-expanded .cf-room-bar{display:flex;gap:4px;padding:4px 0;background:transparent}
 .arcade-page .has-pad-layout.is-expanded .pad-action-row{height:auto;min-height:44px}
}

.arcade-page .has-pad-layout.is-expanded :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud) strong{font-size:1.5625rem!important;line-height:1.1!important;white-space:normal;overflow-wrap:anywhere}
.arcade-page .has-pad-layout.is-expanded .oven-hud #oven-lives{font-size:1.125rem!important}
.arcade-page .has-pad-layout .pad-layout-dialog h2{font-size:1.875rem!important}
.arcade-page .has-pad-layout .pad-size-output{font-size:.875rem}
.arcade-page .has-pad-layout .pad-lobby-overlay h2{font-size:clamp(2rem,11dvh,3rem)!important}
@container(max-width:150px){
 .arcade-page .has-pad-layout.is-expanded :is(.oven-hud,.cf-hud){grid-template-columns:minmax(0,1fr)}
 .arcade-page .has-pad-layout.is-expanded :is(.oven-hud,.cf-hud)>div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px}
}

@media(orientation:portrait){
 .arcade-page .has-pad-layout.is-expanded.pad-adjusting :is(.pad-meta,.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){display:none!important}
}

/* On short enlarged portrait views the metadata remains independently
   scrollable; explicit Start focuses the board and controls below it. */
@media(orientation:portrait){
 .arcade-page .has-pad-layout.is-expanded .pad-meta{display:block;flex:none;max-height:80px;overflow:auto;scrollbar-width:thin;touch-action:pan-y}
 .arcade-page .has-pad-layout.is-expanded :is(.tumble-statusbar,.oven-status-strip,.quest-status,.cf-statusbar){flex:none;max-height:40px;min-height:26px;overflow:auto;scrollbar-width:thin;touch-action:pan-y}
 .arcade-page .has-pad-layout.is-expanded :is(.tumble-workspace,.oven-stage-wrap,.quest-stage,.cf-stage){flex:0 1 auto}
}
@media(orientation:portrait) and (max-height:600px){
 .arcade-page .has-pad-layout.is-expanded :is(.tumble-workspace,.oven-stage-wrap,.quest-stage,.cf-stage){min-height:calc(100dvh - 188px)}
}
.arcade-page .has-pad-layout .pad-layout-dialog p{font-size:1rem!important}
html:lang(zh) .arcade-page .has-pad-layout .pad-layout-dialog p{font-size:1.125rem!important}

@media(orientation:portrait){
 .arcade-page .has-pad-layout.is-expanded .pad-meta :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud){display:flex!important;flex-flow:row nowrap;gap:16px;width:max-content;min-width:100%;padding-inline:8px}
 .arcade-page .has-pad-layout.is-expanded .pad-meta :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud)>div{flex:none;min-width:64px}
 .arcade-page .has-pad-layout.is-expanded .pad-meta :is(.tumble-hud,.oven-hud,.quest-hud,.cf-hud) strong{white-space:nowrap;overflow-wrap:normal}
 .arcade-page .has-pad-layout.is-expanded .pad-meta .tumble-hud .tumble-rail{width:240px;min-width:240px}
}
.arcade-page .has-pad-layout .pad-live-editor{grid-template-columns:minmax(0,max-content) minmax(44px,1fr) max-content;max-height:calc(100dvh - var(--pad-editor-top,46px) - 8px);overflow:auto;scrollbar-width:thin}
.arcade-page .has-pad-layout .pad-live-editor output{white-space:nowrap;min-width:max-content}
.arcade-page .has-pad-layout .pad-live-editor.pad-editor-narrow{grid-template-columns:minmax(0,1fr) max-content}

:root[data-theme=dark] .arcade-page .iatpm-pad{--pad-focus:#ffd384}
.arcade-page .iatpm-pad button:focus-visible{outline-color:var(--pad-focus,var(--pad-sauce))}
.arcade-page .has-pad-layout.pad-adjusting .iatpm-pad button.is-testing{outline-color:var(--pad-focus,var(--pad-sauce))}

/* Auxiliary action labels grow with text enlargement just like primary actions. */
.arcade-page .has-pad-layout .iatpm-pad-extras button{height:auto!important;max-height:none!important;overflow-wrap:anywhere}
.arcade-page .has-pad-layout .iatpm-pad :is(.iatpm-pad-action,.iatpm-pad-extras button)>span{white-space:normal!important;overflow-wrap:anywhere;max-width:100%;min-width:0}
