/* Shared play surface: navigation is one back button, everything else is game UI. */
body.immersive-game{height:100vh;height:100dvh;width:100%;overflow:hidden;overscroll-behavior:none;background:#14252b}
body.immersive-game .game-header{display:contents}
body.immersive-game .game-header>.brand,body.immersive-game .game-header>button{display:none}
body.immersive-game .game-header .back-link{position:fixed;z-index:30;top:calc(env(safe-area-inset-top,0px) + 6px);left:calc(env(safe-area-inset-left,0px) + 6px);width:42px;height:42px;display:grid;place-items:center;gap:0;padding:0;border:1px solid #8ba9a633;border-radius:12px;background:#14252be6;color:#d9e9df;font-size:0;box-shadow:0 3px 10px #08171c25}
body.immersive-game .back-link svg{width:21px;height:21px}
body.immersive-game :is(.casual-main,.mine-main,.solitaire-main,.game-layout){height:100vh;height:100dvh;width:100%;max-width:none;margin:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);display:flex;flex-direction:column;gap:0;min-height:0;overflow:hidden}
body.immersive-game :is(.casual-title,.mine-title,.game-info,.casual-signature,.mine-field-bottom,.table-divider,.table-signature,.game-bottom,.sol-footer){display:none}
body.immersive-game :is(.casual-toolbar,.mine-toolbar,.sol-toolbar){display:none}
body.immersive-game :is(.casual-panel,.mine-field){display:flex;flex-direction:column;flex:1;min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:radial-gradient(ellipse at center,#2a4141,#17292f 80%)}
body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score,.stats){flex-shrink:0;min-height:54px;margin:0;padding:7px 12px 7px 58px;gap:12px;display:flex;align-items:center;justify-content:space-around;border:0;border-radius:0;background:#10202999;box-shadow:none}
body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score)>div{text-align:center;min-width:0}
body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score)>div>span{font:500 7px/1.4 var(--body);letter-spacing:.8px;color:#a1b8b9;display:block;white-space:nowrap}
body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score) b{font:500 19px/1.2 var(--display);margin:2px 0 0;font-variant-numeric:tabular-nums}
body.immersive-game #casual-stage{flex:1;min-height:0;min-width:0;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;padding:8px;overflow:hidden}
body.immersive-game :is(.arcade-stage,.canvas-wrap){max-width:none!important;margin:0;flex:none;min-height:0;min-width:0}
body.immersive-game :is(.collection-canvas,.arcade-canvas,.tetris-canvas){display:block;border:1px solid #8bb8b54d;border-radius:8px;max-width:100%;touch-action:none}
body.immersive-game .tetris-layout{max-width:none!important;display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px;margin:0;flex:none}
body.immersive-game .tetris-side{font-size:8px;padding-top:4px;letter-spacing:.8px}
body.immersive-game .tetris-side p{display:none}
body.immersive-game .tetris-next{width:64px;height:64px;margin-top:7px}
body.immersive-game :is(.tile-grid,.sudoku-grid,.checkers-board,.picross-grid,.sokoban-grid,.mahjong-board,.memory-grid){flex:none;margin:0;min-height:0;max-width:100%}
body.immersive-game .tile-grid{padding:7px;gap:7px;grid-template-rows:repeat(4,minmax(0,1fr))}
body.immersive-game .number-tile{aspect-ratio:auto;font-size:clamp(20px,7vw,50px)}
body.immersive-game .number-tile.high{font-size:clamp(20px,6vw,42px)}
body.immersive-game .number-tile.super{font-size:clamp(16px,4.8vw,34px)}
body.immersive-game .sudoku-grid{grid-template-rows:repeat(9,minmax(0,1fr))}
body.immersive-game .sudoku-cell{aspect-ratio:auto;font-size:var(--sudoku-digit,20px)}
body.immersive-game .memory-grid{gap:7px}
body.immersive-game .memory-card{aspect-ratio:auto;min-height:0;font-size:clamp(22px,6vw,48px)}
body.immersive-game .connect-buttons{flex:none;margin:0;gap:5px}
body.immersive-game .connect-buttons button{min-height:36px;height:36px}
body.immersive-game .connect-board{padding:8px;gap:5px}
body.immersive-game .checker-cell{padding:3px}
body.immersive-game .picross-grid{grid-template-rows:64px repeat(var(--picross-size),minmax(0,1fr));grid-template-columns:40px repeat(var(--picross-size),minmax(0,1fr))}
body.immersive-game .picross-cell{aspect-ratio:auto}
body.immersive-game .picross-clue{font-size:11px}
body.immersive-game .picross-clue.col{min-height:0}
body.immersive-game .sokoban-grid{padding:5px;gap:3px;aspect-ratio:auto}
body.immersive-game .mahjong-board{aspect-ratio:auto}
body.immersive-game :is(.casual-controls,.mine-modes,.immersive-sol-dock,.action-bar){flex:none;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:5px;margin:0;padding:7px 8px;background:#102029ed;border-top:1px solid #6e949128}
body.immersive-game :is(.casual-controls,.mine-modes,.immersive-sol-dock) :is(button.button,.sol-tool,.game-menu-button),body.immersive-game .mine-modes>button{min-height:46px;height:46px;padding:7px 11px;font-size:11px;border-radius:10px;box-shadow:none;transition:background .15s;transform:none;touch-action:manipulation}
body.immersive-game .casual-controls .button{gap:5px}
body.immersive-game .casual-controls .dpad{display:flex;gap:4px;flex:none}
body.immersive-game .dpad button{width:44px;min-height:46px;height:46px;font-size:23px;grid-area:auto;border-radius:10px}
body.immersive-game .dpad button[data-direction=left]{order:0}body.immersive-game .dpad button[data-direction=up]{order:1}body.immersive-game .dpad button[data-direction=down]{order:2}body.immersive-game .dpad button[data-direction=right]{order:3}
body.immersive-game button[data-compact-icon]{font-size:0!important;gap:0!important;width:44px;min-width:44px;padding:0!important;flex-shrink:0}
body.immersive-game button[data-compact-icon]>*{display:none}
body.immersive-game button[data-compact-icon]::before{content:attr(data-compact-icon);font:500 21px/1 var(--display)}
body.immersive-game .game-menu-button{display:grid;place-items:center;width:44px;min-width:44px;min-height:46px;padding:0;border:1px solid #496268;background:#263a42;color:#c6dbd6;border-radius:10px;font-size:25px!important;line-height:1;flex:none;touch-action:manipulation}
body.immersive-game .sudoku-pad{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));width:100%;gap:4px}
body.immersive-game .sudoku-pad button{min-height:44px;height:44px;font-size:22px;padding:0}
body.immersive-game .sudoku-tools{gap:5px}
body.immersive-game .puzzle-tools{display:contents}
body.immersive-game .tetris-controls{display:contents}
.immersive-game[data-game=tetris] .casual-controls{flex-wrap:nowrap;gap:4px}
.immersive-game[data-game=tetris] .casual-controls button{flex:1;min-width:0;width:auto;max-width:58px;min-height:48px;height:48px;font-size:22px;padding:0}
.immersive-game[data-game=tetris] .casual-controls button[data-compact-icon]{min-width:0}
body.immersive-game .flipper-buttons{width:100%;max-width:none;gap:8px;order:5}
body.immersive-game .flipper-buttons button{min-height:48px;height:48px;font-size:12px;touch-action:none}
body.immersive-game :is(.casual-message,.mine-message,.sol-message,.game-message){flex:none;display:block;min-height:0;max-height:34px;margin:0;padding:4px 12px 5px;text-align:center;color:#afc8c5;background:#102029ed;font-size:10px;line-height:1.4;overflow:auto;scrollbar-width:none}
body.immersive-game :is(.sol-message,.game-message)>span{display:none}
body.immersive-game :is(.sol-message,.game-message) p{margin:0;font-size:inherit;line-height:inherit}
body.immersive-game .mine-field{flex:1}
body.immersive-game .mine-indicator{display:none}
body.immersive-game .mine-stats{padding-bottom:7px}
body.immersive-game .mine-stats>div:last-child{text-align:center}
body.immersive-game .mine-scroll{flex:1;min-height:0;min-width:0;display:flex;align-items:flex-start;border:0;border-radius:0;padding:7px;background:transparent;overflow:auto;overscroll-behavior:contain}
body.immersive-game .mine-grid{grid-template-columns:repeat(var(--size),var(--mine-cell,32px));width:max-content;min-width:0;gap:3px;flex:none;margin:auto}
body.immersive-game .mine-cell{width:var(--mine-cell,32px);min-width:0;height:var(--mine-row,var(--mine-cell,32px));aspect-ratio:auto;min-height:0;font-size:clamp(14px,4vw,25px)}
body.immersive-game .mine-modes{flex-wrap:nowrap}
body.immersive-game .mine-modes>button:not(.game-menu-button){flex:1;max-width:200px}
body.immersive-game .solitaire-title{display:contents}
body.immersive-game .solitaire-title>div:first-child{display:none}
body.immersive-game .solitaire-score{justify-content:space-around;padding-top:7px}
body.immersive-game .solitaire-score>div:nth-child(2){display:block}
body.immersive-game .solitaire-score b small{font-size:11px}
body.immersive-game .card-table{flex:1;min-height:0;border:0;border-radius:0;padding:12px 10px;overflow:auto;overscroll-behavior:contain;--gap:7px;--step:25px;--closed-step:14px}
body.immersive-game .table-top{margin-bottom:20px}
body.immersive-game .tableau{padding-bottom:8px}
body.immersive-game .sol-actions{display:contents}
body.immersive-game .game-main{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;background:#17292f}
body.immersive-game .game-top{display:none}
body.immersive-game .stats{margin:0;gap:10px;justify-content:space-between}
body.immersive-game .stats>div{min-width:0;flex:initial}
body.immersive-game .stats>div>span{font-size:6px;letter-spacing:.5px;white-space:nowrap}
body.immersive-game .stats .icon{width:10px;height:10px}
body.immersive-game .floor-stat h2{font:500 13px/1.2 var(--display);margin:0;color:#d1e6dc;white-space:nowrap}
body.immersive-game .floor-stat .out-of{font-size:9px}
body.immersive-game .health-stat #hearts{max-width:100px;margin-top:4px;gap:2px}
body.immersive-game .heart{width:11px;height:11px}
body.immersive-game .energy-stat{width:60px;max-width:75px}
body.immersive-game .energy-stat>b{font-size:11px;bottom:-2px}
body.immersive-game .energy-meter{margin-top:8px;width:calc(100% - 25px)}
body.immersive-game .kills-stat>b{font-size:14px;margin-top:1px}
body.immersive-game .board-wrap{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;border:0;border-radius:0}
body.immersive-game .board-label{position:absolute;top:10px;left:10px;right:10px;z-index:2;padding:0;font-size:7px;pointer-events:none}
body.immersive-game #board{flex:1;min-height:0;width:100%;max-height:none;padding:0;display:block}
body.immersive-game .danger-toggle{position:absolute;left:8px;bottom:8px;z-index:3;margin:0;min-height:32px;font-size:9px;background:#14252bcc;padding:6px 10px}
body.immersive-game .action-bar{flex-wrap:nowrap;gap:4px;padding:6px}
body.immersive-game .action{min-width:0;min-height:54px;height:54px;padding:6px 1px;flex:1;gap:3px;border-radius:9px}
body.immersive-game .action>span{height:22px}body.immersive-game .action .icon{width:20px;height:20px}
body.immersive-game .action strong{font-size:9px}body.immersive-game .action small,body.immersive-game .action kbd{display:none}
body.immersive-game .action-bar>.game-menu-button{min-width:38px;width:38px;height:54px}
body.immersive-game dialog{max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
body.immersive-game .game-settings{padding:22px;max-width:430px}
body.immersive-game .game-settings[open]{display:flex;flex-direction:column;gap:18px}
.game-settings header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.game-settings h2{font:500 23px var(--display);margin:0}
.game-settings .settings-close{width:42px;height:42px;border:1px solid #4b646d;border-radius:10px;background:#253944;color:#d4e2df;font-size:23px;flex:none}
.game-settings .settings-actions{display:flex;flex-direction:column;gap:10px}
.game-settings .settings-actions>button{min-height:46px;height:auto;width:100%;display:flex;align-items:center;justify-content:center;gap:9px;padding:12px;font-size:13px;border:1px solid #496169;border-radius:10px;background:#273c43;color:#deebe5;transform:none}
.game-settings :is(#casual-options,.mine-toolbar,.memory-settings){display:flex;flex-direction:column;gap:12px}
.game-settings label{display:flex;justify-content:space-between;align-items:center;gap:12px;color:#bed0ce;font-size:12px;width:100%}
.game-settings select{max-width:65%;min-height:44px;padding:9px 10px;background:#1a2c35;color:#e3ebe4;border:1px solid #4b646d;border-radius:8px;font:12px var(--body)}
.game-settings :is(.casual-bottom,.mine-record,.sol-footer,.game-bottom){display:flex;flex-direction:column;align-items:stretch;margin:0;padding:14px 0 0;border-top:1px solid #455b5f;gap:12px;font-size:11px;color:#a5bcb9}
.game-settings :is(.casual-tip,.mine-tip){font-size:11px;line-height:1.8;margin:0;text-align:left;color:#afc5c1}
.game-settings .arcade-badge{font-size:10px;text-align:center;background:#20383b;color:#bcd1ca;border-color:#49666a}
.game-settings .save-note{font-size:11px;color:#a5bcb9}
@media(min-width:800px){body.immersive-game .casual-controls{gap:8px}body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score,.stats){min-height:58px}body.immersive-game .card-table{padding-inline:max(14px,calc((100vw - 1050px)/2));--gap:12px;--step:29px;--closed-step:16px}}
@media(max-height:480px){body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score,.stats){min-height:46px;padding-block:4px}body.immersive-game :is(.casual-stats,.mine-stats,.solitaire-score) b{font-size:15px}body.immersive-game :is(.casual-controls,.mine-modes,.immersive-sol-dock,.action-bar){padding-block:4px}body.immersive-game #casual-stage{padding:4px}.immersive-game[data-game=pinball] .flipper-buttons{width:auto;flex:1;order:0}.immersive-game[data-game=pinball] .flipper-buttons button{min-width:110px}body.immersive-game .casual-message{max-height:22px;padding-block:2px}.immersive-game[data-game=sudoku] .casual-controls{flex-wrap:nowrap}.immersive-game[data-game=sudoku] .sudoku-pad{flex:1;max-width:420px}.immersive-game[data-game=sudoku] .sudoku-tools{width:auto;flex:none}body.immersive-game .card-table{--step:21px;--closed-step:11px}body.immersive-game .table-top{max-width:520px;position:sticky;top:0;z-index:50;background:#22483e;padding-bottom:8px}body.immersive-game .tableau{max-width:100%}}

body.immersive-game .initial-game-message{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;max-height:1px!important;margin:0!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap;pointer-events:none}
