/* Compact game tools. The layout owns this cluster's outer coordinates;
   these rules size only the individual controls and their transparent shell. */
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){
 padding:0;min-height:0;max-height:none;height:auto;background:transparent;border:0;box-shadow:none;box-sizing:border-box;
}
/* The original mobile lobby keeps the same one-row tools before entering
   fullscreen. Fine-pointer desktop branding and its inline layout stay intact. */
@media(pointer:coarse){
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){
  display:block;height:44px;min-height:44px;max-height:44px;padding:0;border:0;box-sizing:border-box;background:var(--panel);color:var(--ink);
 }
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-stamp,.oven-brand,.quest-brand,.cf-stamp){display:none}
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){
  display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));grid-auto-rows:44px;gap:0;width:100%;height:44px;max-width:none;min-width:0;margin:0;padding:0;box-sizing:border-box;
 }
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) .quest-tools:has(.pad-layout-button){grid-template-columns:repeat(5,minmax(44px,1fr))}
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;height:44px;min-height:44px;max-height:44px;min-width:44px;max-width:none;margin:0;padding:2px 1px;
  box-sizing:border-box;border:0;border-right:1px solid var(--line);border-radius:0;background:var(--panel);color:var(--ink);box-shadow:none;font:700 9px/1.15 var(--body);letter-spacing:0;touch-action:manipulation;
 }
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:last-child{border-right:0}
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>:is(.icon,b){
  display:block;flex:none;width:18px;height:18px;margin:0;pointer-events:none;font:normal 19px/18px var(--body);
 }
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>span{
  display:block;max-width:100%;min-width:0;margin:0;padding:0;font:700 9px/1.15 var(--body);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;
 }
 .arcade-page .has-pad-layout[data-pad-layout]:not(.is-expanded) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-stamp,.oven-brand,.quest-brand,.cf-stamp){display:none}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){
 display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));grid-auto-rows:44px;gap:4px;
 width:100%;max-width:140px;min-width:44px;margin:0;padding:0;align-items:stretch;justify-items:stretch;
 background:transparent;border:0;box-shadow:none;box-sizing:border-box;
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button{
 position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;gap:2px;
 width:100%;height:44px;min-width:44px;max-width:none;min-height:44px;max-height:44px;margin:0;padding:2px 1px;
 border:1px solid var(--line,#d6cdb9);border-radius:7px;background:var(--panel,#fff8e6);color:var(--ink,#273d31);
 font:700 9px/1.15 var(--body);letter-spacing:0;box-shadow:0 1px 2px #00000016;box-sizing:border-box;
 cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>:is(.icon,b){
 display:block;flex:none;width:18px;height:18px;margin:0;pointer-events:none;font:normal 19px/18px var(--body);
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>span{
 display:block;flex:none;max-width:100%;min-width:0;margin:0;padding:0;font:700 9px/1.15 var(--body);letter-spacing:0;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:is(:hover,:active,[aria-pressed=true]):not(:disabled){
 border-color:var(--accent,#a93625);background:var(--soft,#f3dfbc);color:var(--ink,#273d31);
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:focus-visible{outline:3px solid var(--accent,#a93625);outline-offset:1px}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:disabled{opacity:.42;cursor:default}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded.pad-adjusting :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools)>.pad-layout-button{
 min-width:44px;border-color:var(--accent,#a93625);box-shadow:inset 0 0 0 1px var(--accent,#a93625);
}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded.pad-adjusting .pad-layout-button>b{font-size:0}
.arcade-page .has-pad-layout[data-pad-layout].is-expanded.pad-adjusting .pad-layout-button>b::before{content:'✓';font:700 18px/18px var(--body)}
html:lang(zh) .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>span{font-size:9px;letter-spacing:0}
@media(orientation:portrait){
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){height:44px;min-height:44px;max-height:44px}
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){
  grid-template-columns:repeat(6,minmax(44px,1fr));grid-auto-rows:44px;gap:0;max-width:none;height:44px;
 }
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded .quest-tools:has(.pad-layout-button){grid-template-columns:repeat(5,minmax(44px,1fr))}
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded .quest-tools:has(.pad-layout-button):has(#quest-quit){grid-template-columns:repeat(6,minmax(44px,1fr))}
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button{
  border-radius:0;border:0;border-right:1px solid var(--line,#d6cdb9);box-shadow:none;
 }
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button:last-child{border-right:0}
}

/* Text can wrap and grow with the user's root font setting. The layout measures
   the real row height rather than assuming captions always fit a 44px tile. */
.arcade-page .has-pad-layout[data-pad-layout]:is(.is-expanded,:not(.is-expanded)) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){grid-auto-rows:minmax(44px,auto);height:auto}
.arcade-page .has-pad-layout[data-pad-layout]:is(.is-expanded,:not(.is-expanded)) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button{height:auto;min-height:44px;max-height:none}
.arcade-page .has-pad-layout[data-pad-layout]:is(.is-expanded,:not(.is-expanded)) :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button)>button>span{font-size:var(--pad-caption,.75rem)!important;line-height:1.4;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.arcade-page .has-pad-layout[data-pad-layout]:is(.is-expanded,:not(.is-expanded)) :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){height:auto;min-height:44px;max-height:none}
@media(orientation:portrait){.arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){height:auto;max-height:none}}

@media(orientation:portrait){
 .arcade-page .has-pad-layout[data-pad-layout] .cf-tools:has(.pad-layout-button){grid-template-columns:repeat(5,minmax(44px,1fr))}
}

@media(orientation:portrait){
 .arcade-page .cf-cabinet.has-pad-layout .cf-tools:has(.pad-layout-button){grid-template-columns:repeat(5,minmax(44px,1fr))!important}
}
@media(orientation:landscape){
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-toolbar,.oven-toolbar,.quest-toolbar,.cf-toolbar):has(.pad-layout-button){max-height:var(--pad-tools-height);overflow:auto;scrollbar-width:thin;touch-action:pan-y}
 .arcade-page .has-pad-layout[data-pad-layout].is-expanded :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){grid-template-columns:repeat(var(--pad-tool-columns,3),minmax(44px,1fr))}
}

/* Specialized aiming, drawing and single-action games share utility access
   without acquiring directional buttons that do not match their mechanics. */
.arcade-page [data-arcade-fullscreen] [data-arcade-tools]>button{min-width:44px!important;min-height:44px!important;touch-action:manipulation}
.arcade-page [data-arcade-tools]>button:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}

.arcade-page [data-arcade-help-text]{font-size:var(--arcade-help-font)!important;line-height:1.6!important;overflow-wrap:anywhere}

/* Match native fullscreen when later game/share sheets declare their cabinet
   relative. The shared helper still owns visual-viewport top and height. */
.arcade-page [data-arcade-fullscreen].is-expanded{position:fixed!important;left:0!important;right:auto!important;bottom:auto!important;top:0;width:100%!important;max-width:none!important;margin:0!important;z-index:50}
/* A constrained scroll gutter must not compress enlarged caption contents. */
.arcade-page .has-pad-layout[data-pad-layout] :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools)>button{height:max-content!important}
.arcade-page .has-pad-layout[data-pad-layout] :is(.tumble-tools,.oven-tools,.quest-tools,.cf-tools):has(.pad-layout-button){grid-auto-rows:max-content!important;align-content:start}

/* Bowling's setup tools grow at enlarged text sizes; the following stage
   starts after their full intrinsic header instead of a fixed 44px row. */
.arcade-page .bowling-cabinet.is-expanded .bowling-toolbar{height:max-content!important;min-height:max-content!important;max-height:none!important;align-items:start!important;align-self:start!important}
@media(min-width:600px) and (max-height:550px){.arcade-page .bowling-cabinet.is-expanded.is-setup{grid-template-rows:auto minmax(0,1fr)!important}}
