dialog{border:0;border-radius:20px;padding:0;max-width:440px;width:calc(100% - 20px);max-height:85dvh;color:inherit;background:#f6f6ec;box-shadow:0 18px 80px #102e3b66}dialog::backdrop{background:#132f2c99;backdrop-filter:blur(3px)}#sheet-body{padding:14px 14px calc(14px + env(safe-area-inset-bottom));overflow-wrap:anywhere}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:-14px;background:#f6f6ec;z-index:1}.sheet-head h2{font-size:18px;margin:0}.sheet-head button{font-size:18px;padding:0;width:44px}.sheet-copy{font-size:14px;line-height:1.65}.sheet-copy p{margin:10px 0}.sheet-copy ul{padding-left:20px}.level-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.level-button{text-align:left;min-height:72px;padding:9px;line-height:20px}.level-button small{display:block;font-size:11px;color:#6c7d6d}.level-button.done{background:#e3ecda;border-color:#a2bb8c}.group-title{font-size:15px;margin:16px 0 8px}.menu{display:flex;flex-direction:column;gap:7px}.menu button{text-align:left;padding:9px 12px;line-height:22px}.hints{background:#fffcf0;border-left:4px solid var(--amber);padding:12px;line-height:1.7;font-size:15px;border-radius:8px;margin:12px 0}.hint-steps{display:flex;gap:7px}.dot{height:8px;width:24px;background:#d3d9c9;border-radius:10px}.dot.on{background:#b98027}.full{width:100%;margin-top:10px}.detail-item{background:#fffdf3;border:1px solid #d7decc;border-radius:10px;padding:10px;margin:8px 0;font-size:14px;line-height:1.7}.detail-item pre{white-space:pre-wrap;word-break:break-word;font:12px/1.5 monospace}.detail-metric{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #e5e7da;padding:6px 0;font-size:13px}.sheet-note{font-size:12px;color:#677a6c;line-height:1.6}#toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);max-width:90vw;background:#233e32;color:white;padding:10px 16px;border-radius:10px;font-size:13px;z-index:99;display:none}

:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;font-synthesis:none;color:#f5efd8;background:#102932;--green:#285e50;--amber:#e9b85d;--line:#6b8a83;--scene-top:146px;--dock-height:282px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}button{font:inherit;min-width:44px;min-height:44px;border:1px solid #a4c2a64d;border-radius:12px;background:#264a4c;color:#f8f2d9;padding:0 10px;cursor:pointer;touch-action:manipulation}button:hover:not(:disabled){background:#3a6461;border-color:#cfe9bd}button:focus-visible{outline:3px solid #ffe6a0;outline-offset:2px}button:disabled{opacity:.38;cursor:default}button.primary{background:linear-gradient(#f7ce72,#dfa447);border-color:#ffe29b;color:#423517;font-weight:800;box-shadow:0 3px 0 #936a2d}button.primary:hover:not(:disabled){background:#ffdf8e}
#app{width:100%;height:100dvh}.game{height:100%;width:100%;max-width:1500px;margin:auto;position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 55%,#46696080 0,transparent 64%),radial-gradient(ellipse at 50% 100%,#80705270,transparent 55%),linear-gradient(#142f3b,#21444a 62%,#17353d)}
.game:before{content:"";position:absolute;inset:25% -40% -65%;pointer-events:none;opacity:.12;background-image:linear-gradient(#a8c6ac 1px,transparent 1px),linear-gradient(90deg,#a8c6ac 1px,transparent 1px);background-size:70px 70px;transform:perspective(450px) rotateX(50deg)}
.game-top{position:absolute;z-index:3;top:max(6px,env(safe-area-inset-top));left:10px;right:10px;display:flex;flex-direction:column;gap:3px;pointer-events:none}.game-top button{pointer-events:auto}.head{display:flex;justify-content:space-between;align-items:center;min-height:44px;gap:6px}.brand{display:flex;align-items:center;gap:7px}.brand svg{width:20px;height:29px}.brand h1{font-size:17px;letter-spacing:.04em;margin:0;white-space:nowrap}.head-actions{display:flex;gap:4px}.head-actions button{background:#102b37c9;font-size:12px;padding:0 8px;border-color:#a5c6ad38}.task-top{display:flex;justify-content:space-between;align-items:center;gap:6px;height:24px}.task h2{font-size:13px;margin:0;color:#ffe3a0}.tag{font-size:10px;white-space:nowrap;color:#d3e5cf}.task-info{font-size:11px}.meters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.meter{border:1px solid #83b8a252;background:#163a40df;border-radius:10px;padding:4px 6px;min-width:0}.meter-top{display:flex;justify-content:space-between;align-items:center;gap:2px;font-size:11px;line-height:15px}.meter strong{font-size:14px;white-space:nowrap;font-variant-numeric:tabular-nums}.meter small{display:block;font-size:9px;line-height:12px;color:#b9d4c4;white-space:nowrap}.meter.bad{background:#493f2bdd;border-color:#b69b5266}.meter.bad strong{color:#ffd178}.meter-label{display:flex;gap:2px;align-items:center}.resources{display:flex;justify-content:space-between;gap:4px;font-size:10px;line-height:17px;padding:0 3px;color:#d1e0cc}.over{color:#ffbf88}
.stage{position:absolute;left:0;right:0;top:var(--scene-top);bottom:calc(var(--dock-height) + env(safe-area-inset-bottom));border:0;background:none}.scene-mount,.furnace3d{width:100%;height:100%;position:relative;min-height:0}.scene-canvas{width:100%;height:100%;display:block;touch-action:pan-y;outline-offset:-4px}.scene-caption{display:none}.scene-controls{position:absolute;left:8px;bottom:0;display:flex;gap:3px}.scene-controls button{width:44px;height:44px;font-size:17px;padding:0;background:#14303aaa;border-color:#94b4a238;backdrop-filter:blur(8px)}.scene-canvas[hidden],.scene-controls[hidden]{display:none}
.scene-targets{position:absolute;inset:0;pointer-events:none;z-index:4}.drop-zone{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:50px;height:50px;padding:2px 6px;background:#153d40a6;border:1px dashed #dddbabac;border-radius:50%;box-shadow:0 0 0 4px #b1d7b90a;pointer-events:auto;backdrop-filter:blur(2px);transition:background .15s,box-shadow .15s}.target-icon{font-size:20px;line-height:21px}.drop-zone small{font-size:10px;line-height:13px;white-space:nowrap}.drop-zone[data-active=true]{color:#ffe7a6;border:2px solid #f4c66e;background:#6a592dbb;box-shadow:0 0 0 5px #e5b84e19,0 0 26px #ffce5e38}.drop-zone[data-hover=true]{background:#709e47e8;border-color:#ecffb9;box-shadow:0 0 0 8px #caf48e3b;scale:1.08}.drop-zone:disabled{opacity:.3}
.scene-load,.scene-fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;text-align:center;padding:12px;color:#e4efd7;font-size:12px;background:#163842cc}.scene-fallback[hidden]{display:none}.scene-load small,.scene-fallback small{font-size:11px}.scene-fallback button{font-size:12px}.scene-load{justify-content:center}
.game-bottom{position:absolute;z-index:5;bottom:max(5px,env(safe-area-inset-bottom));left:8px;right:8px;display:flex;flex-direction:column;gap:4px}.feedback{min-height:25px;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;text-align:center;color:#fff0c5;font-size:11px;line-height:14px;pointer-events:none}.feedback b{font-size:13px}.feedback.success{color:#dbf9a8}.feedback.fail{color:#ffd698}.result-line{font-size:10px}.feedback .result-line{max-width:100%;overflow-wrap:anywhere}
.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.pack{min-width:0;background:linear-gradient(#31514fec,#233e40f5);border:1px solid #8eae8e66;border-radius:13px;padding:3px;position:relative;box-shadow:0 4px 0 #102f3299,inset 0 1px 0 #c7dfb322}.pack.selected{border-color:#f6d07b;box-shadow:0 0 0 1px #f6d07b,0 4px 0 #102f3299}.pack-head{display:flex;align-items:center;gap:0}.material{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0;flex:1;min-width:44px;height:44px;padding:0;border:0;background:transparent;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}.material:active{cursor:grabbing}.material-art{display:block;height:25px}.material-art svg{width:30px;height:26px;filter:drop-shadow(0 2px 0 #0005);pointer-events:none}.material b{font-size:10px;line-height:13px;white-space:nowrap}.material.guided:not(:disabled){background:#ddba6438;border:1px solid #ebc673}.pack-adjust{display:flex;align-items:center}.step{width:44px;height:44px;padding:0;font-size:20px;flex-shrink:0;background:#14303799;border-color:transparent;border-radius:9px}.step:hover:not(:disabled){background:#43655c}.step.guided:not(:disabled){background:#cfaa55aa;border-color:#f9d28a}.qty{display:block;width:13px;flex:none;text-align:center;font-size:15px;font-weight:700;color:#fff1ba;font-variant-numeric:tabular-nums}.pack-info{position:relative;padding:2px 2px 0;min-width:0}.pack-effect{display:flex;align-items:center;gap:4px;font-size:10px;line-height:13px;white-space:nowrap}.effect-chip{display:inline-flex;align-items:center;gap:2px}.stat-icon{display:inline-grid;place-items:center;flex:none;width:12px;height:12px;border-radius:4px;background:#cee5c9;color:#345f4e;font-size:10px;font-weight:800;line-height:1}.icon-H{background:#f8d69b;color:#873c12}.icon-R{background:#d9d5f2;color:#554779}.icon-P{background:#bbd7e8;color:#2b576e}.pack-meta{display:block;font-size:10px;line-height:13px;color:#d7e0c8;white-space:nowrap}.pack-meta span{white-space:nowrap}.pack-stock{position:absolute;top:2px;right:3px;font-size:9px;line-height:13px;color:#bfd2b8}.interaction-tip{text-align:center;font-size:10px;line-height:13px;color:#c8d8bd;white-space:nowrap}.actions{display:grid;grid-template-columns:1fr 1fr 1.6fr;gap:6px}.actions button{height:44px;font-size:13px;white-space:nowrap}.foot{display:flex;justify-content:space-between;gap:5px;align-items:center;font-size:9px;color:#91b4a8;line-height:12px}.foot>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70%}.save{white-space:nowrap}.game-alert{position:absolute;z-index:8;top:150px;left:10px;right:10px;max-height:40%;overflow:auto}.banner{padding:8px;border:1px solid #e3c885;background:#3a3728f5;color:#ffe6b3;font-size:12px;line-height:18px;border-radius:12px}.banner button{font-size:12px;margin:3px}.loading{text-align:center;padding:40px;color:#fff}
.drag-ghost{position:fixed;z-index:100;pointer-events:none;width:58px;height:58px;display:grid;place-items:center;border:2px solid #ffe3a2;border-radius:16px;background:#6e7e48dc;box-shadow:0 7px 28px #0008;transform:translate(-50%,-50%)}.drag-ghost svg{width:44px;height:44px}.drag-ghost .material-art{height:44px}#app[data-dragging] .material[aria-pressed=true]{opacity:.5}#toast{position:fixed;z-index:99;left:50%;top:46%;bottom:auto;transform:translate(-50%,-50%);width:max-content;max-width:90vw;background:#102c35f5;color:#ffe7a9;border:1px solid #edca7b;padding:12px 16px;border-radius:13px;font-size:13px;text-align:center;pointer-events:none;display:none}
dialog{color:#203f39;background:#f3f1df}dialog button{color:#24493f;background:#fcfbec;border-color:#c6d2b7}dialog button.primary{color:#443716}dialog::backdrop{background:#092832b8;backdrop-filter:blur(8px)}.sheet-head{background:#f3f1df}
@media(max-width:340px){:root{--scene-top:143px;--dock-height:278px}.game-top{left:8px;right:8px}.brand{gap:4px}.brand h1{font-size:15px}.brand svg{width:17px}.head-actions{gap:2px}.head-actions button{padding:0 5px}.meter{padding:4px}.meter-top{font-size:10px}.meter strong{font-size:12px}.meter small{font-size:9px}.pack{padding:1px}.pack-effect{gap:2px}.pack-info{padding:2px 1px}.pack-stock{right:0;font-size:8px}.pack-meta{font-size:9px}.game-bottom{left:6px;right:6px}.material-art svg{width:26px}.interaction-tip{font-size:9px}.drop-zone{min-width:44px;height:44px}.target-icon{font-size:17px;line-height:17px}}
@media(min-width:700px) and (min-height:550px){:root{--scene-top:160px;--dock-height:212px}.game-top{left:26px;right:26px;top:14px;gap:5px}.brand h1{font-size:23px}.brand svg{width:27px;height:36px}.head-actions button{font-size:14px}.task h2{font-size:16px}.tag{font-size:12px}.meters{width:500px;max-width:100%;gap:7px}.meter{padding:6px 10px}.meter-top{font-size:12px}.meter strong{font-size:17px}.meter small{font-size:10px}.resources{max-width:500px;font-size:12px}.game-bottom{left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 52px);max-width:1120px;bottom:12px;gap:5px}.cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.pack{padding:6px}.material{height:46px;flex-direction:row;gap:6px}.material-art{height:38px}.material-art svg{width:39px;height:36px}.material b{font-size:12px}.pack-adjust{gap:4px}.qty{width:15px;font-size:18px}.pack-info{padding-top:4px}.pack-effect{font-size:11px;gap:6px}.pack-meta{font-size:11px;line-height:15px}.pack-stock{font-size:10px;top:4px}.actions{width:480px;max-width:100%;align-self:center}.feedback b{font-size:16px}.feedback .result-line{font-size:12px}.interaction-tip{font-size:11px}.foot{position:absolute;left:0;right:0;bottom:1px;pointer-events:none}.foot>span:first-child{max-width:25%}.scene-controls{left:24px;bottom:4px}.drop-zone{min-width:60px;height:60px}.target-icon{font-size:23px;line-height:26px}.drop-zone small{font-size:11px}.game-alert{width:500px;left:26px;right:auto}}
@media(max-height:549px) and (min-width:550px){:root{--scene-top:142px;--dock-height:8px}.game-top{left:10px;right:326px;top:4px}.brand h1{font-size:14px}.brand svg{display:none}.head-actions button{padding:0 5px}.task h2{font-size:12px}.stage{right:316px}.game-bottom{top:6px;bottom:6px;left:auto;right:8px;width:300px;justify-content:center;gap:4px}.feedback{min-height:26px}.feedback b{font-size:12px}.result-line{font-size:9px}.cards{gap:5px}.pack{padding:1px}.pack-stock{right:0;font-size:8px}.pack-effect{gap:2px}.pack-meta{font-size:9px}.interaction-tip{font-size:9px}.foot{font-size:8px}.scene-controls{left:6px}.drop-zone{min-width:44px;height:44px}.target-icon{font-size:17px;line-height:17px}.meter{padding:3px}.meter-top{font-size:10px}.meter strong{font-size:12px}.game-alert{top:140px;right:326px}}
.scene-fallback{padding:8px;gap:3px}.scene-fallback>span{padding-left:92px;font-size:11px;line-height:16px}.scene-fallback button{position:absolute;left:8px;top:8px;font-size:11px}

/* One quiet HUD and one inventory tray; visible controls are smaller than
   their unchanged 44px touch targets. Keep rule text at its original size. */
:root{--dock-height:266px}
.ui-icon{display:block;width:20px;height:20px;flex:none;overflow:visible;pointer-events:none}
.button-label{position:relative;z-index:1;pointer-events:none}
.game{background:radial-gradient(ellipse at 50% 48%,#4f857154,transparent 62%),radial-gradient(ellipse at 50% 95%,#8e80521c,transparent 55%),linear-gradient(#102830,#1c3e41 65%,#122e35)}
.game:before{opacity:.028;background-size:64px 64px}
.brand{gap:6px}.brand h1{font-size:15px;letter-spacing:.08em;font-weight:600;color:#e2e9dd}.brand .ui-icon{width:22px;height:22px}
.head-actions{gap:0}.head-actions button,.scene-controls button,.step{position:relative;display:grid;place-items:center;background:transparent;border:0;box-shadow:none;padding:0;isolation:isolate}
.head-actions button{width:44px;height:44px;min-width:44px;color:#a8c0b6}.head-actions .button-label{display:none}.head-actions .ui-icon{width:17px;height:17px;position:relative;z-index:1}
.head-actions button:before{content:"";position:absolute;inset:7px;border-radius:50%;background:#9abfb00a;z-index:-1;pointer-events:none}
.head-actions button:hover:not(:disabled){background:none;color:#e5d3a2}.head-actions button:hover:not(:disabled):before{background:#bcd9bd17}
.task h2{font-size:12px;color:#d5bd87;font-weight:600;letter-spacing:.03em}.tag{color:#92aea1;font-size:10px;font-variant-numeric:tabular-nums}
.meters{gap:0;padding:5px 0;border-top:1px solid #b4d3bf25;border-bottom:1px solid #b4d3bf18;background:linear-gradient(90deg,#719d8e06,#719d8e10,#719d8e06)}
.meter,.meter.bad{border:0;border-right:1px solid #b4d3bf20;border-radius:0;background:none;box-shadow:none;padding:0 6px}.meter:last-child{border-right:0}
.meter strong{font-size:14px;font-weight:650;color:#d9e8d1}.meter.bad strong{color:#e7bd85}.meter-top{font-size:11px;color:#c4d5c9;line-height:15px}.meter small{color:#9fb8a9}.resources{color:#a6bdaf;padding:1px 3px 0}
.stat-icon{background:none;border-radius:0;box-shadow:none;width:12px;height:12px;display:inline-flex;vertical-align:-1px}
.icon-H{background:none;color:#dfb882}.icon-R{background:none;color:#b7b6d5}.icon-P{background:none;color:#9fc9ce}.icon-F{color:#bad3ac}
.stat-icon .ui-icon{width:12px;height:12px}.meter-label{gap:3px}.meter-label .stat-icon,.meter-label .ui-icon{width:12px;height:12px}
.game-bottom{left:10px;right:10px;gap:3px}
.cards{gap:0 12px;padding:3px 6px;border-top:1px solid #bbd2bd26;border-bottom:1px solid #bbd2bd13;border-radius:16px;background:linear-gradient(130deg,#5275691e,#102c3282);box-shadow:0 8px 25px #071e2420}
.pack,.pack.selected{min-width:0;padding:1px 0 4px;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
.pack:nth-child(-n+2){border-bottom:1px solid #b0c9b31b;padding-bottom:5px}.pack:nth-child(n+3){padding-top:3px}.pack:before{content:none}
.pack-head{gap:0}.material{position:relative;isolation:isolate;border:0!important;box-shadow:none!important;background:none!important;gap:0}
.material-art{position:relative;display:grid;place-items:center;width:34px;height:27px}.material-art .material-svg{width:26px;height:26px;filter:drop-shadow(0 1px 1px #071b2b55)}
.material b{font-size:10px;font-weight:600;line-height:13px;letter-spacing:.03em;color:#d8e1ce}.material:disabled{opacity:.55;filter:saturate(.6)}
.material.guided:not(:disabled):before,.pack.selected .material:before{content:"";position:absolute;inset:0 0 11px;border-radius:50%;background:radial-gradient(ellipse,#e7cc6f30,transparent 70%);z-index:-1;pointer-events:none}
.material.guided:not(:disabled):after,.pack.selected .material:after{content:"";position:absolute;bottom:0;left:calc(50% - 8px);width:16px;height:2px;border-radius:2px;background:#d9bf7d;box-shadow:0 0 7px #e6ce6744;pointer-events:none}
.step{width:44px;height:44px;color:#b8cfc1}.step:before{content:"";position:absolute;inset:10px;border-radius:50%;background:none;border:1px solid transparent;z-index:-1;pointer-events:none}
.step[data-delta="1"]:not(:disabled):before{border-color:#b6d5bd40;background:linear-gradient(145deg,#8eb59b24,#8eb59b09);box-shadow:inset 0 1px 0 #e0efd618}
.step .ui-icon{width:13px;height:13px;position:relative;z-index:1}.step:disabled{opacity:.27}
.step:hover:not(:disabled){background:none}.step:hover:not(:disabled):before{border-color:#d9d9b260;background:#bad9b81a}.step:active:not(:disabled):before{background:#a8caa833}
.step.guided:not(:disabled){border:0;background:none}.step.guided:not(:disabled):before{border-color:#d2ba7966;background:#c5ab6026}
.qty{font-size:14px;font-weight:600;color:#e1d6b5;font-feature-settings:"tnum"}.pack-info{padding:0 1px}.pack-effect{color:#c3d3c0}.pack-meta{color:#aabdac}.pack-stock{color:#95ad9d;font-size:9px;right:1px;top:0}
.scene-controls{gap:0;background:none;bottom:0}.scene-controls:before{content:none}.scene-controls button{width:44px;height:44px;color:#9db8aa;backdrop-filter:none}.scene-controls button .ui-icon{width:15px;height:15px}.scene-controls button:hover:not(:disabled){background:none;color:#f1d598}.scene-controls button:active:not(:disabled){color:#fff2ce}
.drop-zone{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px;border:0!important;background:none!important;box-shadow:none!important;border-radius:12px;gap:0;justify-content:flex-start;padding:2px 0 0;backdrop-filter:none;color:#dfdfc3;isolation:isolate;scale:1!important}
.drop-zone:before{content:"";position:absolute;top:1px;left:9px;width:26px;height:26px;border:1px solid #c9d6af80;border-radius:50%;background:radial-gradient(circle at 35% 20%,#6d8c6ab8,#173d40d9 80%);box-shadow:inset 0 1px 0 #edf1c62b;z-index:-1;pointer-events:none}
.drop-zone .target-icon{height:25px;display:grid;place-items:center}.drop-zone .target-icon .ui-icon{width:15px;height:15px}.drop-zone small{font-size:9px;line-height:13px;padding:0 3px;border-radius:3px;background:#14323860;color:#cfdbc3}
.drop-zone[data-active=true]:before{border-color:#e4c888;background:radial-gradient(circle at 35% 20%,#82996bdd,#335849eb 75%);box-shadow:0 0 0 3px #d1b66c17,0 0 15px #c9b87628}
.drop-zone[data-hover=true]:before{border-color:#fff1b1;background:linear-gradient(#aab578,#5a7e51);box-shadow:0 0 0 4px #e6d99129,0 0 20px #bade8040}.drop-zone[data-hover=true] small{color:#f0f1ce}
.feedback{color:#dac99e;min-height:25px}.feedback b{font-size:12px;font-weight:600;letter-spacing:.03em}.feedback.success{color:#cbe6ae}.feedback.fail{color:#ecc39c}.interaction-tip{color:#9ab2a3;font-size:10px}
.actions{grid-template-columns:60px 60px minmax(128px,1fr);gap:6px;width:260px;max-width:100%;align-self:center}
.actions button{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;gap:4px;height:44px;background:none!important;border:0!important;box-shadow:none!important;padding:0 2px;font-size:11px;font-weight:500;color:#b3c7b7}
.actions button:before{content:"";position:absolute;inset:6px 0;border:1px solid transparent;border-radius:17px;background:none;z-index:-1;pointer-events:none}
.actions button .ui-icon{width:14px;height:14px;position:relative;z-index:1}.actions button:hover:not(:disabled):before{background:#bad1b515}.actions .primary{font-size:12px;color:#283d33;font-weight:700;letter-spacing:.02em}
.actions .primary:before{inset:5px 0;border-color:#ead49c88;border-radius:17px;background:linear-gradient(165deg,#f2e0b2,#d8bd83);box-shadow:inset 0 1px 0 #fff5d8a0,0 3px 10px #071f2940}
.actions .primary .ui-icon{width:15px;height:15px}.actions .primary:hover:not(:disabled):before{background:linear-gradient(#fff0c5,#e5c886);border-color:#ffe5ac}.actions button:active:not(:disabled):before{box-shadow:inset 0 1px 4px #172e343b;translate:0 1px}
.foot{color:#89a497;font-size:9px}.drag-ghost{width:44px;height:44px;border-radius:50%;border:1px solid #d5c58d88;background:radial-gradient(circle at 30% 20%,#78956be6,#234b4be6);box-shadow:0 4px 15px #061b2966}.drag-ghost .material-art,.drag-ghost svg{width:34px!important;height:34px!important}
/* Dialogs share the same restrained line work, but keep readable body text. */
dialog{border:1px solid #9bb28b52;border-radius:18px;background:#e9eddd;box-shadow:0 24px 90px #031d2c99}#sheet-body{padding:15px}.sheet-head{background:#e9eddd}.sheet-head h2{font-size:16px}.sheet-head button{background:none;border:none;display:grid;place-items:center}.sheet-head button .ui-icon{width:17px;height:17px}.level-button{border-radius:11px;background:#f2f4e9;border-color:#bccdb657;box-shadow:inset 0 1px 0 #fff9}.level-button.done{background:linear-gradient(#dae8d2,#c6d9c1);border-color:#9bba9477}.group-title{font-size:13px;color:#607b64}.menu button{display:flex;align-items:center;gap:8px;border-radius:10px;background:#f3f5eb;border-color:#becdb84d;font-size:13px}.menu .ui-icon{width:16px;height:16px}.detail-item{border-color:#bacab64d;border-radius:10px;background:#f4f6ed}.hints{border-left:3px solid #a7ad73;background:#f4f3e2}.sheet-note{font-size:12px}.sheet-head .ui-icon{color:#486b5d}
@media(min-width:700px) and (min-height:550px){
 :root{--dock-height:194px}.brand h1{font-size:18px}.brand .ui-icon{width:25px;height:25px}.task h2{font-size:14px}.meters{width:440px}.resources{max-width:440px;font-size:11px}.meter strong{font-size:15px}.meter-top{font-size:11px}.meter{padding:0 8px}.game-bottom{left:50%;right:auto;max-width:900px;gap:5px}.cards{gap:16px;padding:5px 12px;border-radius:16px}.pack,.pack:nth-child(-n+2),.pack:nth-child(n+3){padding:1px 0 4px;border:0}.material{flex-direction:row;gap:5px}.material-art{height:30px;width:30px}.material-art .material-svg{width:28px;height:28px}.material b{font-size:11px}.pack-adjust{gap:0}.qty{font-size:15px;width:15px}.pack-effect{font-size:10px;gap:5px}.pack-meta{font-size:10px;line-height:14px}.pack-stock{font-size:9px}.feedback b{font-size:14px}.actions{width:280px;grid-template-columns:64px 64px minmax(140px,1fr)}.interaction-tip{font-size:10px}
}
@media(max-width:340px){
 :root{--dock-height:264px}.game-bottom{left:6px;right:6px}.brand h1{font-size:14px}.brand .ui-icon{width:20px;height:20px}.cards{padding:3px 0;column-gap:6px;border-radius:13px}.pack{padding:1px 1px 4px}.pack-info{padding:0 1px}.material-art .material-svg{width:24px;height:24px}.meter{padding:0 4px}.meter-top{font-size:10px}.meter strong{font-size:12px}.meter-label{gap:2px}.meter-label .stat-icon,.meter-label .ui-icon{width:11px;height:11px}.pack-effect{gap:2px}.pack-meta{font-size:9px}.pack-stock{font-size:8px;right:0}.interaction-tip{font-size:9px}
}
@media(max-height:549px) and (min-width:550px){
 :root{--dock-height:8px}.brand h1{font-size:14px}.brand .ui-icon{display:none}.game-bottom{left:auto;right:8px;width:300px}.cards{padding:3px 0;column-gap:6px}.pack{padding:1px 1px 4px}.material-art .material-svg{width:24px;height:24px}.pack-info{padding:0 1px}.pack-effect{gap:2px}.pack-meta{font-size:9px}.pack-stock{font-size:8px;right:0}.interaction-tip{font-size:9px}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* A single illustrated manual, scrollable on small phones, separate from play. */
dialog[data-manual]{max-width:680px;max-height:88dvh;overscroll-behavior:contain;scroll-padding-top:60px}
dialog[data-manual] .sheet-head{top:-15px;padding:4px 0 7px;border-bottom:1px solid #526e5426;gap:4px}
dialog[data-manual] .sheet-head h2{font-size:16px;line-height:24px}
.manual{font-size:14px;line-height:1.75;color:#345248}.manual p{margin:9px 0}.manual b{color:#234c3e}.manual-intro{font-size:16px;color:#274f40;font-weight:600;padding:8px 0}.manual-intro span{font-size:12px;font-weight:400;color:#6a7c67}
.manual-section{padding:10px 0 15px;border-bottom:1px solid #6b856529}.manual h3{font-size:15px;line-height:24px;margin:6px 0 12px;display:flex;gap:8px;align-items:center;color:#244d3d}.manual h3 em{display:grid;place-items:center;font-size:12px;font-style:normal;flex:none;width:24px;height:24px;border-radius:50%;background:#315c4e;color:#fff4cf}
.manual-gauges{display:flex;gap:10px;padding:13px;background:#1c3a3e;border-radius:13px;color:#e3ead6}.manual-gauges>div{flex:1;display:grid;grid-template-columns:1fr auto;gap:2px 8px}.manual-gauges span{display:flex;gap:5px;align-items:center}.manual-gauges .ui-icon{width:16px;height:16px}.manual-gauges b{color:#d7ebba;font-size:18px}.manual-gauges .manual-warning{color:#f1c38d}.manual-gauges small{font-size:11px;grid-column:1/-1;color:#aec3b0}
.manual-legend{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:9px 0}.manual-symbol{display:inline-flex;align-items:center;gap:5px;font-size:13px}.manual-symbol .ui-icon{width:16px;height:16px;color:#52745d}
.manual-route{display:flex;align-items:center;justify-content:space-around;padding:12px 8px;margin:8px 0;background:#f5f5e9;border-radius:12px;border:1px solid #9bb18b26}.manual-ores{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;max-width:135px;width:48%}.manual-ores .material-svg{width:34px;height:34px}.manual-ores small{width:100%;text-align:center;font-size:12px}.manual-arrow{font-size:25px;color:#a48a4c}.manual-port{display:grid;justify-items:center;gap:4px;font-size:13px}.manual-port .ui-icon{width:28px;height:28px;color:#52715a}
.manual-example{padding:14px;background:#f5f5e9;border:1px solid #9bb18b26;border-radius:12px}.manual-material{display:flex;gap:8px;align-items:center}.manual-material .material-svg{width:35px;height:35px}.manual-effects{display:flex;flex-wrap:wrap;gap:8px 15px;margin-top:8px}.manual-example p{margin:5px 0}.manual-example small,.manual-note{font-size:12px;color:#677d69}
.manual-flow{display:flex;align-items:center;justify-content:space-between;padding:12px 6px;background:#d7e2ca80;border-radius:12px;gap:3px}.manual-flow span{display:grid;justify-items:center;gap:5px;font-size:12px;font-weight:600}.manual-flow .ui-icon{width:20px;height:20px;color:#627653}.manual-flow i{font-style:normal;color:#82916e}
.manual-check{border-bottom:0}.manual-start{position:sticky;bottom:-15px;padding:8px 0 4px;background:linear-gradient(#e9eddded,#e9eddd 28%)}.manual-start .full{margin-top:0;min-height:44px;border-radius:22px;font-size:14px}
@media(max-width:340px){dialog[data-manual] #sheet-body{padding:12px}.manual{font-size:13px}.manual h3{font-size:14px}.manual-legend{grid-template-columns:1fr}.manual-symbol{font-size:13px}.manual-start{bottom:-12px}.manual-ores .material-svg{width:29px;height:29px}}

/* Header and start action stay visible while only the manual body scrolls. */
dialog[data-manual]{overflow:hidden}dialog[data-manual] #sheet-body{display:flex;flex-direction:column;max-height:calc(88dvh - 2px);padding:0;overflow:hidden}
dialog[data-manual] .sheet-head{position:relative;top:auto;flex:none;margin:0;padding:8px 12px 5px}
dialog[data-manual] .manual{overflow-y:auto;overscroll-behavior:contain;padding:0 15px 12px;min-height:0}
dialog[data-manual] .manual-start{position:relative;bottom:auto;flex:none;padding:10px 15px;background:#e9eddd;border-top:1px solid #526e541a}
@media(max-width:340px){dialog[data-manual] #sheet-body{padding:0}dialog[data-manual] .manual{padding:0 12px 10px}}
.manual-start button{display:flex;align-items:center;justify-content:center;gap:7px}.manual-start button .ui-icon{width:16px;height:16px}

.manual-furnace{margin:0}.manual-furnace svg{display:block;width:100%;max-width:420px;height:auto;margin:0 auto}.manual-furnace figcaption{margin:8px 0 4px}

.scene-landmarks{position:absolute;inset:0;pointer-events:none}.scene-landmarks span{position:absolute;transform:translate(-50%,-50%);padding:3px 6px;border:1px solid #b8ccb32b;border-radius:8px;background:#122f37d9;color:#d6dfc6;font-size:10px;line-height:14px;white-space:nowrap}.furnace3d:not([data-renderer="webgl"]) .scene-landmarks{display:none}

.metric-card{padding:10px 12px;margin:8px 0;border:1px solid #91ad8c33;border-radius:12px;background:#f7f7ed}.metric-card h3{margin:0 0 6px;gap:6px}.metric-card h3 .ui-icon{width:19px;height:19px;color:#577658}.metric-card h3 small{margin-left:auto;font-size:12px;font-weight:400;color:#6a7f64}.metric-card p{margin:5px 0}.metric-lesson{padding-top:6px}.resources:empty{display:none}.pack-meta:empty{min-height:13px}
