.puzzle .game-card{max-width:680px}.puzzle .stage{width:min(100%,470px,max(265px,calc(100dvh - 290px)));aspect-ratio:1;touch-action:pan-y}.puzzle .stage:has(.numbers-board){touch-action:none}.puzzle .expanded .stage{touch-action:none}.memory-board,.numbers-board{position:absolute;inset:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:9px;padding:12px;background:#0a2033}.memory-board[data-size="6"]{grid-template-rows:repeat(3,minmax(0,1fr))}.memory-board[data-size="12"]{grid-template-rows:repeat(6,minmax(0,1fr));gap:6px}.memory-card{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:0;border:1px solid #426d89;background:linear-gradient(145deg,#163c58,#102b44);border-radius:12px;overflow:hidden}.memory-card:disabled{opacity:1;cursor:default}.memory-card .face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;background:#d8eeef;transition:opacity .16s ease}.memory-card .face svg{display:block;width:86%;height:86%}.memory-card .back{color:#72e8e0;font-size:clamp(20px,7vw,34px);font-weight:800}.memory-card .back img{position:absolute;bottom:7px;right:7px;width:17px;height:17px;opacity:.6}.memory-card.open .face{opacity:1}.memory-card.matched{border-color:#61eed1;box-shadow:inset 0 0 0 2px #61eed1}.memory-card.matched .face{background:#d2f3e3}.memory-card.matched::after{content:'✓';position:absolute;bottom:4px;right:5px;color:#126b59;font-size:13px;font-weight:800}.memory-card:focus-visible{outline-offset:-4px;z-index:1}.mode-choice{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;margin:0 0 12px;padding:0;border:0}.mode-choice label{display:flex;align-items:center;gap:6px;font-size:12px;min-height:36px;border:1px solid #2d4e68;border-radius:9px;padding:6px 9px;cursor:pointer}.mode-choice label:has(input:checked){border-color:#53e3d8;color:#9cfff0;background:#103447}.mode-choice input{accent-color:#45dbd0;width:16px;height:16px;margin:0}.mode-choice:disabled label{opacity:.55;cursor:default}.numbers-board{gap:10px;padding:14px;background:#10263b}.number-tile{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;border-radius:12px;background:#19364e;font-size:clamp(25px,8vw,43px);font-weight:850;line-height:1;color:#0c3448;font-variant-numeric:tabular-nums;box-shadow:inset 0 1px 0 #ffffff18}.number-tile.large{font-size:clamp(20px,6vw,34px)}.number-tile.huge{font-size:clamp(15px,5vw,27px)}.number-tile.spawned{animation:tile-arrive .15s ease-out}.number-tile.merged{animation:tile-merge .18s ease-out}.directions{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,44px);justify-content:center;gap:6px;margin:12px auto 0}.directions button{padding:5px}.directions #up{grid-column:2}.directions #left{grid-column:1;grid-row:2}.directions #down{grid-column:2;grid-row:2}.directions #right{grid-column:3;grid-row:2}.puzzle .expanded .play-area{flex:1;justify-content:center;min-height:0}.puzzle .expanded .mode-choice{margin-bottom:6px}.puzzle .expanded .controls{margin-top:7px}.puzzle .expanded .directions{margin-top:7px}.puzzle .expanded .number-tile{font-size:clamp(18px,7vw,45px)}.puzzle .expanded .number-tile.large{font-size:clamp(15px,6vw,32px)}.puzzle .expanded .number-tile.huge{font-size:clamp(12px,4vw,26px)}@keyframes tile-arrive{from{transform:scale(.75);opacity:.6}to{transform:scale(1);opacity:1}}@keyframes tile-merge{50%{transform:scale(1.08)}100%{transform:scale(1)}}@media(max-width:480px){.memory-board{gap:7px;padding:10px}.memory-card{border-radius:9px}.mode-choice label{font-size:11px;padding:5px 7px}.puzzle .game-top h1{font-size:16px}.numbers-board{gap:8px;padding:11px}.number-tile{border-radius:9px}.puzzle .hud{gap:10px 23px}.puzzle .overlay-inner{padding:18px}.puzzle .overlay h2{font-size:24px}}@media(max-height:500px) and (orientation:landscape){.puzzle .expanded .stage{overflow:visible}.puzzle .expanded .overlay{position:fixed;z-index:20}.puzzle .expanded .overlay-inner{max-width:350px;padding:20px}.puzzle .expanded .overlay h2{font-size:24px}.puzzle .expanded .overlay p{font-size:14px}.puzzle .expanded .mode-choice{position:absolute;left:12px;top:65px;max-width:90px}.puzzle .expanded .controls{position:absolute;right:12px;bottom:14px;max-width:175px}.puzzle .expanded .directions{position:absolute;left:14px;bottom:14px}.puzzle .expanded .hud{margin-top:3px;margin-bottom:6px}.puzzle .expanded .memory-board,.puzzle .expanded .numbers-board{border-radius:16px}.memory-card .back img{display:none}}@media(prefers-reduced-motion:reduce){.number-tile{animation:none!important}.memory-card .face{transition:none}}

.numbers-board{grid-template-columns:1fr}.number-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;min-height:0}@media(max-width:480px){.number-row{gap:8px}}
