.game-expand-toggle{position:sticky;top:8px;float:right;z-index:10;width:46px;height:46px;min-height:46px;padding:9px;display:grid;place-items:center;background:#fff9e9;color:#305b50;border:1px solid #97bdc5;border-radius:12px;margin:0 0 6px 8px}.game-expand-toggle[hidden]{display:none}body.game-expanded{overflow:hidden!important}body.game-expanded>header,body.game-expanded>footer,body.game-expanded .journey-nav{visibility:hidden}body.game-expanded #kind-view{position:fixed!important;inset:0!important;z-index:1000;overflow:auto;overscroll-behavior:contain;padding:calc(8px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom))!important;background:#eef4e5!important;scroll-behavior:auto}body.game-expanded .kind-shell{max-width:1100px!important;margin:auto!important;padding:6px!important;clear:both}body.game-expanded #kind-title,body.game-expanded #kind-description,body.game-expanded .kind-shell>.eyebrow,body.game-expanded #share-game,body.game-expanded #kind-status:empty{display:none!important}body.game-expanded .game-expand-toggle{position:sticky;top:0;margin-top:0}body.game-expanded #kind-content{gap:8px}body.game-expanded .jg-board{width:min(100%,calc((100dvh - 310px)*1.3333));margin-inline:auto}body.game-expanded .jg-game{max-width:100%!important}body.game-expanded .jg-hud{gap:8px}body.game-expanded .jg-tray{max-height:130px}@media(max-height:500px){body.game-expanded .jg-board{width:min(55vw,500px)}body.game-expanded .jg-game{overflow:auto}}.game-expand-home{display:none}body.game-expanded .game-expand-home{display:flex;align-items:center;justify-content:flex-start;float:left;position:sticky;top:0;z-index:10;height:46px;min-height:46px;width:150px;max-width:55%;padding:0;border:0;background:transparent;box-shadow:none;margin:0 0 6px}body.game-expanded .game-expand-home img{display:block;width:100%;height:46px;object-fit:contain;object-position:left center}body.game-expanded .game-expand-home:focus-visible{outline:3px solid #305b50;outline-offset:2px;border-radius:8px}
.game-expand-header{display:flex;justify-content:flex-end}
body.game-expanded #kind-view{padding:0 12px calc(12px + env(safe-area-inset-bottom))!important;background-color:#eef4e5!important;background-image:var(--scene-image,var(--season-lanterns,url('assets/scenery/lanterns.webp')))!important;background-position:center!important;background-size:cover!important;background-attachment:fixed!important}
body.game-expanded .game-expand-header{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;margin:0 -12px 12px;padding:calc(8px + env(safe-area-inset-top)) 12px 8px;background:#eef4e5;box-shadow:0 2px 6px #244d3820}
body.game-expanded .game-expand-header .game-expand-home,body.game-expanded .game-expand-header .game-expand-toggle{position:static;float:none;margin:0}
.game-expand-share{display:none}body.game-expanded .game-expand-share{display:grid;place-items:center;width:46px;min-height:46px;padding:9px;margin:0 8px 0 auto;border:1px solid #97bdc5;border-radius:12px;background:#fff9e9;color:#305b50}
body.game-expanded #kind-view[data-scene=dance] .dance-frame{order:0}
body.game-expanded #kind-view[data-scene=dance] .dance-navigation{order:1;margin:0!important}

body.game-expanded #kind-view[data-scene=dance] #kind-content{gap:4px}


/* Center the compact Pair game without shrinking tiles or clipping tall boards. */
#kind-view:has(.blossom-board) .kind-shell{display:flex;flex-direction:column;justify-content:center;min-height:calc(100svh - 250px)}
#kind-view:has(.blossom-board) #kind-content{flex-shrink:0;width:100%}
body.game-expanded #kind-view:has(.blossom-board) .kind-shell{min-height:calc(100dvh - 86px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}

/* Keep the Pair frame and controls close to the board's 480px maximum. */
#kind-view:has(.blossom-board) .kind-shell,body.game-expanded #kind-view:has(.blossom-board) .kind-shell{width:100%;max-width:512px!important;min-height:0;padding:16px!important;box-sizing:border-box}
body.game-expanded #kind-view:has(.blossom-board){display:flex;flex-direction:column}
body.game-expanded #kind-view:has(.blossom-board) .game-expand-header{flex-shrink:0}
body.game-expanded #kind-view:has(.blossom-board) .kind-shell{flex-shrink:0;margin-block:auto!important}

/* A compact, centered frame for every seasonal bridge puzzle. */
#kind-view:has(.bridge-board) .kind-shell,body.game-expanded #kind-view:has(.bridge-board) .kind-shell{width:100%;max-width:392px!important;min-height:0;padding:16px!important;box-sizing:border-box}
#kind-view:has(.bridge-board) .bridge-stage{padding:16px 10px}
body.game-expanded #kind-view:has(.bridge-board){display:flex;flex-direction:column}
body.game-expanded #kind-view:has(.bridge-board) .game-expand-header{flex-shrink:0}
body.game-expanded #kind-view:has(.bridge-board) .kind-shell{flex-shrink:0;margin-block:auto!important}

/* Prevent horizontal touch panning and rubber-banding in compact game views. */
#kind-view:has(.blossom-board),#kind-view:has(.bridge-board){overflow-x:hidden!important;overscroll-behavior-x:none;touch-action:pan-y pinch-zoom}
#kind-view:has(.blossom-board) .kind-shell,#kind-view:has(.bridge-board) .kind-shell{min-width:0}
#kind-view:has(.blossom-board) #kind-content,#kind-view:has(.bridge-board) #kind-content{min-width:0;max-width:100%}


/* Compact game-specific frames; vertical overflow remains scrollable. */
body.game-expanded #kind-view{display:flex;flex-direction:column;overflow-x:hidden!important;overscroll-behavior-x:none}
body.game-expanded #kind-view .game-expand-header{flex-shrink:0}
body.game-expanded #kind-view .kind-shell{width:100%;min-width:0;min-height:0;flex-shrink:0;margin-block:auto!important;box-sizing:border-box}
body.game-expanded #kind-view #kind-content{min-width:0;max-width:100%}
#kind-view:is([data-scene=match],[data-scene=mahjong],[data-scene=solitaire],[data-scene=jigsaw],[data-scene=lantern-sort],[data-scene=dance],[data-scene=stream]){overflow-x:hidden!important;overscroll-behavior-x:none}
#kind-view[data-scene=match] .kind-shell,body.game-expanded #kind-view[data-scene=match] .kind-shell{max-width:574px!important;padding:16px!important}
#kind-view:has(.stone-board) .kind-shell,body.game-expanded #kind-view:has(.stone-board) .kind-shell{max-width:514px!important;padding:16px!important}
#kind-view[data-scene=mahjong] .kind-shell,body.game-expanded #kind-view[data-scene=mahjong] .kind-shell{max-width:790px!important;padding:16px!important}
#kind-view[data-scene=solitaire] .kind-shell,body.game-expanded #kind-view[data-scene=solitaire] .kind-shell{max-width:790px!important;padding:16px!important}
#kind-view[data-scene=lantern-sort] .kind-shell,body.game-expanded #kind-view[data-scene=lantern-sort] .kind-shell{max-width:850px!important;padding:12px!important}
#kind-view[data-scene=jigsaw] .kind-shell,body.game-expanded #kind-view[data-scene=jigsaw] .kind-shell{max-width:714px!important;padding:16px!important}
body.game-expanded #kind-view[data-scene=jigsaw] .kind-shell{max-width:min(714px,calc((100dvh - 310px)*1.3333 + 34px))!important;min-width:min(100%,320px)}
#kind-view[data-scene=dance] .kind-shell,body.game-expanded #kind-view[data-scene=dance] .kind-shell{max-width:850px!important;padding:6px!important}
