*{box-sizing:border-box}body{margin:0;background:#f7f9f3;color:#274638;font-family:system-ui,-apple-system,"Noto Sans SC",sans-serif}.game{max-width:470px;margin:auto;padding:25px 20px 36px}.heading{display:flex;justify-content:space-between;align-items:center;gap:15px}.eyebrow{font-size:10px;letter-spacing:1.6px;color:#8fad8e;font-weight:800}.heading h1{font-size:26px;letter-spacing:-1px;margin:5px 0}.heading p{color:#92a497;font-size:12px;margin:0;line-height:1.6}.restart{border:0;background:#315a44;color:white;border-radius:8px;padding:10px 13px;font-weight:700;font-size:12px;white-space:nowrap}.restart:hover{background:#46785a}.stats{display:flex;gap:8px;margin:22px 0 14px}.stat{background:#e9f1e3;border-radius:8px;padding:9px 15px;min-width:85px;font-size:10px;color:#87a08b}.stat strong{display:block;color:#31583d;font-size:18px;margin-top:2px}.message{min-height:22px;font-size:12px;color:#6b9273;margin:10px 0}.board{background:#c5d6bd;padding:9px;border-radius:12px;display:grid;gap:7px;touch-action:none;user-select:none}.board-2048{grid-template-columns:repeat(4,1fr);aspect-ratio:1}.cell{min-width:0;border:0;border-radius:7px;background:#dce8d6;display:grid;place-items:center;font-size:clamp(20px,6vw,34px);font-weight:800;color:#42664d}.cell[data-value="2"]{background:#f5f6df}.cell[data-value="4"]{background:#e5efbd}.cell[data-value="8"]{background:#bfdf99}.cell[data-value="16"]{background:#93c981;color:white}.cell[data-value="32"]{background:#6eb47c;color:white}.cell[data-value="64"]{background:#4c986d;color:white}.cell.high{background:#e3ad72;color:white;font-size:clamp(17px,5vw,28px)}.help{font-size:12px;color:#95a69a;line-height:1.8;margin:16px 0}.board-memory{grid-template-columns:repeat(4,1fr);aspect-ratio:1;background:#e8d6cd}.memory-cell{background:#d99883;color:#fff;font-size:clamp(22px,7vw,38px);cursor:pointer}.memory-cell.revealed,.memory-cell.matched{background:#fff7eb;color:#bc806d}.memory-cell.matched{opacity:.65}.board-mines{grid-template-columns:repeat(9,1fr);aspect-ratio:1;gap:3px;padding:6px;background:#a6c0bb}.mine-cell{border-radius:4px;background:#dcebe4;color:#4e8a74;font-size:clamp(13px,3.5vw,19px);cursor:pointer}.mine-cell.open{background:#f0f6eb}.mine-cell.flagged{color:#d77d66}.mine-cell.bomb{background:#e6a28d}.mode{border:1px solid #d6e4d2;border-radius:7px;background:white;color:#668a6c;padding:7px 10px;font-size:11px;cursor:pointer}.mode.active{background:#315a44;color:white}.snake-board{position:relative;background:#d9ebcf;border:8px solid #c2dbb9;border-radius:12px;width:100%;aspect-ratio:1;display:block;touch-action:none}.controls{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,42px);gap:5px;justify-content:center;margin:14px auto 0}.controls button{border:0;border-radius:7px;background:#dcebd7;color:#416d4c;font-size:18px;touch-action:manipulation}.controls button:first-child{grid-column:2}.controls button:nth-child(2){grid-column:1;grid-row:2}.controls button:nth-child(3){grid-column:2;grid-row:2}.controls button:nth-child(4){grid-column:3;grid-row:2}.back{display:inline-block;margin-top:5px;color:#80a388;font-size:11px;text-decoration:none}button:focus-visible{outline:3px solid #76a9cc;outline-offset:2px}
@media(max-height:760px){.game{padding:14px 16px 24px}.stats{margin:12px 0 8px}.message{margin:6px 0}.board-2048,.board-memory,.board-mines{width:min(100%,max(180px,calc(100vh - 285px)));margin-inline:auto}.snake-board{width:min(100%,max(180px,calc(100vh - 360px)));margin-inline:auto}.help{margin:10px 0}}
