@font-face{font-family:Fredoka;src:url('assets/fonts/fredoka-latin-500-normal.woff2')}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:Fredoka,system-ui,sans-serif;color:#553414;background:#eddbb7;overscroll-behavior:none}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.42;cursor:default}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:4px solid #8a65ba;outline-offset:3px}button{touch-action:manipulation}button img{pointer-events:none}svg{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;width:25px;height:25px}#app{position:relative;isolation:isolate;height:100%;height:100dvh;display:grid;grid-template-rows:92px minmax(0,1fr) 150px;overflow:hidden}.scenery{position:absolute;inset:0;z-index:-2;background-image:url('assets/topsy/toybox-towers-environment.webp');background-size:cover;background-position:center center}.scenery:after{content:'';position:absolute;inset:0;background:linear-gradient(#ffeecb12,transparent 30%,transparent 80%,#663c2918)}.topbar{display:flex;align-items:center;gap:15px;padding:12px 22px;z-index:4;pointer-events:none}.topbar>*{pointer-events:auto}.round{display:grid;place-items:center;border:2px solid #bb854c;background:linear-gradient(#fff0cf,#f7d7a1);box-shadow:0 3px 0 #9c693d,0 6px 10px #58331622;border-radius:50%;width:49px;height:49px;text-decoration:none;font-size:27px;color:#744316;flex-shrink:0}.round:active,.tool:active{transform:translateY(2px);box-shadow:0 1px 0 #9c693d}.wood-sign{background:linear-gradient(110deg,#edbd77dd,#ffdda2f5 50%,#e4aa65e8);border:2px solid #c28c51;box-shadow:inset 0 2px 1px #fff9,0 4px 0 #aa7341,0 8px 15px #55391622;border-radius:17px;padding:8px 25px 5px;text-align:center;transform:rotate(-1deg)}h1{font-size:32px;line-height:1.15;letter-spacing:-1px;margin:0;color:#6c3b10;text-shadow:0 1px #ffecc3}#worldButton{border:0;background:#fff1d4a8;border-radius:9px;padding:3px 10px;display:flex;align-items:center;justify-content:center;gap:13px;margin:3px auto -15px;box-shadow:0 2px 0 #bd8c58;font-size:15px;min-height:31px}.top-actions{display:flex;gap:10px;margin-left:auto}.play-area{position:relative;min-height:0}canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab;outline:none!important}.top-notes{position:absolute;top:10px;left:50%;transform:translateX(-50%);display:flex;gap:13px;white-space:nowrap;color:#674a31;font-size:13px;pointer-events:none}.top-notes span{background:#fff6dfde;border:1px solid #ffffffe0;border-radius:18px;padding:7px 12px;box-shadow:0 2px 5px #36241310}.hint{position:absolute;left:50%;bottom:5px;transform:translateX(-50%);padding:9px 17px;border-radius:30px;background:#fffaf0eb;border:1px solid #fff;box-shadow:0 3px 12px #55381b12;font-size:16px;text-align:center;max-width:65%;width:max-content;pointer-events:none;transition:opacity .3s}.toolbox{position:absolute;right:20px;top:60px;display:grid;gap:11px}.tool{border:2px solid #b48654;border-radius:17px;background:linear-gradient(#fff2d5,#edc78f);box-shadow:inset 0 1px 1px #fff,0 3px 0 #a77543,0 5px 9px #52331a1c;width:61px;height:65px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0}.tool span{font-size:32px;line-height:30px}.tool small{font-size:12px;line-height:19px}.rebuild{position:absolute;left:20px;bottom:12px;padding:11px 16px;border-radius:16px;border:2px solid #aa7645;background:#fff3d6;box-shadow:0 3px 0 #b3814f;font-size:16px}.workbench{display:flex;align-items:center;justify-content:center;gap:26px;padding:0 26px 15px;z-index:3}.tray{height:138px;display:flex;align-items:center;justify-content:space-evenly;gap:12px;max-width:840px;flex:1;border:9px solid #c58c53;border-top-color:#deb079;border-bottom-color:#af723f;border-radius:25px;background:linear-gradient(3deg,#d5a36e,#f2c58c 45%,#d8a268);box-shadow:inset 0 4px 9px #76492066,inset 0 -2px 2px #fff5,0 5px 0 #8b592f,0 12px 15px #74431d30;padding:8px 20px}.piece-button{border:2px solid transparent;border-radius:14px;background:transparent;display:flex;align-items:center;flex-direction:column;justify-content:center;min-width:0;width:23%;height:109px;padding:0;touch-action:none;position:relative;user-select:none;-webkit-user-select:none}.piece-button img{height:81px;width:100%;object-fit:contain;filter:drop-shadow(1px 3px 2px #774a2440);pointer-events:none}.piece-button span{font-size:13px;background:#fff0d1d9;box-shadow:0 1px 1px #9b6c33aa;border-radius:8px;padding:3px 9px;white-space:nowrap}.piece-button:hover,.piece-button[aria-pressed=true]{background:#fff5d459;border-color:#fff3c9;box-shadow:0 0 0 2px #8d602645}.piece-button[aria-pressed=true]{transform:translateY(-4px)}.wind-controls{width:123px;display:grid;justify-items:center;gap:3px;flex-shrink:0}.wind-button{border:0;padding:0;background:transparent;display:flex;align-items:center;flex-direction:column;position:relative;width:118px}.wind-button img{width:104px;height:104px;object-fit:contain;filter:drop-shadow(0 4px 2px #75451c55);transition:transform .3s}.wind-button:hover img{transform:rotate(12deg)}.wind-button span{background:#367759;color:#fff;border:2px solid #245e45;box-shadow:0 3px #244b37;border-radius:12px;padding:6px 10px;margin-top:-14px;z-index:1;font-size:14px;white-space:nowrap}.strength{font-size:11px;border:0;background:#fff0d5e8;border-radius:20px;margin-top:3px;padding:5px 9px}.blowing .wind-button img{animation:wind-wobble .6s ease-in-out infinite alternate}.blowing canvas{cursor:default}@keyframes wind-wobble{to{transform:rotate(18deg)}}#loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:15px;background:#f5e2bfd9;z-index:7;color:#7d4b25;font-size:19px}#loading[hidden]{display:none}.loading-house{font-size:80px;line-height:1;animation:wind-wobble .7s infinite alternate}dialog{max-width:880px;width:92vw;max-height:90dvh;overflow:auto;background:#fff8e9;border:3px solid #c99a64;border-radius:28px;padding:27px;color:#5c3d23;box-shadow:0 25px 100px #241b1555}dialog::backdrop{background:#30281d80;backdrop-filter:blur(7px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.dialog-heading p{font-size:10px;letter-spacing:2px;margin:0 0 6px;color:#987759}.dialog-heading h2{font-size:30px;margin:0}.dialog-note{font-size:14px;color:#896949;margin:15px 0 23px}.close{box-shadow:none;width:40px;height:40px}.world-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.world-card{border:3px solid transparent;background:#f2e1c5;border-radius:17px;overflow:hidden;padding:0;text-align:left;box-shadow:0 3px 0 #d4b187}.world-card[aria-pressed=true]{border-color:#789163;background:#e4edce}.world-card img{width:100%;aspect-ratio:1.6;object-fit:cover;display:block}.world-card strong{display:block;font-size:17px;padding:12px 12px 4px}.world-card small{display:block;font-size:11px;padding:0 12px 13px;color:#937552}.help-steps{font:15px/1.7 system-ui,sans-serif;max-width:650px;margin:20px auto}.help-steps b{display:block;font-family:Fredoka;font-size:20px;color:#7c5430}.help-steps .keyboard{font-size:12px;color:#856e55}.primary{border:2px solid #2e6149;background:#4d8862;color:white;border-radius:14px;padding:12px 25px;font-size:19px;box-shadow:0 3px 0 #274e35}.load-error{padding:25px;text-align:center}.load-error button{border:1px solid #a97a47;border-radius:12px;padding:10px 20px;background:#fff6e3}#soundButton[aria-pressed=false]{opacity:.55}@media(min-width:1500px){#app{grid-template-rows:100px minmax(0,1fr) 174px}.tray{height:155px}.piece-button{height:125px}.piece-button img{height:98px}}
@media(max-width:700px){#app{grid-template-rows:82px minmax(0,1fr) 127px}.topbar{padding:10px 12px;gap:10px}.wood-sign{padding:7px 14px 5px}h1{font-size:25px}#worldButton{font-size:12px;gap:8px;min-height:29px}.round{width:40px;height:40px;font-size:23px}.round svg{width:22px;height:22px}.top-actions{gap:7px}#fullButton{display:none}.toolbox{right:10px;top:55px;gap:9px}.tool{width:48px;height:54px;border-radius:14px}.tool span{font-size:27px;line-height:27px}.tool small{font-size:10px;line-height:16px}.tool svg{width:23px;height:23px}.top-notes{font-size:11px;gap:7px;top:12px}.top-notes span{padding:5px 9px}.hint{font-size:13px;max-width:90%;padding:7px 13px;bottom:7px}.workbench{padding:0 10px max(10px,env(safe-area-inset-bottom));gap:8px}.tray{height:108px;padding:5px 4px;border-width:6px;border-radius:18px;gap:1px}.piece-button{height:91px;width:25%;border-radius:10px}.piece-button img{height:65px}.piece-button span{font-size:10px;padding:3px 4px}.wind-controls{width:75px;gap:4px}.wind-button{width:75px}.wind-button img{width:80px;height:80px}.wind-button span{font-size:10px;padding:5px 6px}.strength{font-size:9px;padding:4px 6px;max-width:83px}.rebuild{font-size:12px;left:10px;bottom:48px;padding:8px 11px}.world-grid{grid-template-columns:repeat(2,1fr);gap:11px}dialog{padding:20px;border-radius:23px}.dialog-heading h2{font-size:25px}.world-card strong{font-size:15px}.world-card small{font-size:10px}.scenery{background-size:auto 100%;background-position:50% 50%}}
@media(max-height:540px) and (min-width:701px){#app{grid-template-rows:68px minmax(0,1fr) 105px}.topbar{padding:7px 18px}.wood-sign h1{font-size:24px}.wood-sign{padding:4px 20px}.round{width:39px;height:39px}.tray{height:96px}.piece-button{height:76px}.piece-button img{height:57px}.piece-button span{font-size:11px}.wind-button img{width:78px;height:78px}.wind-controls{width:100px}.toolbox{top:20px;grid-template-columns:repeat(2,1fr);gap:8px}.tool{width:48px;height:51px}.hint{font-size:12px}.top-notes{top:0}.tool span{font-size:25px}.workbench{padding-bottom:8px}.wind-button span{font-size:11px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:700px){.wood-sign{min-width:0;max-width:220px;flex:1}h1{font-size:clamp(21px,6vw,25px);white-space:nowrap}#worldButton{max-width:100%}#worldName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-actions{flex-shrink:0}}
@media(max-width:360px){.topbar{gap:7px;padding-left:9px;padding-right:9px}.top-actions{gap:5px}.round{width:36px;height:36px}.wood-sign{padding-left:8px;padding-right:8px}.piece-button span{font-size:9px}.wind-controls{width:68px}.workbench{gap:5px;padding-left:7px;padding-right:7px}}
