/* Advertisements own layout space; gameplay and real controls keep their hit areas. */
body[data-sponsor-layout="arcade"] .playfield .overlay{box-sizing:border-box;max-height:100%;max-width:100%;overflow-y:auto;overscroll-behavior:contain;justify-content:safe center}
body[data-sponsor-layout="arcade"] .playfield .overlay>*{flex-shrink:0}
body[data-sponsor-layout="arcade"] .playfield .overlay .primary{min-width:0;width:min(160px,100%);max-width:100%;min-height:44px}
@container (max-height:200px){
 body[data-sponsor-layout="arcade"] .playfield .overlay{padding:6px;gap:5px}
 body[data-sponsor-layout="arcade"] .playfield .overlay :is(.overlay-badge,p,.overlay-mode){display:none}
 body[data-sponsor-layout="arcade"] .playfield .overlay h2{font-size:15px;line-height:1.25;margin:0;letter-spacing:0}
 body[data-sponsor-layout="arcade"] .playfield .overlay .primary{font-size:12px;padding:5px}
}
/* On very short portrait screens, the three ads share a reserved footer row. */
@media(orientation:portrait) and (max-height:600px){
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .shell .game-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:40px minmax(0,1fr) auto 44px;gap:4px 5px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-card>.metrics{grid-area:1/1/2/4;height:40px;min-height:40px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-card>.progress-track{display:none}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-card>.playfield{grid-area:2/1/3/4;height:100%}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .shell .game-card>.game-controls{grid-area:3/1/4/4;height:auto;min-height:0;max-height:none;overflow:visible;padding-top:3px;gap:3px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-controls .match-tray{height:48px;min-height:48px;padding:4px;gap:4px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .match-tray .tile-pocket{height:36px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-controls>.actions{margin:0;height:48px;min-height:48px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-card>.sponsors-top{grid-area:4/1;margin:0;height:44px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-card>.sponsors-bottom{grid-area:4/2/5/4;margin:0;height:44px;gap:5px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-sponsors .sponsor-link{height:44px;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:3px}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-sponsors .sponsor-name{font-size:10px;max-width:100%;white-space:nowrap}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-sponsors .sponsor-domain{display:none}
 body[data-sponsor-layout="arcade"][data-game-frame="tile-trio"][data-game] .game-sponsors .sponsor-badge{align-self:center;justify-self:center;font-size:8px;padding:1px 3px}
}
/* PVZ's original fixed main must follow the shared navigation in document flow. */
body[data-game-frame="pvz"][data-game-navigation="unified"]>main{position:relative!important;inset:auto!important;flex:none!important}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home:not([hidden]){display:flex!important;flex-direction:column;gap:4px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.title,body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.game-sponsors{flex:none}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.sponsors-top{height:32px;min-height:32px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.sponsors-bottom{height:38px;min-height:38px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.game-sponsors .sponsor-link{box-sizing:border-box;height:100%!important;min-height:0!important;max-height:100%;padding-block:3px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.adventure{display:flex!important;flex-direction:column;flex:1;min-height:0;gap:4px;padding:6px!important}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .chapters{display:flex;flex:none;overflow-x:auto;margin:0!important;padding:0;gap:4px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .chapters>button{flex:none;min-width:70px;height:44px;min-height:44px}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .road{flex:1;min-height:0!important;height:auto!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(2,44px)!important;grid-auto-rows:44px;align-content:start!important;overflow-y:auto;margin:0!important;padding:0!important;gap:4px!important}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .road .block{height:44px!important;min-height:44px!important}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge{flex:none;height:auto!important;min-height:0;padding:3px!important;margin:0}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge h2{font-size:16px;margin:0}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge p{font-size:10px;line-height:1.3;margin:2px 0}
body[data-game-frame="pvz"][data-game-navigation="unified"] #home #enter{height:44px;min-height:44px;margin:3px 0 0}
@media(orientation:portrait) and (max-height:700px){
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:28px minmax(0,1fr) 44px 44px;gap:4px;min-height:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.hero{grid-area:2/1;display:grid;grid-template-columns:minmax(0,1fr) 80px;grid-template-rows:minmax(0,1fr) 44px;grid-template-areas:none;gap:4px 8px;height:100%;min-height:0;padding:0;margin:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home :is(.hero-copy,.story-label,.hero-progress,.footer){display:none}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home :is(.current-story,.gallery-caption){display:contents}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-art-frame{grid-area:1/1/2/3;min-height:0;height:100%;max-height:100%;margin:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-art{width:100%;height:100%;object-fit:contain}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home #continueBtn{grid-area:2/1;min-width:0;width:100%;height:44px;min-height:44px;max-width:100%;margin:0;padding:5px;font-size:14px;gap:4px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home #chooseLevels{grid-area:2/2;min-width:0;width:100%;height:44px;min-height:44px;margin:0;padding:3px;font-size:10px;gap:2px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-top{grid-area:1/1;margin:0!important}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.home-actions{grid-area:3/1;min-height:0;height:44px;margin:0;padding:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .home-actions>.mode{min-height:44px;height:44px;padding:3px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .home-actions>.mode b{font-size:13px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-bottom{grid-area:4/1;margin:0!important}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-bottom .sponsor-link{height:44px;min-height:44px!important;padding:4px!important}
}
@media(max-height:650px){
 body[data-game-frame="bridge-keeper"] #panel.pause-panel{padding:12px}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel .pause-eyebrow{display:none}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel h2{font-size:24px;line-height:1.2}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel .pause-description{margin:4px 0 10px}
 body[data-game-frame="bridge-keeper"] .pause-divider{margin:10px 0 6px}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel :is(#continue,#menu){min-height:44px;padding:9px}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel #menu{margin-top:10px}
 body[data-game-frame="bridge-keeper"] .pause-panel .bridge-ad{height:44px;min-height:44px;padding:5px}
 body[data-game-frame="bridge-keeper"] .pause-panel .bridge-ads-bottom .bridge-ad{height:48px;min-height:48px;padding:5px}
}
@media(orientation:landscape) and (max-height:540px){
 body[data-game-frame="bridge-keeper"] #rotate{position:absolute;inset:4px 8px auto;z-index:20;width:auto;height:auto;min-height:36px;padding:4px;border:1px solid #718d7f;border-radius:8px;background:#18323b;font-size:12px;line-height:16px;pointer-events:none}
 body[data-game-frame="bridge-keeper"] #game>#overlay.pause-screen{padding:48px 8px 8px;box-sizing:border-box}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);grid-template-rows:auto 44px 44px;gap:7px 12px;width:100%;max-width:680px;max-height:100%;padding:10px;box-sizing:border-box}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel :is(.pause-eyebrow,.pause-description){display:none}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel h2{grid-area:1/1;margin:0;font-size:21px;line-height:1.2;align-self:center}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel #continue{grid-area:2/1;min-height:44px;height:44px;margin:0;padding:6px}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel #menu{grid-area:3/1;min-height:44px;height:44px;margin:0;padding:6px}
 body[data-game-frame="bridge-keeper"] #panel.pause-panel .pause-sponsors{grid-area:1/2/4/3;align-self:center}
 body[data-game-frame="bridge-keeper"] .pause-panel .pause-divider{margin:0 0 5px;font-size:9px}
 body[data-game-frame="bridge-keeper"] .pause-panel .bridge-ads-bottom{margin-top:6px}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.adventure{display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:44px minmax(0,1fr)}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.title{grid-template-rows:36px!important;min-height:0;height:36px;gap:0;margin:0}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.title :is(h1,.campaign-overview){display:none}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home>.title .campaign-selector{grid-area:1/1/2/-1}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home .chapters{grid-area:1/1/2/3}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home .road{grid-area:2/1;height:100%!important}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge{grid-area:2/2;display:flex;flex-direction:column;justify-content:center;overflow-y:auto}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge :is(h2,p){display:none}
 body[data-game-frame="pvz"][data-game-navigation="unified"] #home .challenge #enter{flex:none;width:100%;height:44px;min-height:44px;margin:0}
 /* Reserve separate rows for the gallery, actions and both advert groups. */
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 28px 44px 44px;gap:4px;min-height:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.hero{grid-area:1/1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);grid-template-rows:minmax(0,1fr) 44px;grid-template-areas:none;gap:4px 12px;padding:0;margin:0;min-height:0;height:100%}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-copy{grid-area:1/1;align-self:center;min-height:0;overflow:hidden}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-copy :is(h2,p){margin:0;font-size:16px;line-height:1.4}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-copy p{display:none}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home :is(.current-story,.gallery-caption){display:contents}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-art-frame{grid-area:1/2/3/3;min-height:0;max-height:100%;margin:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .hero-art{width:100%;height:100%;object-fit:contain}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home :is(.story-label,.hero-progress,.footer){display:none}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home #continueBtn{grid-area:2/1;justify-self:start;align-self:stretch;width:calc(100% - 84px);min-width:0;min-height:44px;height:44px;margin:0;padding:5px;font-size:12px;gap:3px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home #chooseLevels{grid-area:2/1;justify-self:end;align-self:stretch;width:80px;min-width:0;min-height:44px;height:44px;margin:0;padding:3px;font-size:10px;gap:2px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-top{grid-area:2/1;margin:0!important}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.home-actions{grid-area:3/1;min-height:0;margin:0;padding:0}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .home-actions>.mode{min-height:44px;height:44px;padding:3px;font-size:12px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home .home-actions>.mode b{font-size:13px}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-bottom{grid-area:4/1;margin:0!important}
 body[data-game-frame="find-ball"][data-game-navigation="unified"] #home>.sponsors-bottom .sponsor-link{height:44px;min-height:44px!important;padding:4px!important}
}
