/* Arrowcalypse UI: chunky toy controls, as few words as possible, nothing in the way of the castles. */
:root{font-family:ui-rounded,'Arial Rounded MT Bold','Trebuchet MS',Arial,sans-serif;color:#2f5479;background:#bde7f3;font-synthesis:none;
 --ink:#2f5479;--soft:#5f7f99;--panel:#f4fcffee;--rim:#bfe9fb;--blue:#32acef;--gold:#ffc83d;
 --safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
button,select,input{font:inherit}
[hidden]{display:none!important}
#game{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
.ui-icon{display:block;width:24px;height:24px}

/* ---------- Buttons ---------- */
button{--top:#7fdcff;--face:#32acef;--base:#1766ba;--edge:#134f86;position:relative;cursor:pointer;border:0;border-radius:18px;background:linear-gradient(180deg,var(--top),var(--face) 55%);color:#fff;padding:12px 18px;font-size:15px;font-weight:900;letter-spacing:.2px;
 box-shadow:inset 0 2px 0 #ffffff60,0 4px 0 var(--base),0 6px 10px #1e4a7030;text-shadow:0 1px 0 #1b578e66;transition:translate .1s,filter .12s,box-shadow .1s;touch-action:manipulation}
button:hover:not(:disabled){filter:brightness(1.06)}
button:active:not(:disabled){translate:0 3px;box-shadow:inset 0 2px 0 #ffffff60,0 1px 0 var(--base),0 2px 4px #1e4a7030}
button:disabled{filter:grayscale(.75) brightness(1.05);opacity:.6;cursor:not-allowed}
button:focus-visible{outline:3px solid #ffd34e;outline-offset:3px}
button.primary{--top:#ffe27a;--face:#ffb928;--base:#d27c12;--edge:#9c5a0b;color:#fff;text-shadow:0 2px 0 #b76a0d}
button.danger{--top:#ffb3ab;--face:#f5736c;--base:#c4455a;--edge:#8f334a}
.round{display:grid;place-items:center;width:46px;height:46px;padding:0;border-radius:50%}
.pill{display:flex;align-items:center;gap:10px;padding:8px 16px 8px 10px;border-radius:24px}
.pill .txt,.meter .txt{display:flex;flex-direction:column;align-items:flex-start;line-height:1.1;text-align:left}
.pill small{font-size:10px;letter-spacing:.8px;opacity:.85}
.pill b{font-size:15px}
.ico{display:grid;place-items:center;flex:none}

/* ---------- Top bar ---------- */
#topbar{position:fixed;left:0;right:0;top:0;z-index:10;display:flex;align-items:center;gap:8px;padding:calc(10px + var(--safe-t)) 12px 0;pointer-events:none;transition:opacity .4s,translate .4s}
#topbar>*{pointer-events:auto}
#topbar .spacer{flex:1;pointer-events:none}
.coin{display:flex;align-items:center;gap:6px;height:40px;padding:0 14px 0 8px;border-radius:22px;background:linear-gradient(#fff6c8,#ffe07a);box-shadow:inset 0 2px 0 #fff,0 3px 0 #d6a33a;color:#8a5a12;font-size:17px;font-weight:1000}
.coin .ui-icon{width:28px;height:28px;filter:drop-shadow(0 1px 0 #b8730f66)}
.coin.bump{animation:coinbump .35s cubic-bezier(.2,.9,.3,1.4)}
@keyframes coinbump{40%{transform:scale(1.18)}}
#upgradeQuick{--top:#d4b5ff;--face:#9a6ee6;--base:#6b45b3;--edge:#4c3185}
#upgradeQuick{gap:6px;padding:8px 14px 8px 10px;height:46px}
#upgradeQuick .ui-icon{width:22px;height:22px}
#upgradeQuick .txt{font-size:14px;letter-spacing:.3px}
#upgradeQuick .badge{position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;padding:0 5px;border-radius:11px;background:#ff5b6e;border:3px solid #fff;color:#fff;font:1000 11px/16px ui-rounded,Arial,sans-serif;font-style:normal;text-align:center;text-shadow:none;animation:badge 1.2s ease-in-out infinite}
#sound{--top:#ffffff;--face:#e6f7ff;--base:#9fc8df;--edge:#79a7c2}
#sound.muted .ui-icon{opacity:.55}
@keyframes badge{50%{scale:1.25}}
#menu{--top:#ffffff;--face:#e3f6ff;--base:#9fc8df;--edge:#79a7c2}
#menu .ui-icon path,#menu .ui-icon rect{fill:#4f8fbd}
body[data-mode="battle"] #upgradeQuick,body[data-mode="battle"] #sound{display:none}
body.cinematic #topbar,body.cinematic #battlehud,body.cinematic #battlebar{opacity:0;translate:0 -12px;pointer-events:none}
body.cinematic #battlebar{translate:0 12px}

/* ---------- Workshop ---------- */
#buildhud{position:fixed;left:50%;top:calc(10px + var(--safe-t));translate:-50% 0;z-index:9;display:flex;gap:10px}
.meter{display:flex;align-items:center;gap:10px;height:56px;padding:0 16px 0 10px;border-radius:20px;background:var(--panel);border:3px solid var(--rim);box-shadow:0 4px 0 #8cc6e2,0 8px 18px #2a5c8020}
.meter .ui-icon{width:30px;height:30px}
.meter b{font-size:20px;font-weight:1000;color:var(--ink);white-space:nowrap}
.meter b small{font-size:12px;color:var(--soft);font-weight:900}
.meter>.txt>small{font-size:10px;color:var(--soft);font-weight:800;margin-top:3px;white-space:nowrap}
.meter .bar{display:block;width:118px;height:8px;margin-top:5px;border-radius:5px;background:#d9eef8;overflow:hidden}
.meter .bar i{display:block;height:100%;width:50%;border-radius:5px;background:linear-gradient(90deg,#5fc8f5,#3a9ae0);transition:width .25s}
#bricktray.empty{border-color:#ffb3a8;animation:inventorypulse .5s 2}
#bricktray.empty .bar i{background:linear-gradient(90deg,#ff9a7f,#ff6b6b)}
#bricktray.inventoryfull{animation:nope .35s}
#squadinventory.full{border-color:#bfeaa0}
#squadinventory.full>.txt>small{color:#4a8f2f}
@keyframes inventorypulse{50%{transform:scale(1.05)}}
@keyframes nope{0%,100%{translate:0}25%{translate:-6px}75%{translate:6px}}
#buildinstruction{position:fixed;left:50%;bottom:calc(104px + var(--safe-b));translate:-50% 0;z-index:8;display:flex;gap:8px;pointer-events:none}
.tip{display:flex;align-items:center;gap:7px;padding:6px 12px 6px 6px;border-radius:16px;background:#ffffffd9;color:var(--ink);font-size:12px;font-weight:900;white-space:nowrap;box-shadow:0 3px 0 #a8d3e8}
.key{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;font-style:normal;font-size:17px;line-height:1;color:#fff}
.key.add{background:#3fa7e0}.key.remove{background:#ef8a74}.key.crew{background:#78c95a;padding:2px}.key.crew .ui-icon{width:18px;height:18px}
#buildfeedback{position:fixed;z-index:9;padding:7px 12px;border-radius:12px;background:#fff;color:#b5523f;font-size:12px;font-weight:900;box-shadow:0 3px 0 #e5b3a6;pointer-events:none;white-space:nowrap}
#buildbar{position:fixed;left:50%;bottom:calc(16px + var(--safe-b));translate:-50% 0;z-index:9;display:flex;align-items:center;gap:12px;padding:10px;border-radius:30px;background:var(--panel);border:3px solid var(--rim);box-shadow:0 5px 0 #8cc6e2,0 12px 26px #2a5c8028}
#buildbar .history{display:flex;gap:8px}
#buildbar .round{width:52px;height:52px;--top:#ffffff;--face:#e6f7ff;--base:#9fc8df;--edge:#79a7c2}
#buildbar .round .ui-icon path{fill:#4f8fbd}
#blueprints{height:56px;white-space:nowrap;--top:#8fe4ff;--face:#3db8f2}
#blueprints .ui-icon{width:30px;height:30px}
#battle{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:210px;height:62px;padding:6px 26px;border-radius:24px}
#battle b{font-size:26px;letter-spacing:1px;line-height:1}
#battle small{font-size:11px;font-weight:900;opacity:.95;margin-top:3px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#battle:not(:disabled){animation:fightpulse 1.8s ease-in-out infinite}
@keyframes fightpulse{0%,100%{scale:1}50%{scale:1.035}}

/* ---------- Battle HUD ---------- */
#battlehud{position:fixed;left:50%;top:calc(10px + var(--safe-t));translate:-50% 0;z-index:9;width:min(760px,calc(100vw - 150px));display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:14px;pointer-events:none;transition:opacity .4s,translate .4s}
.team{display:flex;flex-direction:column;gap:5px;padding:8px 12px 10px;border-radius:18px;background:var(--panel);border:3px solid var(--rim);box-shadow:0 4px 0 #8cc6e2}
.team.red{border-color:#ffd3da;box-shadow:0 4px 0 #e6a3b1}
.team .who{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;font-weight:1000;letter-spacing:.6px;min-width:0}
.team .who>b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team.blue .who>b{color:#2d7fc4}.team.red .who>b{color:#c44b65}
.team strong{display:flex;align-items:center;gap:6px;font-size:15px;color:var(--ink)}
.heads{display:flex;flex-wrap:wrap;gap:2px;max-width:96px}
.heads .head{width:7px;height:7px;border-radius:50%;background:#3d8de0}
.heads.enemy .head{background:#e0566f}
.heads .head.down{background:#c8d6df}
.health{position:relative;height:14px;border-radius:8px;background:#29425c;overflow:hidden;box-shadow:inset 0 2px 0 #0003}
.health i,.health .chip{position:absolute;left:0;top:0;bottom:0;width:100%;border-radius:8px}
.health .chip{background:#fff;transition:width .6s .35s}
.team.blue .health i{background:linear-gradient(#7fd4ff,#2e9be6);transition:width .15s}
.team.red .health i{background:linear-gradient(#ff9fb0,#e04c69);transition:width .15s}
.team.red .health i,.team.red .health .chip{left:auto;right:0}
.team.hit{animation:hudhit .35s}
@keyframes hudhit{0%,100%{transform:none}25%{transform:translateX(-5px) rotate(-1deg)}55%{transform:translateX(4px) rotate(.8deg)}}
.level{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px}
/* Aim readout: sits still under the turn label while you drag. */
#aimchip{position:absolute;top:calc(100% + 8px);left:50%;translate:-50% -6px;display:flex;align-items:center;gap:10px;padding:6px 12px;border-radius:16px;background:#ffffffeb;box-shadow:0 3px 0 #a8d3e8,0 8px 20px #1d4a7022;opacity:0;scale:.92;transition:opacity .18s,scale .18s,translate .18s;white-space:nowrap}
#aimchip.on{opacity:1;scale:1;translate:-50% 0}
#aimchip .cell{display:flex;flex-direction:column;align-items:center;line-height:1}
#aimchip .cell>b{font-size:16px;font-weight:1000;color:#22324a;font-variant-numeric:tabular-nums}
#aimchip small{font-size:8.5px;font-weight:1000;letter-spacing:.6px;color:var(--soft);margin-top:3px}
#aimchip small b{color:#22324a;font-variant-numeric:tabular-nums}
#aimchip .pow .bar{display:block;width:74px;height:8px;margin-top:4px;border-radius:5px;background:#dcebf4;overflow:hidden}
#aimchip .pow .bar i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#57c3ff,#f5a524 62%,#ff6a3d);background-size:74px 100%}
#aimchip .vol{flex-direction:row;align-items:baseline;gap:4px;padding:3px 0 3px 10px;border-left:2px solid #e3eef5;transition:background .2s}
#aimchip .vol b{font-size:18px;font-weight:1000;color:#22324a}
#aimchip .vol small{margin:0}
#aimchip .vol.boost{padding:4px 9px;border-left:0;border-radius:11px;background:linear-gradient(#fff4b8,#ffd34e);box-shadow:0 2px 0 #d39b16}
#aimchip .vol .from{font-size:13px;font-weight:1000;color:#9a7420}
#aimchip .vol .arrow{font-size:12px;font-weight:1000;color:#c2500c}
#aimchip .vol.boost small{color:#8a5a0a}
#aimchip .vol.bump{animation:volbump .38s cubic-bezier(.3,1.7,.5,1)}
@keyframes volbump{0%{scale:1.3}100%{scale:1}}
#turnlabel{padding:7px 14px;border-radius:14px;background:linear-gradient(#7fdcff,#2f9fe6);color:#fff;font-size:13px;font-weight:1000;letter-spacing:.8px;white-space:nowrap;box-shadow:0 3px 0 #1766ba;text-shadow:0 1px 0 #1b578e66}
#battlehud.enemyturn #turnlabel{background:linear-gradient(#ffb0bd,#e65873);box-shadow:0 3px 0 #a93a55}
#wind{display:flex;align-items:center;gap:6px;padding:3px 9px;border-radius:10px;background:#ffffffcc;font-size:10px;font-weight:1000;color:var(--soft);letter-spacing:.5px}
#wind i{position:relative;width:26px;height:4px;border-radius:3px;background:#cfe3ee}
#wind i::after{content:'';position:absolute;top:-4px;left:50%;width:0;height:0;border:6px solid transparent;border-left-color:#3a9ae0;translate:calc(-2px + var(--dir,1)*calc(var(--wind,0)*10px)) 0;scale:var(--dir,1) 1}
#wind.calm i::after{display:none}
#battlebar{position:fixed;left:50%;bottom:calc(14px + var(--safe-b));translate:-50% 0;z-index:9;transition:opacity .4s,translate .4s}
.weapons{display:flex;gap:10px;padding:8px;border-radius:28px;background:var(--panel);border:3px solid var(--rim);box-shadow:0 5px 0 #8cc6e2,0 12px 26px #2a5c8028}
.weapons button{display:flex;align-items:center;gap:8px;min-width:176px;height:70px;white-space:nowrap;padding:6px 12px 6px 6px;border-radius:20px;text-align:left;--top:#ffffff;--face:#e8f6fd;--base:#a5c9dc;--edge:#7ea6bd;color:var(--ink);text-shadow:none}
.weapons img{width:68px;height:50px;object-fit:contain;flex:none;pointer-events:none}
.weapons span{display:flex;flex-direction:column;font-size:15px;line-height:1.1}
.weapons small{display:flex;align-items:center;font-size:9px;font-weight:1000;letter-spacing:.4px;color:var(--soft);margin-top:4px}
.weapons small .short{display:none;align-items:center;gap:2px}
.weapons small .ui-icon{width:12px;height:12px;flex:none}
.weapons button.active{--top:#d4ff9c;--face:#86d64a;--base:#4f9b2a;--edge:#3b7520;color:#fff;text-shadow:0 1px 0 #3f7d22;scale:1.04}
.weapons button.active small{color:#f3ffe3}
.weapons .charge{position:absolute;top:-9px;right:8px;padding:3px 8px;border-radius:10px;background:#5fca4a;color:#fff;font-size:9px;font-style:normal;font-weight:1000;letter-spacing:.5px;box-shadow:0 2px 0 #3b8a2c}
.weapons .charging{filter:grayscale(.7);opacity:.75}
.weapons .charging .charge{background:#8aa0b0;box-shadow:0 2px 0 #627888}
.weapons .recharged .charge{animation:recharged .5s cubic-bezier(.2,.9,.3,1.5)}
.weapons .nope{animation:nope .3s}
@keyframes recharged{0%{transform:scale(.4)}60%{transform:scale(1.4)}100%{transform:scale(1)}}

/* Drag-to-aim demo for new players */
#battlehint{position:fixed;left:50%;bottom:calc(112px + var(--safe-b));translate:-50% 0;z-index:8;display:flex;align-items:center;gap:12px;padding:10px 18px 10px 12px;border-radius:20px;background:#ffffffee;box-shadow:0 4px 0 #a8d3e8;pointer-events:none;animation:hintin .4s cubic-bezier(.2,.9,.3,1.3)}
#battlehint b{display:block;font-size:15px;color:var(--ink)}
#battlehint small{display:block;font-size:11px;color:var(--soft);font-weight:800;margin-top:2px}
#battlehint .hand{position:relative;width:40px;height:40px;flex:none}
#battlehint .hand::before{content:'';position:absolute;left:12px;top:12px;width:20px;height:20px;border-radius:50%;background:#ffd34e;border:3px solid #fff;box-shadow:0 2px 0 #d79a1c;animation:handdrag 1.6s ease-in-out infinite}
#battlehint .hand::after{content:'';position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;border:3px solid #3a9ae0;opacity:.6}
@keyframes handdrag{0%,12%{translate:-8px -8px;scale:1}45%{translate:8px 8px;scale:.9}70%{translate:8px 8px;scale:1.25;opacity:1}85%,100%{translate:-8px -8px;opacity:0}}
@keyframes hintin{0%{opacity:0;translate:-50% 14px}100%{opacity:1;translate:-50% 0}}

/* Volley juice: destruction combo and multiplied shell counter */
#combo{position:fixed;left:calc(18px + env(safe-area-inset-left,0px));top:calc(96px + var(--safe-t));z-index:7;display:flex;flex-direction:column;align-items:flex-start;pointer-events:none;opacity:0;scale:.6;transition:opacity .25s,scale .25s;--c:#fff4c2;--s:#2a4a63}
#combo.on{opacity:1;scale:1}
#combo small{font-size:18px;font-weight:1000;letter-spacing:1px;color:var(--c);-webkit-text-stroke:5px var(--s);paint-order:stroke fill}
#combo b{font-size:54px;font-weight:1000;line-height:1;color:#fff;-webkit-text-stroke:7px var(--s);paint-order:stroke fill;text-shadow:0 5px 0 #2a4a6340;font-variant-numeric:tabular-nums}
#combo span{font-size:13px;font-weight:1000;color:#fff;-webkit-text-stroke:4px var(--s);paint-order:stroke fill;min-height:16px}
#combo.bump b,#combo.bump small{animation:combobump .32s cubic-bezier(.2,.9,.3,1.5)}
#combo[data-tier="1"]{--c:#b8ffd6;--s:#1f6b4a}
#combo[data-tier="2"]{--c:#bfe3ff;--s:#1f4f8a}
#combo[data-tier="3"]{--c:#e3d0ff;--s:#55308f}
#combo[data-tier="4"]{--c:#ffd1a1;--s:#8f3d14}
#combo[data-tier="5"]{--c:#ffe46b;--s:#8c2340}
#combo[data-tier="5"] small{font-size:24px;animation:shake .12s infinite}
#combo.final b{animation:combofinal .5s cubic-bezier(.2,.9,.3,1.4)}
#combo.record span{color:#ffe46b;font-size:17px;animation:combobump .4s cubic-bezier(.2,.9,.3,1.5) 2}
@keyframes combobump{0%{scale:1.45}100%{scale:1}}
@keyframes combofinal{0%{scale:1}40%{scale:1.3}100%{scale:1.1}}
@keyframes shake{0%,100%{translate:0}50%{translate:2px -1px}}
#shellcount{position:fixed;left:50%;top:calc(92px + var(--safe-t));translate:-50% 0;z-index:7;display:flex;align-items:baseline;gap:8px;pointer-events:none;opacity:0;scale:.5;transition:opacity .2s,scale .25s}
#shellcount.on{opacity:1;scale:1}
#shellcount b{font-size:46px;font-weight:1000;color:#ffe46b;-webkit-text-stroke:7px #22324a;paint-order:stroke fill;font-variant-numeric:tabular-nums}
#shellcount small{font-size:16px;font-weight:1000;color:#fff;-webkit-text-stroke:5px #22324a;paint-order:stroke fill;letter-spacing:.5px}
#shellcount.bump b{animation:combobump .25s cubic-bezier(.2,.9,.3,1.6)}
.flycoin{position:fixed;left:0;top:0;width:28px;height:28px;margin:-14px 0 0 -14px;z-index:12;pointer-events:none;will-change:transform;filter:drop-shadow(0 2px 2px #7a4a0855)}
.flycoin .ui-icon{width:28px;height:28px}
#coinfly{position:fixed;inset:0;pointer-events:none;z-index:12}

/* ---------- Toasts, popups, banners ---------- */
#message{position:fixed;left:50%;bottom:calc(150px + var(--safe-b));translate:-50% 0;z-index:11;max-width:min(520px,90vw);padding:10px 16px;border-radius:16px;background:#22364aee;color:#fff;font-size:13px;font-weight:900;text-align:center;opacity:0;transition:opacity .25s;pointer-events:none}
#message:empty{display:none}
#popups{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:6}
.pop{position:absolute;transform:translate(-50%,-50%);font-weight:1000;white-space:nowrap;letter-spacing:-.5px;animation:popfloat 1.15s cubic-bezier(.2,.9,.3,1) forwards;font-size:22px;color:#fff;-webkit-text-stroke:5px #2a4a63;paint-order:stroke fill;text-shadow:0 4px 0 #2a4a6355}
.pop.word{color:#fff4c2;font-size:26px}
.pop.armor{color:#eef5fb;font-size:24px;-webkit-text-stroke-color:#3c5a78;letter-spacing:1px}
.pop.word.big{font-size:38px;color:#ffd34e;animation-duration:1.35s}
.pop.gold{color:#ffd34e;font-size:21px;-webkit-text-stroke-color:#7a5310;animation-name:goldfloat}
.pop.ko{font-size:42px;color:#ffe46b;-webkit-text-stroke:6px #8c2340;animation-duration:1.4s}
.pop.ko.streak{font-size:50px;color:#fff06b}
.pop.bad{color:#ffd1d8;-webkit-text-stroke-color:#a82645;font-size:20px}
.pop.dmg{color:#ff5b78;font-size:18px;-webkit-text-stroke-width:4px;-webkit-text-stroke-color:#fff;animation-name:dmgfloat;animation-duration:.8s}
.pop.dmg.burn{color:#ff8a2a}
.pop.miss{color:#eef6fa;-webkit-text-stroke-color:#56717f;font-size:19px;animation-duration:1.3s}
.pop.mult{font-size:36px;color:#fff;-webkit-text-stroke:6px #22324a;animation-duration:1.05s;letter-spacing:0}
.pop.mult.m2{color:#b8ffd6}.pop.mult.m3{color:#bfe3ff}.pop.mult.m4{color:#e3d0ff}.pop.mult.m5{color:#ffe08a;font-size:42px}
@keyframes popfloat{0%{transform:translate(-50%,-50%) scale(.2) rotate(var(--tilt));opacity:0}14%{transform:translate(-50%,-70%) scale(1.25) rotate(var(--tilt));opacity:1}26%{transform:translate(-50%,-75%) scale(1) rotate(var(--tilt))}75%{opacity:1}100%{transform:translate(-50%,-160%) scale(.95) rotate(var(--tilt));opacity:0}}
@keyframes goldfloat{0%{transform:translate(-50%,-50%) scale(.4);opacity:0}15%{transform:translate(-50%,-80%) scale(1.2);opacity:1}70%{opacity:1}100%{transform:translate(-50%,-220%) scale(.9);opacity:0}}
@keyframes dmgfloat{0%{transform:translate(-50%,-50%) scale(.5);opacity:0}20%{transform:translate(-30%,-90%) scale(1.15);opacity:1}100%{transform:translate(0%,-170%) scale(.9);opacity:0}}
.banner{position:absolute;left:50%;top:36%;transform:translate(-50%,-50%);max-width:min(620px,90vw);padding:16px 30px;border:4px solid #d8f6ff;border-radius:28px;background:linear-gradient(#79cffa,#3994dc);box-shadow:inset 0 4px 0 #fff8,0 7px 0 #2464b0,0 14px 30px #19497944;text-align:center;animation:banner 1.9s cubic-bezier(.2,.9,.3,1) forwards}
.banner b{display:block;font-size:clamp(30px,4.6vw,58px);line-height:1.08;letter-spacing:-1px;color:#fff;-webkit-text-stroke:5px #2466a3;paint-order:stroke fill;text-shadow:0 5px 0 #24588d44}
.banner small{display:inline-block;margin-top:9px;padding:7px 14px;border-radius:14px;background:#fff1ab;color:#8a611d;font-size:12px;font-weight:1000;letter-spacing:.5px}
.banner.turn{top:30%;animation-duration:1.4s}.banner.turn b{font-size:clamp(28px,4vw,48px)}
.banner.turn.enemy{background:linear-gradient(#ffb0bd,#e65873);border-color:#ffe3e9;box-shadow:inset 0 4px 0 #fff8,0 7px 0 #a93a55,0 14px 30px #19497944}.banner.turn.enemy b{-webkit-text-stroke-color:#a93a55}
.banner.win{background:linear-gradient(#b5ed77,#78c540);border-color:#e6ffb7;box-shadow:inset 0 4px 0 #fff8,0 7px 0 #4f8a2a,0 14px 30px #19497944}.banner.win b{color:#fff2b1;-webkit-text-stroke-color:#5b8a29;font-size:clamp(36px,6vw,74px)}
.banner.lose{background:linear-gradient(#fda8ba,#dd729b);border-color:#ffe3e9}.banner.lose b{-webkit-text-stroke-color:#a93a55}
.banner.rank{top:58%;background:linear-gradient(#ffe27a,#ffb928);border-color:#fff4c2;box-shadow:inset 0 4px 0 #fff8,0 7px 0 #d27c12,0 14px 30px #19497944;animation-duration:1.6s}.banner.rank b{font-size:clamp(24px,3.4vw,38px);-webkit-text-stroke-color:#b76a0d}.banner.rank small{background:#fff;color:#d48a0e;font-size:16px;letter-spacing:3px}
@keyframes banner{0%{transform:translate(-50%,-50%) scale(2.2);opacity:0}12%{transform:translate(-50%,-50%) scale(.94);opacity:1}20%{transform:translate(-50%,-50%) scale(1.04)}28%{transform:translate(-50%,-50%) scale(1)}82%{transform:translate(-50%,-50%) scale(1);opacity:1}100%{transform:translate(-50%,-62%) scale(.96);opacity:0}}
#flash{position:fixed;inset:0;pointer-events:none;background:radial-gradient(circle at 50% 45%,#fff8e0 0%,#ffe6a8aa 40%,transparent 75%);opacity:0;z-index:5}
#flash.on{animation:flash .32s ease-out}
@keyframes flash{0%{opacity:.75}100%{opacity:0}}
.confetti{position:fixed;top:-20px;width:10px;height:14px;border-radius:3px;z-index:50;pointer-events:none;animation:confetti 3s cubic-bezier(.3,.6,.5,1) forwards}
@keyframes confetti{0%{transform:translate(0,0) rotate(0)}100%{transform:translate(var(--dx),105vh) rotate(var(--r))}}
#journeywipe{position:fixed;inset:0;z-index:8;pointer-events:none;overflow:hidden}
#journeywipe i{position:absolute;left:-40vw;top:-40vh;width:180vw;height:180vh;border-radius:42%;background:radial-gradient(ellipse at 30% 25%,#ffffff24 0 13%,transparent 14%),radial-gradient(ellipse at 70% 70%,#0000000c 0 22%,transparent 23%),var(--wipe-colour,#81ba72);box-shadow:inset -45px -35px 0 #0000000b;will-change:transform}

/* Aiming band and per-commando health tags */
#elastic{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;display:none;z-index:7;--band:#168fc8}
#pullLine{stroke:var(--band);stroke-width:6;stroke-linecap:round;transition:stroke .15s}
#pullLine2{stroke:#fff;stroke-width:16;stroke-linecap:round;opacity:.55}
#pullAnchor{fill:#fff;stroke:var(--band);stroke-width:4}
#pullHandle{fill:#ffffffd0;stroke:var(--band);stroke-width:4;transition:stroke .15s}
#elastic.invalid #pullLine{stroke-dasharray:4 9}
#tags{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:4}
.hptag{position:absolute;left:0;top:0;width:var(--tw,40px);height:var(--th,8px);margin:calc(var(--th,8px)/-2) 0 0 calc(var(--tw,40px)/-2);border-radius:6px;background:#22364acc;border:1.5px solid #fff;overflow:hidden;box-shadow:0 2px 0 #2a4a6340;transition:opacity .12s;will-change:translate}
.hptag.enemy{border-color:#ffe3e9}
.hptag i{position:absolute;left:0;top:0;bottom:0;width:var(--hp,100%)}
.hptag .chip{background:#fff;transition:width .45s .35s}.hptag .fill{background:#4fd18b;transition:width .12s}
.hptag.mid .fill{background:#f5c044}.hptag.low .fill{background:#ff5b6e}
.hptag.hurt{animation:taghurt .4s cubic-bezier(.2,.9,.3,1.3)}.hptag.burning{border-color:#ffb04a;box-shadow:0 0 10px #ff8a2a}.hptag.dead,.hptag.full{opacity:0}.hptag.dead{transition:opacity .5s .4s}
@keyframes taghurt{0%{scale:1.45}100%{scale:1}}
.locktag{position:absolute;left:0;top:0;margin:-12px 0 0 -46px;width:92px;text-align:center;font-size:12px;font-weight:1000;letter-spacing:.6px;color:#ffd34e;-webkit-text-stroke:4px #7a5310;paint-order:stroke fill;opacity:0;transition:opacity .15s;scale:.8}
.locktag.on{opacity:1;animation:lockpulse .6s ease-in-out infinite alternate}
@keyframes lockpulse{from{scale:.92}to{scale:1.08}}

/* ---------- Dialogs ---------- */
dialog{border:4px solid #c6efff;background:linear-gradient(#fbfeff,#e3f6ff);border-radius:28px;padding:24px;max-width:440px;width:92vw;color:var(--ink);box-shadow:inset 0 2px 0 #fff,0 7px 0 #6fb2d8,0 24px 60px #163e6655;max-height:88dvh;overflow:auto}
dialog[open]{animation:dialogin .35s cubic-bezier(.2,.9,.3,1.3)}
dialog::backdrop{background:#17386370;backdrop-filter:blur(4px)}
@keyframes dialogin{0%{transform:scale(.7);opacity:0}100%{transform:scale(1);opacity:1}}
dialog h2{margin:0 0 16px;font-size:28px;line-height:1.15;color:#2b5e8c}
.eyebrow{display:block;margin:0 0 6px;font-size:11px;font-weight:1000;letter-spacing:1.6px;color:#4aa3dc}
.close{float:right;display:grid;place-items:center;width:40px;height:40px;padding:8px;border-radius:50%;margin:-8px -8px 0 8px;--top:#ffaba1;--face:#fa716c;--base:#c74759;--edge:#923b51}
.close .ui-icon{width:20px;height:20px}
.note{font-size:12px;color:var(--soft);line-height:1.5;margin:14px 0 0}
.menu-list{display:flex;flex-direction:column;gap:12px}
.menu-list button{display:flex;align-items:center;justify-content:center;gap:10px;height:54px;font-size:16px}
.menu-list button:not(.primary):not(.danger){--top:#ffffff;--face:#e6f7ff;--base:#9fc8df;--edge:#79a7c2;color:var(--ink);text-shadow:none}
.menu-list button small{font-size:11px;opacity:.85;margin-left:6px}
.menu-list .primary{height:60px;font-size:19px}
#sound.muted,#menusound.muted{opacity:.75}
#blueprintpanel{max-width:720px}
#blueprintlist{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.bp{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:8px 8px 12px;border-radius:22px;text-align:left;--top:#ffffff;--face:#f4fbff;--base:#b4d9ef;--edge:#8fbfdc;color:var(--ink);text-shadow:none}
.bp .art{position:relative;display:grid;place-items:end center;height:112px;padding:6px 6px 0;border-radius:16px;overflow:hidden;background:linear-gradient(#bfe6fb,#e9f7ff 70%,#cfeec0 70%,#b6e0a4)}
.bp .art svg{width:100%;height:100%}
.bp strong{font-size:16px;margin:6px 4px 0;color:#2b5e8c}
.bp small{font-size:11px;line-height:1.3;color:var(--soft);margin:0 4px;min-height:28px}
.bp .chips{display:flex;gap:6px;margin:2px 4px 0}
.bp .chips span{display:flex;align-items:center;gap:3px;height:22px;padding:0 8px 0 4px;border-radius:11px;background:#e6f4ff;font-size:12px;font-weight:1000;color:#2d6aa3}
.bp .chips .ui-icon{width:16px;height:16px}
.bp .tag{position:absolute;top:8px;left:8px;padding:2px 8px;border-radius:9px;background:#2f5479;color:#fff;font-size:9px;font-style:normal;font-weight:1000;letter-spacing:.6px}
.bp.inuse{--face:#eef8ff;outline:3px solid #6cc0f2;outline-offset:-3px}
.bp:hover:not(:disabled) .art svg{animation:bphop .5s cubic-bezier(.2,.9,.3,1.5)}
@keyframes bphop{40%{transform:translateY(-6px)}}
@media (max-width:420px){#blueprintlist{grid-template-columns:1fr 1fr;gap:10px}.bp .art{height:92px}.bp small{display:none}}

/* Expedition map */
.route-steps{display:flex;justify-content:center;align-items:center}
.route-step{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;gap:6px;min-width:0;font-size:9px;font-weight:1000;letter-spacing:.6px;color:#6a8ca2}
.route-step:not(:last-child):after{content:'';position:absolute;left:calc(50% + 17px);width:calc(100% - 34px);top:14px;height:3px;border-radius:3px;background:#aacfe6}
.route-step i{display:grid;place-items:center;width:30px;height:30px;border:2px solid #e3faff;border-radius:50%;background:linear-gradient(#badbef,#8db7d5);box-shadow:0 3px 0 #6698be;font-style:normal;font-size:13px;color:#fff}
.route-step.current{color:#bb7c18}.route-step.current i{background:linear-gradient(#fff188,#ffc43a);border-color:#fff6b7;box-shadow:0 3px 0 #d79527;color:#9c6117}
.route-step.done{color:#498633}.route-step.done i{background:linear-gradient(#b4ec76,#77bf43);border-color:#e4ffb9;box-shadow:0 3px 0 #508a31}
#journeypanel{max-width:900px;width:94vw}
#journeystory{font-size:14px;line-height:1.55;color:var(--soft);max-width:640px;margin:0}
#journeysteps{max-width:520px;margin:6px auto 12px}
.journey-rule{font-size:12px;line-height:1.5;color:var(--soft);padding:10px 14px;border-radius:14px;background:#ffffffb0;margin:0}
#journeyresume{padding:10px 14px;border-radius:12px;background:#fff0b6;color:#94632c;font-size:12px}
.journey-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
#endExpedition,#workshop{--top:#ffffff;--face:#e6f7ff;--base:#9fc8df;--edge:#79a7c2;color:var(--ink);text-shadow:none}

/* Battle result */
#result{text-align:center;overflow:visible}
#result h2{margin:4px 0 4px;font-size:34px}
.stars{display:flex;justify-content:center;gap:10px;margin:6px 0 2px}
.stars i{font-style:normal;font-size:52px;color:#dfe8ec;text-shadow:0 4px 0 #c5d3d9;transform:scale(0);animation:star .45s cubic-bezier(.2,.9,.3,1.6) forwards}
.stars i:nth-child(2){font-size:66px;margin-top:-12px;animation-delay:.35s}
.stars i:nth-child(1){animation-delay:.2s}.stars i:nth-child(3){animation-delay:.5s}
.stars.s1 i:nth-child(1),.stars.s2 i:nth-child(-n+2),.stars.s3 i{color:#ffcf3f;text-shadow:0 4px 0 #d79a1c,0 0 18px #ffd34e88}
@keyframes star{0%{transform:scale(0) rotate(-40deg)}100%{transform:scale(1) rotate(0)}}
#resultjourney{max-width:240px;margin:12px auto 16px}
.tally{display:flex;gap:10px;justify-content:center;margin:4px 0 12px}
.tally>span{display:flex;flex-direction:column;align-items:center;gap:2px;flex:1;padding:10px;border-radius:18px;background:#fff;border:3px solid #d4eef9}
.tally small{font-size:10px;font-weight:1000;letter-spacing:1px;color:var(--soft)}
.tally b{display:flex;align-items:center;gap:4px;font-size:26px;font-weight:1000;color:var(--ink);font-variant-numeric:tabular-nums}
.tally .reward{background:linear-gradient(#fff6c8,#ffe07a);border-color:#fff2ac;color:#8a5a12}
.tally .reward b{color:#8a5a12}
#resulttext{line-height:1.6;font-size:13px;color:var(--soft);margin:6px 0 18px}
.resultactions{display:flex;gap:12px}
.resultactions button{flex:1;height:56px;font-size:16px}
.resultactions .primary{flex:1.4;font-size:18px}

/* ---------- Phones ---------- */
@media (max-width:700px){
 .round{width:42px;height:42px}
 .pill{padding:6px 12px 6px 8px}
 #journey small{font-size:9px}#journey b{font-size:13px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .coin{height:36px;font-size:15px;padding:0 10px 0 6px}
 #buildhud{top:calc(62px + var(--safe-t));gap:8px;width:calc(100vw - 20px);justify-content:center}
 .meter{flex:1;height:52px;gap:8px;padding:0 10px 0 8px;min-width:0}
 .meter .ui-icon{width:26px;height:26px}
 .meter b{font-size:17px}.meter b small{font-size:11px}
 .meter .bar{width:100%}
 .meter>.txt{min-width:0;flex:1}
 .meter>.txt>small{white-space:normal;font-size:9px;line-height:1.2}
 #buildinstruction{bottom:calc(92px + var(--safe-b));flex-wrap:wrap;justify-content:center;width:96vw;gap:5px}
 .tip{font-size:11px}
 #buildbar{bottom:calc(10px + var(--safe-b));gap:8px;padding:8px;width:calc(100vw - 16px);justify-content:space-between}
 #buildbar .history{gap:6px}
 #buildbar .round{width:46px;height:46px}
 #blueprints{height:50px;padding:6px 10px}
 #blueprints small{display:none}
 #blueprints b{font-size:13px}
 #battle{min-width:0;flex:1;height:56px;padding:6px 10px}
 #battle b{font-size:21px}#battle small{font-size:10px;max-width:130px}
 #battlehud{top:calc(60px + var(--safe-t));width:calc(100vw - 16px);gap:8px}
 .team{padding:6px 8px 8px;border-radius:14px;gap:4px}
 .team .who{font-size:10px}
 .heads{display:none}
 .team strong{font-size:14px}
 .team strong::before{content:'';width:9px;height:9px;border-radius:50%;background:currentColor;opacity:.5}
 .health{height:11px}
 #turnlabel{font-size:11px;padding:6px 9px}
 #wind{font-size:9px;padding:2px 6px}
 #battlebar{bottom:calc(8px + var(--safe-b));width:calc(100vw - 16px)}
 .weapons{gap:6px;padding:6px;border-radius:22px}
 .weapons button{flex:1;min-width:0;width:auto;height:70px;flex-direction:column;justify-content:center;gap:0;padding:4px;text-align:center;border-radius:16px}
 .weapons img{width:56px;height:38px}
 .weapons span{font-size:11px;align-items:center}
 .weapons small{margin-top:2px;font-size:8.5px;letter-spacing:.2px}
 .weapons small .long{display:none}
 .weapons small .short{display:inline-flex}
 .weapons img{margin-top:-4px}
 .weapons .charge{right:4px;top:-8px;font-size:8px;padding:2px 6px}
 #battlehint{bottom:calc(98px + var(--safe-b));padding:8px 14px 8px 10px;max-width:calc(100vw - 24px)}
 #battlehint b{font-size:13px;white-space:nowrap}#battlehint small{display:none}
 #combo{top:calc(126px + var(--safe-t));left:10px}
 #combo b{font-size:40px;-webkit-text-stroke-width:6px}
 #combo small{font-size:14px}
 #shellcount{top:calc(128px + var(--safe-t));left:auto;right:10px;translate:none;flex-direction:column;align-items:flex-end;gap:0}
 #shellcount b{font-size:36px}
 #message{bottom:calc(160px + var(--safe-b))}
 dialog{padding:18px 16px;border-radius:24px}
 dialog h2{font-size:23px}
 .journey-actions{position:sticky;bottom:-18px;background:#e3f6ff;padding:12px 0 14px;margin-top:10px}
 .journey-actions button{font-size:13px;padding:10px 12px;min-height:46px}
 #blueprintlist{grid-template-columns:repeat(2,1fr)}
 .banner{padding:12px 18px;border-width:3px}
 .banner b,.banner.turn b{font-size:28px}.banner.win b{font-size:38px}.banner small{font-size:10px}
}
@media (max-width:380px){#journey .txt b{display:none}#journey .txt small{font-size:8.5px;letter-spacing:.3px;white-space:nowrap}#journey{gap:6px;padding:5px 9px 5px 6px}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* ---------- Upgrades ---------- */
#perks{display:flex;gap:4px;flex-wrap:wrap}
#perks:empty{display:none}
.perk{display:flex;align-items:center;gap:2px;height:18px;padding:0 6px 0 2px;border-radius:9px;background:#e6f4ff;color:#2d6aa3;font-size:11px;font-weight:1000;box-shadow:inset 0 -2px 0 #c3def2}
.perk .ui-icon{width:15px;height:15px}
#upgradepanel{max-width:480px}
.purse{display:flex;align-items:center;gap:8px;width:max-content;margin:-4px 0 14px;padding:6px 14px 6px 8px;border-radius:20px;background:linear-gradient(#fff6c8,#ffe07a);box-shadow:inset 0 2px 0 #fff,0 3px 0 #d6a33a;color:#8a5a12}
.purse .ui-icon{width:26px;height:26px}.purse b{font-size:20px}.purse small{font-size:11px;font-weight:900;opacity:.8}
.purse b.bump{animation:coinbump .35s cubic-bezier(.2,.9,.3,1.4)}
#upgradelist{display:flex;flex-direction:column;gap:12px}
.upg{position:relative;display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:12px;padding:12px;border-radius:22px;background:#fff;border:3px solid #d7efff;box-shadow:0 4px 0 #b4d9ef}
.upg .art{position:relative;display:grid;place-items:center;width:64px;height:64px;border-radius:18px;background:linear-gradient(#e8f6ff,#c8e7fb);box-shadow:inset 0 -4px 0 #a9d2ee}
.upg[data-id="damage"] .art{background:linear-gradient(#fff1d9,#ffd49a);box-shadow:inset 0 -4px 0 #f0b467}
.upg[data-id="volley"] .art{background:linear-gradient(#e9fff1,#bff0d3);box-shadow:inset 0 -4px 0 #8fd8ad}
.upg .art .ui-icon{width:44px;height:44px}
.upg .lv{position:absolute;bottom:-8px;left:50%;translate:-50% 0;padding:1px 7px;border-radius:9px;background:#2f5479;color:#fff;font-size:10px;letter-spacing:.5px;white-space:nowrap}
.upg.max .lv{background:linear-gradient(#ffe27a,#ffb928);color:#7a4a08}
.upg .body{min-width:0}
.upg strong{display:block;font-size:17px;color:#2b5e8c}
.pips{display:flex;gap:4px;margin:5px 0 6px}
.pips i{width:16px;height:8px;border-radius:4px;background:#dbe8f2;box-shadow:inset 0 1px 0 #0001}
.pips i.on{background:linear-gradient(#ffe27a,#ffb928);box-shadow:0 1px 0 #d27c12}
.upg p{margin:0;font-size:12px;line-height:1.35;color:var(--soft)}
.upg p.now{font-weight:900;color:var(--ink)}
.upg p.next b{color:#2d9b5a}
.upg p.next.done{color:#c28513;font-weight:900}
.buy{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:86px;height:64px;padding:6px 10px;border-radius:18px}
.buy .ui-icon{width:20px;height:20px;margin-bottom:1px}
.buy b{font-size:17px;line-height:1}
.buy small{font-size:9px;letter-spacing:.6px;margin-top:2px;opacity:.95}
.buy.short{--top:#f2f6f9;--face:#dfe7ee;--base:#b3c2cf;--edge:#8fa1b1;color:#6b7f91;text-shadow:none}
.buy.nope{animation:nope .35s}
@keyframes nope{20%,60%{translate:-5px 0}40%,80%{translate:5px 0}}
.upg.bought{animation:upgflash .6s ease-out}
.upg.bought .art{animation:combobump .45s cubic-bezier(.2,.9,.3,1.6)}
.upg.bought .pips i.on:last-of-type,.upg.bought .pips i.on{animation:pippop .5s cubic-bezier(.2,.9,.3,1.6) backwards}
@keyframes pippop{0%{scale:.2}}
@keyframes upgflash{0%{border-color:#ffd34e;box-shadow:0 4px 0 #e0a92a,0 0 0 8px #ffe27a66}100%{border-color:#d7efff}}
.lvlup{position:absolute;left:46px;top:-6px;padding:4px 12px;border-radius:14px;background:linear-gradient(#ffe27a,#ffb928);color:#fff;font-weight:1000;font-size:16px;text-shadow:0 2px 0 #b76a0d;box-shadow:0 3px 0 #d27c12;pointer-events:none;animation:lvlup 1.2s cubic-bezier(.2,.9,.3,1.2) forwards}
@keyframes lvlup{0%{scale:.3;opacity:0}20%{scale:1.15;opacity:1}70%{translate:0 -14px;opacity:1}100%{translate:0 -30px;opacity:0}}
.spark{position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px;border-radius:50%;background:#ffd34e;pointer-events:none;animation:spark .7s ease-out forwards}
@keyframes spark{to{transform:rotate(var(--a)) translateX(var(--d)) scale(.2);opacity:0}}
@media (max-width:420px){
 #upgradeQuick .txt{display:none}#upgradeQuick{padding:0;width:42px;height:42px;justify-content:center;border-radius:50%}
 .upg{grid-template-columns:52px 1fr;gap:10px}.upg .art{width:52px;height:52px}.upg .art .ui-icon{width:36px;height:36px}
 .buy{grid-column:1/-1;flex-direction:row;gap:8px;height:46px;min-width:0}.buy small{margin:0}
}
@media (max-width:700px){#perks{flex-wrap:nowrap;gap:3px}.perk{height:16px;padding:0 4px 0 1px;font-size:10px;gap:1px}.perk .ui-icon{width:12px;height:12px}}
@media (max-width:700px){#aimchip{gap:7px;padding:5px 9px;top:calc(100% + 6px)}#aimchip .pow .bar{width:54px}#aimchip .cell>b{font-size:14px}#aimchip .vol b{font-size:15px}}

/* ---------- Expedition map ---------- */
.region-hero{--accent:#76bb78;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px;align-items:center;margin:10px 0 14px}
.region-hero .art{position:relative;aspect-ratio:560/230;border:4px solid #fff;border-radius:24px;overflow:hidden;box-shadow:0 5px 0 #8fc0dc,0 14px 30px #1d4a7026}
.region-hero .art svg{display:block;width:100%;height:100%}
.region-hero .art .state{position:absolute;left:12px;top:12px;padding:4px 10px;border-radius:10px;background:#22364ad0;color:#fff;font-size:10px;font-weight:1000;letter-spacing:.8px}
.region-hero[data-state=ahead] .art svg{filter:saturate(.55) brightness(1.04)}
.region-hero .tag{display:inline-block;font-size:10px;font-weight:1000;letter-spacing:1.2px;color:var(--accent);filter:brightness(.82)}
.region-hero h2{margin:4px 0 8px;font-size:clamp(22px,3.2vw,30px);line-height:1.1}
.region-hero #journeystory{font-size:13.5px}
#regionboss{display:inline-flex;align-items:center;gap:8px;margin-top:12px;padding:6px 14px 6px 7px;border-radius:15px;background:#fff;box-shadow:0 3px 0 #dccdf2}
#regionboss .ui-icon{width:28px;height:28px;flex:none}
#regionboss b{display:block;font-size:13.5px;font-weight:1000;color:#5b3f8f}
#regionboss small{display:block;font-size:10.5px;font-weight:800;color:var(--soft)}
.route-steps.stops .route-step small{display:block;max-width:132px;margin-top:-2px;font-size:10.5px;font-weight:800;letter-spacing:0;line-height:1.25;text-align:center;color:#5d7a8e}
.route-steps.stops .route-step.current small{color:#9c6117}
.journey-rule{text-align:center;font-size:11.5px}
.worldbar{display:flex;align-items:center;gap:10px;margin:16px 2px 8px;font-size:11px;font-weight:1000;letter-spacing:.5px;color:var(--soft)}
.worldbar b{color:#22324a;white-space:nowrap}
.worldbar span{white-space:nowrap}
.worldbar .bar{flex:1;height:9px;border-radius:6px;background:#d5e9f5;overflow:hidden;box-shadow:inset 0 1px 2px #1d4a7020}
.worldbar .bar i{display:block;height:100%;min-width:9px;border-radius:6px;background:linear-gradient(90deg,#ffd34e,#ff9f3a)}
#worldmap{position:relative;overflow-x:auto;overflow-y:hidden;border:4px solid #fff;border-radius:24px;box-shadow:0 4px 0 #8fc0dc;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:thin;overscroll-behavior-x:contain}
#maptrail{position:relative;height:210px}
#maptrail::after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 50% 120%,#ffffff40,transparent 60%);pointer-events:none}
.road{position:absolute;left:0;top:0;pointer-events:none}
.road .base{fill:none;stroke:#fff8e6;stroke-width:12;stroke-linecap:round;opacity:.75}
.road .dash{fill:none;stroke:#8a6a3a;stroke-width:3;stroke-dasharray:1 10;stroke-linecap:round;opacity:.45}
.road .gone{fill:none;stroke:#ffc43a;stroke-width:6;stroke-linecap:round;filter:drop-shadow(0 2px 0 #d7952780)}
.node{position:absolute;z-index:1;translate:-50% -46%;display:flex;flex-direction:column;align-items:center;gap:4px;width:108px;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:inherit;text-shadow:none}
.node:hover:not(:disabled){filter:none}
.node:active:not(:disabled){translate:-50% -44%;box-shadow:none}
.node .disc{display:block;width:66px;height:66px;border:4px solid #fff;border-radius:50%;overflow:hidden;box-shadow:0 4px 0 #00000030;transition:scale .2s,border-color .2s}
.node .disc svg{display:block;width:100%;height:100%}
.node:hover .disc{scale:1.06}
.node.current{z-index:2}
.node.current .disc{width:84px;height:84px;border-color:#ffd34e;box-shadow:0 4px 0 #d39b16,0 0 0 7px #ffd34e55;animation:nodepulse 1.8s ease-in-out infinite}
.node.ahead .disc svg{filter:saturate(.4) brightness(1.06)}
.node.peek .disc{border-color:#57c3ff;scale:1.1;box-shadow:0 4px 0 #2f86c4,0 0 0 6px #57c3ff44}
.node .name{display:flex;align-items:center;gap:4px;max-width:110px;padding:2px 7px 2px 3px;border-radius:9px;background:#ffffffeb;font-size:10px;font-weight:1000;line-height:1.15;color:#22324a;text-align:left;box-shadow:0 2px 0 #00000018}
.node .name small{display:grid;place-items:center;flex:none;min-width:16px;height:16px;padding:0 3px;border-radius:8px;background:var(--ac);color:#fff;font-size:9px}
.node.ahead .name{color:#6d8597}
.node.ahead .name small{background:#9fb3c2}
.node .badge{position:absolute;top:0;right:18px;display:grid;place-items:center;width:22px;height:22px;border:2px solid #fff;border-radius:50%;font-style:normal;font-size:12px;font-weight:1000;color:#fff;box-shadow:0 2px 0 #00000030}
.node .badge.ok{background:#77bf43}
.node .badge.lock{background:#5d7a8e}
.node .badge.lock .ui-icon{width:14px;height:14px}
.node .you{position:absolute;top:-26px;padding:3px 9px;border-radius:9px;background:linear-gradient(#fff188,#ffc43a);color:#8a5210;font-size:9.5px;font-weight:1000;letter-spacing:.6px;white-space:nowrap;box-shadow:0 2px 0 #d79527;animation:youbob 1.4s ease-in-out infinite}
.node .you::after{content:'';position:absolute;left:50%;bottom:-5px;translate:-50% 0;border:5px solid transparent;border-bottom:0;border-top-color:#ffc43a}
.node .pips{display:flex;gap:4px}
.node .pips i{width:8px;height:8px;border:1.5px solid #ffffffcc;border-radius:50%;background:#00000026}
.node .pips i.boss{border-radius:2px;rotate:45deg}
.node .pips i.done{background:#77bf43}
.node .pips i.now{background:#ffc43a;box-shadow:0 0 0 2px #ffc43a66}
@keyframes nodepulse{50%{box-shadow:0 4px 0 #d39b16,0 0 0 12px #ffd34e22}}
@keyframes youbob{50%{translate:0 -3px}}
@media (max-width:700px){
 .region-hero{grid-template-columns:1fr;gap:10px;margin-top:6px}
 .region-hero .art{aspect-ratio:560/200;border-radius:20px}
 .region-hero h2{font-size:22px;margin:2px 0 4px}
 .region-hero #journeystory{font-size:12.5px}
 #regionboss{margin-top:8px}
 .route-steps.stops .route-step small{font-size:9.5px;max-width:96px}
 .journey-rule{display:none}
 .worldbar{margin-top:10px}
 #maptrail{height:200px}
}

/* The region's three battles on the map button: done, now, and the boss still to come. */
#journey .levels{display:flex;align-items:center;gap:0;margin-left:2px}
#journey .levels i{position:relative;display:grid;place-items:center;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:#bcd3e3;color:#fff;font-style:normal;font-size:10px;font-weight:1000;line-height:1;box-shadow:0 2px 0 #7fa3bd}
#journey .levels i+i{margin-left:8px}
#journey .levels i+i::before{content:'';position:absolute;right:calc(100% + 1px);top:50%;width:9px;height:3px;translate:0 -50%;border-radius:2px;background:#c9dceb}
#journey .levels i.done{background:#77bf43;box-shadow:0 2px 0 #508a31}
#journey .levels i.done+i::before{background:#9dd56f}
#journey .levels i.now{width:24px;height:24px;background:linear-gradient(#fff188,#ffc43a);color:#8a5210;box-shadow:0 2px 0 #d79527,0 0 0 3px #ffd34e55;animation:levelnow 1.6s ease-in-out infinite}
#journey .levels i.boss:not(.done):not(.now){background:#c7b6e6;box-shadow:0 2px 0 #8f77b8}
#journey .levels i.boss.now{background:linear-gradient(#ffb0bd,#e65873);color:#fff;box-shadow:0 2px 0 #a93a55,0 0 0 3px #e6587355}
@keyframes levelnow{50%{box-shadow:0 2px 0 #d79527,0 0 0 6px #ffd34e22}}
body[data-mode="battle"] #journey .txt b{max-width:110px}
body[data-mode="battle"] #menu{order:-1}

/* Gunner badges: who fires the special weapon. */
.gunmark{position:absolute;left:0;top:0;display:grid;place-items:center;width:22px;height:22px;margin:-30px 0 0 -11px;border:2.5px solid #fff;border-radius:50%;background:#8b5cf0;color:#fff;font-size:11px;font-weight:1000;box-shadow:0 2px 0 #00000040;opacity:0;scale:.4;transition:opacity .18s,scale .25s cubic-bezier(.3,1.7,.5,1);pointer-events:none;will-change:translate}
.gunmark::after{content:'';position:absolute;left:50%;bottom:-7px;translate:-50% 0;border:5px solid transparent;border-bottom:0;border-top-color:#fff}
.gunmark[data-weapon=fire]{background:#ff7a2f}
.gunmark.on{opacity:1;scale:1;animation:gunbob 1.2s ease-in-out infinite}
@keyframes gunbob{50%{margin-top:-33px}}

/* Squad picture in the upgrades panel */
.squadview{position:relative;margin:10px 0 4px;border-radius:22px;overflow:hidden;background:radial-gradient(ellipse at 50% 110%,#c9f0a8 0 38%,transparent 39%),linear-gradient(#bfe6ff,#e9f8ff);border:3px solid #fff;box-shadow:0 4px 0 #8fc0dc}
.squadview canvas{display:block;width:100%;height:auto;aspect-ratio:560/220}
.squadview .caption{position:absolute;left:12px;top:10px;padding:3px 9px;border-radius:9px;background:#ffffffd8;font-size:10px;font-weight:1000;letter-spacing:.9px;color:#3f6f8f}
.squadview .newgear{position:absolute;left:50%;bottom:10px;translate:-50% 0;max-width:calc(100% - 24px);padding:5px 12px;border-radius:12px;background:linear-gradient(#fff4b8,#ffd34e);color:#7a4a08;font-size:12px;font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 3px 0 #d39b16;opacity:0;pointer-events:none}
.squadview .newgear.show{animation:newgear 2.4s cubic-bezier(.2,.9,.3,1.2) forwards}
.squadview.flash::after{content:'';position:absolute;inset:0;background:radial-gradient(circle at 50% 60%,#fff 0,#fff0 65%);animation:squadflash .6s ease-out forwards;pointer-events:none}
@keyframes newgear{0%{opacity:0;scale:.6}12%{opacity:1;scale:1.08}20%{scale:1}82%{opacity:1}100%{opacity:0}}
@keyframes squadflash{0%{opacity:.95}100%{opacity:0}}
.upg .look{margin:3px 0 0;font-size:11px;font-weight:800;color:#8a6a2a}
.upg .look::before{content:'✦ ';color:#f0a21f}

/* Immediate inventory feedback without delaying the actual count. */
.meter{position:relative}
#bricksleft,#crewposted{display:inline-block;transform-origin:center;min-width:1ch;font-variant-numeric:tabular-nums}
.counter-delta{position:absolute;right:8px;top:calc(100% + 5px);padding:2px 9px;border-radius:12px;background:#fffdf5;box-shadow:0 3px 0 #9fc8df;font-size:16px;font-weight:1000;opacity:0;pointer-events:none;white-space:nowrap}

/* Multiplier ready state stays readable in screen pixels at any camera zoom. */
.gate-aim-callout{position:fixed;z-index:8;pointer-events:none;display:flex;align-items:center;gap:9px;padding:8px 13px;border:3px solid #fff9d6;border-radius:19px;background:linear-gradient(#fff4a5,#ffd34e);box-shadow:0 5px 0 #bd851c,0 0 24px 8px #ffd34e88;color:#55370c;opacity:0;transform:translate(-50%,-100%) scale(.65);transition:opacity .13s,transform .2s cubic-bezier(.18,1.5,.4,1)}
.gate-aim-callout.on{opacity:1;transform:translate(-50%,-100%) scale(1)}
.gate-aim-callout>b{font-size:40px;line-height:1;font-weight:1000;letter-spacing:-2px}
.gate-aim-callout>span{display:flex;flex-direction:column;font-size:17px;font-weight:1000;line-height:1.1}
.gate-aim-callout small{font-size:8px;letter-spacing:.5px;margin-top:4px}
body[data-mode="build"] .gate-aim-callout{display:none}
@media(max-width:700px){.gate-aim-callout{gap:6px;padding:6px 10px;border-radius:15px}.gate-aim-callout>b{font-size:31px}.gate-aim-callout>span{font-size:14px}.gate-aim-callout small{font-size:7px}}
@media(prefers-reduced-motion:reduce){.gate-aim-callout{transition:opacity .13s;transform:translate(-50%,-100%)}.gate-aim-callout.on{transform:translate(-50%,-100%)}}
