/* Mission Arcade v1.3.4 – iPhone playability pass. Keep scroll possible, hide scrollbar chrome. */
html,body{overflow-x:clip;scrollbar-width:none}
html::-webkit-scrollbar,body::-webkit-scrollbar,main::-webkit-scrollbar,.game::-webkit-scrollbar{width:0;height:0;display:none}
body.game-mode .game.active{width:100%;min-width:0}
body.game-mode .game.active>*{max-width:100%;box-sizing:border-box}
body.game-mode .game.active .backrow{width:100%;min-width:0}
body.game-mode .game.active>.stats{width:100%;min-width:0}
body.game-mode .game.active>.status{width:100%;box-sizing:border-box}
body.game-mode .game.active .btn{touch-action:manipulation}
/* Block Puzzle: real edge-to-edge 8x8 grid and generous piece tray. */
body.game-mode #blocks{width:100%}
body.game-mode #blocks .block-board{width:min(100%,480px);max-width:480px;aspect-ratio:1/1;align-self:center;margin:7px auto;padding:6px;gap:3px;flex:0 0 auto;touch-action:none}
#blocks .block-cell{min-width:0;min-height:0;aspect-ratio:1/1;border-radius:5px}
body.game-mode #blocks .pieces{width:min(100%,480px);max-width:480px;align-self:center;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:7px auto;flex:0 0 auto}
#blocks .piece{min-width:0;min-height:94px;border-width:2px;touch-action:none;user-select:none;-webkit-user-select:none}
#blocks .piecegrid{gap:3px}
#blocks .unit{width:clamp(18px,5.2vw,26px);height:clamp(18px,5.2vw,26px)}
#blocks .block-drag-ghost{filter:drop-shadow(0 5px 13px rgba(0,0,0,.65))}
body.game-mode #blocks #blockRestart{width:min(100%,480px)!important;max-width:480px;align-self:center;min-height:47px}
/* Mahjong: stable geometry with enough room on tall and short phones. */
body.game-mode #mahjong .mahjong-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
body.game-mode #mahjong .mahjong-hero{display:none}
body.game-mode #mahjong .mahjong-status{margin:4px 0;padding:8px 10px;min-height:44px;font-size:12.5px;line-height:1.28}
#mahjong .mahjong-bonus{align-self:center;width:min(100%,620px);text-align:center;font-size:12px;color:#ffdb7d;font-weight:850;margin:0 auto 3px;padding:4px 7px}
body.game-mode #mahjong .mahjong-board-frame{width:min(100%,620px);max-width:620px;box-sizing:border-box;align-self:center;margin:5px auto 8px;padding:7px 6px;overflow:hidden;flex:0 0 auto;contain:layout}
body.game-mode #mahjong .mahjong-board{width:100%;height:auto;aspect-ratio:var(--mj-cols) / var(--mj-rows);max-height:none;display:grid;grid-template-columns:repeat(var(--mj-cols),minmax(0,1fr));grid-template-rows:repeat(var(--mj-rows),minmax(0,1fr));min-width:0;min-height:0;gap:4px;align-content:stretch;justify-content:stretch;box-sizing:border-box}
body.game-mode #mahjong .mahjong-stone{aspect-ratio:auto;box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;max-height:100%;padding:0 1px;overflow:hidden;transition:none;touch-action:manipulation}
body.game-mode #mahjong .mahjong-stone .glyph{font-size:clamp(18px,6.4vw,34px);line-height:1}
body.game-mode #mahjong .mahjong-stone .stone-index{font-size:clamp(8px,2vw,11px)}
body.game-mode #mahjong .mahjong-actions{width:min(100%,620px);max-width:620px;align-self:center;gap:7px;margin:5px auto 10px}
body.game-mode #mahjong .mahjong-actions .btn{min-height:49px;font-size:clamp(12px,3.5vw,15px)}
body.game-mode #mahjong .mahjong-rules{width:min(100%,620px);align-self:center;margin:7px auto}
#mahjong .mahjong-stone.wrong{outline:3px solid #ff6481!important;outline-offset:-3px!important;background:linear-gradient(145deg,#ffe0e4,#ff9cac)!important;box-shadow:0 0 0 3px rgba(255,100,129,.43),0 0 20px rgba(255,100,129,.5)!important;filter:brightness(1.1)!important;animation:mahjong-wrong .24s ease-in-out 2}
@keyframes mahjong-wrong{0%,100%{translate:0}35%{translate:-3px}70%{translate:3px}}
/* Tablet / landscape still remain centered instead of stretching the tiles beyond usability. */
@media(min-width:700px){body.game-mode #mahjong .mahjong-board{width:min(100%,610px)}}
@media(max-height:720px){body.game-mode #blocks .block-board{width:min(100%,390px)}}
@media(prefers-reduced-motion:reduce){#mahjong .mahjong-stone.wrong{animation:none}}
