*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#233445}body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus{outline:3px solid #ffdb51;outline-offset:2px}button:active{filter:brightness(1.08)}button:disabled{cursor:default;filter:saturate(.35);opacity:.55}[hidden]{display:none!important}#viewport{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;padding-top:0;padding-top:var(--safe-area-inset-top,env(safe-area-inset-top,0px));padding-bottom:0;padding-bottom:var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px))}#stage{position:relative;width:360px;height:680px;flex-shrink:0;overflow:hidden;background:#a9d6ef;transform-origin:center center;box-shadow:0 15px 80px rgba(0,0,0,0.333333);border-radius:12px}#scene{position:absolute;top:0;left:0;width:360px;height:680px}.topbar{position:absolute;top:16px;left:14px;right:14px;height:33px;display:flex;align-items:center;justify-content:space-between}.topbar h1{font-size:16px;color:#fff;background:#555c61;border-radius:18px;margin:0;width:102px;text-align:center;padding:3px 0;text-shadow:0 1px 1px #222}.pause{border:2px solid #345c9a;border-radius:50%;height:32px;width:32px;font-size:23px;line-height:20px;color:#fff;background:linear-gradient(#83bdff,#558de4);box-shadow:inset 0 2px 0 #c8e5ff,0 2px 0 #263d77;text-shadow:0 1px 2px #244a7c}.album-button{border:1px solid #b2d3e5;border-radius:8px;background:#e9f8ff;color:#487590;width:30px;height:28px;font-size:23px}.boxes{position:absolute;top:69px;left:12px;right:12px;height:104px;display:flex;justify-content:space-between}.box{width:73px;height:92px;margin-top:10px;position:relative;border-radius:11px;background:var(--dark);box-shadow:0 2px 0 rgba(0,0,0,0.133333);transition:transform .2s}.box-handle{position:absolute;left:17px;top:-15px;width:40px;height:21px;border:6px solid #6c6e64;border-bottom:0;border-radius:3px}.box-handle:before{content:"";position:absolute;left:0;right:0;top:-7px;height:10px;background:var(--color);box-shadow:inset 0 -3px 0 rgba(255,255,255,0.266667)}.box-face{position:absolute;top:0;left:0;width:73px;height:65px;background:#eeeeed;border:4px solid var(--color);border-radius:11px;box-shadow:inset 0 4px 0 #c9cccd}.box-face .well{position:absolute;width:18px;height:18px;border-radius:50%;background:#777;box-shadow:inset 0 2px 0 #b2b2b2}.box-face .well:nth-child(1){top:11px;left:24px}.box-face .well:nth-child(2){top:34px;left:10px}.box-face .well:nth-child(3){top:34px;right:10px}.bolt-mini{width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--dark);background:var(--color);border:1px solid var(--dark);box-shadow:inset 0 1px 0 rgba(255,255,255,0.6);font-size:21px;line-height:16px;font-weight:900}.box-lock{height:99px;margin-top:0;border:2px solid #5c9b8b;background:linear-gradient(#9ce4d1,#83d8c7);box-shadow:inset 0 -5px 0 #63b5a0;border-radius:17px 17px 12px 12px;color:#fff;font-size:18px;font-weight:800;line-height:21px;text-shadow:1px 1px 0 #5b9387,-1px -1px 0 #5b9387;padding:15px 5px 7px}.box-lock small{display:block;font-size:10px;line-height:17px;color:#367366;text-shadow:none;font-weight:600}.box-lock .lock-plus{display:block;font-size:20px;line-height:18px}.box-empty{background:#e4ecef;border:2px dashed #c3d2d9;color:#8da3ae;display:flex;align-items:center;justify-content:center;font-size:11px;box-shadow:none}.slots{position:absolute;top:182px;left:50px;right:50px;display:flex;justify-content:center;height:24px}.slot{width:20px;height:20px;flex-shrink:0;border:1px solid #9b9e9e;border-radius:50%;background:#b5b6b6;box-shadow:inset 0 1px 1px #fff,0 1px 0 #fff;margin:0 6px}.slots.danger .slot{border-color:#e86f6f;background:#e4b7b4}.progress-badge{position:absolute;top:198px;right:6px;width:68px;text-align:center;pointer-events:none}.progress-badge strong{display:block;font-size:12px;color:#142a37;margin-top:2px}.crate{position:relative;background:linear-gradient(120deg,#d7aa65,#c9924d);border-radius:1px;transform:skewY(-4deg);box-shadow:inset 0 -7px 0 rgba(0,0,0,0.066667)}.crate:before,.crate:after{content:"";position:absolute;top:-15%;height:35%;background:#ebc48b;border:1px solid #d4ab70}.crate:before{left:-12%;width:58%;transform:skewY(23deg) rotate(-10deg)}.crate:after{right:-12%;width:58%;transform:skewY(-15deg) rotate(10deg)}.crate i{position:absolute;top:0;left:49%;bottom:0;width:1px;background:#a6773b}.crate b{position:absolute;left:10%;right:10%;top:-19%;height:26%;background:#7a674f;transform:skewY(3deg)}.small-crate{width:47px;height:30px;margin:3px auto 0;background:linear-gradient(120deg,#c7c7c7,#9e9e9e)}.small-crate:before,.small-crate:after{background:#ddd;border-color:#aaa}#instruction{position:absolute;top:237px;left:47px;width:267px;background:rgba(245,252,255,0.929412);border:1px solid #719aa9;box-shadow:0 2px 0 rgba(117,155,177,0.333333);border-radius:5px;padding:11px 5px;color:#344d82;text-align:center;font-size:17px;pointer-events:none;z-index:2}#screw-controls{position:absolute;inset:0;top:0;left:0;right:0;bottom:0;pointer-events:none}.screw-hit{position:absolute;width:40px;height:40px;margin:-20px 0 0 -20px;opacity:0;border:0;background:transparent;border-radius:50%;pointer-events:auto}.screw-hit:disabled{pointer-events:none}.screw-hit:focus{opacity:1;background:rgba(255,255,255,0.066667);outline:3px dashed #fff}.tools{position:absolute;top:615px;left:49px;right:49px;display:flex;justify-content:space-between}.tools>button{position:relative;width:67px;height:53px;border:1px solid #2876b7;border-radius:9px;background:linear-gradient(#74d7ff,#43bcff);box-shadow:inset 0 2px 0 #d6f4ff,0 3px 0 #4676ad;color:#fff}.tools b{position:absolute;bottom:0;left:0;right:0;font-size:13px;font-weight:900;text-shadow:1px 1px 0 #244b86,-1px 1px 0 #244b86,1px -1px 0 #244b86,-1px -1px 0 #244b86}.tool-art{width:34px;height:34px;position:absolute;top:2px;left:15px}.add-art{background:#3b5578;color:#a2ff69;border:3px solid #d5e6ef;border-radius:50%;font-size:18px;font-weight:900;line-height:27px;box-shadow:0 0 0 1px #275c97}.tools i{position:absolute;right:-7px;top:-8px;background:#a4e950;border:1px solid #5c9318;box-shadow:inset 0 1px 0 #e5ffbc;border-radius:50%;width:21px;height:21px;font-style:normal;font-size:13px;font-weight:900;line-height:18px;text-shadow:0 1px 0 #638c28}.topbar,.boxes,.slots,.tools,.progress-badge{z-index:3}#reserve-label{position:absolute;top:574px;left:0;right:0;text-align:center;color:#366884;font-size:11px}#melt-banner{position:absolute;top:222px;left:20px;right:20px;padding:10px 6px;background:rgba(228,255,217,0.960784);border:2px solid #6db75b;border-radius:9px;color:#31733a;text-align:center;z-index:4;font-size:13px}#melt-banner button{margin-left:12px;border:0;color:#347c46;background:transparent;text-decoration:underline}#toast{position:absolute;bottom:82px;left:30px;right:30px;background:rgba(35,70,97,0.909804);color:#fff;font-size:12px;line-height:1.5;text-align:center;padding:9px;border-radius:9px;z-index:9;pointer-events:none;opacity:0;transition:opacity .15s}#toast.visible{opacity:1}.overlay{position:absolute;inset:0;top:0;left:0;right:0;bottom:0;background:rgba(20,42,66,0.466667);display:flex;align-items:center;justify-content:center;z-index:10}.dialog{position:relative;width:298px;padding:44px 18px 20px;background:#f8f9fd;border:6px solid #72c8ff;border-radius:20px;box-shadow:inset 0 -5px 0 #b8c9e2,0 4px 0 #376a9e;text-align:center;color:#4f557d}.dialog h2{position:absolute;top:-25px;left:39px;right:39px;margin:0;border:2px solid #184263;border-radius:7px;padding:9px 0;background:linear-gradient(125deg,#4ba9dc 50%,#247bb3 50%);color:#fff;text-shadow:2px 2px 0 #111,-1px -1px 0 #111;font-size:22px;box-shadow:0 2px 0 rgba(255,255,255,0.6)}.dialog p{font-size:14px;line-height:1.8;margin:10px 0 16px}.dialog .hero-symbol{font-size:64px;color:#ffca3e;text-shadow:2px 3px 0 #cb8130}.dialog .fine{font-size:11px;color:#8d98ad}.primary{display:block;border:2px solid #573a22;border-radius:22px;padding:10px 12px;box-shadow:inset 0 3px 0 #ffe9b2,inset 0 -4px 0 #c64f19,0 2px 0 #6d3426;background:linear-gradient(#ffbc63,#ff853d);color:#fff;font-size:19px;font-weight:800;text-shadow:1px 1px 0 #9e5125;margin:10px auto;min-width:155px}.cyan-button{border-color:#14527b;background:linear-gradient(#7ae6ff,#32c8ef);box-shadow:inset 0 3px 0 #d5faff,inset 0 -4px 0 #1f9fc5,0 2px 0 #13476e;text-shadow:1px 1px 0 #2682a4}.pink-button{border-color:#6f216c;background:linear-gradient(#fc8afa,#ec38e9);box-shadow:inset 0 3px 0 #ffc6ff,inset 0 -4px 0 #bd29bb,0 2px 0 #612260;text-shadow:1px 1px 0 #9d3199}.secondary{display:block;border:0;background:transparent;color:#7787a0;font-size:12px;padding:9px;margin:2px auto}.small-button{border:1px solid #629aca;border-radius:8px;padding:6px 9px;background:#e7f7ff;color:#3c7099;font-size:12px}.art-header{position:absolute;top:23px;left:18px;right:18px;display:flex;align-items:center;justify-content:space-between}.art-header h2{font-size:21px;color:#fff;text-shadow:1px 2px 0 #397aaf;margin:0}.wood-frame{position:absolute;top:83px;left:33px;width:294px;height:294px;padding:12px;background:repeating-linear-gradient(3deg,#a5763f 0,#a5763f 5px,#b4874b 7px,#c49b60 10px);border:3px solid #704b27;border-radius:5px;box-shadow:0 4px 0 rgba(69,103,129,0.301961)}.wood-frame canvas{display:block;width:264px;height:264px;background:#fff9ec;box-shadow:inset 0 0 20px rgba(176,141,85,0.266667)}.corner{position:absolute;font-style:normal;font-size:15px;color:#59636d;background:#aab4b9;border:1px solid #5c6870;border-radius:50%;height:17px;width:17px;line-height:14px;text-align:center}.tl{left:0;top:0}.tr{right:0;top:0}.bl{left:0;bottom:0}.br{right:0;bottom:0}.art-progress{position:absolute;top:393px;left:46px;right:46px;height:22px;background:#83776e;border:2px solid #a9b1bb;border-radius:7px;box-shadow:0 0 0 1px #9c7449;overflow:hidden}.art-progress i{display:block;background:linear-gradient(#ffe476,#f6ba37);width:0;height:100%}.art-progress b{position:absolute;top:2px;left:0;right:0;text-align:center;color:#fff;font-size:11px;text-shadow:0 1px 0 #946d4c}#art-name{position:absolute;top:421px;left:0;right:0;margin:0;color:#386781;font-size:13px;text-align:center}.art-crate{position:absolute;top:474px;left:123px;width:114px;height:69px}#crate-bolts{position:absolute;top:-30px;left:8px;width:98px;display:flex;flex-wrap:wrap;transform:skewY(4deg);z-index:-1}#crate-bolts .bolt-mini{width:15px;height:15px;font-size:15px;margin:-1px}#wallet{position:absolute;top:544px;left:0;right:0;text-align:center;color:#315877;font-size:13px;margin:8px 0}.art-hint{position:absolute;top:576px;left:0;right:0;text-align:center;font-size:11px;color:#9667b4;margin:0}#shoot,#continue{position:absolute;top:590px;left:98px;width:164px;margin-top:8px}.gallery-cards{display:flex;justify-content:space-around;margin:20px 0}.gallery-cards div{padding:8px 5px;border:2px solid #d7c9af;border-radius:8px;background:#fff6e8;font-size:12px;width:70px}.gallery-cards strong{display:block;font-size:33px;margin-bottom:4px}.success-crate{width:110px;height:65px;margin:28px auto}.tool-symbol{width:80px;height:80px;margin:10px auto;border-radius:50%;background:#e4e7f2;display:flex;align-items:center;justify-content:center;font-size:45px}.tool-notice{font-size:12px;color:#578d6a}#boot-error{padding:25px;text-align:center;color:#333;background:#fff}.box.pop{animation:boxpop .35s}@keyframes boxpop{50%{transform:translateY(-10px) rotate(-4deg)}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

