/* games-mobile.css */
/* V35: shared, native-like in-game interface */














/* Fullscreen must contain only the game shell, not the whole website. */
.game-panel:fullscreen,.classic-game-shell:fullscreen,.native-fullscreen{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:env(safe-area-inset-top,6px) max(9px,env(safe-area-inset-right)) env(safe-area-inset-bottom,6px) max(9px,env(safe-area-inset-left))!important;border-radius:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;background:#101b30!important;box-sizing:border-box!important}
.game-panel:fullscreen .native-game-controls,.classic-game-shell:fullscreen .native-game-controls{flex:none;margin-bottom:5px}
.game-panel:fullscreen .arcade-toolbar,.classic-game-shell:fullscreen .classic-top{flex:none;margin:0 0 5px!important;padding:3px 5px!important}
.game-panel:fullscreen .game-stats,.classic-game-shell:fullscreen .classic-bottom{flex:none;margin:0 0 5px!important}
.game-panel:fullscreen .game-canvas-wrap{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;max-height:none!important;overflow:hidden!important;padding:3px!important}
.game-panel:fullscreen .game-canvas-wrap canvas{display:block;max-width:100%!important;max-height:100%!important;width:auto!important;height:auto!important;object-fit:contain!important}
.game-panel:fullscreen .game-actions,.game-panel:fullscreen .game-controls{flex:none;margin:4px auto!important}
.game-panel:fullscreen .game-help{display:none!important}
.game-panel:fullscreen .arcade-board{flex:1 1 auto;min-height:0;max-height:100%;overflow:hidden!important;display:flex;flex-direction:column;align-items:center;justify-content:center}
.game-panel:fullscreen .game-overlay,.classic-game-shell:fullscreen .classic-overlay{position:absolute!important;inset:0!important;display:grid;place-items:center;padding:8px!important;overflow:hidden!important;background:#0b1525f2!important}
.game-panel:fullscreen .game-overlay[hidden],.classic-game-shell:fullscreen .classic-overlay[hidden]{display:none!important}
.game-panel:fullscreen .game-modal,.classic-game-shell:fullscreen .classic-modal{max-height:calc(100dvh - 28px)!important;overflow-y:auto!important;scrollbar-width:none!important}
.game-panel:fullscreen .game-modal::-webkit-scrollbar,.classic-game-shell:fullscreen .classic-modal::-webkit-scrollbar{display:none}
.classic-game-shell:fullscreen .classic-board{flex:1 1 auto;min-height:0;margin:4px auto!important;max-height:calc(100dvh - 155px)!important}
.classic-game-shell:fullscreen .classic-xadrez,.classic-game-shell:fullscreen .classic-damas{height:auto!important;width:auto!important;aspect-ratio:1!important;max-width:min(100%,calc(100dvh - 180px))!important;max-height:calc(100dvh - 180px)!important}
.classic-game-shell:fullscreen .chess-premium-layout{flex:1 1 auto;min-height:0;margin:0 auto!important;width:100%;max-width:950px;grid-template-columns:minmax(0,1fr) minmax(160px,220px);overflow:hidden}
.classic-game-shell:fullscreen .chess-board-column{min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center}
.classic-game-shell:fullscreen .chess-board-column .classic-xadrez{max-width:min(100%,calc(100dvh - 175px))!important;max-height:calc(100dvh - 175px)!important}
.classic-game-shell:fullscreen .chess-side-panel{min-height:0;overflow:hidden}
.classic-game-shell:fullscreen .chess-history-list{height:min(25dvh,180px)}
.classic-game-shell:fullscreen .classic-paciencia{width:100%;overflow-x:auto;overflow-y:auto;scrollbar-width:none;max-height:calc(100dvh - 175px)!important}
@media(max-width:850px){.game-panel:fullscreen .arcade-toolbar{display:none!important}.game-panel:fullscreen .game-stats{font-size:12px!important}.game-panel:fullscreen .game-controls .dpad button{min-height:35px!important;padding:4px 10px!important}.game-panel:fullscreen .game-actions button{padding:6px 10px!important;font-size:12px!important}.classic-game-shell:fullscreen .classic-top{gap:5px}.classic-game-shell:fullscreen .classic-brand img{width:30px;height:30px}.classic-game-shell:fullscreen .classic-brand strong{font-size:14px}.classic-game-shell:fullscreen .classic-actions button,.classic-game-shell:fullscreen .classic-actions a{font-size:11px!important;padding:6px!important}.classic-game-shell:fullscreen .chess-premium-layout{grid-template-columns:minmax(0,1fr);display:flex;flex-direction:column;align-items:center}.classic-game-shell:fullscreen .chess-side-panel{width:100%;display:flex;flex-wrap:wrap;gap:4px;padding:4px;flex:none;max-height:68px}.classic-game-shell:fullscreen .chess-player-bar{padding:1px}.classic-game-shell:fullscreen .chess-player-bar small{display:none}.classic-game-shell:fullscreen .chess-capture-strip{min-height:24px;padding:1px;flex:1}.classic-game-shell:fullscreen .chess-capture-strip img{width:15px;height:20px}.classic-game-shell:fullscreen .chess-history-head,.classic-game-shell:fullscreen .chess-history-list{display:none}.classic-game-shell:fullscreen .chess-board-column .classic-xadrez{max-height:calc(100dvh - 235px)!important;max-width:min(100%,calc(100dvh - 235px))!important}.classic-game-shell:fullscreen .chess-board-note{display:none}}
@media(max-height:650px){.game-panel:fullscreen .native-game-controls,.classic-game-shell:fullscreen .native-game-controls{padding:3px 8px}.game-panel:fullscreen .native-orientation-hint,.classic-game-shell:fullscreen .native-orientation-hint{display:none}}

/* iOS Safari fallback: fixed app-like shell when native fullscreen is unavailable */
html.native-game-open{overflow:hidden!important}
.native-simulated{position:fixed!important;inset:0!important;z-index:99999!important}
/* V35: shared, native-like in-game interface */
.native-game-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;margin:0 0 9px;border-radius:12px;background:#0b1629;border:1px solid #334b6c;color:#d8e6ff;position:relative;z-index:30}
.native-game-label{font-size:11px;letter-spacing:.1em;font-weight:800;white-space:nowrap}.native-game-label b{color:#8bb5ff}
.native-game-buttons{display:flex;gap:5px;align-items:center}.native-game-buttons button{font-size:12px!important;padding:7px 9px!important;border-radius:8px!important;white-space:nowrap;min-height:34px}
.native-quick-play{margin:12px auto 8px;display:flex;justify-content:center;width:100%}.native-quick-play button{font-size:17px!important;font-weight:800!important;min-height:52px!important;width:min(100%,350px)!important;background:linear-gradient(115deg,#547af9,#7845e7)!important;color:white!important;border:0!important;box-shadow:0 8px 22px #4562d350}
.native-menu-settings{border:1px solid #415476;border-radius:12px;padding:10px 12px;margin:10px auto;background:#172740;width:100%;box-sizing:border-box;text-align:left}
.native-menu-settings summary{cursor:pointer;font-size:13px;font-weight:700;color:#cfe1ff}.native-menu-settings[open] summary{margin-bottom:10px}
.native-menu-settings .avatar-choices{justify-content:center}.native-menu-back{display:block;margin:13px auto 3px;color:#bcd2f8!important;text-decoration:none;font-size:13px;font-weight:700;text-align:center}
.native-orientation-hint{font-size:11px;color:#a6c3e9;text-align:center;margin:2px auto 8px}
.game-panel .game-overlay,.classic-game-shell .classic-overlay{z-index:25}
.game-panel .game-modal,.classic-game-shell .classic-modal{max-width:min(96%,440px)!important;box-sizing:border-box;max-height:none!important;overflow:visible!important;padding:18px!important}
.game-panel .game-modal .avatar-choices{gap:5px}.game-panel .game-modal .avatar-option{width:44px;height:44px}
.game-panel .game-modal .avatar-picture{width:37px;height:37px}
.game-panel .game-modal-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:7px}
.game-panel .game-modal-actions button{font-size:12px;padding:9px 11px}
/* Fullscreen must contain only the game shell, not the whole website. */
.game-panel.native-simulated,.classic-game-shell.native-simulated,.native-fullscreen{width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:env(safe-area-inset-top,6px) max(9px,env(safe-area-inset-right)) env(safe-area-inset-bottom,6px) max(9px,env(safe-area-inset-left))!important;border-radius:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;background:#101b30!important;box-sizing:border-box!important}
.game-panel.native-simulated .native-game-controls,.classic-game-shell.native-simulated .native-game-controls{flex:none;margin-bottom:5px}
.game-panel.native-simulated .arcade-toolbar,.classic-game-shell.native-simulated .classic-top{flex:none;margin:0 0 5px!important;padding:3px 5px!important}
.game-panel.native-simulated .game-stats,.classic-game-shell.native-simulated .classic-bottom{flex:none;margin:0 0 5px!important}
.game-panel.native-simulated .game-canvas-wrap{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;max-height:none!important;overflow:hidden!important;padding:3px!important}
.game-panel.native-simulated .game-canvas-wrap canvas{display:block;max-width:100%!important;max-height:100%!important;width:auto!important;height:auto!important;object-fit:contain!important}
.game-panel.native-simulated .game-actions,.game-panel.native-simulated .game-controls{flex:none;margin:4px auto!important}
.game-panel.native-simulated .game-help{display:none!important}
.game-panel.native-simulated .arcade-board{flex:1 1 auto;min-height:0;max-height:100%;overflow:hidden!important;display:flex;flex-direction:column;align-items:center;justify-content:center}
.game-panel.native-simulated .game-overlay,.classic-game-shell.native-simulated .classic-overlay{position:absolute!important;inset:0!important;display:grid;place-items:center;padding:8px!important;overflow:hidden!important;background:#0b1525f2!important}
.game-panel.native-simulated .game-overlay[hidden],.classic-game-shell.native-simulated .classic-overlay[hidden]{display:none!important}
.game-panel.native-simulated .game-modal,.classic-game-shell.native-simulated .classic-modal{max-height:calc(100dvh - 28px)!important;overflow-y:auto!important;scrollbar-width:none!important}
.game-panel.native-simulated .game-modal::-webkit-scrollbar,.classic-game-shell.native-simulated .classic-modal::-webkit-scrollbar{display:none}
.classic-game-shell.native-simulated .classic-board{flex:1 1 auto;min-height:0;margin:4px auto!important;max-height:calc(100dvh - 155px)!important}
.classic-game-shell.native-simulated .classic-xadrez,.classic-game-shell.native-simulated .classic-damas{height:auto!important;width:auto!important;aspect-ratio:1!important;max-width:min(100%,calc(100dvh - 180px))!important;max-height:calc(100dvh - 180px)!important}
.classic-game-shell.native-simulated .chess-premium-layout{flex:1 1 auto;min-height:0;margin:0 auto!important;width:100%;max-width:950px;grid-template-columns:minmax(0,1fr) minmax(160px,220px);overflow:hidden}
.classic-game-shell.native-simulated .chess-board-column{min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center}
.classic-game-shell.native-simulated .chess-board-column .classic-xadrez{max-width:min(100%,calc(100dvh - 175px))!important;max-height:calc(100dvh - 175px)!important}
.classic-game-shell.native-simulated .chess-side-panel{min-height:0;overflow:hidden}
.classic-game-shell.native-simulated .chess-history-list{height:min(25dvh,180px)}
.classic-game-shell.native-simulated .classic-paciencia{width:100%;overflow-x:auto;overflow-y:auto;scrollbar-width:none;max-height:calc(100dvh - 175px)!important}
@media(max-width:850px){.game-panel.native-simulated .arcade-toolbar{display:none!important}.game-panel.native-simulated .game-stats{font-size:12px!important}.game-panel.native-simulated .game-controls .dpad button{min-height:35px!important;padding:4px 10px!important}.game-panel.native-simulated .game-actions button{padding:6px 10px!important;font-size:12px!important}.classic-game-shell.native-simulated .classic-top{gap:5px}.classic-game-shell.native-simulated .classic-brand img{width:30px;height:30px}.classic-game-shell.native-simulated .classic-brand strong{font-size:14px}.classic-game-shell.native-simulated .classic-actions button,.classic-game-shell.native-simulated .classic-actions a{font-size:11px!important;padding:6px!important}.classic-game-shell.native-simulated .chess-premium-layout{grid-template-columns:minmax(0,1fr);display:flex;flex-direction:column;align-items:center}.classic-game-shell.native-simulated .chess-side-panel{width:100%;display:flex;flex-wrap:wrap;gap:4px;padding:4px;flex:none;max-height:68px}.classic-game-shell.native-simulated .chess-player-bar{padding:1px}.classic-game-shell.native-simulated .chess-player-bar small{display:none}.classic-game-shell.native-simulated .chess-capture-strip{min-height:24px;padding:1px;flex:1}.classic-game-shell.native-simulated .chess-capture-strip img{width:15px;height:20px}.classic-game-shell.native-simulated .chess-history-head,.classic-game-shell.native-simulated .chess-history-list{display:none}.classic-game-shell.native-simulated .chess-board-column .classic-xadrez{max-height:calc(100dvh - 235px)!important;max-width:min(100%,calc(100dvh - 235px))!important}.classic-game-shell.native-simulated .chess-board-note{display:none}}
@media(max-height:650px){.game-panel.native-simulated .native-game-controls,.classic-game-shell.native-simulated .native-game-controls{padding:3px 8px}.game-panel.native-simulated .native-orientation-hint,.classic-game-shell.native-simulated .native-orientation-hint{display:none}}
/* V35 final geometry: board must not collapse or stretch in fullscreen */
@media(max-width:850px){.classic-game-shell:fullscreen .chess-premium-layout,.classic-game-shell.native-simulated .chess-premium-layout{width:100%!important;flex:1 1 auto!important;min-height:0!important;align-items:center!important;justify-content:center!important}.classic-game-shell:fullscreen .chess-board-column,.classic-game-shell.native-simulated .chess-board-column{width:100%!important;flex:1 1 auto!important;min-height:0!important;align-items:center!important;justify-content:center!important}.classic-game-shell:fullscreen .chess-board-column .classic-xadrez,.classic-game-shell.native-simulated .chess-board-column .classic-xadrez,
 .classic-game-shell:fullscreen .classic-damas,.classic-game-shell.native-simulated .classic-damas{
  flex:0 0 auto!important;box-sizing:border-box!important;
  width:min(calc(100vw - 24px),calc(100dvh - 270px))!important;
  height:min(calc(100vw - 24px),calc(100dvh - 270px))!important;
  min-width:0!important;min-height:0!important;
  max-width:100%!important;max-height:calc(100dvh - 270px)!important;
  aspect-ratio:1/1!important;margin:4px auto!important;
 }.game-panel:fullscreen .game-canvas-wrap,.game-panel.native-simulated .game-canvas-wrap{
  flex:0 1 auto!important;height:auto!important;min-height:0!important;
  max-height:calc(100dvh - 255px)!important;margin:auto!important;
 }.game-panel:fullscreen .game-canvas-wrap canvas,.game-panel.native-simulated .game-canvas-wrap canvas{
  max-height:calc(100dvh - 260px)!important;
  max-width:min(100%,calc(100dvh - 260px))!important;
 }.game-panel:fullscreen .game-controls,.game-panel.native-simulated .game-controls{display:flex!important;flex:none!important;justify-content:center!important;max-height:100px!important}}

/* Keep the launch screen focused on playing; instructions appear on demand. */
.classic-modal #classic-modal-desc{display:none}.classic-modal.show-help #classic-modal-desc{display:block}
/* Full-width arcade stage avoids shrink-to-content on small grids. */
.game-panel:fullscreen .arcade-board,.game-panel.native-simulated .arcade-board{width:100%!important;box-sizing:border-box!important}
.game-panel:fullscreen .memory-grid,.game-panel.native-simulated .memory-grid{
 width:min(100%,calc(100dvh - 250px),440px)!important;flex:0 0 auto!important;
}
.game-panel:fullscreen .board-2048,.game-panel.native-simulated .board-2048{
 width:min(100%,calc(100dvh - 245px),400px)!important;
 height:min(calc(100vw - 32px),calc(100dvh - 245px),400px)!important;
 aspect-ratio:1!important;flex:0 0 auto!important;box-sizing:border-box!important;
}
.game-panel:fullscreen .ttt-grid,.game-panel.native-simulated .ttt-grid{
 width:min(100%,calc(100dvh - 255px),370px)!important;flex:0 0 auto!important;
}


/* V39: Tetris-specific presentation; no other games affected. */
#game-panel:has(canvas[data-game="tetris"]) .tetris-previews{display:flex;justify-content:center;gap:14px;margin:8px auto 12px;max-width:340px}
#game-panel:has(canvas[data-game="tetris"]) .tetris-preview{display:flex;align-items:center;flex-direction:column;gap:3px;background:linear-gradient(150deg,#182b48,#101c35);border:1px solid #4b6a9277;border-radius:12px;padding:6px 12px;min-width:125px;box-shadow:inset 0 1px #ffffff16}
#game-panel:has(canvas[data-game="tetris"]) .tetris-preview span{font-size:10px;letter-spacing:.16em;font-weight:800;color:#b7d4ed}
#game-panel:has(canvas[data-game="tetris"]) .tetris-preview canvas{width:90px;height:55px}
#game-panel:has(canvas[data-game="tetris"]) .tetris-pad{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;width:min(100%,400px);margin:8px auto;touch-action:none}
#game-panel:has(canvas[data-game="tetris"]) .tetris-pad button{min-height:56px;border-radius:13px;background:linear-gradient(160deg,#294b76,#172d50);border:1px solid #74c7e777;color:#fff;font-size:25px;font-weight:800;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:0 4px 0 #0b172c,0 8px 18px #0004}
#game-panel:has(canvas[data-game="tetris"]) .tetris-pad button:active{transform:translateY(3px);box-shadow:0 1px 0 #0b172c;background:#366a93}
#game-panel:has(canvas[data-game="tetris"]) .tetris-pad button[data-action="drop"]{background:linear-gradient(150deg,#5b3aa5,#342467)}
#game-panel:has(canvas[data-game="tetris"]) .tetris-pad button[data-action="hold"]{font-size:12px;letter-spacing:.04em;background:linear-gradient(150deg,#2e776b,#185044)}
#game-panel:has(canvas[data-game="tetris"]) canvas#game{touch-action:none;max-height:min(65vh,600px)}
@media(max-width:600px){#game-panel:has(canvas[data-game="tetris"]) .tetris-pad{gap:7px;max-width:340px}#game-panel:has(canvas[data-game="tetris"]) .tetris-pad button{min-height:55px}#game-panel:has(canvas[data-game="tetris"]) .tetris-previews{margin:3px auto 6px;gap:8px}#game-panel:has(canvas[data-game="tetris"]) .tetris-preview{min-width:105px;padding:4px 8px}#game-panel:has(canvas[data-game="tetris"]) .tetris-preview canvas{height:43px}}

