@font-face{font-family:Fredoka;src:url('assets/fonts/fredoka-latin-500-normal.woff2')}@font-face{font-family:Gaegu;src:url('assets/fonts/gaegu-latin-700.woff');font-weight:700}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overscroll-behavior:none}body{font-family:Fredoka,system-ui,sans-serif;color:#3e4027;background:#eee9db}button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #377c95;outline-offset:3px}button img{pointer-events:none;user-select:none;-webkit-user-drag:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.game{height:var(--play-height,100svh);max-width:1200px;margin:auto;display:grid;grid-template-rows:66px 94px minmax(100px,1fr) auto 76px;position:relative;padding:8px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom));gap:4px;isolation:isolate}.game::before{content:"";position:fixed;inset:0;z-index:-2;background:linear-gradient(#fff5 0%,#fff1 40%,#efecd466),url('assets/number-play/garden-backdrop.webp') center/cover}.workshop .game::before{background-image:linear-gradient(#fff7,#fff0 55%,#e8dac466),url('assets/number-play/workshop-backdrop.webp')}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.top-actions{display:flex;gap:6px}.round-button{width:46px;height:46px;flex-shrink:0;display:grid;place-items:center;border-radius:50%;background:#fffdf0ed;border:2px solid #d1b486;box-shadow:0 3px 0 #93713e33,inset 0 2px 2px #fff;text-decoration:none;font-size:24px;color:#475039}.round-button:disabled{opacity:.5}.round-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.title-art{width:min(45vw,330px);height:62px;object-fit:contain;min-width:0}.needs-tap{box-shadow:0 0 0 4px #dc9e43}
.challenge{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0}.plaque{width:250px;height:70px;background:url('assets/number-play/plaque-blank.webp') center/100% 100% no-repeat;display:flex;align-items:center;justify-content:center;gap:12px;font-size:25px;text-shadow:0 2px #fff9;border:0;padding:0}.plaque strong{font-size:46px;color:#4a6735;line-height:1}.progress{display:flex;align-items:center;gap:5px;margin-top:4px;font-size:12px;color:#5e644c}.progress i{width:8px;height:8px;border-radius:50%;background:#8fa77950}.progress i.earned{background:#527437}.progress span{margin-right:6px}
.stage{position:relative;min-height:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.board{position:relative;width:min(100%,800px);height:100%;max-height:490px;min-height:0;background:url('assets/number-play/garden-soil-tray.webp') center/100% 100% no-repeat;touch-action:none;isolation:isolate}.workshop .board{background-image:url('assets/number-play/workshop-felt-tray.webp')}.play-area{position:absolute;inset:15% 9% 20%;min-width:0;min-height:0}.workshop .play-area{inset:14% 11% 20%}#pieces{position:absolute;inset:0;min-width:0;min-height:0}.holes{display:block}.hole{position:absolute;left:50%;top:50%;width:40px;height:40px;max-width:90px;max-height:90px;min-width:0;min-height:0;transform:translate(-50%,-50%);padding:0;border:0;background:none;touch-action:none;border-radius:40%;overflow:visible}.hole .soil-hole{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none}.hole .seed{position:absolute;left:12%;top:12%;width:76%;height:76%;object-fit:contain;filter:drop-shadow(1px 4px 2px #281b2460)}.hole .seed.just-planted{animation:plant .22s ease-out}.hole .seed.awaiting-hand{visibility:hidden}.hole .sprout{position:absolute;left:-5%;bottom:43%;width:110%;height:auto;max-width:110%;object-fit:contain;filter:drop-shadow(0 4px 2px #19350d35);animation:unfurl 1s cubic-bezier(.18,.65,.26,1) both;animation-delay:var(--delay);transform-origin:50% 100%}.hole:disabled{opacity:1}.mascot{position:absolute;right:-4px;bottom:-4px;height:clamp(55px,12vh,130px);max-width:22%;object-fit:contain;pointer-events:none;z-index:5;filter:drop-shadow(0 5px 3px #35271530)}.live-count{position:absolute;left:50%;bottom:3%;transform:translateX(-50%);min-width:64px;padding:3px 15px;border-radius:22px;background:#fff9e6f2;text-align:center;font-size:22px;box-shadow:0 2px 5px #31230c20;z-index:5}.live-count.responding{animation:count-response .5s ease-in-out 2}.board-feedback{position:absolute;z-index:8;top:5%;left:50%;transform:translateX(-50%);width:max-content;max-width:90%;padding:10px 16px;border-radius:18px;background:#fff9e9;color:#73502b;box-shadow:0 3px 15px #45321c33;font-size:18px;text-align:center;pointer-events:none;opacity:0}.board-feedback.visible{opacity:1}.board-feedback.success{color:#416830}
.tools{position:relative;width:100%;max-width:850px;margin:0 auto;min-width:0;display:flex;justify-content:center;align-items:center;gap:10px}.seed-supply{position:relative;width:90px;height:68px;border:0;background:none;padding:0;touch-action:none}.seed-supply img{width:100%;height:100%;object-fit:contain}.seed-supply .bowl-seed{position:absolute;width:35%;height:45%;left:32%;top:12%;transform:rotate(-20deg)}.supply-caption{font-family:Gaegu,system-ui;font-size:24px;max-width:185px;line-height:1.05;color:#465033}.workshop .tools{display:block;padding:4px 0}.tray-controls{height:32px;display:flex;justify-content:space-between;align-items:center;margin:0 6px 3px}.orientations{display:flex;gap:5px}.orientations button,.tray-next{border:1px solid #987348;border-radius:11px;background:#f6e6c8;color:#644b2f;padding:5px 12px;min-height:30px;font-size:14px}.orientations button[aria-pressed=true]{background:#6d8552;color:#fff;border-color:#577040}.tray-next{font-size:26px;width:40px;line-height:18px;padding:3px}.piece-tray{display:flex;align-items:center;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;scroll-snap-type:x proximity;border:2px solid #80532d;border-radius:18px;background:linear-gradient(100deg,#845328,#bf945c,#8e6136);box-shadow:inset 0 2px 2px #fff6,inset 0 -3px 2px #53351d,0 4px 0 #77502c;padding:5px 7px;touch-action:pan-x}.piece-tray::-webkit-scrollbar{display:none}.piece{flex:0 0 91px;width:91px;height:78px;min-width:0;border:0;border-radius:13px;background:url('assets/number-play/wood-compartment.webp') center/100% 100% no-repeat;position:relative;padding:10px;display:grid;place-items:center;scroll-snap-align:start;touch-action:pan-x}.piece .pattern-art{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 2px 1px #2c1a1350)}.piece:disabled{opacity:.9}.piece:active{filter:brightness(1.12)}
.bottom{display:grid;grid-template-columns:46px minmax(0,1fr) 46px;gap:7px;align-items:end;max-width:760px;width:100%;margin:0 auto;position:relative;z-index:10}.center-actions{text-align:center;min-width:0}.message{min-height:22px;margin:0 0 5px;font-size:15px;line-height:1.2;text-wrap:balance}.primary{border:2px solid #729154;background:linear-gradient(#90b36a,#648846);box-shadow:inset 0 2px 0 #c9df9d,0 4px 0 #47662f;color:white;min-height:46px;padding:8px 12px;border-radius:23px;font-size:21px;width:100%;text-shadow:0 1px 1px #213b22;touch-action:manipulation}.primary:active{transform:translateY(2px);box-shadow:inset 0 2px 0 #c9df9d,0 2px 0 #47662f}.bottom .round-button{margin-bottom:3px}
.group-hit{position:absolute;transform:translate(-50%,-50%);border:2px solid transparent;border-radius:14px;padding:0;background:transparent;touch-action:none;z-index:3;min-width:20px;min-height:20px}.group-hit img{width:100%;height:100%;object-fit:contain;pointer-events:none}.group-hit.selected{border-color:#d59a35;background:#fff3;box-shadow:0 0 0 2px #fff8}.model-ready .group-hit .pattern-art{visibility:hidden}.three-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}.celebration{position:absolute;inset:0;pointer-events:none;z-index:6;overflow:hidden}.celebration i{position:absolute;left:var(--x);top:25%;font-size:24px;color:#f9d764;animation:sparkle 1.6s both;animation-delay:var(--delay)}.drag-ghost{position:fixed;z-index:40;width:120px;height:120px;pointer-events:none;transform:translate(-50%,-50%);filter:drop-shadow(0 10px 8px #49352140)}.drag-ghost img{width:100%;height:100%;object-fit:contain}.planting-hand{position:fixed;left:0;top:0;width:138px;height:138px;object-fit:contain;pointer-events:none;z-index:45;transform-origin:12px 34px;filter:drop-shadow(0 7px 5px #281b242b)}.drag-ghost.garden-drag{width:138px;height:138px;transform:translate(-12px,-34px)}
dialog{border:2px solid #cab18a;border-radius:28px;background:#fffbed;color:#3c482e;width:min(90vw,420px);max-height:90vh;overflow:auto;padding:26px;box-shadow:0 20px 90px #1e28185c}dialog::backdrop{background:#22301e70;backdrop-filter:blur(5px)}dialog h2{margin:0 0 12px;font-size:28px}dialog p{line-height:1.5;font-family:system-ui;font-size:15px}.levels{display:flex;gap:10px;margin:20px 0}.levels button{flex:1;padding:14px;border-radius:16px;background:#eeead8;border:2px solid #c4cbae;font-size:22px}.levels button[aria-pressed=true]{background:#759550;color:white;border-color:#58753b}.dialog-close{position:absolute;right:12px;top:10px;border:0;background:none;font-size:28px;width:40px;height:40px}.small-note{font-size:12px!important;color:#6c755f}
@keyframes plant{from{transform:translateY(-12px) scale(.7)}to{transform:none}}@keyframes unfurl{0%{transform:scale(.08,.12);clip-path:inset(65% 0 0)}40%{transform:scale(.4,.65);clip-path:inset(25% 0 0)}100%{transform:scale(1);clip-path:inset(0)}}@keyframes sparkle{0%{transform:translateY(25px) scale(.2);opacity:0}25%{opacity:1}100%{transform:translateY(-120px) rotate(100deg);opacity:0}}@keyframes count-response{50%{transform:translateX(-50%) scale(1.15);background:#ffe5af}}
@media(min-width:850px) and (min-height:571px){.game{padding:12px 30px;grid-template-rows:76px 105px minmax(150px,1fr) auto 78px}.title-art{height:74px}.plaque{width:290px;height:80px}.piece{flex-basis:98px;width:98px;height:85px}.message{font-size:18px}.mascot{height:140px}}
@media(max-height:660px) and (max-width:599px){.game{grid-template-rows:48px 77px minmax(90px,1fr) auto 69px;gap:3px;padding-top:5px;padding-bottom:8px}.title-art{height:47px}.round-button{width:42px;height:42px}.plaque{height:56px;width:220px;font-size:23px}.plaque strong{font-size:39px}.progress{font-size:11px;margin-top:3px}.seed-supply{height:52px;width:72px}.supply-caption{font-size:20px}.piece{height:68px;flex-basis:86px;width:86px;padding:9px}.tray-controls{height:28px}.orientations button{min-height:26px;padding:3px 10px}.bottom{grid-template-columns:42px minmax(0,1fr) 42px}.primary{font-size:18px;min-height:42px}.message{font-size:13px}.mascot{height:58px}}
@media(max-height:570px) and (min-width:600px){.game{grid-template-columns:145px minmax(180px,1fr) 140px;grid-template-rows:46px minmax(0,1fr) 85px;padding:7px 16px;gap:5px 10px}.topbar{grid-column:1/4}.title-art{height:44px;width:230px}.challenge{grid-column:1;grid-row:2}.plaque{width:145px;height:70px;font-size:21px;gap:5px}.plaque strong{font-size:35px}.stage{grid-column:2;grid-row:2/4}.tools{grid-column:3;grid-row:2/4;height:100%;flex-direction:column}.workshop .tools{display:flex;flex-direction:column;gap:2px}.tray-controls{height:34px;width:100%;flex-shrink:0;margin:0}.orientations button{font-size:11px;padding:4px}.tray-next{display:none}.piece-tray{width:100%;height:100%;flex-direction:column;overflow-y:auto;overflow-x:hidden;touch-action:pan-y;scroll-snap-type:y proximity;padding:4px}.piece{height:66px;min-height:66px;flex-basis:66px;width:110px;padding:6px 14px;touch-action:pan-y}.bottom{grid-column:1;grid-row:3;grid-template-columns:34px minmax(0,1fr) 34px;gap:3px;align-content:end}.bottom .center-actions{grid-column:1/4;grid-row:1}.bottom .round-button{height:30px;width:30px}.bottom #remove{grid-column:3}.primary{font-size:17px;min-height:38px;padding:6px}.message{font-size:12px;line-height:1.1}.mascot{height:55px}.supply-caption{font-size:19px;text-align:center}.round-button{height:40px;width:40px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Explicit inset sizing prevents portrait sprites from setting grid track height. */
.piece .pattern-art{position:absolute;inset:10px;width:calc(100% - 20px);height:calc(100% - 20px);max-height:none;max-width:none;object-fit:contain}.group-hit .pattern-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