#effects{position:absolute;top:0;left:0;width:360px;height:680px;z-index:5;pointer-events:none}

/* Reference level rack: same native-toolbar-free 360px layout as the screenshot. */
#stage.reference-level .topbar{top:51px;height:28px}
#stage.reference-level .topbar h1{width:100px;font-size:14px;padding:2px 0}
#stage.reference-level .pause{width:29px;height:29px}
#stage.reference-level .boxes{top:94px;left:14px;right:14px;height:80px}
#stage.reference-level .box{width:72px;height:81px;margin-top:0}
#stage.reference-level .box-face{width:72px;height:60px;border-width:4px}
#stage.reference-level .box-face .well{width:18px;height:18px}
#stage.reference-level .box-face .well:nth-child(1){top:9px;left:23px}
#stage.reference-level .box-face .well:nth-child(2){top:31px;left:9px}
#stage.reference-level .box-face .well:nth-child(3){top:31px;right:9px}
#stage.reference-level .box-lock{height:86px;margin-top:-5px;padding:13px 5px 3px;background:#76ddc9}
#stage.reference-level .box-lock:before{content:'';position:absolute;top:-10px;left:12px;width:46px;height:11px;border:2px solid #5c9b8b;border-bottom:0;border-radius:10px 10px 0 0;background:#76ddc9}
#stage.reference-level .slots{top:184px;left:60px;right:140px;justify-content:flex-start}
#stage.reference-level .slot{width:19px;height:19px;margin:0 7px}
#stage.reference-level .tools{top:615px;left:50px;right:50px}
#stage.reference-level .tools>button{width:67px;height:47px}

