
/* Mission Arcade 1.3 — immersive portrait gameplay; scroll remains available for long instructions */
html,body{overscroll-behavior-y:contain}
body.game-mode{background:#071326;min-height:100dvh}
body.game-mode>main{width:100%;max-width:none;margin:0;padding:calc(env(safe-area-inset-top) + 6px) 10px max(14px,env(safe-area-inset-bottom))}
body.game-mode>main>header{display:none}
body.game-mode .footer{display:none}
body.game-mode .game.active{display:flex;flex-direction:column;min-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);max-width:840px;margin:0 auto}
body.game-mode .backrow{position:sticky;top:0;z-index:11;background:#081527eb;backdrop-filter:blur(12px);margin:0 0 8px;padding:6px 2px;min-height:46px}
body.game-mode .backrow .game-heading{font-size:16px}
body.game-mode .game .status{margin:8px 0;padding:10px}
body.game-mode .game .stats{gap:6px}
body.game-mode .game .stat{padding:8px 4px}
body.game-mode .game .panel{margin:8px 0}
body.game-mode .ttt-board,body.game-mode .block-board,body.game-mode .maze,body.game-mode .circuit,body.game-mode .water-board,body.game-mode .gravity-board{width:100%;max-width:min(calc(100vw - 20px), min(65dvh,620px));margin:10px auto}
body.game-mode .ttt-board{max-width:min(calc(100vw - 20px), min(67dvh,600px))}
body.game-mode .block-board{width:min(calc(100vw - 20px),min(62dvh,640px));max-width:none}
body.game-mode .pieces{width:100%;max-width:min(98vw,620px);margin:10px auto}
body.game-mode .circuit{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
body.game-mode .circuit button{font-size:clamp(23px,7vw,39px);border-radius:12px;min-width:0}
.circuit .circuit-wall{opacity:.5;background:repeating-linear-gradient(45deg,#15283f,#15283f 6px,#0b1a2c 6px,#0b1a2c 12px);border:1px solid #283e5d}
.circuit .circuit-empty{background:#101d2f;border:1px dashed #243950}
.circuit .circuit-decoy{border:2px solid #54678a;background:#26344e}
.circuit-help{margin:2px 0 4px;text-align:center}
/* Locked grid dimensions stop the puzzle from expanding on selection or after removing a pair. */
body.game-mode .mahjong-hero{display:none}
.mahjong-board-frame,body.game-mode .mahjong-board-frame{width:100%;max-width:min(calc(100vw - 20px),680px);margin:9px auto;padding:7px;overflow:hidden;contain:layout}
.mahjong-board{width:100%;aspect-ratio:auto;grid-template-columns:repeat(var(--mj-cols),minmax(0,1fr));grid-template-rows:repeat(var(--mj-rows),minmax(0,1fr));height:min(65dvh,calc((100vw - 36px)*var(--mj-rows)/var(--mj-cols)*1.25));min-height:0;gap:4px;align-content:stretch}
.mahjong-stone,.mahjong-stone.upper{box-sizing:border-box;width:100%;height:100%;aspect-ratio:auto;min-width:0;min-height:0;overflow:hidden;contain:size;transform:none;padding:1px;outline-offset:-3px;box-shadow:inset -2px -3px 0 #72999b}
.mahjong-stone.upper{transform:translate(2px,-2px);box-shadow:inset -2px -3px 0 #7aa09b,2px 3px 4px #0008}
.mahjong-stone.chosen{outline:3px solid #ffc954;box-shadow:inset 0 0 0 2px #ffc95455}
.mahjong-stone.hinted{outline:3px solid #70fbc8;box-shadow:inset 0 0 0 2px #70fbc855}
.mahjong-stone .glyph{font-size:clamp(19px,6vw,35px)}
.mahjong-stone .stone-index{font-size:clamp(7px,2vw,11px)}
.mahjong-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
body.game-mode .mahjong-actions{margin:7px 0}
/* Touch drag for Block Puzzle */
.piece{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;min-height:90px}
.piece:active{cursor:grabbing}
.block-drag-ghost{position:fixed;z-index:900;pointer-events:none;display:grid;gap:3px;transform:translate(-50%,-50%);opacity:.9;filter:drop-shadow(0 5px 9px #000a)}
.block-drag-ghost span{display:block;width:26px;height:26px;border-radius:5px}
.block-drag-ghost .filled{background:linear-gradient(130deg,#9b82ff,#5ce4ff);border:1px solid #b6eeff}
.block-drag-ghost .empty{opacity:0}
.block-cell.preview{background:#2dbb9a!important;border-color:#b6f9dc!important}
.block-cell.invalid{background:#ad506b!important}
@media(min-width:600px){body.game-mode .mahjong-board{height:min(65dvh,500px)}body.game-mode .mahjong-stone .glyph{font-size:27px}}
@media(max-height:700px){body.game-mode .mahjong-board{height:min(53dvh,calc((100vw - 36px)*var(--mj-rows)/var(--mj-cols)*1.2))}}
