@font-face{font-family:Lilita;src:url('assets/LILITAONE-REGULAR.ttf') format('truetype');font-display:swap}
@font-face{font-family:GameSans;src:url('assets/LiberationSans.ttf') format('truetype');font-display:swap}
:root{--ink:#49446e;--muted:#82758b;--pink:#ffc6d2;--paper:#fff8f3;--blue:#7b78da;--green:#66be83;--shadow:#ca819252;--line:#e7ccd0;--font:Lilita,Georgia,serif}
*{box-sizing:border-box}body{margin:0;color:var(--ink);font:16px GameSans,sans-serif;background:radial-gradient(ellipse at 25% 20%,#ffede6 0,transparent 42%),radial-gradient(ellipse at 85% 80%,#e5dcf1 0,transparent 47%),#efc5d0;min-height:100dvh;display:grid;place-items:center}button,input{font:inherit}button{cursor:pointer;color:inherit;touch-action:manipulation}button:focus-visible,input:focus-visible{outline:3px solid #49446e;outline-offset:3px}button:disabled{cursor:not-allowed;opacity:.4}button:not(:disabled):active{transform:translateY(2px)}button{transition:filter .16s,transform .16s}button:hover:not(:disabled){filter:brightness(1.04)}.game-shell{width:min(100%,510px);min-height:min(100dvh,920px);background:linear-gradient(180deg,#ffd8dc 0%,#ffe6de 47%,#fff0df 100%);position:relative;box-shadow:0 16px 100px #84627f3b;overflow:hidden}.topbar{display:flex;align-items:center;justify-content:space-between;padding:18px 24px 12px;gap:12px}.brand{text-align:center}.brand h1{font:31px/1 var(--font);margin:0 0 7px;color:#595182;letter-spacing:-.7px;text-shadow:0 2px #ffffffb0}.brand button{border:0;background:transparent;font:20px var(--font);padding:0 12px;color:#976478}.round-button{border:2px solid #fff6ed;background:#fff6eaa3;border-radius:18px;width:46px;height:46px;box-shadow:0 4px 0 #dba0b44a;display:grid;place-items:center;padding:8px}.round-button svg{width:24px;fill:var(--ink)}.round-button img{width:31px;height:31px;object-fit:contain}.collection{padding:8px 26px 0}.section-line{display:flex;justify-content:space-between;font-size:10px;letter-spacing:1.3px;font-weight:bold;color:#9c6f7f}.section-line span:last-child{letter-spacing:.2px;font-weight:normal;font-size:11px}.boxes{display:flex;justify-content:center;gap:13px;min-height:87px;margin:9px 0 13px}.screw-box{position:relative;border-radius:16px 16px 22px 22px;background:var(--color);box-shadow:inset 0 3px 0 #ffffff75,inset 0 -7px 0 #0000001f,0 7px 10px #b87c8c21;padding:15px 12px 13px;flex:1;max-width:175px;border:2px solid #ffffff79;display:flex;align-items:center;justify-content:space-around;gap:7px;transition:background .3s}.screw-box:before{content:'';position:absolute;inset:6px 8px 11px;border:1px solid #00000015;border-radius:10px 10px 16px 16px}.screw-box .hole{width:37px;height:37px}.screw-box small{position:absolute;bottom:-13px;left:0;right:0;text-align:center;font:11px var(--font);color:#896273}.screw-box.empty{background:#d6bccc4d;box-shadow:inset 0 0 0 1px #b897a133;opacity:.55}.screw-box.compact{padding:12px 5px;gap:3px}.screw-box.compact .hole{width:27px;height:27px}.hole{border-radius:50%;background:#00000030;box-shadow:inset 0 3px 4px #00000048,0 2px 0 #ffffff6b;position:relative;display:grid;place-items:center}.pin{width:29px;height:29px;background:var(--color);border-radius:50%;box-shadow:inset 2px 3px 2px #ffffff86,inset -2px -3px 1px #00000040,0 2px 3px #0000003d;display:block;position:relative}.pin:before,.pin:after{content:'';position:absolute;top:45%;left:23%;height:12%;width:54%;border-radius:3px;background:#00000045;box-shadow:0 1px #ffffff77;transform:rotate(35deg)}.pin:after{transform:rotate(125deg)}.buffer-label{display:flex;justify-content:space-between;font:12px var(--font);color:#a67b86;padding:4px 9px}.buffer{display:flex;gap:12px;justify-content:center;border-radius:30px;background:#b88b9840;border:1px solid #fff7e6a8;padding:10px;min-height:57px;box-shadow:inset 0 3px 4px #ba8d9b22}.buffer .hole{width:34px;height:34px}.stage{height:386px;position:relative;margin-top:3px;touch-action:none}.stage:before{content:'';position:absolute;width:220px;height:33px;background:radial-gradient(ellipse,#a3849947,transparent 65%);bottom:65px;left:50%;transform:translateX(-50%);pointer-events:none}#canvas-host,#canvas-host canvas,.screw-targets{position:absolute;inset:0;width:100%;height:100%}#canvas-host canvas{display:block;outline:none}.screw-targets{pointer-events:none}.screw-target{position:absolute;width:36px;height:36px;transform:translate(-50%,-50%);pointer-events:auto;background:transparent;border:0;border-radius:50%;padding:0;transition:none}.screw-target:focus-visible,.screw-target.hinted{outline:3px solid #fff;box-shadow:0 0 0 6px #71b795a6,0 0 20px 8px #fff5a8;z-index:3}.screw-target.blocked{pointer-events:none}.screw-target:hover{background:#ffffff22}.model-caption{position:absolute;top:14px;left:26px;right:26px;display:flex;justify-content:space-between;color:#a1808c;font-size:11px;pointer-events:none}.model-caption span:first-child{text-transform:uppercase;letter-spacing:1.5px}.view-controls{position:absolute;bottom:9px;left:30px;right:30px;display:flex;align-items:center;justify-content:space-between;gap:7px;color:#a07b88;font-size:11px;pointer-events:none}.view-controls button{pointer-events:auto;width:38px;height:34px;background:#fff3df99;border:1px solid #dcb7ba;border-radius:12px;font-size:20px}.loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#ffe6de;font:22px var(--font);z-index:8}.loading[hidden]{display:none}.loading span{width:90px;height:5px;background:#d6bbcd;border-radius:4px;margin:18px;overflow:hidden}.loading span:after{content:'';display:block;width:45%;height:100%;background:#8b7ac3;animation:load 1s infinite alternate}@keyframes load{to{transform:translateX(130%)}}.toast{position:absolute;top:55px;left:50%;transform:translate(-50%,-8px);background:#fff9ecf0;box-shadow:0 4px 20px #997b8830;border-radius:14px;padding:11px 15px;max-width:90%;width:max-content;font-size:13px;text-align:center;opacity:0;transition:.2s;pointer-events:none;z-index:10}.toast.show{opacity:1;transform:translate(-50%,0)}footer{padding:6px 26px 14px}.progress-label{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#947c89}.progress-label button{border:0;background:none;color:#8073a2;font-size:11px;padding:5px}.progress-track{height:9px;border-radius:10px;background:#d9bfc333;box-shadow:inset 0 1px 3px #a68f9330;margin:5px 0 16px;overflow:hidden}.progress-track div{height:100%;width:0;background:#82c5a3;border-radius:10px;box-shadow:inset 0 2px #ffffff5c;transition:width .4s}.tools{display:flex;justify-content:space-between;gap:9px}.tool{border:0;padding:0;background:transparent;font:11px var(--font);display:flex;align-items:center;flex-direction:column;gap:8px;min-width:52px}.tool-icon{width:58px;height:55px;background:#fff8eb;border:2px solid white;border-radius:18px;display:grid;place-items:center;position:relative;box-shadow:0 4px 0 #dab8b46b}.tool-icon img{width:39px;height:39px;object-fit:contain}.tool-icon b{position:absolute;right:-4px;bottom:-3px;background:#80bd9a;color:white;border:2px solid #fff7e9;border-radius:50%;width:22px;height:22px;display:grid;place-items:center;font:12px var(--font)}.text-icon{font:34px var(--font);color:#8f81b7}.tool.armed .tool-icon{outline:3px solid #c49757}.restart{display:block;border:0;background:transparent;margin:16px auto 0;color:#b29aa1;font-size:11px;text-decoration:underline;text-underline-offset:3px}dialog{border:2px solid #fff9e9;background:#fff2e4;color:var(--ink);border-radius:30px;box-shadow:0 20px 100px #503f6059;width:min(440px,calc(100% - 28px));max-height:88dvh;padding:25px;overflow:auto}dialog::backdrop{background:#57446166;backdrop-filter:blur(6px)}dialog h2{font:32px var(--font);margin:5px 0 15px;text-align:center}dialog h3{font:19px var(--font);margin:12px 0 8px}dialog p{line-height:1.6;font-size:14px;color:#8a7689;text-wrap:pretty}.dialog-heading{display:flex;align-items:center;justify-content:space-between}.dialog-heading h2{font-size:27px;margin:0}.close-button{width:34px;height:34px;flex-shrink:0;border:0;border-radius:50%;background:#e6ccd1;font-size:23px}.primary,.secondary{display:block;width:100%;border-radius:16px;padding:13px 15px;font:19px var(--font);border:2px solid white;margin-top:14px;background:#79bd91;color:white;box-shadow:0 4px 0 #549e6e}.secondary{background:#ded3e9;color:#746286;box-shadow:0 4px 0 #c6b2d5}.setting-row{display:flex;align-items:center;justify-content:space-between;padding:16px 0;border-bottom:1px solid #e3ced2;font:18px var(--font)}.switch{border:0;width:54px;height:30px;border-radius:30px;background:#b8a7b6;padding:4px}.switch:after{content:'';width:22px;height:22px;background:#fff;display:block;border-radius:50%;transition:.2s}.switch[aria-checked=true]{background:#7fbd95}.switch[aria-checked=true]:after{transform:translateX(24px)}.level-navigation{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:17px 0;font-size:13px}.level-navigation button{border:0;background:#dfd1e4;border-radius:9px;padding:8px 12px}input[type=number]{width:72px;border:1px solid #d7bfce;border-radius:8px;background:#fff8ef;padding:6px;color:var(--ink)}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.level-card{border:1px solid #eddee5;background:#fff9ef;border-radius:13px;aspect-ratio:.86;position:relative;display:flex;align-items:center;flex-direction:column;justify-content:center;padding:4px;font:15px var(--font)}.level-card img{width:100%;height:48px;object-fit:contain}.level-card.done{background:#e5f2df}.level-card:disabled{opacity:.45}.level-card.current{outline:2px solid #a18bc0}.level-card .lock{position:absolute;right:5px;top:3px;font:10px GameSans}.win-icon{display:block;height:125px;max-width:100%;object-fit:contain;margin:10px auto}.victory{text-align:center}.eyebrow{font-size:11px;letter-spacing:2px;color:#b58a95}.stats{display:flex;justify-content:space-around;padding:12px 0;border-top:1px solid #e9d4d4;border-bottom:1px solid #e9d4d4}.stats b{display:block;font:26px var(--font);color:#7b6898}.stats span{font-size:11px;color:#a18b96}.celebration{position:fixed;inset:0;pointer-events:none;z-index:20;overflow:hidden}.confetto{position:absolute;top:-20px;width:8px;height:14px;background:var(--color);border-radius:3px;animation:confetti 2.6s ease-in forwards;animation-delay:var(--delay)}@keyframes confetti{to{transform:translate(var(--drift),105vh) rotate(800deg)}}
@media(min-width:650px){.game-shell{border-radius:34px;margin:25px 0;border:5px solid #fff7e8}.stage{height:404px}}
@media(max-width:380px){.topbar{padding:14px 18px 8px}.collection,footer{padding-left:18px;padding-right:18px}.tools{gap:5px}.tool{min-width:48px}.tool-icon{width:52px;height:50px}.stage{height:340px}.buffer{gap:9px}.brand h1{font-size:27px}}
@media(max-height:770px){.topbar{padding-top:10px;padding-bottom:5px}.stage{height:calc(100dvh - 425px);min-height:240px}.boxes{min-height:73px;margin-bottom:10px}.screw-box{padding:11px}.tool-icon{height:48px;width:52px}.tools{gap:6px}.restart{margin-top:11px}footer{padding-bottom:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.aux-tools{display:flex;justify-content:center;gap:10px;margin-top:15px}.aux-tools button{border:1px solid #dfc7cc;border-radius:20px;padding:7px 10px;background:#fff7ed99;font-size:10px}.aux-tools b{font-weight:normal;margin-left:3px;color:#5e9d7d}.aux-tools button[aria-pressed=true]{background:#d9e9e2;border-color:#88bda3}.reserve{font-size:10px;color:#907783;display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 0}.reserve[hidden]{display:none}.reserve .pin{width:17px;height:17px}.restart{margin-top:10px}.game-shell{min-height:0}
.screw-target:not(:disabled):active{transform:translate(-50%,-50%)}
@media(max-height:900px){.stage{height:calc(100dvh - 500px);min-height:250px}.topbar{padding-top:12px}.boxes{min-height:75px}}
@media(max-height:730px){.stage{height:250px}.game-shell{min-height:100dvh}}