#stage.dense-level .screw-hit{width:28px;height:28px;margin:-14px 0 0 -14px}
#stage.reference-level .box-lock small{font-size:9px;line-height:11px}
#stage.reference-level .box-lock{padding-top:9px;font-size:18px;line-height:20px}
/* Planning aids stay outside the playing area and never cover a screw. */
#queue-preview{position:absolute;top:48px;left:70px;right:46px;height:19px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#58717c;z-index:3;pointer-events:none}
#queue-preview>span+span{margin-left:6px}
.queue-color{padding:2px 5px;border-radius:8px;border:1px solid var(--dark);background:var(--color);color:var(--dark);font-weight:700;line-height:12px}
#stage.reference-level #queue-preview{top:24px;left:50px;right:50px}
#strategy-status{position:absolute;top:594px;left:8px;right:8px;height:17px;line-height:17px;text-align:center;font-size:10px;color:#315c70;pointer-events:none}
#strategy-status.danger{color:#9c302b;font-weight:700}
.rules-list{max-height:390px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;margin:0 0 12px;padding-left:19px;text-align:left;font-size:12px;line-height:1.65}
.rules-list li{margin:0 0 9px;padding-left:1px}
.box.collecting{background:#718893;--color:#9bb5c1;--dark:#486775}
.box.collecting .bolt-mini{visibility:hidden}
.box.collecting .collecting-label{position:absolute;left:0;right:0;bottom:4px;text-align:center;font-size:10px;line-height:12px;color:#fff;font-weight:700}
#queue-preview{left:167px;right:10px;justify-content:flex-end}
#save-status{position:absolute;top:0;left:0;right:0;padding:2px 5px;background:#fff0d0;color:#7a4c06;font-size:10px;line-height:13px;text-align:center;z-index:10;pointer-events:none}

.box-restricted{background:#e7eaec;border:2px dashed #abb4b8;box-shadow:none;color:#62747b;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px;text-shadow:none}.box-restricted small{font-size:11px;line-height:1.5;margin-top:8px}#level-title{white-space:nowrap;max-width:230px;overflow:hidden;text-overflow:ellipsis}

.rank-list{max-height:280px;overflow-y:auto}.rank-row{display:flex;align-items:center;text-align:left;padding:10px 0;border-bottom:1px solid #dce7ee;font-size:12px}.rank-row>b{width:28px;flex-shrink:0;color:#2490b8}.rank-row>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rank-row>strong{margin-left:8px;white-space:nowrap}.rank-mine{background:#e1f4ff;border-radius:8px;padding:8px}.tools>button:disabled{opacity:.45}

/* A visual hint only: touches still reach the actual screw and all controls. */
#first-play-guide{position:absolute;width:0;height:0;z-index:5;pointer-events:none}
.guide-ring{position:absolute;left:-20px;top:-20px;width:40px;height:40px;border:3px solid #fff4a2;border-radius:50%;box-shadow:0 0 0 2px #d5a442,0 0 14px rgba(255,241,149,.8);animation:guide-ring 1.3s ease-out infinite}
.guide-hand{position:absolute;left:-18px;top:-4px;width:64px;height:78px;filter:drop-shadow(0 3px 2px rgba(58,65,70,.3));transform-origin:18px 4px;animation:guide-tap 1.3s ease-in-out infinite}
#first-play-hint{position:absolute;bottom:31px;width:184px;padding:8px 4px;border:1px solid #fff0bc;border-radius:20px;background:#466780;color:#fff9dd;text-align:center;font-size:12px;font-weight:700;line-height:17px;box-shadow:0 2px 5px rgba(36,63,79,.18)}
@keyframes guide-tap{0%,65%,100%{transform:translate(5px,9px) rotate(8deg)}25%,40%{transform:translate(0,0) rotate(0deg)}}
@keyframes guide-ring{0%,100%{transform:scale(.9);opacity:.45}30%{transform:scale(1.08);opacity:1}65%{transform:scale(1.3);opacity:.15}}
@media(prefers-reduced-motion:reduce){.guide-hand{transform:none}.guide-ring{opacity:1}}
