/* Responsive original game collection: controls stay outside the playfield. */
.library-toolbar,.library-actions{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;margin:12px 0}.library-toolbar select{font:inherit;font-size:16px;min-height:44px;max-width:100%;padding:8px;border:1px solid #d5cae5;border-radius:9px;background:#fff;color:#302343}.library-toolbar button,.library-actions button{min-height:44px}.library-summary{text-align:center;font-weight:650;color:#594276;margin:16px 0;min-height:24px}.library-playfield{max-width:640px;margin:0 auto}.library-playfield button:focus-visible{outline:3px solid #e05e17;outline-offset:2px;z-index:5}.library-grid{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:3px}.library-grid button{min-width:0;aspect-ratio:1;border:0;font:inherit;border-radius:6px;cursor:pointer}.library-grid button.selected,.selected{outline:3px solid #e97021!important;outline-offset:-3px}.library-grid button.legal,.legal{box-shadow:inset 0 0 0 3px #178474}.library-chess{gap:0;border:4px solid #544064;border-radius:9px;overflow:hidden;max-width:544px}.library-chess .chess-square{border-radius:0;font-size:clamp(24px,5vw,48px);line-height:1}.chess-square.light{background:#f4e9d5}.chess-square.dark{background:#a890b9}.chess-square.white-piece{color:#fff;text-shadow:0 1px 1px #121122,1px 0 1px #121122,-1px 0 1px #121122,0 -1px 1px #121122}.chess-square.black-piece{color:#241833}.promotion-choices{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.bg-board{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:3px;background:#e7d6b8;padding:6px;border-radius:12px}.bg-point{height:140px;min-width:0;border:0;border-radius:6px;white-space:pre-line;background:linear-gradient(100deg,#c7b2d7,#f6e9d0);font-weight:700;font-size:15px;padding:4px 0}.bg-point:nth-child(even){background:linear-gradient(100deg,#f5e9cf,#d7ad8e)}.bg-bar{grid-column:1/-1;display:flex;gap:8px;justify-content:center;padding:10px 0;flex-wrap:wrap}.violet{color:#5d3487}.orange{color:#8a3f0a}.blackjack-table,.colors-table{background:radial-gradient(ellipse at top,#246657,#173d3d);border:6px solid #dab892;border-radius:24px;padding:20px;color:#fff;text-align:center}.card-hand{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:14px 0}.card-hand .hand-label{width:100%;font-size:16px;margin:0 0 10px;color:#fff}.library-card{background:#fffdf6;border:1px solid #d8cbd8;border-radius:7px;box-shadow:0 2px 3px #25173922;color:#231a35;font-family:Georgia,serif;font-weight:bold;font-size:20px;min-width:0;width:64px;height:82px;padding:5px;text-align:left;vertical-align:top;cursor:pointer;line-height:1.1}.library-card.card-red{color:#a62441}.library-card.card-back{background:repeating-linear-gradient(45deg,#72509a,#72509a 4px,#8362ac 4px,#8362ac 8px);color:#efe7fd}.library-card:disabled{opacity:1;cursor:default}.color-hand{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:20px 0}.color-card{width:80px;height:92px;border:2px solid #fff8;border-radius:10px;white-space:pre-line;line-height:1.6;font-weight:750;color:#221d34}.color-card:disabled{filter:saturate(.45);opacity:.8}.color-0{background:#cbb6ed}.color-1{background:#ffbd7f}.color-2{background:#8be1ca}.color-3{background:#f5b3cb}.color--1{background:conic-gradient(#cbb6ed,#ffbd7f,#8be1ca,#f5b3cb,#cbb6ed)}.snakes-board{gap:2px;background:#c6b2d8;padding:3px;border-radius:9px}.snakes-cell{aspect-ratio:1;position:relative;background:#fff7ea;font-size:12px;padding:2px}.snakes-cell:nth-child(2n){background:#f0e4fa}.snakes-cell small{display:block;font-size:10px}.snakes-cell .ladder{color:#156450}.snakes-cell .snake{color:#963c45}.snakes-cell b{position:absolute;right:1px;bottom:0;background:#fff;border:1px solid currentColor;border-radius:50%;padding:1px 4px}.snakes-cell b.orange{right:17px}.solitaire-table{background:#dce9e0;border:1px solid #c0d5c7;border-radius:12px;padding:12px;--columns:7}.solitaire-columns{display:grid;grid-template-columns:repeat(var(--columns),minmax(0,1fr));gap:5px}.solitaire-column{position:relative}.solitaire-column .library-card{position:absolute;top:calc(var(--index,0)*26px);width:100%;height:78px}.solitaire-column>.button{position:relative;top:90px;width:100%;padding:6px}.solitaire-column:has(>.button){padding-bottom:55px}.solitaire-stock{display:flex;gap:14px;align-items:center;margin-top:15px;justify-content:center}.solitaire-peaks{position:relative;height:calc((var(--rows) - 1)*38px + 78px)}.solitaire-peaks .library-card{position:absolute;width:calc(100%/var(--columns) - 3px);height:76px}.freecell-top{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin-bottom:16px}.freecell-top .library-card{width:100%}.foundation{border-style:dashed}.solitaire-clock{aspect-ratio:1;max-width:440px;position:relative;margin:0 auto}.clock-pile{position:absolute;width:20%;height:20%;border:1px solid #bbadd1;background:#fffcf5;border-radius:50%;white-space:pre-line;color:#3a284e;font-size:16px;font-weight:700}.wordsearch-grid{max-width:560px;touch-action:none}.wordsearch-grid .letter-cell{color:#3a2c4f;background:#f0e8f8;border:1px solid #d5c9e2;font-size:clamp(14px,2.8vw,23px);font-weight:700}.wordsearch-grid .found{background:#ccebdd;color:#205941}.wordsearch-list{width:100%;display:flex;list-style:none;flex-wrap:wrap;gap:8px 18px;justify-content:center;padding:0}.wordsearch-list .found{text-decoration:line-through;color:#287353}.scramble-board{text-align:center;padding:25px;background:#f1eafa;border:1px solid #e1d4ed;border-radius:16px}.scramble-clue{font-weight:650}.scramble-answer{font-size:clamp(24px,5vw,40px);letter-spacing:.16em;font-weight:800;color:#553675;min-height:50px}.letter-tray{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}.letter-tile{width:48px;height:52px;font-size:22px;font-weight:750;border:1px solid #bca8d2;border-radius:9px;background:#fff;color:#50326f;box-shadow:0 3px 0 #cbb7de}.letter-tile:disabled{visibility:hidden}.library-grid .puzzle-cell{background:#eee5f7;color:#4d326a;font-size:clamp(18px,4vw,34px);position:relative}.pipes-grid{max-width:420px;gap:0;border:2px solid #c8b6db}.pipes-grid .puzzle-cell{border:1px solid #ddd0e8;border-radius:0;font-size:clamp(34px,8vw,74px);line-height:1;font-family:monospace;overflow:hidden}.pipes-grid .connected{color:#126357;background:#d2eee5}.pipe-source{position:absolute;font:14px system-ui;top:4px;left:4px}.fill-maze-grid{gap:0;border:5px solid #403151;touch-action:none}.fill-maze-grid .puzzle-cell{border-radius:0;background:#eee7f6;opacity:1}.fill-maze-grid .wall{background:#403151}.fill-maze-grid .painted{background:#b59ae0;color:#261f30}.direction-pad{display:flex;gap:8px}.direction-pad button{min-width:50px}[class~="2048-merge-grid"]{padding:6px;background:#dbcae9;border-radius:12px;gap:5px;max-width:450px}.library-grid .number-tile{background:#fff5df;font-size:clamp(17px,4vw,28px);font-weight:750}.library-grid .value-3,.library-grid .value-4{background:#ffc799;color:#653416}.library-grid .value-5,.library-grid .value-6{background:#c9afea;color:#4d267b}.library-grid .value-7,.library-grid .value-8{background:#8adac7;color:#184a40}.library-grid .value-9,.library-grid .value-10,.library-grid .value-11{background:#634393;color:#fff}.block-sudoku-grid{gap:2px;border:3px solid #a88cbc;max-width:486px}.block-sudoku-grid .puzzle-cell{background:#f1e9f9;border-radius:2px}.block-sudoku-grid .occupied{background:#725197;box-shadow:inset 0 0 0 2px #9674b8}.block-sudoku-grid .puzzle-cell:nth-child(3n){border-right:2px solid #ae96c5}.block-sudoku-grid .puzzle-cell:nth-child(n+19):nth-child(-n+27),.block-sudoku-grid .puzzle-cell:nth-child(n+46):nth-child(-n+54){border-bottom:2px solid #ae96c5}.shape-tray{display:flex;gap:14px;justify-content:center;width:100%}.shape-choice{padding:10px;border:1px solid #d2c0e3;border-radius:10px;background:#f5eefb}.shape-choice:disabled{opacity:.25}.shape-preview{display:grid;grid-template-columns:repeat(4,15px);gap:2px}.shape-preview i{width:15px;height:15px}.shape-preview .filled{background:#78549c;border-radius:2px}.library-canvas-wrap{text-align:center;max-width:440px}.library-canvas-wrap canvas{display:block;margin:0 auto;width:auto;max-width:100%;height:auto;max-height:calc(100svh - 190px);object-fit:contain;touch-action:none;border-radius:14px;background:#151a32;outline-offset:3px}.library-game .button{white-space:normal}.library-game{min-width:0}
@media(max-width:600px){.library-toolbar{gap:8px}.library-toolbar label{font-size:13px}.library-playfield{width:100%}.solitaire-table{padding:6px}.solitaire-columns{gap:3px}.library-card{font-size:15px;padding:3px;border-radius:4px}.spider-table .library-card{font-size:12px;padding:2px}.solitaire-peaks .library-card{font-size:13px}.freecell-top{gap:3px}.bg-board{grid-template-columns:repeat(6,minmax(0,1fr))}.bg-point{height:80px;min-height:44px}.bg-bar{grid-column:1/-1}.blackjack-table,.colors-table{padding:12px}.library-chess .chess-square{font-size:clamp(25px,7.5vw,44px)}.library-summary{font-size:14px}.scramble-board{padding:18px 8px}.letter-tray{gap:6px}.letter-tile{width:42px;min-height:48px}.snakes-cell{font-size:10px}.snakes-cell small{font-size:8px}.shape-tray{gap:10px}}
@media(prefers-reduced-motion:reduce){.library-game *{scroll-behavior:auto;transition:none}}

.solitaire-table{overflow-x:auto}.spider-table .solitaire-columns{min-width:455px}.solitaire-peaks[style*="--columns: 10"]{min-width:460px}.freecell-top{min-width:350px}.solitaire-table:has(.freecell-top) .solitaire-columns{min-width:350px}.library-focus-open{overflow:hidden}.library-focus{position:fixed;inset:0;z-index:1000;background:#fbf8ff;overflow:auto;padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom));overscroll-behavior:contain}.library-focus .library-toolbar{position:sticky;top:-12px;z-index:10;background:#fbf8ff;padding:10px;margin:0}.library-focus .library-summary{margin:8px 0}.library-focus .library-canvas-wrap canvas{max-height:calc(100svh - 205px)}.library-focus .library-actions{padding-bottom:16px}.library-focus .library-chess{max-width:min(544px,calc(100svh - 220px))}
.jewel-hunt-grid,.blocky-pop-grid{max-width:490px;gap:4px;padding:6px;background:#d9cae7;border-radius:12px}.library-grid .gem-color-0{background:#c7b1ec;color:#482b75}.library-grid .gem-color-1{background:#ffc38c;color:#6b390e}.library-grid .gem-color-2{background:#94deca;color:#1a554b}.library-grid .gem-color-3{background:#f5b5cf;color:#702845}.library-grid .gem-color-4{background:#a8cdec;color:#274d74}.jewel-hunt-grid button,.blocky-pop-grid button{font-size:clamp(20px,4vw,34px)}.butterfly-kyodai-grid,.flower-mahjong-slide-grid{padding:6px;background:#e2ecdf;border-radius:12px;gap:5px}.butterfly-kyodai-grid button,.flower-mahjong-slide-grid button{background:#fffcf4!important;border:1px solid #b6cbb6!important;font-size:clamp(24px,4vw,40px)!important}.library-grid .flower-color-0,.library-grid .flower-color-6{color:#793a8c}.library-grid .flower-color-1,.library-grid .flower-color-7{color:#9a4a16}.library-grid .flower-color-2{color:#1b7762}.library-grid .flower-color-3{color:#a33461}.library-grid .flower-color-4{color:#3067a1}.library-grid .flower-color-5{color:#554386}.library-grid .empty{background:transparent!important;border-color:transparent!important}.color-me-grid{max-width:320px}.unfold-grid{max-width:480px;border:4px solid #c6b1dc;gap:3px}.paint-0{background:#f3edf8!important}.paint-1{background:#d1b8ef!important;color:#4e2876!important}.paint-2{background:#ffd29d!important;color:#71451c!important}.paint-3{background:#94daca!important;color:#19574b!important}.paint-4{background:#f0b2cc!important;color:#792950!important}.paint-target{width:140px;margin:12px auto;display:grid;grid-template-columns:repeat(4,1fr);gap:2px}.paint-target>span{grid-column:1/-1;text-align:center;font-size:12px;font-weight:750;letter-spacing:.12em}.paint-target i{height:28px;text-align:center;font-style:normal;font-size:12px;line-height:28px}.paint-palette,.paint-lines{display:flex;gap:7px;flex-wrap:wrap;justify-content:center;width:100%}.unblocked-grid{max-width:450px;border:5px solid #6f597e;gap:2px;background:#e7dcef;position:relative}.unblocked-grid .puzzle-cell{background:#c9acd9}.unblocked-grid .exit-car{background:#ef9a9f;color:#70202a;font-weight:850}.unblocked-grid .vehicle-2,.unblocked-grid .vehicle-5{background:#ffcb98;color:#654324}.unblocked-grid .vehicle-3,.unblocked-grid .vehicle-6{background:#a1d8c8;color:#2b584b}.unblocked-grid .vehicle-4,.unblocked-grid .vehicle-7{background:#a5c2e7;color:#2b466a}.rolling-ball-grid{max-width:430px;background:#bfabc9;border:4px solid #a88dbc;gap:4px}.rolling-ball-grid .puzzle-cell{background:#efe5d4;color:#775137;font:clamp(30px,7vw,65px)/1 monospace}.rolling-ball-grid .start-pipe{background:#96d9bf;color:#174e3e}.rolling-ball-grid .end-pipe{background:#efb0c8;color:#702746}.merge-card-table{padding:12px;background:#e6dcf0;border:1px solid #d1bce2;border-radius:16px}.merge-card-columns{display:flex;gap:8px;align-items:flex-start;justify-content:center}.merge-card-column{flex:1;min-width:0;min-height:90px;background:#d4c2e4;border:2px dashed #a38abc;border-radius:10px;padding:5px;color:#684286;font-size:28px;cursor:pointer}.number-card{display:block;border-radius:6px;background:#fff8e9;color:#4f355f;border:1px solid #c7afd3;text-align:center;font-weight:800;font-size:20px;line-height:38px;min-height:42px}.merge-card-column .number-card+.number-card{margin-top:-12px;position:relative}.merge-card-column .number-card:last-child{line-height:60px;min-height:65px}.charm-tray{display:flex;gap:4px;justify-content:center;margin-top:20px;padding:10px 0}.charm-tray .number-card{flex:1;min-width:0;font-size:16px}.library-focus .paint-target{width:110px}.library-focus .paint-target i{height:20px;line-height:20px}
.quiz-panel{background:#f3edf9;border:1px solid #d9c8e8;border-radius:20px;padding:24px;text-align:center}.quiz-question{font-size:clamp(20px,3.4vw,28px);font-weight:750;color:#44305f;line-height:1.4;margin:6px 0 22px}.quiz-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.quiz-choice{min-height:70px;padding:14px;border:1px solid #cdb8e0;border-bottom-width:4px;border-radius:13px;background:#fffaf0;color:#4b365f;font:700 17px/1.4 inherit;cursor:pointer}.quiz-choice.correct{background:#cbe9db;border-color:#59876d;color:#20543a}.quiz-choice.incorrect{background:#f5d1d8;border-color:#ac6677;color:#762f42}.quiz-choice:disabled{opacity:1}.quiz-explanation{margin:22px 0 0;padding:15px;background:#fffaf1;border-radius:12px;color:#514061;line-height:1.6}.quiz-result{font-weight:800;font-size:22px;color:#684397}.quiz-risk{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:18px}.odd-grid{gap:8px;max-width:480px}.odd-grid .odd-cell{font-size:clamp(24px,5vw,44px);background:#ebdef7;color:#513372}.odd-grid button:disabled{opacity:.5}.wording-letters{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.center-letter{background:#ffc787!important;border-color:#b77835!important;color:#663907!important}.word-answer-form{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:24px}.word-answer-form input{min-width:0;width:220px;max-width:100%;min-height:48px;border:1px solid #bc9fd4;border-radius:10px;background:#fff;font:600 20px system-ui;text-transform:uppercase;padding:8px 12px;color:#513473}.found-word-list{display:flex;gap:8px 16px;flex-wrap:wrap;justify-content:center;list-style:none;padding:10px 0 0}.found-word-list li{font-size:14px;background:#e0d1ef;border-radius:6px;padding:4px 8px}.farm-grid{gap:3px;max-width:430px;margin:0 auto}.farm-cell{aspect-ratio:1;background:#fff9ec;border:1px solid #c3afd2;border-radius:4px;position:relative;display:grid;place-items:center;color:#533372;font-weight:700;font-size:20px}.farm-cell.empty{visibility:hidden}.farm-cell small{position:absolute;top:1px;left:2px;font-size:9px}.farm-cell.filled{background:#d6eadf;color:#285b43}.farm-clues{display:flex;flex-direction:column;gap:7px;margin:18px 0}.farm-clue{font:inherit;text-align:left;border:1px solid #d2c1e2;border-radius:9px;background:#f3ebfa;padding:12px;color:#4c3761;cursor:pointer;min-height:44px}.farm-crossword .scramble-answer{text-align:center;margin:12px 0}.story-frame{display:block;border:0;width:100%;aspect-ratio:16/9;border-radius:12px;background:#242424}.library-playfield.story-board{max-width:960px}.story-intro{text-align:center;padding:28px;background:#ede6f5;border-radius:14px}.story-intro p{max-width:580px;margin:0 auto 18px}.library-focus .story-frame{height:calc(100svh - 180px);max-height:none;aspect-ratio:auto}.game-source-credits{font-size:14px;line-height:1.6;padding:18px;background:#f4eef8;border-radius:12px;margin:20px 0}.game-source-credits ul{padding-left:22px}@media(max-width:600px){.quiz-panel{padding:18px 12px}.quiz-options{gap:8px}.quiz-choice{font-size:16px;padding:10px;min-height:68px}.odd-grid{gap:5px}.farm-cell{font-size:16px}}
.hex-board{position:relative;aspect-ratio:1;max-width:450px;border-radius:20px;background:radial-gradient(#f4ecfc,#e5d6ee)}.hex-cell{position:absolute;width:15.9%;height:18.4%;transform:translate(-50%,-50%);clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);border:0;background:#cfb9e3;color:#694085;font-size:clamp(24px,5vw,38px);font-weight:800;cursor:pointer;padding:0}.hex-cell.numbered{background:#ffe0ad;color:#764718}.hex-cell.connected{background:#a4dccd;color:#205e52}.hex-cell svg{display:block;width:100%;height:100%}.hex-cell:focus-visible{background:#f3bf88;outline:0!important}.advanced-grid{max-width:490px;gap:4px;padding:5px;background:#ddcce9;border-radius:12px}.advanced-grid .puzzle-cell{font-size:clamp(18px,4vw,31px);font-weight:750;background:#f6edf9}.advanced-grid .merge-value-1,.advanced-grid .merge-value-2{background:#ffe0b8;color:#714424}.advanced-grid .merge-value-3,.advanced-grid .merge-value-4{background:#c8adea;color:#512a7e}.advanced-grid .merge-value-5,.advanced-grid .merge-value-6{background:#93d3bf;color:#1f5543}.advanced-grid .merge-value-7{background:#77509d;color:#fff}.lines-grid{max-width:360px;gap:3px}.lines-grid .occupied{background:#9070ae;color:#d6c2e9}.lines-preview{width:100%;display:flex;gap:35px;justify-content:center}.lines-preview>div{display:flex;flex-direction:column;align-items:center;gap:8px}.tiling-tray{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;width:100%}.tiling-tray .shape-choice{padding:5px;display:flex;align-items:center;gap:3px;font-size:12px}.tiling-tray .shape-preview{grid-template-columns:repeat(4,11px)}.tiling-tray .shape-preview i{width:11px;height:11px}.advanced-grid .piece-color-1,.resource-0{background:#d5b6ed!important;color:#593573!important}.advanced-grid .piece-color-2,.resource-1{background:#b3c6df!important;color:#3d5277!important}.advanced-grid .piece-color-3,.resource-2{background:#c2b9c4!important;color:#413245!important}.advanced-grid .piece-color-4,.resource-3{background:#ffe1a1!important;color:#77541b!important}.advanced-grid .piece-color-5,.resource-4{background:#a9dcbf!important;color:#315d43!important}.resource-5{background:#98c7e0!important;color:#214d70!important}.resource-6{background:#f3b5c6!important;color:#762e48!important}.cats-table{background:#e7ddeb;padding:10px;border-radius:16px}.hat-tray,.cat-columns{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}.hat-tray{margin-bottom:18px}.hat-cell{height:60px;border:2px solid #c4aed8;border-radius:8px;font-size:32px;cursor:pointer}.cat-column{display:flex;flex-direction:column;gap:6px}.cat-face,.cat-empty{height:45px;min-width:0;font-size:clamp(12px,2.5vw,21px);display:grid;place-items:center;border-radius:10px 10px 6px 6px;white-space:nowrap}.cat-color-0{background:#cfb7ef;color:#603683}.cat-color-1{background:#ffd09f;color:#845128}.cat-color-2{background:#abe0cd;color:#2a6955}.cat-color-3{background:#f4bcd0;color:#89364f}.cat-color--1{background:#ffe589;color:#705311}.cat-color--2{background:#fef7f0;color:#9656bc;box-shadow:0 0 12px #bb8bd1}.dragon-lanes{max-width:490px;margin:10px auto;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}.dragon-lane{min-height:76px;padding:5px 2px;background:#f1e6f7;border:1px solid #d9c7e5;border-radius:8px;text-align:center;font-size:11px;color:#57396e}.dragon-lane b{display:block;color:#8b699f;font-size:10px}.dragon-lane span{display:block;white-space:pre-line;margin-top:5px}
.basket-grid{touch-action:none}.basket-grid .wall{background:#65587e}.basket-grid .puzzle-cell{font-size:clamp(20px,5vw,34px);color:#f2cb84}.spatial-board{display:block!important;background:#251e38;border-radius:16px;overflow:hidden}.spatial-scene{position:relative;width:100%;height:350px;max-width:440px;margin:auto}.spatial-tile{position:absolute;transform:translate(-50%,-50%);width:35px;height:37px;border:2px solid #6c6380;border-radius:5px;background:#746b86;color:#201a30;font-weight:800;font-size:13px;box-shadow:0 6px 0 #151020;touch-action:manipulation}.spatial-tile.available{background:var(--tile-color);border-color:#f5e8ff}.spatial-tile.selected{outline:3px solid #fff;outline-offset:2px}.spatial-list{padding:12px;color:#f8f0ff}.spatial-list summary{min-height:44px;cursor:pointer}.spatial-list button{margin:3px;white-space:normal;text-align:left}.spatial-canvas canvas{display:block;width:100%;height:auto;max-width:440px;margin:auto;touch-action:none;border-radius:16px}.spatial-canvas{display:block!important}.library-actions select{min-height:44px;max-width:100%}
.motion-canvas{display:block!important}.motion-canvas canvas{display:block;width:100%;max-width:440px;height:auto;margin:auto;border-radius:16px;touch-action:none}.motion-hold{min-width:70px;touch-action:none;user-select:none}.library-actions input[type=range]{min-height:44px;max-width:100%;accent-color:#916abb}
.hidden-scene{display:block!important}.hidden-scroll{overflow:auto;border-radius:16px;max-width:100%;overscroll-behavior:contain}.hidden-scroll>canvas{display:block;width:100%;height:auto;min-width:0;touch-action:pan-x pan-y}.hidden-scroll.zoomed>canvas{width:800px;max-width:none}.hidden-clue{background:#342942;border-radius:8px;width:60px;height:68px}.hidden-scroll canvas{cursor:crosshair}
.solitaire-plus{overflow-x:auto;overscroll-behavior-x:contain}.solitaire-plus .solitaire-top{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}.solitaire-plus .solitaire-foundations,.solitaire-plus .solitaire-cells{display:flex;flex-wrap:wrap;gap:4px}.solitaire-plus .solitaire-columns{display:grid;gap:6px;margin-top:18px}.solitaire-plus .solitaire-column{display:flex;flex-direction:column;padding-bottom:8px}.solitaire-plus .library-card{min-width:46px;max-width:65px;height:76px;min-height:76px;flex-shrink:0;font-size:16px;display:flex;align-items:flex-start;justify-content:flex-start;padding:5px}.solitaire-variant-rules{flex-basis:100%;font-size:14px;line-height:1.65;color:var(--text)}.solitaire-plus .solitaire-peaks{position:relative;min-width:350px;margin-top:12px}
.word-race{display:block!important}.race-words{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;max-width:330px;margin:auto}.race-letter{aspect-ratio:1;display:grid;place-items:center;border:2px solid #a69aba;border-radius:6px;font-size:25px;font-weight:800;background:#eae1f0;color:#352943}.race-letter.mark-0{background:#665f76;color:white}.race-letter.mark-1{background:#e6c77f;color:#302638}.race-letter.mark-2{background:#91c5a7;color:#24382b}.race-keyboard{display:flex;flex-wrap:wrap;justify-content:center;gap:4px}.race-keyboard .letter-tile{min-width:32px;min-height:44px;padding:6px}.race-word-list{flex-basis:100%;max-width:100%;font-size:14px;line-height:1.6}.race-word-list summary{min-height:44px;cursor:pointer}

.library-focus-open .mobile-bottom{display:none}.library-focus .motion-canvas canvas,.library-focus .spatial-canvas canvas{width:auto;max-width:100%;max-height:calc(100svh - 230px);height:auto}.library-focus .spatial-board{max-width:600px;margin:auto}

/* ---- Chess: board, pieces and side panels ------------------------------ */
.library-chess{gap:0;border:6px solid #4a3556;border-radius:12px;overflow:hidden;max-width:544px;background:#4a3556;box-shadow:0 12px 30px #2a184a33,inset 0 0 0 2px #7b5f8a}
.library-chess .chess-square{position:relative;border-radius:0;font-size:clamp(24px,5vw,46px);line-height:1;transition:filter .12s ease,transform .12s ease}
.library-chess .chess-square:hover{filter:brightness(1.06)}
.chess-square.light{background:linear-gradient(135deg,#f6ead4,#ecd9b6)}
.chess-square.dark{background:linear-gradient(135deg,#a98bc1,#8b6ea4)}
.chess-square.white-piece{color:#fff;text-shadow:0 1px 1px #121122,1px 0 1px #121122,-1px 0 1px #121122,0 -1px 1px #121122,0 4px 8px #0006}
.chess-square.black-piece{color:#241833;text-shadow:0 3px 6px #0004}
.chess-square.last::before{content:"";position:absolute;inset:0;background:#f5c54266;pointer-events:none}
.chess-square.selected{outline:3px solid #e97021!important;outline-offset:-3px;background:#f8d58a}
.chess-square.legal{box-shadow:none}
.chess-square.legal::after{content:"";position:absolute;left:50%;top:50%;width:26%;height:26%;transform:translate(-50%,-50%);border-radius:50%;background:#178474cc;pointer-events:none}
.chess-square.capture{box-shadow:none}
.chess-square.capture::after{content:"";position:absolute;inset:6%;border-radius:50%;border:4px solid #d94a3ccc;pointer-events:none}
.chess-square.check{background:radial-gradient(circle,#ff7b72,#cf3d3d 75%)!important}
.chess-square[data-rank]>i,.chess-square[data-file]>i{display:none}
.chess-square[data-rank]::before{content:attr(data-rank);position:absolute;left:3px;top:2px;font-size:10px;font-weight:700;color:#4a3556;opacity:.75;text-shadow:none;pointer-events:none}
.chess-square.last[data-rank]::before{content:attr(data-rank);background:none}
.chess-square[data-file]::after{content:attr(data-file);position:absolute;right:3px;bottom:1px;font-size:10px;font-weight:700;color:#4a3556;opacity:.75;text-shadow:none;pointer-events:none;width:auto;height:auto;border:0;border-radius:0;background:none;transform:none;left:auto;top:auto;inset:auto}
.chess-square.legal[data-file]::after{content:"";left:50%;top:50%;width:26%;height:26%;transform:translate(-50%,-50%);border-radius:50%;background:#178474cc}
.chess-square.capture[data-file]::after{content:"";inset:6%;border-radius:50%;border:4px solid #d94a3ccc;left:auto;top:auto;width:auto;height:auto;transform:none}
.chess-square.dark[data-rank]::before,.chess-square.dark[data-file]::after{color:#f6ead4}
.library-actions .chess-moves{list-style:decimal inside;margin:0;padding:8px 12px;max-height:104px;overflow:auto;width:100%;max-width:544px;display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:2px 14px;font-size:13px;color:#4d326a;background:#f7f2fc;border:1px solid #e4d9ee;border-radius:10px;font-variant-numeric:tabular-nums}
.library-actions .chess-moves li.current{font-weight:750;color:#2f1c4a}
.chess-captured{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 18px;width:100%;max-width:544px;font-size:13px;color:#594276}
.chess-captured .tray{display:inline-flex;align-items:center;gap:8px}
.chess-captured .tray b{font-weight:650;font-size:12px}
.chess-captured .pieces{font-size:20px;letter-spacing:1px;line-height:1}
.chess-captured .tray.white .pieces{color:#241833}
.chess-captured .tray.black .pieces{color:#fff;text-shadow:0 1px 1px #121122,1px 0 1px #121122,-1px 0 1px #121122,0 -1px 1px #121122}
.chess-captured em{font-style:normal;font-weight:750;color:#e05e17}
@media(max-width:560px){.library-chess{border-width:4px}.library-actions .chess-moves{max-height:84px;font-size:12px}}

/* Layout stability: canvas and board playfields hold their size before scripts build them. */
.library-game[data-game="bubble-shooter"] .library-playfield,.library-game[data-game="bubble-shooter-levels"] .library-playfield,.library-game[data-game="raccoon-rescue-bubble-shooter"] .library-playfield,.library-game[data-game="dino-bubbles"] .library-playfield,.library-game[data-game="super-brick-ball"] .library-playfield{aspect-ratio:440/580;max-width:440px;width:100%;max-height:calc(100svh - 205px)}
.library-game[data-game="backgammon"] .library-playfield{aspect-ratio:3/2;max-width:640px;width:100%}
.library-actions{min-height:44px}
