:root{--ink:#173a38;--muted:#657a72;--paper:#f5f3e9;--teal:#087c78;--gold:#db9a38;--line:#d5dfd4}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.65 system-ui,-apple-system,'Noto Sans TC',sans-serif}button,input{font:inherit}button{cursor:pointer;border:1px solid #bfd4ca;border-radius:9px;padding:9px 15px;background:#fffef7;color:var(--ink);font-weight:700}button:hover:not(:disabled){border-color:var(--teal);background:#e9f5ed}button:focus-visible,input:focus-visible{outline:3px solid #ec9d26;outline-offset:3px}button:disabled{cursor:default;opacity:.5}main{max-width:1180px;margin:auto;padding:26px 30px}header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:3px;margin:0;color:var(--teal)}h1{font-size:34px;line-height:1.3;margin:5px 0;letter-spacing:1px}h1 span{font-size:18px;display:inline-block;color:#79846d;font-weight:500;margin-left:14px}.tools{display:flex;gap:7px}.tools button{font-size:13px;padding:8px 11px}.intro{background:#e8eddf;border-left:4px solid var(--gold);padding:17px 22px;display:grid;grid-template-columns:1.5fr 1fr;gap:24px;border-radius:0 10px 10px 0;margin-bottom:20px}.intro b{font-size:18px}.intro p{font-size:13px;margin:6px 0;color:#536f63}.intro form{display:grid;grid-template-columns:1fr auto;gap:7px;align-content:center}.intro label{grid-column:1/-1;font-size:12px}.intro input{width:100%;min-width:0;border:1px solid #b8cebd;background:#fffdf5;border-radius:8px;padding:10px}.intro button,#saveHub{background:var(--teal);color:white;border:0}.dashboard{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:11px 11px 0 0;background:#fffdf5;padding:12px 20px}.dashboard span+span{border-left:1px solid var(--line);padding-left:25px}.dashboard small{display:block;color:var(--muted);font-size:11px}.dashboard b{font-size:22px;font-variant-numeric:tabular-nums}#shield{font-size:16px;color:var(--teal)}.arena{height:500px;position:relative;overflow:hidden;isolation:isolate;background:#adcac0}.scroll-bg{position:absolute;inset:0;background:url('starport.png') repeat-x bottom center;background-size:auto 130%;animation:scroll 65s linear infinite}.atmosphere{position:absolute;inset:0;background:linear-gradient(#0b484766,transparent 28%,transparent 80%,#123a3a55)}.zone{position:absolute;top:15px;left:20px;right:20px;display:flex;justify-content:space-between;color:#fff;font-size:12px;font-weight:750;text-shadow:0 1px 3px #123}.live{font-size:10px;letter-spacing:1px}.zone #chapter{background:#164d46de;padding:4px 12px;border-radius:20px}#weapon{position:absolute;top:58px;left:50%;transform:translateX(-50%);width:max-content;max-width:92%;text-align:center;padding:10px 30px;background:#fffdf1ed;border:1px solid #f0d393;border-radius:13px;box-shadow:0 5px 20px #113d3022}#weapon small{font-size:10px;letter-spacing:1px;color:#73826a}#formula{font-size:31px;font-weight:850;line-height:1.5;white-space:normal}sup{font-size:.6em;vertical-align:super;line-height:0}em{font-style:normal;color:var(--teal)}.sprite{background-image:url('combat_actions.png');background-size:400% 200%;background-repeat:no-repeat}.hero{width:160px;height:160px;position:absolute;left:3%;bottom:49px;background-position:0 0;z-index:4;transform-origin:bottom center}.running .hero{animation:runSprite .45s steps(1) infinite,bob .45s ease-in-out infinite}.enemy{position:absolute;bottom:65px;width:135px;height:160px;text-align:center;cursor:crosshair;transition:filter .2s}.enemy .monster{width:135px;height:135px;background-position:0 100%;animation:monsterBob 1.9s ease-in-out infinite}.enemy.e0{left:29%}.enemy.e1{left:46%;bottom:83px}.enemy.e2{left:63%}.enemy.e3{left:80%;bottom:100px}.enemy.e1 .monster{background-position:33.333% 100%;animation-delay:-.5s}.enemy.e2 .monster{background-position:66.666% 100%;animation-delay:-1s}.enemy.e3 .monster{background-position:100% 100%;animation-delay:-1.5s}.armor{position:absolute;top:-12px;left:50%;transform:translateX(-50%);padding:4px 10px;border-radius:7px;white-space:nowrap;font-size:22px;font-weight:850;background:#fffdefee;border:2px solid #bca369;box-shadow:0 3px 0 #544c3850;min-width:55px}.enemy.selected{filter:drop-shadow(0 0 10px #fff1a4)}.enemy.hit{animation:hit .4s ease}.bullet{position:absolute;bottom:136px;left:14%;width:25px;height:4px;border-radius:100%;background:#e4ffff;box-shadow:0 0 9px #14f8f7;animation:bullet 1s linear forwards;pointer-events:none}#beam{position:absolute;left:14%;bottom:140px;width:0;height:9px;border-radius:100%;background:#fff;box-shadow:0 0 13px #40f8ed;opacity:0;z-index:5;transform-origin:left center}#beam.fire{animation:beam .5s ease-out}#proof{position:absolute;top:158px;left:21%;right:4%;padding:12px 18px;background:#123d39f0;border:1px solid #71c9b3;border-radius:12px;color:#fffdf1;z-index:7;box-shadow:0 6px 30px #1234}.proof-title{font-size:12px;color:#9edfd2;display:flex;justify-content:space-between}#factors{min-height:74px;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:12px 0}.factor-group{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:center;padding:5px;border-radius:6px;transition:all .6s}.factor-group.boxed{border:1px solid #91b2a7}.factor{display:inline-flex;align-items:center;justify-content:center;width:27px;height:31px;background:#2c9c96;border:1px solid #9ce1cd;border-radius:5px;font-weight:800;position:relative;animation:arrive .55s ease}.factor.gold{background:#b7852c;border-color:#f8d98a}.factor.purple{background:#825ba0;border-color:#d3adee}.factor.cancelled{opacity:.35}.factor.cancelled:after{content:'';position:absolute;width:36px;height:2px;background:#fff;transform:rotate(-45deg)}.times{font-size:11px;opacity:.65}.fraction #factors{flex-direction:column;gap:2px}.fraction .factor-group:first-child{border-bottom:2px solid #b3d8cb;border-radius:0;padding-bottom:10px}.factor-group.folded{opacity:.25;transform:scale(.8)}#proofResult{font-size:12px;text-align:center;color:#fff0b8;min-height:20px}#sceneCaption{position:absolute;bottom:13px;left:20px;right:20px;font-size:13px;font-weight:700;color:white;text-shadow:0 1px 4px #123;z-index:8;text-align:right}#pauseOverlay{position:absolute;inset:0;background:#123f35dd;z-index:30;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;color:white;font-size:32px}.arena.paused *{animation-play-state:paused!important}.command{background:#fffdf6;border:1px solid var(--line);border-top:0;border-radius:0 0 12px 12px;padding:18px 22px}.command-head{display:flex;justify-content:space-between;gap:12px;font-size:14px}.command-head span{font-size:11px;color:var(--teal);white-space:nowrap}.choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:13px}.choices button{display:flex;align-items:center;gap:16px;font-size:23px;padding:10px 16px;min-height:59px;border:1px solid #bed3c5;background:#f3f7ec;text-align:left}.choices kbd{font:12px system-ui;border:1px solid #b8c9b4;border-radius:4px;padding:0 7px;color:#657960}.choices button.chosen{border:2px solid #d4a039;background:#fff1cf}.choices button:disabled{opacity:.8}.secondary{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.secondary button{font-size:12px;padding:6px 10px}#message{font-size:13px;margin:10px 0 0;min-height:22px;color:#526b5c}#message.error{color:#aa352b;border-left:3px solid #b44;padding-left:12px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.section-heading small{font-size:9px;letter-spacing:2px;color:var(--teal)}h2{font-size:18px;margin:3px 0 10px}.base,.board,#finish{margin-top:26px}.base #completed{font-size:24px;color:var(--teal)}#milestones{display:grid;grid-template-columns:repeat(12,1fr);gap:6px;margin-top:9px}.milestone{height:68px;border:1px solid #d0dacf;border-radius:8px;text-align:center;background:#e9ede0;color:#8d9b8c;position:relative;overflow:hidden}.milestone b{font-size:21px;line-height:35px;display:block}.milestone small{font-size:9px;display:block}.milestone.done{background:#dbede0;border-color:#75ab93;color:#126153}.milestone.done:after{content:'✓';position:absolute;right:3px;top:0;font-size:11px}#finish{border:1px solid #a1c9ac;border-radius:12px;background:#e3eddb;padding:24px}.save-row{display:flex;align-items:center;gap:15px;margin:10px 0;font-size:13px}.board{border-top:1px solid var(--line);padding-top:20px}.board button{font-size:12px}#boardRows{font-size:13px;color:var(--muted)}table{width:100%;border-collapse:collapse;text-align:left}th,td{padding:8px;border-bottom:1px solid #dae2d6}footer{font-size:11px;color:#829080;border-top:1px solid var(--line);margin-top:30px;padding:16px 0}footer span{float:right;font-size:9px;letter-spacing:1px}a{color:var(--teal)}#repair{position:absolute;width:230px;height:125px;right:6%;bottom:55px;z-index:6;display:none}#repair i{position:absolute;display:block;transition:transform .9s cubic-bezier(.2,.8,.2,1),opacity .9s,background .5s;opacity:0;background:#386c62;border:3px solid #d8bd77;box-shadow:inset 0 0 10px #84e4c7;border-radius:5px;width:36px;height:32px;bottom:0;transform:translateY(-90px) rotate(30deg)}#repair i:nth-child(2){left:38px}#repair i:nth-child(3){left:76px}#repair i:nth-child(4){left:114px}#repair i:nth-child(5){left:152px}#repair i:nth-child(6){left:190px}#repair.active{display:block}#repair.build i{opacity:1;transform:none}#repair.connect i{background:#4ed5b3;box-shadow:0 0 15px #76ffdc}#repair.effect-2 i{height:16px;bottom:10px;transform:translateX(-190px)}#repair.effect-2.build i{transform:none}#repair.effect-3 i{height:70px;width:25px;border-radius:50%;bottom:0;transform:rotateY(90deg)}#repair.effect-3.build i{transform:rotateY(0)}#repair.effect-4 i{bottom:70px;background:#a2aaa1;transform:translateY(0)}#repair.effect-4.build i{opacity:.7;transform:translateY(80px) rotate(65deg)}#repair.effect-5 i{border-radius:50%;height:36px;bottom:12px}#repair.effect-5.build{animation:transport 1s forwards}#repair.effect-6 i{height:110px;width:34px;bottom:0;transform:translateX(0);opacity:1}#repair.effect-6.build i{transform:translateX(230px)}#repair.effect-7 i{height:30px;bottom:25px;transform:translateY(90px)}#repair.effect-7 i:nth-child(n+3){height:15px;bottom:60px}#repair.effect-7.build i{transform:none}#repair.effect-8 i{height:22px;bottom:40px;transform:rotate(-70deg)}#repair.effect-8.build i{transform:rotate(0)}#repair.effect-9 i{border-radius:50%;height:46px;width:32px;bottom:35px;transform:translateY(-80px)}#repair.effect-9 i:nth-child(even){background:#bb8b40}#repair.effect-9.build i{transform:none}#repair.effect-10 i{height:80px;width:36px;transform:scaleY(.1);transform-origin:bottom}#repair.effect-10.build i{transform:scaleY(1)}#repair.effect-11 i{height:50px;width:34px;bottom:20px;transform:rotate(-90deg) translateY(80px)}#repair.effect-11 i:nth-child(3),#repair.effect-11 i:nth-child(4){height:90px}#repair.effect-11.build i{transform:none}#repair.effect-12 i{height:60px;transform:translateY(100px);bottom:0}#repair.effect-12 i:nth-child(3),#repair.effect-12 i:nth-child(4){height:115px}#repair.effect-12.build i{transform:none}.defeated .enemy{animation:defeat .9s forwards}.defeated.effect-4 .enemy{animation:crumble .9s forwards}.defeated.effect-12 .enemy{transform-origin:bottom;animation:fall 1.1s forwards}
@keyframes scroll{to{background-position-x:-1500px}}@keyframes runSprite{0%,100%{background-position:33.333% 0}50%{background-position:66.666% 0}}@keyframes bob{50%{transform:translateY(-5px)}}@keyframes monsterBob{50%{transform:translateY(-7px)}}@keyframes bullet{to{left:105%;opacity:.1}}@keyframes beam{0%{opacity:1;width:0}60%{opacity:1;width:78%}100%{width:78%;opacity:0}}@keyframes arrive{from{transform:translateY(-15px);opacity:.1}to{transform:none;opacity:1}}@keyframes hit{50%{transform:translateX(15px);filter:brightness(1.8)}}@keyframes defeat{to{transform:translateX(100px) rotate(40deg);opacity:0}}@keyframes crumble{to{transform:translateY(100px) rotate(30deg);opacity:0}}@keyframes fall{to{transform:rotate(80deg);opacity:0}}@keyframes transport{to{transform:translateX(65px)}}[hidden]{display:none!important}.reduce .factor,.reduce .factor-group,.reduce #repair i{animation:none!important;transition:none!important}
@media(max-width:700px){main{padding:16px 12px}header{align-items:flex-start;gap:5px}h1{font-size:26px}h1 span{display:block;font-size:13px;margin:4px 0}.tools{gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:180px}.tools button{font-size:11px;padding:6px 8px}.intro{grid-template-columns:1fr;gap:8px;padding:15px}.intro b{font-size:16px}.dashboard{padding:10px;gap:4px}.dashboard span+span{padding-left:8px}.dashboard b{font-size:17px}.dashboard small{font-size:10px}#shield{font-size:10px}.arena{height:430px}.zone{left:10px;right:10px;font-size:10px}.live{font-size:8px;max-width:125px;text-align:right}#weapon{top:57px;padding:8px 15px}#formula{font-size:27px}.hero{width:110px;height:110px;left:-5%;bottom:25px}.enemy{width:76px;height:100px;bottom:55px}.enemy .monster{width:76px;height:90px}.enemy.e0{left:21%}.enemy.e1{left:40%;bottom:48px}.enemy.e2{left:59%;bottom:55px}.enemy.e3{left:78%;bottom:66px}.armor{font-size:15px;padding:3px 5px;min-width:38px;top:-7px}.choices{grid-template-columns:1fr}.choices button{font-size:22px;min-height:54px}.command{padding:15px}.command-head{font-size:12px}.command-head span{font-size:10px}#proof{left:3%;right:3%;top:146px;padding:9px 12px}.factor{width:22px;height:26px;font-size:13px}.factor-group{gap:2px;padding:3px}#factors{gap:5px;padding:8px 0;min-height:74px}.times{font-size:9px}#proofResult{font-size:11px}#milestones{grid-template-columns:repeat(6,1fr)}.milestone{height:61px}.milestone small{font-size:9px}.bullet{bottom:83px}#beam{bottom:84px}#repair{transform:scale(.7);transform-origin:bottom right;bottom:40px;right:4%}.save-row{flex-direction:column;align-items:flex-start}footer span{float:none;display:block}.proof-title{font-size:10px}#sceneCaption{font-size:11px;left:10px;right:10px;bottom:7px}.scroll-bg{background-size:auto 120%}}


.factor.travelling{animation:factorTravel .85s cubic-bezier(.2,.7,.2,1) both}@keyframes factorTravel{from{transform:translate(var(--dx),var(--dy))}to{transform:translate(0,0)}}
.hero{bottom:100px}@media(max-width:700px){.hero{bottom:65px}}

.arena.finished .scroll-bg,.arena.finished .monster{animation-play-state:paused}

/* v1.1: frame-driven battle actors and collision effects; essential effects remain visible. */
.motion-note{font-size:12px;margin:-9px 0 14px;color:#51695d}.tools{flex-wrap:wrap;justify-content:flex-end}.tools #motion{border-color:#c28b39;background:#fff0cd}
#combatFx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:6}
.hero.sprite,.enemy .monster{background-image:url('combat_actions.png');background-size:400% 400%;animation:none!important;will-change:transform,background-position}
.hero.sprite{width:170px;height:170px;bottom:89px;left:2%}.enemy .monster{background-position:0 33.333%;transform-origin:50% 85%}
.enemy{will-change:transform;transition:none}.enemy.e1 .monster{background-position:0 66.666%}.enemy.e2 .monster{background-position:0 100%}.enemy.e3 .monster{background-position:0 66.666%;filter:hue-rotate(55deg) saturate(1.35)}
.running .hero,.enemy .monster,.enemy.hit,.defeated .enemy,.defeated.effect-4 .enemy,.defeated.effect-12 .enemy{animation:none!important}
.enemy.combat-hit .monster{filter:brightness(1.65) drop-shadow(0 0 8px #fff0a7)}
.enemy.e3.combat-hit .monster{filter:hue-rotate(55deg) brightness(1.6)}
.enemy .armor{z-index:2}.enemy.focus-target .armor{border-color:#087c78;box-shadow:0 0 0 3px #8af7e773}
#beam,#bullets{display:none}#proof{background:#123d39f7}
.reduce #combatFx{display:block!important}.reduce .hero.sprite,.reduce .enemy .monster{animation:none!important}
@media(max-width:700px){.tools{max-width:205px}.tools #motion{font-size:10px}.motion-note{font-size:11px}.hero.sprite{width:112px;height:112px;bottom:59px;left:-4%}.enemy{width:72px}.enemy .monster{width:76px;height:88px}}

@media(max-width:700px){.hero.sprite{left:-1%}}
/* v1.2.0: one backdrop, independent continuous floor, calibrated foot anchors. */
.arena{height:520px;--ground-y:426px}.scroll-bg{inset:-6%;background-repeat:no-repeat;background-size:cover;background-position:center 35%;animation:none!important;will-change:transform}
.battle-ground{position:absolute;left:0;right:0;top:calc(var(--ground-y) - 28px);bottom:0;z-index:1;background:#68756a;box-shadow:0 -3px 0 #d6ddad,0 -7px 18px #314e3b55}
.ground-road{position:absolute;inset:0 0 auto;height:62px;background-color:#b7ab8f;background-image:repeating-linear-gradient(100deg,transparent 0 104px,#7b8069 105px 108px,#eee2bf 109px 112px),linear-gradient(0deg,#4d675b 0 3px,#d6c9a7 4px 6px,transparent 7px 31px,#867f69 32px 34px,#d7c8a6 35px 37px,transparent 38px);background-size:112px 62px;box-shadow:inset 0 7px 10px #eee6bb66,inset 0 -7px 0 #647467}
.ground-wall{position:absolute;top:62px;bottom:0;left:0;right:0;background-color:#526b60;background-image:repeating-linear-gradient(95deg,transparent 0 137px,#324c45 139px 143px,#728577 144px 146px),repeating-linear-gradient(0deg,transparent 0 43px,#304e43 45px 48px,#80917b 49px 52px);background-size:146px 52px;box-shadow:inset 0 8px 16px #183c3266}
.battle-ground:after{content:'';position:absolute;left:0;right:0;top:60px;height:4px;background:linear-gradient(90deg,#90c8a5,#d8dcb2,#90c8a5);opacity:.8}
.hero{width:170px!important;height:170px;left:2%!important;bottom:94px;transform-origin:50% 100%;z-index:4}.heroArt{position:absolute;inset:0;background-image:url('combat_actions.png');background-size:400% 400%;background-repeat:no-repeat;will-change:translate,background-position}
.enemy{height:135px;bottom:94px;transform-origin:50% 100%;z-index:3}.enemy.e2{bottom:134px}.enemy .monster{height:135px;position:absolute;inset:0;will-change:translate,background-position}.enemy .armor{top:0}
.actor-shadow{position:absolute;left:20%;width:60%;height:9px;border-radius:50%;bottom:-3px;background:#143d35;opacity:.28;filter:blur(2px);pointer-events:none;z-index:-1}.enemy.e2 .actor-shadow{width:45%;left:28%;opacity:.18}
#proof{top:141px;padding:9px 15px}#factors{min-height:58px;padding:8px 0}#proofResult{font-size:12px}#repair{bottom:40px}
#ultimateBanner{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:8;white-space:nowrap;font-size:13px;font-weight:800;letter-spacing:1px;padding:5px 18px;border:1px solid #e2c77e;border-radius:20px;background:#153e36ee;color:#fff0b8}
.enemy.armor-broken .armor{border-color:#efc56c;background:#fff0bd;transform:translateX(-50%) rotate(-8deg)}
@media(max-width:700px){.arena{height:500px;--ground-y:410px}.hero{width:108px!important;height:108px;left:0!important}.enemy{width:72px;height:88px}.enemy .monster{width:76px;height:88px}.enemy .armor{top:-8px}#proof{left:3%;right:3%;top:136px;padding:8px 10px}#factors{min-height:52px}#proofResult{font-size:11px}#ultimateBanner{font-size:10px;letter-spacing:0;padding:5px 10px;max-width:95%;white-space:normal;text-align:center}.actor-shadow{height:6px}}
/* A clipped battlefield is not an inner scroll container when targets are clicked. */
.arena{overflow:clip}
/* Starport supply curriculum and visual system. */
:root{--ink:#183c58;--muted:#5c7b8f;--paper:#edf6fb;--teal:#087b98;--gold:#e6a52b;--line:#c5dce8}.intro{background:#dceef7}.intro p{color:#42677e}h1 span{color:#557d94}.dashboard,.command{background:#fff}.choices button{background:#f0f8fc;border-color:#bfd9e8}.arena{background:#b5d8f6}.atmosphere{background:linear-gradient(#14476a35,transparent 35%,transparent)}.zone #chapter{background:#1b5779ed}.heroArt,.enemy .monster{background-size:400% 500%}.armor{font-size:14px;padding:4px 7px;min-width:94px;border-color:#dcb35e;background:#fffbee}.ground-road{background-color:#d4e6ed;background-image:repeating-linear-gradient(90deg,transparent 0 103px,#91adbd 104px 107px,#effaff 108px 112px),linear-gradient(0deg,#6d9eb4 0 3px,#f7d175 4px 6px,transparent 7px 30px,#9eb9c6 31px 34px,#f4fcff 35px 37px,transparent 38px);box-shadow:inset 0 7px 10px #f6ffff99,inset 0 -7px 0 #7699ab}.ground-wall{background-color:#7198af;background-image:repeating-linear-gradient(90deg,transparent 0 137px,#456a83 139px 143px,#b0d5df 144px 146px),repeating-linear-gradient(0deg,transparent 0 43px,#3c6c88 45px 48px,#98c6d8 49px 52px)}.battle-ground:after{background:#f7d071}.wave-tracker{display:flex;align-items:center;justify-content:space-between;padding:9px 20px;background:#dbeef7;border:1px solid var(--line);font-size:12px}#waveModules{display:flex;gap:6px}#waveModules i{width:18px;height:16px;border:2px solid #8caebe;border-radius:3px;background:#c3d9e3}#waveModules .filled{background:#f6c64a;border-color:#b67b16}.milestone{background:#e0edf5}.milestone.done{background:#c7eef1;color:#085e75}.motion-note{color:#416d88}#proof{top:145px;left:19%;right:3%;background:#143f5cf5;border-color:#82d8ed;padding:10px 14px}#factors{display:flex;flex-direction:column;gap:5px;padding:7px 0;min-height:90px}#proofTitle{font-size:12px;color:#b9ecff}#proofResult{font-size:12px}.cargo-box{border:1px solid #77cfdf;border-radius:6px;padding:5px;background:#24647d;min-width:36px}.cargo-box b{display:block;font-size:10px;text-align:center;line-height:1.4;color:#f2fbff}.cargo-units{display:flex;flex-wrap:wrap;justify-content:center;gap:3px;max-width:450px;margin:5px auto 0}.cargo-unit{display:block;width:8px;height:8px;border-radius:2px;background:#83f7ef;box-shadow:inset -2px -2px 0 #23b6b6}.crate-row{display:flex;gap:5px;justify-content:center;align-items:flex-start;width:100%}.crate-row .cargo-box{flex:1;max-width:150px}.crate-row .cargo-units{gap:2px}.crate-row .cargo-unit{width:7px;height:7px}.cargo-box.inventory{max-width:90%;padding:10px}.cargo-box.reserve{width:100%;background:#776024;border:2px solid #eac35b}.cargo-box.reserve .cargo-unit{background:#ffe488;box-shadow:inset -2px -2px 0 #c69b34}.cargo-box.loose{width:100%;background:#214d67}.batch-stored{font-size:11px;color:#b4f5ed;background:#1c6c75;padding:2px 10px;border-radius:5px}.packing-count{font-size:12px;color:#c8f7fa}.math-check{color:#ffe99c;font-size:12px;text-align:center}.packing-animate .cargo-unit{animation:loadCargo .5s both;animation-delay:var(--delay)}@keyframes loadCargo{from{transform:translate(-40px,-14px);opacity:0}to{transform:none;opacity:1}}.reduce .cargo-unit{animation:none}#repair i{background:#97c5e2;border-color:#ffdf8b;box-shadow:inset 0 0 8px #defbff}#repair.connect i{background:#8ee7fa;box-shadow:0 0 12px #90efff}#repair.supply-drop{width:70px;height:60px;right:14%;bottom:80px}#repair.supply-drop i{display:none}#repair.supply-drop i:first-child{display:block;width:56px;height:50px;border:4px solid #f9d87c;background:#36a7c7;transform:translateY(-30px)}#repair.supply-drop.connect i:first-child{transform:none}
/* Twelve distinct structures: assembly then functional motion. */
#repair.effect-1 i:nth-child(1),#repair.effect-1 i:nth-child(6){height:100px;width:24px}#repair.effect-1 i:nth-child(2),#repair.effect-1 i:nth-child(3),#repair.effect-1 i:nth-child(4),#repair.effect-1 i:nth-child(5){bottom:85px;height:18px}#repair.effect-1.connect i:nth-child(3){bottom:40px;height:60px;width:9px}
#repair.effect-2 i{height:30px;bottom:0;border-radius:50%;transform:translateX(-70px)}#repair.effect-2 i:nth-child(6){width:230px;height:14px;left:0;bottom:31px;border-radius:3px}#repair.effect-2.connect i:nth-child(-n+5){animation:wheelSpin 1s linear infinite}
#repair.effect-3 i{width:24px;height:75px;border-radius:7px;bottom:0;transform:rotate(-65deg);transform-origin:bottom}#repair.effect-3 i:nth-child(n+4){transform:rotate(65deg)}#repair.effect-3.build i{transform:rotate(-20deg)}#repair.effect-3.build i:nth-child(n+4){transform:rotate(20deg)}#repair.effect-3.connect i{transform:rotate(-40deg)}#repair.effect-3.connect i:nth-child(n+4){transform:rotate(40deg)}
#repair.effect-4 i{bottom:0;height:100px;transform:translateY(110px)}#repair.effect-4.build i{opacity:1;transform:none}#repair.effect-4.connect i:nth-child(3),#repair.effect-4.connect i:nth-child(4){transform:translateY(-85px)}
#repair.effect-5.build{animation:none}#repair.effect-5 i{border-radius:3px;height:15px;bottom:18px}#repair.effect-5 i:nth-child(5),#repair.effect-5 i:nth-child(6){left:0;width:230px;height:8px;bottom:38px}#repair.effect-5 i:nth-child(6){bottom:0}#repair.effect-5.connect:after{content:'';position:absolute;bottom:40px;width:50px;height:25px;border-radius:5px;background:#fff2ae;animation:railCar 1.8s infinite}
#repair.effect-6 i{width:24px;height:120px;opacity:0;transform:translateY(100px)}#repair.effect-6.build i{opacity:1;transform:none}#repair.effect-6 i:nth-child(n+3){height:10px;bottom:10px;width:45px}#repair.effect-6.connect i:nth-child(n+3){transform:translateY(-80px)}
#repair.effect-7 i{width:45px;height:90px;bottom:0;border-radius:50%;transform:scale(.1)}#repair.effect-7.build i{transform:none}#repair.effect-7.connect:after{content:'';position:absolute;inset:-20px;border:5px solid #9af8ff;border-radius:50%;background:#7ce9ff33}
#repair.effect-8 i{width:35px;height:55px;bottom:20px;transform:rotateX(90deg);background:#336aaf}#repair.effect-8.build i{transform:rotateX(0)}#repair.effect-8.connect i{background:repeating-linear-gradient(0deg,#458bc9 0 9px,#a5ddf9 10px 12px)}
#repair.effect-9 i{width:34px;height:70px;border-radius:50%;bottom:30px;transform:translateY(-90px)}#repair.effect-9 i:nth-child(even){background:#afcfe6}#repair.effect-9.build i{transform:none}#repair.effect-9.connect{animation:dishSweep 2s ease-in-out infinite alternate;transform-origin:50% 100%}
#repair.effect-10 i{height:110px;bottom:0;transform:scaleY(.1)}#repair.effect-10.build i{transform:scaleY(1)}#repair.effect-10.connect i:nth-child(-n+3){transform:translateX(-65px)}#repair.effect-10.connect i:nth-child(n+4){transform:translateX(65px)}
#repair.effect-11.connect{background-image:url('combat_actions.png');background-size:400% 500%;background-position:100% 100%;width:170px;height:170px}#repair.effect-11.connect i{display:none}
#repair.effect-12 i{height:25px;bottom:0;transform:translateY(100px)}#repair.effect-12.build i{transform:none}#repair.effect-12 i:nth-child(3),#repair.effect-12 i:nth-child(4){height:95px;border-radius:40% 40% 5px 5px;bottom:25px}#repair.effect-12.connect i:nth-child(3),#repair.effect-12.connect i:nth-child(4){animation:launchRocket 1.5s forwards}
@keyframes wheelSpin{to{transform:rotate(360deg)}}@keyframes railCar{from{left:0}to{left:180px}}@keyframes dishSweep{from{rotate:-8deg}to{rotate:8deg}}@keyframes launchRocket{to{transform:translateY(-160px);opacity:.1}}
.reduce #repair,.reduce #repair:after,.reduce #repair i{animation:none!important;transition:none!important}.reduce #repair.effect-12.connect i:nth-child(3),.reduce #repair.effect-12.connect i:nth-child(4){transform:translateY(-100px)}
@media(max-width:700px){.armor{font-size:10px;min-width:65px;white-space:normal;line-height:1.35;top:-15px;padding:3px}#formula{font-size:21px}#weapon{max-width:96%;width:95%;padding:7px}.arena{height:540px}#proof{top:140px;left:3%;right:3%;padding:8px}.proof-title{font-size:10px}#proofResult{font-size:11px}.crate-row .cargo-unit{width:6px;height:6px}.cargo-units{gap:2px}.cargo-unit{width:7px;height:7px}.cargo-box b{font-size:9px}.math-check{font-size:11px}.batch-stored{font-size:10px}.wave-tracker{padding:8px 12px;font-size:11px}#repair.effect-11.connect{width:150px;height:150px}}

.mini-facility{position:absolute;width:230px;height:125px;right:6%;bottom:55px;z-index:6;display:none}.mini-facility i{position:absolute;display:block;transition:transform .9s cubic-bezier(.2,.8,.2,1),opacity .9s,background .5s;opacity:0;background:#386c62;border:3px solid #d8bd77;box-shadow:inset 0 0 10px #84e4c7;border-radius:5px;width:36px;height:32px;bottom:0;transform:translateY(-90px) rotate(30deg)}.mini-facility i:nth-child(2){left:38px}.mini-facility i:nth-child(3){left:76px}.mini-facility i:nth-child(4){left:114px}.mini-facility i:nth-child(5){left:152px}.mini-facility i:nth-child(6){left:190px}.mini-facility.active{display:block}.mini-facility.build i{opacity:1;transform:none}.mini-facility.connect i{background:#4ed5b3;box-shadow:0 0 15px #76ffdc}.mini-facility.effect-2 i{height:16px;bottom:10px;transform:translateX(-190px)}.mini-facility.effect-2.build i{transform:none}.mini-facility.effect-3 i{height:70px;width:25px;border-radius:50%;bottom:0;transform:rotateY(90deg)}.mini-facility.effect-3.build i{transform:rotateY(0)}.mini-facility.effect-4 i{bottom:70px;background:#a2aaa1;transform:translateY(0)}.mini-facility.effect-4.build i{opacity:.7;transform:translateY(80px) rotate(65deg)}.mini-facility.effect-5 i{border-radius:50%;height:36px;bottom:12px}.mini-facility.effect-5.build{animation:transport 1s forwards}.mini-facility.effect-6 i{height:110px;width:34px;bottom:0;transform:translateX(0);opacity:1}.mini-facility.effect-6.build i{transform:translateX(230px)}.mini-facility.effect-7 i{height:30px;bottom:25px;transform:translateY(90px)}.mini-facility.effect-7 i:nth-child(n+3){height:15px;bottom:60px}.mini-facility.effect-7.build i{transform:none}.mini-facility.effect-8 i{height:22px;bottom:40px;transform:rotate(-70deg)}.mini-facility.effect-8.build i{transform:rotate(0)}.mini-facility.effect-9 i{border-radius:50%;height:46px;width:32px;bottom:35px;transform:translateY(-80px)}.mini-facility.effect-9 i:nth-child(even){background:#bb8b40}.mini-facility.effect-9.build i{transform:none}.mini-facility.effect-10 i{height:80px;width:36px;transform:scaleY(.1);transform-origin:bottom}.mini-facility.effect-10.build i{transform:scaleY(1)}.mini-facility.effect-11 i{height:50px;width:34px;bottom:20px;transform:rotate(-90deg) translateY(80px)}.mini-facility.effect-11 i:nth-child(3),.mini-facility.effect-11 i:nth-child(4){height:90px}.mini-facility.effect-11.build i{transform:none}.mini-facility.effect-12 i{height:60px;transform:translateY(100px);bottom:0}.mini-facility.effect-12 i:nth-child(3),.mini-facility.effect-12 i:nth-child(4){height:115px}.mini-facility.effect-12.build i{transform:none}
/* Twelve distinct structures: assembly then functional motion. */
.mini-facility.effect-1 i:nth-child(1),.mini-facility.effect-1 i:nth-child(6){height:100px;width:24px}.mini-facility.effect-1 i:nth-child(2),.mini-facility.effect-1 i:nth-child(3),.mini-facility.effect-1 i:nth-child(4),.mini-facility.effect-1 i:nth-child(5){bottom:85px;height:18px}.mini-facility.effect-1.connect i:nth-child(3){bottom:40px;height:60px;width:9px}
.mini-facility.effect-2 i{height:30px;bottom:0;border-radius:50%;transform:translateX(-70px)}.mini-facility.effect-2 i:nth-child(6){width:230px;height:14px;left:0;bottom:31px;border-radius:3px}.mini-facility.effect-2.connect i:nth-child(-n+5){animation:wheelSpin 1s linear infinite}
.mini-facility.effect-3 i{width:24px;height:75px;border-radius:7px;bottom:0;transform:rotate(-65deg);transform-origin:bottom}.mini-facility.effect-3 i:nth-child(n+4){transform:rotate(65deg)}.mini-facility.effect-3.build i{transform:rotate(-20deg)}.mini-facility.effect-3.build i:nth-child(n+4){transform:rotate(20deg)}.mini-facility.effect-3.connect i{transform:rotate(-40deg)}.mini-facility.effect-3.connect i:nth-child(n+4){transform:rotate(40deg)}
.mini-facility.effect-4 i{bottom:0;height:100px;transform:translateY(110px)}.mini-facility.effect-4.build i{opacity:1;transform:none}.mini-facility.effect-4.connect i:nth-child(3),.mini-facility.effect-4.connect i:nth-child(4){transform:translateY(-85px)}
.mini-facility.effect-5.build{animation:none}.mini-facility.effect-5 i{border-radius:3px;height:15px;bottom:18px}.mini-facility.effect-5 i:nth-child(5),.mini-facility.effect-5 i:nth-child(6){left:0;width:230px;height:8px;bottom:38px}.mini-facility.effect-5 i:nth-child(6){bottom:0}.mini-facility.effect-5.connect:after{content:'';position:absolute;bottom:40px;width:50px;height:25px;border-radius:5px;background:#fff2ae;animation:railCar 1.8s infinite}
.mini-facility.effect-6 i{width:24px;height:120px;opacity:0;transform:translateY(100px)}.mini-facility.effect-6.build i{opacity:1;transform:none}.mini-facility.effect-6 i:nth-child(n+3){height:10px;bottom:10px;width:45px}.mini-facility.effect-6.connect i:nth-child(n+3){transform:translateY(-80px)}
.mini-facility.effect-7 i{width:45px;height:90px;bottom:0;border-radius:50%;transform:scale(.1)}.mini-facility.effect-7.build i{transform:none}.mini-facility.effect-7.connect:after{content:'';position:absolute;inset:-20px;border:5px solid #9af8ff;border-radius:50%;background:#7ce9ff33}
.mini-facility.effect-8 i{width:35px;height:55px;bottom:20px;transform:rotateX(90deg);background:#336aaf}.mini-facility.effect-8.build i{transform:rotateX(0)}.mini-facility.effect-8.connect i{background:repeating-linear-gradient(0deg,#458bc9 0 9px,#a5ddf9 10px 12px)}
.mini-facility.effect-9 i{width:34px;height:70px;border-radius:50%;bottom:30px;transform:translateY(-90px)}.mini-facility.effect-9 i:nth-child(even){background:#afcfe6}.mini-facility.effect-9.build i{transform:none}.mini-facility.effect-9.connect{animation:dishSweep 2s ease-in-out infinite alternate;transform-origin:50% 100%}
.mini-facility.effect-10 i{height:110px;bottom:0;transform:scaleY(.1)}.mini-facility.effect-10.build i{transform:scaleY(1)}.mini-facility.effect-10.connect i:nth-child(-n+3){transform:translateX(-65px)}.mini-facility.effect-10.connect i:nth-child(n+4){transform:translateX(65px)}
.mini-facility.effect-11.connect{background-image:url('combat_actions.png');background-size:400% 500%;background-position:100% 100%;width:170px;height:170px}.mini-facility.effect-11.connect i{display:none}
.mini-facility.effect-12 i{height:25px;bottom:0;transform:translateY(100px)}.mini-facility.effect-12.build i{transform:none}.mini-facility.effect-12 i:nth-child(3),.mini-facility.effect-12 i:nth-child(4){height:95px;border-radius:40% 40% 5px 5px;bottom:25px}.mini-facility.effect-12.connect i:nth-child(3),.mini-facility.effect-12.connect i:nth-child(4){animation:launchRocket 1.5s forwards}

.milestone .mini-facility{display:none!important}.milestone.done b{visibility:hidden}.milestone.done .mini-facility{display:block!important;position:absolute;top:0;left:50%;right:auto;bottom:auto;margin-left:-115px;transform:scale(.25);transform-origin:50% 0;width:230px;height:125px;pointer-events:none}.milestone.done .mini-facility.effect-11{background-image:url("combat_actions.png");background-size:400% 500%;background-position:100% 100%}.milestone .mini-facility i,.milestone .mini-facility:after,.milestone .mini-facility{animation:none!important;transition:none!important}.milestone small{position:absolute;bottom:5px;left:0;right:0;font-size:9px}.armor{max-width:140px;white-space:normal;line-height:1.4}.dashboard span:first-child b{font-size:18px}#proof{max-height:calc(var(--ground-y) - 140px);overflow:auto;scrollbar-width:thin}.proof-title{flex-shrink:0}@media(max-width:700px){.armor{max-width:74px}.dashboard span:first-child b{font-size:13px}.dashboard{grid-template-columns:1.4fr .8fr 1fr .9fr}.crate-row{gap:3px}.cargo-box{padding:3px}.milestone.done .mini-facility{transform:scale(.23)}}

@media(max-width:700px){.hero{width:86px!important;height:86px}.enemy{width:56px;height:64px}.enemy .monster{width:56px;height:64px}.enemy.e0{left:27%}.enemy.e1{left:45%}.enemy.e2{left:63%}.enemy.e3{left:81%}.armor{width:58px;min-width:58px;max-width:58px;font-size:9px;padding:3px 1px}}

/* v1.0.1: short normal-wave delivery; sixth-wave facilities keep their full construction. */
#repair.supply-drop i{transition:transform .12s ease,opacity .12s,background .12s}.packing-animate .cargo-unit{animation-duration:.3s;animation-delay:0ms}
