@font-face{font-family:Loyola;src:url('assets/loyola.ttf')}@font-face{font-family:Brice;src:url('assets/brice.otf')}
:root{--cream:#fff4d3;--green:#70d12c;--ink:#362120;--gold:#ffcc52;--navy:#264c44;--shadow:#15392b;--font:Loyola,Trebuchet MS,sans-serif}
*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 25%,#3d7546 0,#183f31 65%,#102d24);font-family:var(--font);color:var(--cream)}button{font:inherit;cursor:pointer;border:0;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;filter:grayscale(.6);opacity:.5}button:focus-visible{outline:3px solid #fff;outline-offset:4px}button:active:not(:disabled){transform:translateY(2px) scale(.96)}
.game{width:min(100%,560px);min-height:100dvh;position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;padding:20px 17px 12px;background:#438330 url('assets/garden.png') center/cover;box-shadow:0 0 120px #0008}.game:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(#173e3675 0%,transparent 22%,transparent 70%,#133c3299 100%);pointer-events:none}.game[data-theme=lantern]{background-image:url('assets/lantern.png')}.game[data-theme=beach]{background-image:url('assets/beach.png')}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:0 5px}.brand{text-align:center}.brand h1{font-family:Brice,var(--font);font-size:clamp(32px,7vw,43px);font-weight:900;color:#fff9d9;line-height:1;margin:0;letter-spacing:-1.5px;text-shadow:0 3px #5b471e,0 5px 0 #385723,0 7px 12px #193f38}.brand button{background:none;padding:8px 12px 0;font-size:17px;text-shadow:0 2px 2px #183322}.art-button{width:48px;height:48px;background:none;padding:0;filter:drop-shadow(0 4px 2px #183c4770)}.art-button img{width:100%;height:100%;object-fit:contain}.round-button{width:47px;height:47px;border-radius:15px;background:linear-gradient(#36beec,#0283d2 65%,#006bab);box-shadow:inset 0 2px 2px #93edff,0 4px 0 #005c89,0 6px 5px #173e4870;color:white}.menu-grid{font-size:37px;line-height:1}.scorebar{margin:17px 7px 8px;padding:9px 12px;display:flex;gap:16px;align-items:center;background:#173b36b5;box-shadow:inset 0 1px 2px #10291d90,0 1px #b3dd9540;border-radius:19px}.timer{display:flex;gap:7px;align-items:center;min-width:94px}.timer strong{font-size:23px;font-variant-numeric:tabular-nums}.clock{display:block;width:21px;height:21px;border:3px solid var(--cream);border-radius:50%;position:relative}.clock:after{content:"";position:absolute;width:5px;height:7px;border-left:2px solid var(--cream);border-bottom:2px solid var(--cream);left:7px;top:2px}.timer.urgent{color:#ffbc79}.match-progress{flex:1}.progress-label{display:flex;justify-content:space-between;align-items:center;font-size:12px;gap:6px}.progress-label span{letter-spacing:1.5px;font-size:10px;opacity:.8}.progress-track{height:10px;border-radius:10px;background:#102e2f;margin-top:5px;overflow:hidden;box-shadow:0 1px #e4f5bd44}.progress-track span{height:100%;display:block;background:linear-gradient(#d7f86c,#8edc32);border-radius:10px;transition:width .4s}.sound-button{width:37px;height:37px;background:none;padding:0}.sound-button img{width:100%;height:100%;object-fit:contain}
.board-area{position:relative;flex:1;display:flex;align-items:center;min-height:330px;margin:0 -5px}.board{position:relative;width:100%;aspect-ratio:540/635;max-height:650px;touch-action:none}.tray{position:absolute;width:29.2%;height:18.4%;transform:translate(-50%,-50%);background:url('assets/tray.png') center/100% 100% no-repeat;filter:drop-shadow(0 6px 2px #133f3045);transition:left .5s,top .5s;z-index:2}.tray.empty{background-image:url('assets/tray-empty.png')}.tray.single{width:18%;height:15.3%;background-image:url('assets/single.png')}.tray.moving{background-image:url('assets/moving-back.png'),url('assets/tray.png');background-size:100% 28%,100% 100%;background-position:center 18%,center}.tray .slot-row{position:absolute;display:flex;inset:16% 7% 29%;align-items:center}.tray.single .slot-row{inset:6% 9% 12%}.slot{height:100%;flex:1;min-width:0;background:transparent;padding:0;position:relative;border-radius:14px;display:grid;place-items:center;z-index:3}.slot img{display:block;width:118%;height:118%;max-width:none;object-fit:contain;pointer-events:none;filter:drop-shadow(0 3px 1px #703f2640);transition:transform .16s,filter .16s}.slot:hover img{transform:translateY(-3px) scale(1.05)}.slot.selected img{transform:translateY(-13px) scale(1.15);filter:drop-shadow(0 0 4px #fff7bb) drop-shadow(0 4px 1px #603b2670)}.slot.available:after{content:"";position:absolute;width:45%;height:40%;border:2px dashed #c0a15d;border-radius:50%;background:#fff9d031}.slot.hinted{outline:3px solid #fffbb5;box-shadow:0 0 18px #ffec7b;border-radius:50%;animation:hint 1s ease-in-out infinite}.tray.locked .slot-row{filter:blur(1px);opacity:.6}.ice-cover{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;z-index:4;pointer-events:none;opacity:.86}.lock-number{position:absolute;z-index:5;left:50%;top:50%;transform:translate(-50%,-50%);background:#155188d9;border:2px solid #ddfaff;color:white;border-radius:20px;padding:4px 10px;font-size:19px;text-shadow:0 2px #174379;pointer-events:none}.preview{position:absolute;display:flex;left:20%;right:20%;bottom:7%;height:24%;justify-content:center;opacity:.57;filter:brightness(.7);pointer-events:none}.preview img{width:33.33%;object-fit:contain}.layer-count{position:absolute;right:3px;bottom:-4px;border:2px solid #e9cf91;border-radius:12px;background:#856843;color:#fff6dd;font-size:11px;padding:1px 5px;z-index:4}.single .layer-count{right:-3px;bottom:3px}.moving-controls{position:absolute;left:0;width:100%;height:19%;z-index:1;display:flex;align-items:center;justify-content:space-between;background:url('assets/carpet.png') center/100% 78% no-repeat;pointer-events:none}.moving-controls button{width:27px;height:36px;background:#6638ba;border:2px solid #f1b742;border-radius:10px;pointer-events:auto;z-index:8;font-size:20px}.moving-label{position:absolute;bottom:-2px;left:50%;transform:translateX(-50%);font-size:10px;letter-spacing:1px;text-shadow:0 2px #211f38;background:#352954cc;border-radius:8px;padding:2px 7px;white-space:nowrap}.repair-label{position:absolute;bottom:-18px;width:150%;left:-25%;font-size:10px;text-align:center;text-shadow:0 1px #183d2d}.tray.matching{animation:match .43s ease both}.tray.revealed{animation:reveal .45s ease both}.instruction{text-align:center;margin:8px 0 13px;font-size:16px;min-height:22px;text-shadow:0 2px 3px #173b21}.toolbelt{display:flex;align-items:flex-start;justify-content:center;gap:12px;padding:0 8px 8px}.tool{position:relative;width:76px;display:flex;flex-direction:column;align-items:center;background:transparent;padding:0;gap:5px;font-size:13px;text-shadow:0 2px 2px #183b22}.tool img,.undo-symbol{width:59px;height:59px;object-fit:contain;filter:drop-shadow(0 4px 1px #17362766)}.undo-symbol{display:grid;place-items:center;background:linear-gradient(#75caef,#1378bd);border:2px solid #0d6596;box-shadow:inset 0 2px #c8f0f6;border-radius:17px;font-size:46px;line-height:1;color:white}.tool-count{position:absolute;top:40px;right:0;min-width:23px;padding:2px 5px;background:#91e939;border:2px solid #fff3cc;box-shadow:0 2px 2px #123f28;border-radius:12px;color:#214d17;font-size:11px;text-shadow:none}.tool.armed img{filter:drop-shadow(0 0 10px #fff47b);animation:hint .8s infinite}.bottom-bar{display:flex;justify-content:space-between;align-items:center;margin:8px 13px 0;font-size:12px;color:#fff7d7ce}.bottom-bar button{background:none;color:inherit;padding:8px 0;text-decoration:underline;text-underline-offset:3px}.bottom-bar span{opacity:.8}#toast{position:absolute;bottom:155px;left:50%;transform:translateX(-50%);border-radius:16px;padding:10px 16px;max-width:90%;width:max-content;text-align:center;background:#183b36ed;box-shadow:0 5px 20px #102b1e60;pointer-events:none;opacity:0;transition:opacity .2s;z-index:25;font-size:14px}#toast.show{opacity:1}#flying{position:absolute;inset:0;pointer-events:none;z-index:20}.flying-fruit{position:fixed;object-fit:contain;z-index:30;pointer-events:none;filter:drop-shadow(0 9px 4px #49381a70)}#celebration{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:22}.confetti{position:absolute;width:8px;height:16px;top:-20px;animation:confetti 2.2s ease-in forwards}
dialog{border:3px solid #f9e6b6;border-radius:30px;padding:32px 25px 25px;background:#fff5dc;color:var(--ink);box-shadow:0 15px 0 #80633466,0 35px 90px #0006;max-width:min(94vw,460px);width:440px;max-height:88dvh;overflow:auto;font-family:var(--font)}dialog::backdrop{background:#0c2925b5;backdrop-filter:blur(5px)}.close-dialog{position:absolute;top:10px;right:12px;width:34px;height:34px;background:#e5d3ad;color:#725d42;border-radius:50%;font-size:26px;line-height:1}dialog h2{font-family:Brice,var(--font);font-size:35px;line-height:1.1;text-align:center;margin:7px 0 16px;color:#715024}dialog p{line-height:1.55;font-size:14px;text-wrap:pretty}dialog .eyebrow{text-align:center;color:#8b7957;letter-spacing:2px;font-size:10px;margin:0}.primary,.secondary{display:block;width:100%;min-height:49px;border-radius:14px;font-size:17px;margin:12px 0 0;padding:12px 10px}.primary{background:linear-gradient(#a5ee46,#66c51c);color:#21460e;border:2px solid #64b51e;box-shadow:inset 0 2px #e5ff95,0 4px #3d8215}.secondary{background:#eddfbd;color:#71552d;border:2px solid #dbc89c}.dialog-tools{display:flex;gap:12px;justify-content:center;align-items:center;margin:18px 0}.dialog-tools img{height:70px;width:70px;object-fit:contain}.victory-emblem{width:110px;height:110px;background:#ffdb67;border:7px solid #f9ec9e;box-shadow:0 0 0 4px #d4a147,0 5px 0 5px #c78c27;border-radius:50%;margin:12px auto 25px;display:grid;place-items:center}.victory-emblem img{width:80px;height:80px;object-fit:contain}.stats{display:flex;justify-content:space-around;background:#eaddbd;border-radius:16px;padding:15px 8px;margin:20px 0}.stats strong{display:block;font-size:25px;color:#765129}.stats span{display:block;font-size:10px;color:#947d56;text-align:center;margin-top:5px;text-transform:uppercase;letter-spacing:1px}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin:18px 0}.level-choice{height:49px;background:#fff9e8;border:2px solid #e2cda5;border-radius:12px;color:#946f3a;font-size:17px;position:relative}.level-choice.current{border-color:#55a91f;background:#e4f7bf;color:#3d7616}.level-choice.completed{background:#bce879;border-color:#8dc348;color:#3c6b1d}.level-choice.completed:after{content:"";position:absolute;width:5px;height:5px;background:#568d25;border-radius:50%;bottom:4px;left:calc(50% - 2px)}.pager{display:flex;justify-content:space-between;align-items:center;font-size:13px}.pager button{background:#e4d3ac;border-radius:10px;color:#71552d;padding:9px 13px;min-height:40px}.jump-row{display:flex;gap:8px;margin:15px 0;align-items:center;justify-content:center;font-size:13px}.jump-row input{width:70px;padding:8px;border:2px solid #dcc796;border-radius:8px;color:#72532d;font:inherit;background:#fffaf0}.jump-row button{padding:10px;background:#b7db87;color:#395e20;border-radius:8px}.toggle-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid #e5d7b4;font-size:15px}.switch{width:53px;height:29px;border-radius:20px;background:#baa884;position:relative}.switch:after{content:"";position:absolute;width:21px;height:21px;left:4px;top:4px;border-radius:50%;background:#fff9e9;transition:left .2s}.switch[aria-checked=true]{background:#77b533}.switch[aria-checked=true]:after{left:28px}.theme-picker{display:flex;gap:10px;margin:15px 0}.theme-picker button{flex:1;height:70px;border:3px solid #e0cfa3;border-radius:12px;background-size:cover;background-position:center;font-size:12px;display:flex;align-items:end;justify-content:center;padding:6px;text-shadow:0 2px 2px #000;color:white}.theme-picker button[aria-pressed=true]{border-color:#83bf35}.note{font-size:11px!important;color:#8e7957}.warning-note{padding:10px 12px;border-radius:10px;background:#f2dfac}.help-step{display:flex;gap:14px;align-items:center;margin:20px 0}.help-step b{display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;border-radius:50%;color:#fff5df;background:#a18650}.help-step p{margin:0}
@keyframes hint{50%{filter:drop-shadow(0 0 8px #fff3a0)}}@keyframes match{40%{filter:brightness(1.6) drop-shadow(0 0 14px #fff);transform:translate(-50%,-50%) scale(1.1)}80%{transform:translate(-50%,-50%) scale(.95)}}@keyframes reveal{from{filter:brightness(1.5);opacity:.4}to{opacity:1}}@keyframes confetti{to{transform:translate(var(--dx),760px) rotate(var(--rot));opacity:0}}
@media(min-width:700px){.game{min-height:0;height:min(980px,100dvh);border-left:1px solid #a3cba33b;border-right:1px solid #a3cba33b}.board-area{min-height:0}.board{max-height:635px}.topbar{flex-shrink:0}.toolbelt{gap:18px}}
@media(max-width:380px){.game{padding:12px 9px 7px}.topbar{height:66px}.scorebar{margin:12px 5px 3px;gap:8px;padding:8px 10px}.timer{min-width:80px}.timer strong{font-size:20px}.toolbelt{gap:4px;padding:0}.tool{width:60px;font-size:11px}.tool img,.undo-symbol{width:49px;height:49px}.tool-count{top:33px}.instruction{font-size:14px;margin:3px 0 10px}.bottom-bar{margin-top:3px}.board-area{min-height:300px}dialog{padding:30px 18px 20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Belt controls sit above trays so edge arrows stay tappable on narrow screens. */
.moving-controls{z-index:8}.moving-controls button{width:32px;height:44px}.moving-controls.vertical{flex-direction:column;background-size:88% 100%}.moving-controls.vertical .moving-label{bottom:auto;top:50%;left:50%;writing-mode:vertical-rl}.moving-controls.vertical button{transform:rotate(90deg)}.preview span{width:33.33%}

.belt-background{position:absolute;left:0;width:100%;height:19%;background:url('assets/carpet.png') center/100% 78% no-repeat;z-index:0;pointer-events:none}.moving-controls{background:none}.crowded .tray{height:15%}.crowded .tray.single{height:12%;width:15%}.crowded .moving-controls,.crowded .belt-background{height:15%}.crowded .repair-label{bottom:-10px}.moving-label{bottom:-5px}

.brand h1{word-spacing:6px}.crowded .repair-label{bottom:auto;top:-9px;z-index:9;background:#204c2dcc;border-radius:5px}
