:root{color-scheme:light;--ink:#20373e;--muted:#6d7d7f;--paper:#f4f2eb;--line:#dedfd6;--green:#26766a;--orange:#cc6337;--blue:#233f4b;font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-size:14px}button,input{font:inherit}button{cursor:pointer;border:1px solid var(--line);color:inherit;background:#fffefa;border-radius:10px;min-height:44px;padding:8px 12px;touch-action:manipulation}button:disabled{opacity:.42;cursor:default}button:focus-visible{outline:3px solid #e9ae66;outline-offset:2px}.primary{background:var(--orange);border-color:var(--orange);color:white;font-weight:650}.quiet{background:transparent}.small{font-size:12px;color:var(--muted)}.tag{font-size:11px;letter-spacing:.08em;text-transform:uppercase}.app-shell{max-width:460px;margin:auto;min-height:100svh;padding:0 12px 82px}.mast{display:flex;align-items:center;justify-content:space-between;min-height:56px;border-bottom:1px solid var(--line)}.mast h1{margin:0;font-size:21px;letter-spacing:.04em}.mast button{min-width:52px;background:transparent;border-color:transparent}.brand{display:flex;gap:10px;align-items:center}.brand-mark{width:29px;height:29px;background:var(--ink);border-radius:7px;color:#eeb87e;display:grid;place-content:center;font-size:17px}.level-head{display:flex;align-items:center;justify-content:space-between;padding:9px 0 8px}.level-head h2{font-size:16px;margin:2px 0 0}.level-counter{text-align:right;color:var(--muted);font-variant-numeric:tabular-nums}.orders{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:7px}.order{position:relative;padding:9px 11px;background:#fffefa;border:1px solid var(--line);border-radius:11px;overflow:hidden;min-height:66px}.order-top{display:flex;justify-content:space-between;align-items:center;gap:5px}.order-top b{font-size:14px}.order-top span{font-size:11px;color:var(--muted)}.order-count{font-size:19px;font-weight:700;font-variant-numeric:tabular-nums}.order-count small{font-size:11px;color:var(--muted);font-weight:400}.bar{height:3px;background:#e8e8df;margin-top:6px;border-radius:3px;overflow:hidden}.bar i{display:block;height:100%;background:var(--green);transition:width .2s}.resources{display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:43px;border-bottom:1px dashed #d4d6cd;color:var(--muted);font-size:12px}.resources strong{color:var(--ink);font-size:16px;margin-left:5px}.roundbar{display:flex;justify-content:space-between;align-items:center;min-height:38px;gap:6px}.roundbar button{min-height:44px;padding:5px 7px;border:0;background:none;font-size:12px}.round-dots{display:flex;gap:5px;align-items:center}.dot{width:7px;height:7px;border-radius:50%;background:#d3d9cf}.dot.active{width:20px;background:var(--orange);border-radius:4px}.dot.done{background:var(--green)}.lanes{display:grid;gap:7px}.lane{border:1px solid var(--line);border-radius:12px;background:#fffefa;padding:8px;display:grid;grid-template-columns:43px 1fr auto;align-items:center;gap:8px;min-height:73px;position:relative}.lane.hold{background:#f0ece3;border-style:dashed}.lane.sealed{background:#e6e8e3}.lane.planned{border-color:#75a49a;box-shadow:0 0 0 1px #75a49a33}.lane-icon{height:44px;width:43px;border-radius:8px;background:#e8ede7;display:grid;place-content:center}.hold .lane-icon{background:#e8dfce}.lane svg{width:33px;height:33px}.lane-title{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:650}.pill{font-size:10px;border-radius:4px;background:#e6eae3;padding:2px 4px;font-weight:400;white-space:nowrap}.lane .sub{font-size:12px;margin-top:4px;color:var(--muted);line-height:1.4}.lane button{padding:8px 10px;min-width:52px;font-size:13px}.lane .work{color:var(--green);font-weight:500}.feedback{margin-top:9px;border:1px solid #cadcd1;background:#e9f0e7;padding:10px 12px;border-radius:11px;min-height:66px;line-height:1.5}.feedback b{display:block;font-size:13px}.feedback p{margin:3px 0 0;font-size:12px;color:#556d64}.feedback.error{border-color:#dfb39c;background:#f5e7dc}.footer{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,460px);padding:9px 12px calc(9px + env(safe-area-inset-bottom));background:#f4f2ebf5;border-top:1px solid var(--line);display:grid;grid-template-columns:60px 1fr 60px;gap:7px;backdrop-filter:blur(10px);z-index:3}.footer button{min-height:48px}.help-line{display:flex;justify-content:space-between;align-items:center;margin-top:2px;gap:6px}.help-line button{font-size:12px;min-height:44px;border:0;background:none;padding:4px}.qa-banner,.save-warning{background:#f3d69d;padding:7px 10px;font-size:12px;line-height:1.5}.qa-banner{text-align:center;color:#71511f}.save-warning:empty{display:none}.finish{background:var(--ink);border-radius:15px;padding:22px 18px;color:#f6f2e8;margin-top:14px}.finish h2{margin:7px 0 8px;font-size:25px}.finish p{line-height:1.7;color:#ccd8d3;font-size:13px}.badges{display:flex;flex-wrap:wrap;gap:6px}.badge{padding:5px 8px;border-radius:6px;background:#ffffff17;font-size:12px;color:#e9ba84}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:15px 0}.stat{background:#ffffff0c;border-radius:8px;text-align:center;padding:9px 0}.stat strong{font-size:24px;display:block}.stat span{color:#b9cbc6;font-size:11px}dialog{border:1px solid #cbd2c7;border-radius:18px 18px 0 0;box-shadow:0 -10px 100px #152b3d22;padding:0;width:min(calc(100% - 12px),448px);max-height:calc(100svh - 26px);margin:auto auto 0;overflow:auto;color:var(--ink);background:var(--paper)}dialog::backdrop{background:#152b3d68;backdrop-filter:blur(3px)}.sheet-top{display:flex;justify-content:space-between;align-items:center;padding:12px 14px 8px;position:sticky;top:0;background:var(--paper);z-index:1;border-bottom:1px solid var(--line)}.sheet-top h2{font-size:18px;margin:0}.sheet-top button{border:0;background:none;padding:8px;min-width:44px}.sheet-body{padding:12px 14px 22px;line-height:1.7}.sheet-body p{font-size:13px;margin:0 0 10px}.sheet-body .option{display:block;width:100%;text-align:left;margin:7px 0;min-height:54px;padding:11px 13px}.option b,.option small{display:block}.option small{color:var(--muted);font-size:12px;margin-top:1px;font-weight:400}.option.primary small{color:#ffffffc9}.record{border:1px solid var(--line);background:#fffefa;border-radius:11px;padding:12px;margin:8px 0;font-size:13px}.record.old{opacity:.65}.record .option{margin-bottom:0}.note{font-size:12px;color:var(--muted);padding:9px 0}.quantity{display:flex;gap:8px;align-items:center;margin:12px 0}.quantity button{width:48px;font-size:22px}.quantity output{min-width:48px;text-align:center;font-size:24px;font-weight:650}.level-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.level-grid button{text-align:left;min-height:77px}.level-grid b{display:block;font-size:13px}.level-grid small{font-size:11px;color:var(--muted)}.level-grid button.current{border:2px solid var(--green)}.section-title{font-size:14px;margin:17px 0 6px}.summary-row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px dashed var(--line);padding:7px 0;font-size:13px}.full{width:100%;margin-top:10px}.loading{display:grid;min-height:80svh;place-content:center;color:var(--muted)}#toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);background:#20373ef0;color:white;padding:10px 16px;border-radius:9px;font-size:13px;z-index:8;opacity:0;pointer-events:none;transition:opacity .15s}#toast.show{opacity:1}.trouble{padding:24px;line-height:1.8}.trouble h1{font-size:20px}@media(min-width:700px){body{background:radial-gradient(ellipse at 15% 20%,#e5e8de,transparent 60%),var(--paper)}.app-shell{border-left:1px solid #dedfd6;border-right:1px solid #dedfd6;padding-left:20px;padding-right:20px}.mast{min-height:70px}.level-head{padding-top:15px;padding-bottom:14px}.lane{min-height:87px}.orders .order{min-height:80px}.feedback{margin-top:14px}.footer{padding-left:20px;padding-right:20px}dialog{margin:auto;border-radius:18px}}@media(max-width:350px),(max-height:640px){.mast{min-height:48px}.mast h1{font-size:18px}.level-head{padding:6px 0}.level-head h2{font-size:14px}.order{min-height:61px;padding:7px 9px}.lane{min-height:67px;padding:6px;gap:6px;grid-template-columns:34px 1fr auto}.lane-icon{width:34px;height:37px}.lane svg{width:29px}.lane .sub{font-size:11px}.lane-title{font-size:13px}.lane button{min-width:48px;padding:6px 8px}.resources{min-height:37px}.feedback{padding:8px 10px}.app-shell{padding:0 9px 82px}.lanes{gap:6px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
@media(max-width:500px){html{scrollbar-width:none}html::-webkit-scrollbar{display:none}.lane{min-height:68px}}
.teach{background:#fffdf6;border:1px solid #e0d6bf;border-radius:18px;padding:20px;margin-top:12px}.teach h2{font-size:clamp(20px,5vw,26px);line-height:1.35;margin:12px 0}.teach .option{width:100%;text-align:left;min-height:56px;margin:5px 0;background:#f2f6ee;border-color:#c9d6bb;color:#263d26}.teach .option:focus-visible{outline:3px solid #527a46}.teach-meter{font-weight:700}.teach-feedback{min-height:2.5em;color:#6b421f}.summary-row .option{min-width:50px;width:auto;margin:0}.footer>button:only-child{grid-column:1/-1}

/* Workshop illustrations and game pieces. */
:root{--ink:#202f4a;--muted:#586780;--paper:#edf1fb;--line:#d5def0;--green:#187567;--orange:#a63e17}
body{background:#dbe5f8}
.app-shell{background:var(--paper)}
.brand-mark{background:#273b60}
.brand-mark .art{width:24px}
.art{width:24px;height:24px;display:inline-block;vertical-align:middle;flex:none}
.teach{padding:12px;background:#fcfdff;border-color:#cfdbf2;box-shadow:0 5px 0 #cfdaf0;margin-top:4px}
.lesson-step{display:flex;gap:5px;margin:0 0 8px}
.lesson-step i{height:5px;flex:1;border-radius:5px;background:#dfe6f5}
.lesson-step i.lit{background:#4275ca}
.order-tray{display:flex;justify-content:center;align-items:center;gap:9px;margin-top:8px;padding:6px;background:#e5efff;border-radius:9px}
.cargo-slots{display:flex;gap:4px}
.cargo-slots span{display:grid;place-items:center;width:25px;height:25px;border:1px dashed #5c78a6;border-radius:5px}
.cargo-slots span.filled{background:#c6f0e4;border:1px solid #42816e}
.cargo{display:inline-block;width:13px;height:13px;vertical-align:-1px;background:#fcbe53;border:2px solid #84512c;border-radius:50%;flex:none}
.cargo.diamond{transform:rotate(45deg);border-radius:2px;background:#9c8bfc;border-color:#514b96}
.teach h3{text-align:center;margin:10px 0 8px;font-size:clamp(16px,5vw,21px)}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.choice{display:grid;justify-items:center;align-content:center;gap:3px;min-height:72px;background:#f1f5ff;border:2px solid #bfceed;border-bottom-width:4px;font-size:14px;padding:5px}
.choice:hover{background:#e2edff}
.choice:active{transform:translateY(2px)}
.choice .art{width:31px;height:31px}
.teach-feedback{margin:7px 0 0;min-height:0;text-align:center;font-size:13px}
.teach-feedback:empty{margin:0}
.resources{gap:4px;padding:6px 0}
.resources span{flex:1;display:grid;grid-template-columns:auto auto;align-items:center;justify-content:center;gap:1px 4px;background:#dfe9fb;border-radius:8px;padding:4px 2px}
.resources .art{grid-row:span 2;width:20px;height:20px}
.resources small{font-size:10px;line-height:1}
.resources strong{margin:0;font-size:15px;line-height:1.15}
.lane{box-shadow:0 2px 0 #d6e1f3}
.lane-icon{background:#e1ebfc}
.order .bar{height:6px}
.feedback{min-height:0}
.footer{background:#edf1fbf5;grid-template-columns:minmax(60px,auto) 1fr minmax(60px,auto)}
.finish{text-align:center;background:#243659}
.reward .art{width:95px;height:95px;filter:drop-shadow(0 0 16px #ffc55488);animation:prize .4s ease-out}
.badges{justify-content:center}
@keyframes prize{from{transform:scale(.65) rotate(-10deg);opacity:.35}to{transform:scale(1);opacity:1}}
.cargo-slots span:not(.filled) .cargo{background:transparent;opacity:.55}
.cargo-slots span.filled{animation:prize .3s ease-out}

.workshop-view{height:clamp(194px,52vw,252px);position:relative;overflow:hidden;isolation:isolate;border-radius:14px;margin:0 0 8px;background:#314354 url('./workshop.jpg?v=12') center 57%/cover no-repeat}
.workshop-view canvas{position:absolute;inset:0;width:100%;height:100%;display:none;touch-action:none;cursor:grab}
.workshop-view canvas:active{cursor:grabbing}
.workshop-view.rendered canvas{display:block}
.scene-controls{position:absolute;inset:auto 7px 6px;display:none;gap:5px;align-items:center;justify-content:flex-end;pointer-events:none}
.rendered .scene-controls{display:flex}
.scene-controls span,.scene-fallback{margin-right:auto;padding:4px 7px;border-radius:6px;background:#162631eb;color:#f7fbff;font-size:11px}
.scene-controls button{pointer-events:auto;min-width:44px;padding:0;background:#203644f2;border:1px solid #b4c6d9;color:#fff;font-size:19px}
.scene-fallback{position:absolute;top:7px;left:7px}
.rendered .scene-fallback{display:none}
.scene-markers{position:absolute;inset:auto 6px 6px;display:flex;justify-content:center;flex-wrap:wrap;gap:4px;pointer-events:none}
.rendered .scene-markers{inset:0}
.scene-marker{display:inline-flex;align-items:center;gap:4px;padding:4px 6px;border-radius:8px;background:#172b3bf5;border:1px solid #98b2c4;color:#fff;font-size:12px;font-weight:650;white-space:nowrap}
.rendered .scene-marker{position:absolute;left:var(--projected-x);top:var(--projected-y);transform:translate(-50%,-50%)}
.scene-marker span{font-size:10px;font-weight:500}
button.scene-marker{pointer-events:auto;min-height:44px;min-width:44px}
.signal{width:7px;height:7px;background:#65eab0;border-radius:50%;flex:none}
.signal.hold{background:#ff7b66}
.signal.repair{background:#ffb653}
.signal.await{background:#76c3ff}
.signal.sealed{background:#aab6bf}
.workshop-view+.orders{margin-top:9px}
.workshop-view+.finish{margin-top:0;padding:12px 15px}
.workshop-view+.finish .reward .art{width:62px;height:62px}

.scene-marker .cargo{width:9px;height:9px;border-width:1px}


/* Full viewport scene with floating controls. */
:root{--safe-top:max(10px,env(safe-area-inset-top));--safe-bottom:max(8px,env(safe-area-inset-bottom));--safe-left:max(10px,env(safe-area-inset-left));--safe-right:max(10px,env(safe-area-inset-right))}
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background:#273945}
#app,.app-shell,.game-stage{width:100%;height:100%;height:100dvh;min-height:0;max-width:none;margin:0;padding:0;border:0;border-radius:0}
.game-stage{position:relative;overflow:hidden;isolation:isolate;color:#eff7ff}
.game-stage .workshop-view{position:absolute;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;isolation:auto;background-size:cover}
.game-stage .workshop-view canvas{inset:0;width:100%;height:100%}
.hud-top,.hud-bottom{position:absolute;z-index:3;pointer-events:none}
.hud-top button,.hud-bottom button{pointer-events:auto}
.hud-top{top:var(--safe-top);left:var(--safe-left);right:var(--safe-right);max-width:360px;display:grid;gap:5px}
.hud-bottom{left:50%;bottom:var(--safe-bottom);transform:translateX(-50%);width:min(calc(100% - var(--safe-left) - var(--safe-right)),420px);display:grid;gap:5px}
.game-stage .mast{min-height:44px;padding:0;border:0}
.game-stage .mast h1{font-size:15px;letter-spacing:.025em;margin:0;text-shadow:0 2px 5px #000}
.game-stage .brand{gap:7px}
.game-stage .brand-mark{background:transparent;color:#efc48b;width:24px;height:24px}
.top-buttons{display:flex;gap:5px}
.game-stage :where(button:not(.choice):not(.work-card):not(.primary)){background:#142c3ce8;color:#edf7ff;border:1px solid #8aa9bd88}
.game-stage .top-buttons button{min-width:44px;padding:5px 9px}
.game-stage .level-head{padding:0 3px;background:none;border:0;border-radius:0;min-width:0;gap:8px;max-width:300px;text-shadow:0 1px 5px #081820}
.game-stage .level-head h2{font-size:13px;margin:1px 0 0}
.game-stage .small,.game-stage .level-counter{color:#d4e5f0}
.game-stage .level-counter{font-size:12px;font-variant-numeric:tabular-nums}
.game-stage .orders{display:flex;gap:6px;margin:2px 0 0;width:fit-content;max-width:100%}
.game-stage .order{display:grid;grid-template-columns:22px 1fr auto;align-items:center;gap:4px 7px;flex:1;min-width:136px;min-height:0;padding:7px 9px 6px;background:linear-gradient(135deg,#152630e8,#223944dc);border:1px solid #c1d8df30;color:#f7fbff;border-radius:11px;box-shadow:0 3px 12px #07192418}
.game-stage .order-top b{font-size:12px}
.game-stage .order-top span{font-size:10px;color:#c9dce9}
.game-stage .order-count{font-size:17px;line-height:1.2;font-weight:650;font-variant-numeric:tabular-nums}
.game-stage .order-count small{color:#d4e5f0}
.game-stage .bar{grid-column:1/-1;margin-top:0;height:2px;background:#91b6c029}
.game-stage .bar i{background:#99d3be}
.game-stage .resources{display:flex;justify-content:start;min-height:0;border:1px solid #c1d8df24;background:#172b36d9;border-radius:9px;padding:4px 1px;max-width:320px;gap:0}
.game-stage .resources span{display:flex;justify-content:center;flex:1;background:none;border:0;border-right:1px solid #b6ccd326;padding:0 5px;gap:3px;border-radius:0}
.game-stage .resources strong{color:#f5fbff;font-size:12px}
.game-stage .resources small{font-size:10px;color:#cddfea}
.game-stage .mission{margin:0;padding:4px 7px;background:#223e4ed9;font-size:11px;border-radius:6px;max-width:340px}
.game-stage .qa-banner{justify-self:start;font-size:10px;padding:2px 6px;border-radius:5px}
.game-stage .save-warning{padding:6px 9px;border-radius:8px;max-height:80px;overflow:auto;pointer-events:auto;color:#563c15}
.game-stage .teach{padding:0 4px;background:none;border:0;border-radius:0;box-shadow:none;margin:0;color:#f4faff}
.game-stage .lesson-step{margin-bottom:5px;max-width:68px;margin-left:auto;margin-right:auto}
.game-stage .lesson-step i{height:2px;background:#688396}
.game-stage .lesson-step i.lit{background:#7de4bd}
.game-stage .teach h3{text-align:center;font-size:15px;font-weight:600;letter-spacing:.025em;margin:3px 0;text-shadow:0 1px 5px #0c1c26,0 0 12px #0c1c26}
.drag-hint{font-size:12px;color:#d4e5f0;text-shadow:0 1px 3px #142c3c;margin:0 0 4px;text-align:center}
.game-stage .teach-feedback{color:#ffd49c;font-size:12px;line-height:1.4;margin-top:5px}
.game-stage .teach-feedback:empty{margin:0}
.scene-dock{position:relative;padding:0;margin:0;pointer-events:none}
.choices{gap:8px}
.game-stage .choice,.work-card{color:#e7f1f3;background:linear-gradient(145deg,#243d49f0,#172d39f5);border:1px solid #c1d8df55;box-shadow:inset 0 1px 0 #f0fdff0a,0 3px 8px #08182230;pointer-events:auto;transition:background .15s,border-color .15s,transform .15s}
.game-stage .choice{min-height:48px;display:flex;flex-direction:row;justify-content:center;gap:7px;font-size:13px;padding:7px 9px;border-radius:12px}
.game-stage .choice .art{width:20px;height:20px;color:#efc48b}
.work-cards{display:flex;gap:6px;justify-content:center}
.work-card{flex:1;max-width:76px;min-width:44px;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:5px;font-size:12px;border-radius:10px}
.work-card .art{width:20px;height:20px;color:#efc48b}
.work-card[aria-pressed="true"]{background:#244b47;border-color:#8ed5bb;box-shadow:0 0 0 2px #8ed5bb22}
[data-card]{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
[data-card].lifted{opacity:.35}
.card-ghost{position:fixed;z-index:10;top:0;left:0;transform:translate(-50%,-70%);display:flex;align-items:center;gap:5px;padding:7px 9px;border:2px solid #8cf6d2;border-radius:10px;color:#142639;background:#eefbfa;box-shadow:0 5px 15px #15263866;pointer-events:none}
.card-ghost .art{width:23px;height:23px}
.game-stage .roundbar{min-height:44px;border-radius:0;background:none;padding:0;font-size:11px;gap:3px;text-shadow:0 1px 4px #0d202d}
.game-stage .roundbar>div{display:flex;gap:4px}
.game-stage .roundbar button{font-size:11px;padding:4px 7px}
.game-stage .feedback{padding:6px 10px;margin:0;font-size:12px;min-height:0;max-height:70px;overflow:auto;pointer-events:auto}
.game-stage .footer{position:static;transform:none;left:auto;width:100%;margin:0;min-height:0;padding:0;border:0;backdrop-filter:none;background:transparent;grid-template-columns:48px minmax(130px,210px) 48px;justify-content:center;gap:8px}
.game-stage .footer button{min-height:44px}
.game-stage .footer .primary{background:linear-gradient(135deg,#e5bb83,#c99b65);border-color:#f0d2a8;color:#252a29;font-weight:650;box-shadow:0 2px 10px #0a182b33}
.save-status{justify-self:center;color:#d3e6ef;font-size:10px;text-shadow:0 1px 3px #0e2331}
.game-stage .finish{margin:0;padding:12px 16px;background:#122c3dea;border:1px solid #86a6ba77;max-height:calc(100dvh - 190px);overflow:auto;pointer-events:auto}
.game-stage .finish h2{font-size:23px;margin:4px 0}
.game-stage .finish p{margin:5px 0}
.game-stage .finish .reward .art{width:56px;height:56px}
.game-stage .finish .stats{margin:9px 0}
.game-stage .scene-controls{z-index:2;inset:auto var(--safe-right) 40% auto;display:none;flex-direction:column;gap:5px;pointer-events:none}
.game-stage .rendered .scene-controls{display:flex}
.game-stage .scene-controls span{display:none}
.game-stage .scene-controls button{min-width:44px;min-height:44px;display:grid;place-items:center}
.scene-marker{box-shadow:0 3px 12px #0e243666}
.truck-marker .art{width:19px;height:19px}
.dragging .scene-marker[data-drop],.choosing-target button.scene-marker{border-color:#8cf6d2;box-shadow:0 0 0 2px #8cf6d266}
.dragging .scene-marker.hovered{color:#112e27;background:#a6f6dc;box-shadow:0 0 0 3px #caffeb88}
.game-stage .workshop-view:not(.rendered) .scene-markers{top:45%;bottom:auto;left:8px;right:64px}
.scene-fallback{top:40%;left:10px}
dialog{position:fixed;inset:0;margin:auto;width:min(calc(100% - 24px),520px);max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(24px,env(safe-area-inset-bottom)));border:2px solid #7191a9;border-radius:16px;overscroll-behavior:contain}
dialog::backdrop{background:#0a1a2a7d;backdrop-filter:blur(2px)}
#toast{bottom:calc(var(--safe-bottom) + 185px);z-index:12}
@media(min-width:900px){
 .hud-top{max-width:360px}
 .hud-bottom{width:420px}
 .game-stage .mast h1{font-size:17px}
 .game-stage .scene-controls{bottom:var(--safe-bottom)}
}
@media(max-height:480px) and (min-width:500px){
 .hud-top{max-width:none;right:120px;display:grid;grid-template-columns:minmax(160px,1fr) minmax(170px,1fr);gap:4px 10px}
 .game-stage .mast{grid-column:1;grid-row:1;min-height:32px}
 .game-stage .mast h1{font-size:14px}
 .game-stage .brand-mark{width:23px;height:23px}
 .top-buttons{position:fixed;right:var(--safe-right);top:var(--safe-top)}
 .game-stage .level-head{grid-column:1;grid-row:2;align-self:start}
 .game-stage .level-head .tag{font-size:9px}
 .game-stage .orders{grid-column:2;grid-row:1 / span 2}
 .game-stage .resources{grid-column:2;grid-row:3}
 .game-stage .mission{grid-column:1;grid-row:3}
 .game-stage .qa-banner{position:fixed;left:var(--safe-left);top:110px}
 .game-stage .save-warning{grid-column:1 / -1}
 .hud-bottom{width:calc(100% - var(--safe-left) - var(--safe-right));max-width:900px;grid-template-columns:1fr 1fr;align-items:end;gap:4px 12px}
 .game-stage .teach{grid-column:1 / -1;padding:5px 8px;display:grid;grid-template-columns:1fr 1fr;gap:3px 12px;align-items:center}
 .game-stage .teach .scene-dock{grid-column:2;grid-row:1 / span 3}
 .game-stage .teach h3{font-size:16px}
 .game-stage .teach .lesson-step{width:100px}
 .game-stage .teach .drag-hint{font-size:11px}
 .game-stage .teach-feedback:not(:empty){grid-column:1 / -1}
 .game-stage .choice,.work-card{min-height:48px}
 .game-stage .roundbar{grid-column:1 / -1;min-height:34px}
 .game-stage .roundbar button{min-height:34px}
 .practice .hud-bottom>.drag-hint{display:none}
 .game-stage .feedback{grid-column:1 / -1}
 .save-status{grid-column:1 / -1;font-size:9px}
 .game-stage .finish{grid-column:1 / -1;max-height:calc(100dvh - 130px);padding:7px 10px}
 .completed .footer{grid-column:1 / -1}
 .game-stage .scene-controls{bottom:44%;flex-direction:row}
 #toast{bottom:125px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
@media(max-height:480px) and (min-width:500px){
 .game-stage .orders{grid-row:1;align-self:start}
 .game-stage .resources{grid-row:2;align-self:end}
 .game-stage .mission{grid-column:1 / -1;grid-row:3}
 .game-stage .qa-banner{top:94px}
}

/* Fine-line symbols, compact HUD surfaces and generous invisible hit areas. */
.icon-accent{fill:currentColor}
.game-stage .art{width:20px;height:20px}
.game-stage .brand-mark .art{width:22px;height:22px}
.game-stage .level-head .tag{font-size:10px;letter-spacing:.08em;color:#c7d7de}
.level-counter small{margin-left:3px;font-size:10px;opacity:.75}
.game-stage .order-shape{display:grid;place-items:center;width:22px;height:26px;border-radius:7px;background:#eac99c12}
.game-stage .order-shape .cargo{width:10px;height:10px;border:1.5px solid #efd1a2;background:#e9bd79}
.game-stage .order-shape .diamond{background:#9dbfcf;border-color:#cee2eb}
.order-label{display:flex;flex-direction:column;gap:2px}
.order-label b{font-size:11px;font-weight:500}
.order-label small{font-size:9px;color:#bed0d9}
.game-stage .order-count small{margin-left:3px;font-size:11px;font-weight:400}
.game-stage .resources .art{width:15px;height:15px;color:#e7c393}
.game-stage .resources span:last-child{border:0}
.game-stage button.utility-button,.game-stage .scene-controls button,.game-stage .footer .secondary-action{position:relative;isolation:isolate;background:transparent;border:0;box-shadow:none;color:#d9e6eb;border-radius:50%}
.game-stage .utility-button::before,.game-stage .scene-controls button::before{content:"";position:absolute;inset:5px;border-radius:50%;background:#192e3bd9;border:1px solid #cfdee53b;box-shadow:0 2px 7px #081b2a22;z-index:-1}
.game-stage .utility-button .art,.game-stage .scene-controls .art{width:18px;height:18px}
.game-stage .top-buttons{gap:0}
.game-stage .top-buttons button{display:grid;place-items:center;padding:0;width:44px}
.game-stage .scene-controls{gap:0}
.game-stage .choice:hover,.game-stage .work-card:hover{border-color:#e6c38f;background:#294651}
.game-stage .choice:active,.game-stage .work-card:active{transform:translateY(1px)}
.game-stage .work-card[aria-pressed="true"] .art{color:#b3efda}
.game-stage .choices{grid-template-columns:repeat(2,minmax(0,150px));justify-content:center;gap:8px;margin-top:7px}
.game-stage .drag-hint{font-size:11px;color:#d3e2e8}
.game-stage .roundbar button{background:#162c38cc;border:1px solid #d1e1e524;min-height:44px;font-size:11px;border-radius:14px;padding:4px 8px}
.game-stage .roundbar .art{width:14px;height:14px;margin-left:2px}
.game-stage .footer button{display:flex;align-items:center;justify-content:center;gap:8px;border-radius:14px}
.game-stage .footer .secondary-action{flex-direction:column;gap:2px;font-size:10px;text-shadow:0 1px 4px #142c3c}
.game-stage .footer .secondary-action .art{width:17px;height:17px}
.game-stage .footer .primary .art{width:17px;height:17px}
.game-stage .scene-marker{background:#152b35e6;border:1px solid #e5f0f333;border-radius:18px;padding:5px 8px;font-size:11px;font-weight:500;box-shadow:0 2px 8px #10232b33}
.game-stage .scene-marker span{font-size:10px;color:#c8dce4}
.game-stage .scene-marker .signal{width:5px;height:5px;box-shadow:0 0 7px #80d7bc55}
.game-stage .truck-marker .art{width:17px;height:17px;color:#eac28d}
.game-stage .teach-feedback:not(:empty){background:#1b303bdb;border-radius:8px;padding:5px 8px}
.game-stage .save-status{font-size:9px;color:#d0dfe5;opacity:.85}
.game-stage .finish{background:linear-gradient(145deg,#223a46ed,#132a36f0);border-color:#d4e5ea40;border-radius:18px}
.game-stage .finish .reward{color:#e8be80}
.game-stage .finish .reward .art{width:45px;height:45px;filter:drop-shadow(0 0 10px #e8be8030)}
dialog{background:#172d39;color:#e4eef1;border:1px solid #b5d1dc55;border-radius:18px;box-shadow:0 12px 60px #07162280}
.sheet-top{background:#172d39;border-color:#d0e3eb22}
.sheet-top h2{font-size:16px}
.sheet-top button{color:#e2edf2}
.sheet-body .option{background:#28414e;color:#e4eef1;border:1px solid #d1e4eb30;border-radius:12px;min-height:50px;padding:9px 12px}
.sheet-body .option small,.sheet-body .small,.sheet-body .note{color:#bed0da}
.sheet-body .option.primary{background:#d8b17f;border-color:#f0d2a8;color:#222e32}
.sheet-body .option.primary small{color:#3e4a4e}
.record{background:#213946;border-color:#cce2ea22}
.summary-row,.sheet-body .section-title{border-color:#d1e4eb26}
.sheet-body .level-grid button{background:#223c4a;border-color:#cce2ea26;color:#e4eef1;min-height:66px;border-radius:12px}
.sheet-body .level-grid button.current{border:1px solid #e0ba84;box-shadow:inset 0 0 0 1px #e0ba8422}
.sheet-body .level-grid small{color:#adc6d4}
.sheet-body .quantity button{background:#28414e;color:#e4eef1;border-color:#cce2ea30}
.sheet-body .lane{background:#223c4a;border-color:#cce2ea26;color:#e4eef1;box-shadow:none}
.sheet-body .lane .sub{color:#bad1d9}
.sheet-body .lane button{background:#354f5a;color:#edf6f7;border-color:#cce2ea30}
.sheet-body .pill,.sheet-body .lane-icon{background:#cce2ea12;color:#d7e8ec}
.sheet-body .feedback.error{color:#23353c}
button:focus-visible{outline:2px solid #f0cb94;outline-offset:3px}
@media(max-height:480px) and (min-width:500px){
 .hud-bottom{grid-template-columns:1fr minmax(260px,1fr);gap:3px 10px}
 .game-stage .teach{padding:0}
 .game-stage .teach .choices{margin-top:0}
 .game-stage .roundbar button{min-height:44px}
 .game-stage .order{min-width:0}
 .game-stage .footer{grid-template-columns:44px minmax(130px,1fr) 44px;gap:3px}
}
@media(max-height:480px) and (min-width:500px){
 .game-stage .order{grid-template-columns:20px 1fr;gap:2px 5px;padding:5px 7px}
 .game-stage .order-shape{grid-column:1;grid-row:1;width:20px;height:19px}
 .game-stage .order-label{display:contents}
 .game-stage .order-label b{display:none}
 .game-stage .order-label small{grid-column:1/-1;grid-row:2;white-space:nowrap}
 .game-stage .order-count{grid-column:2;grid-row:1;text-align:right;font-size:16px}
 .game-stage .order .bar{grid-row:3}
}
@media(max-height:480px) and (min-width:500px){
 .game-stage .resources span{padding:0 3px;gap:2px}
 .game-stage .resources small{white-space:nowrap;font-size:9px}
 .game-stage .resources .art{width:12px;height:12px}
 .game-stage .resources strong{font-size:11px}
}

/* One scrollable illustrated manual, shown on entry. */
dialog.manual-sheet{width:min(calc(100% - 20px),650px);max-height:calc(100dvh - 24px)}
.manual-sheet .sheet-body{padding:12px 16px 0}
.manual{font-size:13px;line-height:1.65}
.manual .manual-lead{font-size:15px;font-weight:550;color:#f0d0a3}
.manual section{margin:20px 0}
.manual h3{font-size:15px;margin:0 0 8px;color:#f5dfbb}
.manual strong{color:#e9d1ab}
.manual-map{padding:12px;border:1px solid #bcd5df35;border-radius:14px;background:linear-gradient(145deg,#314b56,#162d3a);display:grid;gap:9px;overflow:hidden}
.map-top,.map-dock{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.map-top>span{padding:5px 8px;background:#0d2430;border:1px solid #7e9ca755;border-radius:8px;font-size:12px}
.map-top small{display:block;font-size:10px;color:#b7cfd9}
.map-top b{margin-left:8px}
.manual-map i{font-style:normal;color:#e5c79e;font-size:11px}
.map-floor{position:relative;overflow:hidden;border-radius:7px}
.map-floor img{display:block;width:100%;height:clamp(125px,23dvh,187px);object-fit:cover;object-position:50% 65%}
.map-floor>i,.map-labels b{padding:3px 7px;border-radius:10px;background:#152936eb;color:#fff;font-size:11px;font-weight:600}
.map-floor>i{position:absolute;left:6px;top:6px}
.map-labels{position:absolute;bottom:8px;inset-inline:0;display:grid;grid-template-columns:39% 19% 42%;justify-items:center}
.map-dock>span{display:flex;align-items:center;gap:5px;border:1px solid #9db7c066;border-radius:7px;padding:5px 8px;background:#1b3441;color:#e7c590;font-size:11px}
.map-dock .art{width:17px;height:17px}
.map-preview{background:#d5af7e;color:#20323a;border-radius:7px;text-align:center;padding:5px;font-size:12px;font-weight:600}
.manual-goals{display:flex;gap:6px;flex-wrap:wrap}
.manual-goals span{display:inline-flex;align-items:center;gap:5px;padding:5px 7px;background:#273f49;border-radius:8px;font-size:11px}
.manual-goals .art{width:18px;height:18px;color:#9ed5bf}
.manual-mode{border-left:2px solid #cba573;padding:0 0 0 10px;margin:12px 0}
.manual-mode>b{color:#a8dac8}
.manual-mode p{margin:3px 0}
.manual-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.manual-steps>div{padding:8px;background:#26404d;border:1px solid #c1d8df22;border-radius:10px}
.manual-steps .art{width:23px;height:23px;display:block;color:#e7c590;margin-bottom:5px}
.manual-steps b{font-size:12px}
.manual-steps p{font-size:11px!important;margin:4px 0 0!important;color:#c2d4db}
.manual-timeline{display:flex;align-items:center;justify-content:center;gap:7px;padding:10px;margin-bottom:8px;background:#102936;border-radius:10px}
.manual-timeline span{display:grid;justify-items:center;gap:4px;min-width:54px;font-size:12px;color:#a8dac8}
.manual-timeline .art{width:24px;height:24px;color:#e3bf8b}
.manual-timeline i{color:#8eacb6;font-style:normal}
.manual-legend>div{display:flex;gap:7px;align-items:center;border-bottom:1px solid #c1d8df18;padding:9px 0}
.manual-legend .art{width:18px;height:18px;flex-shrink:0;color:#e7c590}
.manual-legend .cargo{flex-shrink:0;width:11px;height:11px}
.manual-legend p{margin:0!important;font-size:12px!important;color:#c5d8e0}
.manual-legend b{display:block;color:#f0f5f7;font-weight:550}
.manual-checks{background:#25423e;border:1px solid #8abfa244;border-radius:10px;padding:12px}
.manual-checks h3{color:#b2dfcb}
.manual-checks ol{padding-left:20px;margin:0;font-size:12px}
.manual-checks li{padding:3px 0}
.manual .manual-note{font-size:11px;color:#aec6d1}
.manual-actions{position:sticky;bottom:0;display:flex;align-items:center;gap:8px;padding:12px 0;background:#172d39;box-shadow:0 -8px 12px #172d39dd}
.manual-actions button{min-height:46px;border:1px solid #bcd4df44;background:#294451;color:#e8f2f6;border-radius:10px;font-size:12px}
.manual-actions .primary{flex:1;background:#d5af7e;border-color:#eccb9f;color:#20323a;display:flex;align-items:center;justify-content:center;gap:6px}
.manual-actions .art{width:18px;height:18px}
@media(max-width:400px){.manual-steps{grid-template-columns:1fr 1fr}.manual-sheet .sheet-body{padding-left:12px;padding-right:12px}}

.game-stage .orders{position:relative;padding-top:16px}
.orders-title{position:absolute;left:4px;top:0;font-size:11px;font-weight:600;color:#f1d3a7;text-shadow:0 1px 4px #132b39}
.game-stage .order-label b{white-space:nowrap}
.game-stage .order-count small{font-size:10px}
@media(max-height:480px) and (min-width:500px){
 .game-stage .order-label b{display:block;grid-column:1/-1;grid-row:1;font-size:10px}
 .game-stage .order-shape,.game-stage .order-count{grid-row:2}
 .game-stage .order-label small{grid-row:3}
 .game-stage .order .bar{grid-row:4}
}

.truck-badge{display:inline-flex;align-items:center;gap:4px}
.game-stage .workshop-view:not(.rendered){background-color:#203441;background-size:100% auto;background-position:center}
.game-stage .workshop-view:not(.rendered) .scene-markers{display:block;inset:0}
.workshop-view:not(.rendered) .scene-marker{position:absolute;top:50%;transform:translate(-50%,-50%)}
.workshop-view:not(.rendered) [data-drop="A"]{left:12%}
.workshop-view:not(.rendered) [data-drop="B"]{left:32%}
.workshop-view:not(.rendered)[data-lanes="1"] [data-drop="A"]{left:20%}
.workshop-view:not(.rendered)[data-lanes="3"] [data-drop="B"]{left:25%;top:calc(50% + 35px)}
.workshop-view:not(.rendered) [data-drop="C"]{left:38%}
/* The badge and its drop area follow the photographed truck at any screen width. */
.game-stage .workshop-view:not(.rendered) .truck-marker{left:51%;top:calc(50% - 8vw);width:46%;height:24vw;transform:none;display:grid;place-items:center;border:none;background:none;box-shadow:none}
.workshop-view:not(.rendered) .truck-badge{padding:5px 8px;border-radius:18px;background:#152b35ed;color:white}
.workshop-view:not(.rendered) .truck-marker.hovered .truck-badge{background:#a6f6dc;color:#142639}
@media (orientation:portrait){
 .game-stage .workshop-view:not(.rendered) .scene-fallback{top:calc(50% - 32vw);left:8px}
}
