:root{--ink:#16363d;--muted:#587276;--cream:#fff9ea;--paper:#f4ead6;--wood:#b78150;--teal:#168d8d;--teal-deep:#0b5d65;--cyan:#36b8c7;--blue:#3e7fc5;--amber:#efb64c;--orange:#ee7b4f;--coral:#e85f5b;--violet:#7662bd;color-scheme:light}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{background:#eaf2ed;color:var(--ink);font-family:Inter,ui-rounded,"Avenir Next",system-ui,sans-serif}button,input{font:inherit}button:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:4px solid #123d70;outline-offset:4px}.relay-shell{width:min(1390px,calc(100vw - 34px));height:min(850px,calc(100vh - 24px));margin:12px auto;display:grid;grid-template-rows:minmax(0,1fr) 176px;gap:14px}
.workshop{position:relative;min-height:0;display:grid;grid-template-columns:218px minmax(0,1fr) 286px;gap:19px;padding:29px;border-radius:32px;overflow:hidden;background:linear-gradient(180deg,#f6edda 0 76%,#c08a58 76%);box-shadow:0 20px 58px rgba(30,68,61,.16);isolation:isolate;transition:background 180ms,color 180ms}.pegboard{position:absolute;inset:17px 17px 25%;z-index:-1;border:1px solid rgba(22,54,61,.12);border-radius:26px;background-image:radial-gradient(rgba(40,77,77,.14) 1.5px,transparent 1.5px);background-size:23px 23px;background-color:rgba(255,255,255,.31)}.workshop.dark{color:#eefbf8;background:linear-gradient(180deg,#152d38 0 76%,#5c4436 76%)}.workshop.dark .pegboard{background-color:#173642;background-image:radial-gradient(rgba(151,214,208,.18) 1.5px,transparent 1.5px)}
.eyebrow,.mission-copy>span{color:var(--teal-deep);font-size:11px;font-weight:950;letter-spacing:.13em;text-transform:uppercase}.workshop.dark .eyebrow{color:#8fe1d9}.store-station,.ledger{position:relative;z-index:3;align-self:center;border:1px solid rgba(22,54,61,.11);border-radius:24px;background:rgba(255,250,236,.95);box-shadow:0 12px 27px rgba(36,57,49,.12)}.workshop.dark .store-station,.workshop.dark .ledger{color:var(--ink);background:rgba(246,240,222,.97)}.store-station{height:382px;padding:20px;display:flex;flex-direction:column;align-items:center}.battery{position:relative;width:112px;height:238px;margin:16px 0 13px;padding:18px 13px 15px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;border:8px solid #315c62;border-radius:25px;background:#e1e7dd;overflow:hidden;box-shadow:inset 0 0 0 4px white,0 8px 0 #173e46}.battery-cap{position:absolute;left:32px;top:-17px;width:47px;height:23px;border-radius:10px 10px 4px 4px;background:var(--amber);border:6px solid #315c62}.battery-fill{position:absolute;left:9px;right:9px;bottom:9px;height:100%;border-radius:11px;background:repeating-linear-gradient(0deg,#34b9b2 0 28px,#55d0c2 28px 31px);transition:height 160ms linear}.battery strong,.battery small{position:relative;z-index:2;color:white;text-shadow:0 2px 5px rgba(0,0,0,.4)}.battery strong{font-size:35px}.battery small{font-size:10px;font-weight:900}.rate-card{width:100%;padding:10px;border-radius:14px;background:#e7f0eb;text-align:center}.rate-card span{display:block;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase}.rate-card strong{font-size:22px}.rate-card small{font-size:10px;font-weight:800}
.relay-stage{position:relative;align-self:center;height:414px;border:7px solid #2b5157;border-radius:29px;background:linear-gradient(#f8f3e7,#eae0ca);box-shadow:0 11px 0 #173b43,0 25px 38px rgba(34,45,39,.18);overflow:hidden}.workshop.dark .relay-stage{background:linear-gradient(#213d45,#152f39)}.device{position:absolute;z-index:4;width:132px;height:140px;padding:13px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;border:5px solid #27545b;border-radius:19px;background:#f7f0df;box-shadow:0 8px 0 #183b42}.device strong{font-size:14px}.device small{color:var(--muted);font-size:10px;font-weight:800}.battery-device{left:24px;top:52px;background:#f0b951}.battery-device i{display:grid;place-items:center;width:75px;height:66px;margin-bottom:8px;border-radius:12px;color:white;background:#285e62;font-size:24px;font-style:normal;font-weight:950}.motor-device{left:50%;top:52px;transform:translateX(-50%);background:#3da8a8}.output-device{right:24px;top:52px;background:#ef815d}.rotor,.fan{width:74px;height:74px;margin-bottom:7px;border:8px solid #214a50;border-radius:50%;background:#dfe6dd}.rotor i{display:block;width:32px;height:32px;margin:13px;border-radius:50%;background:var(--orange);box-shadow:0 0 0 8px #315f63}.fan{position:relative}.fan i{position:absolute;left:26px;top:5px;width:14px;height:29px;border-radius:90% 10% 70% 30%;background:var(--teal);transform-origin:7px 31px}.fan i:nth-child(2){transform:rotate(120deg)}.fan i:nth-child(3){transform:rotate(240deg)}.workshop.running .rotor,.workshop.running .fan{animation:spin 620ms linear infinite}.connector-dock{position:absolute;z-index:5;left:181px;top:94px;width:calc(50% - 253px);min-width:82px;height:55px;display:grid;place-items:center;border:3px dashed #809a9d;border-radius:14px;background:rgba(255,255,255,.7);color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;transition:transform 150ms,background 150ms,border 150ms}.connector-dock.active{border-color:var(--amber);background:#fff4c7;transform:translateY(-4px)}.connector-dock.drop-ready{border-color:var(--teal);background:#d7f0e9;transform:translateY(-6px) scale(1.03)}
.path{position:absolute;z-index:2;border-radius:99px;overflow:hidden;box-shadow:inset 0 0 0 2px rgba(24,54,61,.16);transition:height 160ms,opacity 160ms}.path i{position:absolute;inset:0}.path-electrical{left:156px;right:50%;top:107px;background:#2c98a8}.path-electrical i{background:repeating-linear-gradient(90deg,transparent 0 15px,rgba(255,255,255,.78) 15px 18px,transparent 18px 32px)}.path-mechanical{left:50%;right:150px;top:107px;background:#4f86bd}.path-mechanical i{background:repeating-linear-gradient(135deg,rgba(255,255,255,.42) 0 9px,transparent 9px 19px)}.path-thermal{left:50%;right:145px;top:237px;background:#ed9d43}.path-thermal i{background:repeating-radial-gradient(ellipse at center,rgba(255,255,255,.42) 0 3px,transparent 4px 14px)}.path-sound{left:50%;right:105px;top:326px;background:#7862bb}.path-sound i{background:repeating-linear-gradient(90deg,transparent 0 8px,rgba(255,255,255,.74) 9px 11px,transparent 12px 19px)}.workshop:not(.dark) .path-thermal.hidden-path{opacity:.08}.workshop.dark .path-thermal.hidden-path{opacity:1;filter:drop-shadow(0 0 12px #f5a54f)}.workshop:not(.reduced) .path i{animation:path-shift 1.1s linear infinite}.thermal-haze{position:absolute;z-index:1;left:39%;top:13px;width:300px;height:285px;border-radius:50%;opacity:0;background:radial-gradient(ellipse,rgba(246,142,59,.36),transparent 67%);filter:blur(15px);transition:opacity 220ms}.workshop.dark .thermal-haze{opacity:1}.path-note{position:absolute;left:50%;bottom:13px;transform:translateX(-50%);width:78%;margin:0;color:var(--muted);font-size:10px;font-weight:800;text-align:center}.workshop.dark .path-note{color:#bad2d2}.thermal-build-dock{position:absolute;z-index:8;right:22px;top:214px;width:188px;min-height:72px;padding:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;border:4px dashed #efb64c;border-radius:17px;color:#17343b;background:rgba(255,249,234,.94);cursor:pointer;text-align:center;transition:transform 150ms,box-shadow 150ms}.thermal-build-dock span{width:34px;height:9px;margin-bottom:6px;border-radius:99px;background:#ed9d43}.thermal-build-dock b{font-size:11px;text-transform:uppercase}.thermal-build-dock small{font-size:9px}.thermal-build-dock.drop-ready{transform:scale(1.08);box-shadow:0 0 0 8px rgba(239,182,76,.28);background:#fff0b4}
.ledger{align-self:center;min-height:382px;padding:19px}.ledger-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:15px}.ledger-heading strong{font-size:12px}.ledger-row{display:grid;grid-template-columns:78px 1fr 29px;align-items:center;gap:8px;margin:11px 0}.ledger-row span{font-size:10px;font-weight:900}.ledger-row>div{height:18px;border-radius:6px;background:#dedfd8;overflow:hidden}.ledger-row i{display:block;width:0;height:100%;border-radius:6px;transition:width 160ms ease-out}.ledger-row b{text-align:right;font-size:12px}.ledger-row.input i{background:var(--cyan)}.ledger-row.mechanical i{background:repeating-linear-gradient(135deg,var(--blue) 0 8px,#65a2d6 8px 15px)}.ledger-row.thermal i{background:var(--amber)}.ledger-row.sound i{background:repeating-linear-gradient(90deg,var(--violet) 0 7px,#9b87d1 7px 12px)}.ledger-row.stored i{background:var(--teal)}.ledger-rule{height:2px;margin:13px 0;background:#bcc9c3}.ledger p{margin:17px 0 0;padding:12px;border-radius:12px;background:#e8eee9;text-align:center;font-size:18px;font-weight:950}.ledger.unbalanced p{color:#8d413a;background:#f8dfda}.ledger.pulse{animation:pulse 700ms ease-out}.freeze-card{position:absolute;z-index:10;left:50%;top:44%;min-width:330px;padding:18px 24px;border:4px double var(--teal);border-radius:16px;color:var(--teal-deep);background:var(--cream);box-shadow:0 15px 40px rgba(16,44,44,.22);opacity:0;transform:translate(-50%,-50%) scale(.8);pointer-events:none}.freeze-card strong,.freeze-card span{display:block;text-align:center}.freeze-card.show{animation:freeze 850ms ease-out}.celebration{position:absolute;inset:0;z-index:11;pointer-events:none}.celebration i{position:absolute;left:50%;top:50%;width:9px;height:18px;border-radius:4px;opacity:0}.celebration.on i{animation:confetti 850ms ease-out forwards}
.action-tray{min-width:0;display:grid;grid-template-columns:minmax(340px,.82fr) minmax(620px,1.68fr);align-items:center;gap:28px;padding:20px 27px;border-radius:27px;background:var(--cream);box-shadow:0 12px 36px rgba(33,55,48,.12)}.mission-copy h1{margin:5px 0 4px;max-width:520px;font-size:clamp(23px,2vw,31px);line-height:1.04;letter-spacing:-.035em}.mission-copy p{margin:0;color:var(--muted);font-size:13px;font-weight:720}.controls{min-width:0;display:flex;justify-content:flex-end;align-items:center;gap:11px}.connector-card,.choice,.primary{min-height:60px;border:0;border-radius:17px;cursor:pointer;transition:transform 140ms ease-out,box-shadow 140ms ease-out}.connector-card:hover,.choice:hover,.primary:hover{transform:translateY(-3px)}.connector-card:active,.choice:active,.primary:active{transform:translateY(1px) scale(.98)}.connector-card{width:174px;padding:10px 13px;color:var(--ink);background:#e6efeb;border:2px solid transparent;text-align:left;font-size:12px;font-weight:850}.connector-card b{display:block;margin-bottom:5px;color:var(--teal-deep);font-size:10px;letter-spacing:.1em;text-transform:uppercase}.connector-card span{display:block;height:10px;margin-bottom:7px;border-radius:8px}.connector-card.electrical span{background:repeating-linear-gradient(90deg,var(--cyan) 0 14px,#e7ffff 14px 17px,var(--cyan) 17px 28px)}.connector-card.mechanical span{background:repeating-linear-gradient(135deg,var(--blue) 0 8px,#9fc4e4 8px 15px)}.connector-card.thermal span{background:var(--amber)}.connector-card.sound span{background:repeating-linear-gradient(90deg,var(--violet) 0 7px,#c6b8e9 7px 12px)}.choice{max-width:245px;padding:11px 15px;color:var(--ink);background:#edf1ee;font-size:12px;font-weight:850}.primary{min-width:190px;padding:14px 22px;color:white;background:var(--teal);box-shadow:0 7px 0 var(--teal-deep);font-size:15px;font-weight:950}.primary.coral{background:var(--coral);box-shadow:0 7px 0 #9d3837}.feedback{max-width:350px;color:var(--muted);font-size:13px;font-weight:740;line-height:1.35}.feedback strong{display:block;color:var(--ink);font-size:18px}.slider-control{width:min(470px,44vw);padding:13px 16px;border-radius:18px;background:#e7efea}.slider-control label{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:9px;font-size:12px;font-weight:900}.slider-control label strong{font-size:24px}.slider-control input{width:100%;height:28px;accent-color:var(--teal);cursor:grab}.slider-control small{display:block;color:var(--muted);font-size:10px;font-weight:800}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.store-station.pulse,.connector-dock.pulse,.thermal-haze.pulse{animation:pulse 700ms ease-out}
@keyframes spin{to{transform:rotate(360deg)}}@keyframes path-shift{to{transform:translateX(31px)}}@keyframes freeze{18%{opacity:1;transform:translate(-50%,-50%) scale(1.03)}72%{opacity:1}100%{opacity:0;transform:translate(-50%,-58%) scale(1)}}@keyframes pulse{40%{transform:scale(1.025);filter:brightness(1.05)}100%{transform:none}}@keyframes confetti{15%{opacity:1}100%{opacity:0;transform:rotate(var(--angle)) translateY(-180px) rotate(190deg)}}
@media(max-width:1150px){.workshop{grid-template-columns:185px minmax(0,1fr) 245px;padding:22px;gap:13px}.store-station,.ledger{transform:scale(.93)}.device{width:112px}.connector-dock{left:148px}.action-tray{grid-template-columns:330px 1fr}.connector-card{width:155px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important;scroll-behavior:auto!important}}
