/* Keep large maps and growing memory decks usable on small touchscreens. */
.mirror-palette{margin-top:16px;text-align:center;color:#7a8d86;font-size:12px}
.mirror-palette>div{display:flex;justify-content:center;gap:10px;margin-top:10px}
.mirror-palette button{width:62px;height:64px;min-width:44px;min-height:44px;border-radius:16px;padding:8px;background:#fffaf0;border:2px solid #d7e0d0}
.mirror-palette button.selected{border-color:#c9aa67;background:#fff0c9;box-shadow:0 0 0 3px #ecdcba80}
.math-group .math-object{min-width:44px;min-height:48px;width:44px;height:48px;flex-shrink:0}
.memory-grid{grid-template-columns:repeat(var(--columns),minmax(44px,90px));width:100%;max-width:430px;align-self:center;gap:12px}
.memory-grid .memory-pad{width:100%;padding:10px;min-height:80px}
.memory-grid .memory-pad .art{width:100%;height:65px}
.puzzle-canvas-viewport{width:100%;min-width:0;overflow-x:auto;padding:8px;flex:1}
.puzzle-canvas-viewport .puzzle-board{min-width:calc(var(--puzzle-cols)*55px + 6px);margin:0 auto}
.puzzle-board.game-board .puzzle-tray{grid-template-columns:repeat(5,minmax(44px,88px))!important;gap:12px!important;max-width:510px;max-height:320px;overflow:auto;padding:7px;align-self:center}
.puzzle-board.game-board .puzzle-tray .puzzle-piece{min-height:60px;padding:5px!important}
.puzzle-board.game-board .puzzle-tray:has(>:nth-child(5)):not(:has(>:nth-child(10))){grid-template-columns:repeat(3,minmax(44px,88px))!important}
.puzzle-board.game-board .puzzle-tray:not(:has(>:nth-child(5))){grid-template-columns:repeat(2,minmax(44px,88px))!important}
.puzzle-scroll-hint{text-align:center;color:#8c9b80;font-size:11px;margin-top:-8px}
.spatial-board{min-width:0;gap:18px}
.path-overview{display:flex;gap:18px;align-items:center;justify-content:center;color:#658376}
.path-overview>div:last-child{display:flex;flex-direction:column;gap:6px;font-size:12px}
.path-overview strong{font-size:18px;letter-spacing:2px}
.path-overview small{font-size:11px;color:#879984}
.path-mini{display:grid;grid-template-columns:repeat(var(--size),16px);gap:2px;padding:6px;border-radius:10px;background:#d4e0ce;flex-shrink:0}
.path-mini>span{width:16px;height:16px;border-radius:3px;background:#faf8e9}
.path-mini>span.wall{background:#a9be9d}
.path-mini>span.mini-visited{background:#e4d2a7}
.path-mini>span.mini-here{background:#ffd881;box-shadow:0 0 0 2px #ba9657}
.path-mini .art{width:100%;height:100%}
.path-viewport{width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;padding:5px 0 12px;border-radius:18px;scrollbar-color:#bbceb4 #edf0e2}
.path-viewport .path-grid{--cell:64px;width:max-content;max-width:none;margin:0 auto;grid-template-columns:repeat(var(--size),var(--cell));gap:6px;padding:10px}
.path-viewport .path-grid .path-cell{width:var(--cell);height:var(--cell);min-width:44px;min-height:44px;padding:6px;border-radius:13px}
.path-viewport .path-grid .path-cell .art{width:100%;height:100%}
.path-viewport .path-grid .path-cell.blocked{padding:10px}
.path-grid .path-cell.visited:not(.here){background:#f4ecd6}
.path-trail{font-size:32px;color:#bca16c}
.pairs-board .pair-grid{width:100%;max-width:590px;align-self:center;grid-template-columns:repeat(var(--pair-columns),minmax(44px,90px));gap:10px}
.pairs-board .pair-card{width:100%;height:90px;min-height:56px}
@media(max-width:600px){
 .mirror-palette>div{gap:8px}
 .mirror-palette button{width:54px;height:56px;padding:6px}
 .memory-grid{gap:8px}
 .memory-grid .memory-pad{height:82px;min-height:72px;padding:7px;border-radius:18px}
 .puzzle-board.game-board .puzzle-tray{grid-template-columns:repeat(4,minmax(44px,1fr))!important;gap:8px!important;max-height:240px}
 .puzzle-workbench{min-width:0}
 .puzzle-canvas-viewport{flex:auto;padding:5px 0 12px}
 .path-viewport .path-grid{--cell:44px;gap:5px;padding:7px}
 .path-viewport .path-grid .path-cell{padding:4px;border-radius:10px}
 .path-viewport .path-grid .path-cell.blocked{padding:7px}
 .path-overview{gap:12px}
 .path-mini{grid-template-columns:repeat(var(--size),13px);gap:2px;padding:5px}
 .path-mini>span{width:13px;height:13px}
 .path-overview>div:last-child{font-size:11px;max-width:132px}
 .pairs-board .pair-grid{max-width:350px;grid-template-columns:repeat(var(--pair-mobile),minmax(44px,1fr));gap:8px}
 .pairs-board .pair-grid .pair-card{height:70px;border-radius:14px}
 .pairs-board .pair-grid .pair-card>span{inset:6px}
}
@media(prefers-reduced-motion:reduce){.path-viewport{scroll-behavior:auto}}
