:root{color-scheme:light;font-family:ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#214e58;background:#e5f4ec;font-synthesis:none;--ink:#214e58;--muted:#54747a;--aqua:#27b9c5;--glass:linear-gradient(150deg,#ffffffed,#f5fff7c9)}
*{box-sizing:border-box}body{margin:0;min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:radial-gradient(ellipse at 20% 5%,#fff9d9 0,transparent 48%),radial-gradient(ellipse at 95% 85%,#bce6de,transparent 55%),repeating-linear-gradient(95deg,#ffffff15 0 2px,transparent 2px 150px),#e5f4ec}button,input{font:inherit}button{border:0;cursor:pointer;color:inherit;touch-action:manipulation;min-height:44px}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible,canvas:focus-visible{outline:3px solid #087eaa;outline-offset:3px}button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}[hidden]{display:none!important}
.site{width:min(480px,100%);height:min(900px,calc(100dvh - 24px))}
.game-frame{position:relative;isolation:isolate;width:100%;height:100%;overflow:hidden;border-radius:30px;background:#b8deec;box-shadow:0 16px 60px #234d4730}
.stage{position:absolute;inset:0;z-index:0;overflow:hidden}
.stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}
.stage canvas:focus-visible{outline-offset:-4px}
.play-area{position:absolute;inset:164px 12px 116px;pointer-events:none}
.toolbar{position:absolute;z-index:2;top:max(16px,env(safe-area-inset-top));left:16px;right:16px;display:flex;align-items:center;gap:12px;pointer-events:none}
.brand{display:block;width:76px;height:76px;flex-shrink:0;filter:drop-shadow(0 3px 3px #173b5c35)}
.scoreblock{position:relative;min-width:72px;flex:1;padding:5px 8px 5px 26px;border:1px solid #ffffffb3;border-radius:22px;background:#f4fbffe0;box-shadow:0 2px 8px #244c5b15;font-variant-numeric:tabular-nums}
.score-star{position:absolute;width:30px;height:30px;left:-10px;top:12px;filter:drop-shadow(0 2px 1px #98741930)}
.scoreblock small,.shots-wrap>small{display:block;font-size:10px;font-weight:700;color:#48626c}
.scoreblock strong{display:block;font-size:25px;line-height:1.05;color:#214451;letter-spacing:-1px}
.shots-wrap{padding:7px 10px;background:#f4fbffe0;border:1px solid #ffffffb3;border-radius:22px;text-align:center;box-shadow:0 2px 8px #244c5b15}
.shots-wrap>small{font-size:9px;letter-spacing:.4px}
.shots{display:flex;justify-content:center;gap:2px;margin-top:3px}
.shot{display:block;width:17px;height:23px;color:#ffc626;filter:drop-shadow(0 1px 0 #ab6c1b)}
.shot svg{width:100%;height:100%;fill:currentColor;stroke:#db9400;stroke-width:.6}
.shot.used{opacity:.25;filter:grayscale(1)}
.icon-button{display:grid;place-items:center;width:52px;height:52px;flex-shrink:0;padding:0;background:transparent;border-radius:50%;pointer-events:auto;filter:drop-shadow(0 3px 3px #21496630)}
.icon-button [data-art]{display:block;width:100%;height:100%}
.icon-button:active{transform:scale(.94)}
.hud{position:absolute;top:104px;left:24px;right:24px;z-index:2;pointer-events:none}
.goal-line{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:650;color:#173b47;text-shadow:0 1px 3px #fff,0 0 8px #fff}
.goal-line strong{font-size:19px;font-variant-numeric:tabular-nums}.goal-total{font-size:12px}.goal-line b{font-weight:850}#goal-tick{color:#177848}
.progress{height:12px;margin:5px 0 0;padding:2px;border-radius:20px;background:#eaf7ffc9;border:1px solid #fff;box-shadow:0 2px 4px #26444924,inset 0 1px 3px #2a668434;overflow:hidden}
.progress i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(#b4ef59,#4cbb45);box-shadow:inset 0 1px 1px #efffd4;transition:width .15s}
.reward-line{position:absolute;top:48px;left:0;right:0;display:flex;justify-content:center;gap:6px;align-items:center}
.status{font-size:11px;color:#254a4d;text-shadow:0 1px 3px #fff,0 0 6px #fff;font-weight:600}
.combo-badge{position:absolute;top:32px;left:50%;transform:translateX(-50%) scale(.9);opacity:0;padding:6px 13px;border:1px solid #fff;border-radius:30px;background:#f5fff1eb;box-shadow:0 3px 10px #4d572924;color:#27753f;font-size:22px;white-space:nowrap;transition:opacity .15s,transform .15s}
.combo-badge small{font-size:10px;font-weight:800}.combo-badge.active{opacity:1;transform:translateX(-50%) scale(1)}.combo-badge.mega{color:#a66809}
.powers{position:absolute;z-index:2;bottom:max(18px,env(safe-area-inset-bottom));left:24px;right:24px;text-align:center;pointer-events:none}
.power-items{display:flex;justify-content:center;gap:34px}
.power{display:flex;flex-direction:column;align-items:center;position:relative;pointer-events:auto;cursor:default}
.power [data-art]{display:block;width:66px;height:70px;filter:drop-shadow(0 3px 4px #274d5130)}
.power b{min-width:56px;margin-top:-3px;padding:4px 10px;border-radius:14px;border:1px solid #ffffffd9;background:#f7fcffe8;box-shadow:0 2px 4px #25434820;font-size:11px;font-weight:650;color:#31525c}
.powers>small{display:inline-block;margin-top:8px;padding:3px 10px;border-radius:12px;background:#f7fcffdf;color:#49636a;font-size:9px;letter-spacing:.3px}
@media(max-width:600px){body{display:block;padding:0;height:100dvh;min-height:0}.site{width:100%;height:100%}.game-frame{border-radius:0;box-shadow:none}.play-area{top:calc(174px + env(safe-area-inset-top));bottom:calc(120px + env(safe-area-inset-bottom))}.hud{top:calc(104px + env(safe-area-inset-top))}}
@media(max-width:360px){.toolbar{left:12px;right:12px;gap:9px}.brand{width:64px;height:64px}.icon-button{width:46px;height:46px}.scoreblock{min-width:60px;padding-left:20px}.scoreblock strong{font-size:22px}.shots-wrap{padding:6px 8px}.hud{top:calc(90px + env(safe-area-inset-top));left:20px;right:20px}.play-area{top:calc(158px + env(safe-area-inset-top));bottom:110px}.power [data-art]{width:56px;height:60px}.powers{bottom:12px}.power-items{gap:30px}}
@media(orientation:landscape) and (max-height:500px){body{display:block;padding:0;height:100dvh;min-height:0}.site{width:100%;height:100%}.game-frame{border-radius:0}.toolbar{left:max(18px,env(safe-area-inset-left));right:auto;width:142px;flex-wrap:wrap;justify-content:center;gap:12px}.brand{width:72px;height:72px}.icon-button{order:1}.scoreblock{flex:1}.shots-wrap{width:100%}.hud{left:max(18px,env(safe-area-inset-left));right:auto;width:142px;top:230px}.reward-line{top:54px}.status{font-size:10px;text-align:center}.play-area{top:14px;bottom:14px;left:180px;right:116px}.powers{left:auto;right:max(16px,env(safe-area-inset-right));top:20px;bottom:20px;width:80px}.power-items{flex-direction:column;gap:10px}.power [data-art]{width:56px;height:59px}.powers>small{font-size:8px}.combo-badge{top:40px}}

.overlay{position:absolute;inset:0;z-index:5;padding:16px;display:flex;align-items:center;justify-content:center;text-align:center;background:#d9f2e899;backdrop-filter:blur(7px);overflow:auto;border-radius:27px}.overlay-card{width:100%;max-width:320px;max-height:100%;overflow:auto;overscroll-behavior:contain;padding:24px;border-radius:24px;border:1px solid #fff;background:var(--glass);box-shadow:0 15px 40px #326d7720,inset 0 2px 0 #fff;color:var(--ink)}.welcome{padding-top:10px}.hero-logo{display:block;width:100%;height:190px;margin:0 auto 10px;clip-path:polygon(0 0,100% 0,100% 65%,90% 65%,90% 100%,0 100%)}h1,h2{font-size:25px;letter-spacing:-.8px;margin:0 0 14px;font-weight:850}.desc{font-size:13px;line-height:1.65;color:var(--muted);margin:0 0 22px}.primary-button{width:100%;border-radius:15px;padding:13px 16px;font-weight:800;font-size:16px;color:#fff;background:linear-gradient(#39c9da,#159ebc);border:1px solid #61dce4;box-shadow:0 4px 0 #14849e,0 7px 16px #249bb32a;text-shadow:0 1px 1px #28748b55}.primary-button:active{transform:translateY(2px);box-shadow:0 2px 0 #14849e}.primary-button svg{margin-left:9px}.secondary-button,.text-button{width:100%;background:transparent;font-size:12px;font-weight:650;margin-top:9px}.sound-notice{font-size:10px;line-height:1.5;color:var(--muted);margin:18px 0 0}.overlay-kicker{font-size:9px;letter-spacing:1.7px;font-weight:800;color:#34858c;margin:0 0 12px}.result-stars{color:#c5d9d3;font-size:39px;letter-spacing:4px;margin-bottom:12px}.result-stars .earned{color:#f9bb23;text-shadow:0 2px 0 #d58c15}.result-stats{display:flex;gap:8px;border-block:1px solid #cbe5dd;margin:16px 0 22px;padding:14px 0}.result-stats>div{flex:1}.result-stats strong{display:block;font-size:20px}.result-stats small{display:block;font-size:9px;color:var(--muted);margin-top:5px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;font-size:13px;margin:12px 0 4px}.switch{width:52px;height:44px;background:transparent;position:relative;flex-shrink:0}.switch:before{content:"";position:absolute;inset:9px 0;border-radius:20px;background:#22b4b4}.switch:after{content:"";position:absolute;top:13px;left:29px;width:18px;height:18px;border-radius:50%;background:white;box-shadow:0 1px 3px #35665f30}.switch[aria-checked=false]:before{background:#bdd3ce}.switch[aria-checked=false]:after{left:5px}.volume-label{display:flex;justify-content:space-between;font-size:11px;margin-top:8px;color:var(--muted)}.slider{width:100%;height:44px;accent-color:#1cadb9}.sound-tests{display:flex;gap:5px}.mini-button{flex:1;border-radius:10px;background:#e2f3eb;font-size:10px;border:1px solid white}.setting-note,.local-record{font-size:10px;line-height:1.5;color:var(--muted)}.settings-overlay .primary-button{margin-top:15px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}#degraded-notice{position:fixed;bottom:4px;left:8px;right:8px;z-index:20;margin:0;text-align:center;font-size:10px;background:#fff5d9;padding:5px;border-radius:10px;pointer-events:none}.loading-dot{display:block;width:24px;height:24px;border-radius:50%;background:#39c9da;margin:0 auto 20px;animation:breathe 1s ease-in-out infinite alternate}@keyframes breathe{to{opacity:.3;transform:scale(.8)}}

@media(max-height:680px){.hero-logo{height:120px}.overlay-card{padding:18px}.desc{margin-bottom:14px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* Candy-like, tactile controls: the artwork stays at the centre of each button. */
.power{padding:0 2px;background:transparent;border-radius:28px;cursor:pointer;transition:transform .18s,filter .18s;min-width:64px}
.power em{font-style:normal;font-size:10px;font-weight:750;margin-top:4px;color:#234651;text-shadow:0 1px 3px white,0 0 6px white}
.power:not(:disabled):active{transform:scale(.92)}
.power[aria-pressed=true]{transform:translateY(-5px)}
.power[aria-pressed=true] [data-art]{filter:drop-shadow(0 0 8px white) drop-shadow(0 3px 8px #089dca)}
.power[aria-pressed=true] b{background:#d7f6ff;border-color:#fff;box-shadow:0 0 0 2px #24badd}
.power:disabled{opacity:.5;filter:saturate(.5)}
.combo-badge{pointer-events:none;background:linear-gradient(#fffde9,#ffe495);color:#a05506;border:2px solid #fff;box-shadow:0 3px 0 #cd8f35,0 5px 18px #8f510e30;font-weight:900}
.combo-badge.mega{background:linear-gradient(#ffeefe,#f8acf0);color:#863586;box-shadow:0 3px 0 #b461b4,0 5px 18px #86358630}
@media(orientation:landscape) and (max-height:500px){.power em{font-size:9px}.power-items{gap:4px}}
@media(max-height:620px) and (orientation:portrait){.power [data-art]{width:52px;height:54px}.power em{display:none}.powers{bottom:max(8px,env(safe-area-inset-bottom))}.powers>small{margin-top:5px}}


/* One soft overshoot, inspired by bounceIn; no animation dependency. */
.power-dialog{background:#24496955;backdrop-filter:blur(5px);border-radius:0;padding:22px}
.power-dialog-card{max-width:350px;text-align:center;padding:25px 22px 26px;border:4px solid #fff;border-radius:36px;background:linear-gradient(160deg,#fffefa 5%,#e9faff 68%,#cbeefb);box-shadow:0 7px 0 #86c3da,0 16px 35px #153d6855,inset 0 3px 0 #fff;animation:power-enter .42s cubic-bezier(.22,.7,.35,1) both}
.power-dialog-card h2{font-size:36px;font-weight:900;line-height:1.1;color:#236780;text-shadow:0 2px 0 white;margin:0 0 12px}
.power-dialog-art{height:112px;display:grid;place-items:center;margin-bottom:12px}
.power-dialog-art [data-art]{display:block;width:108px;height:112px;filter:drop-shadow(0 6px 5px #27749a30)}
#power-description{font-size:15px;line-height:1.55;font-weight:650;margin:0 0 23px;color:#315c6c}
.power-actions{display:flex;gap:12px}
.power-actions button{flex:1;min-width:0;min-height:50px;padding:11px 6px;border:2px solid #fff;border-radius:19px;font-size:17px;font-weight:850;box-shadow:0 5px 0 #6495b2,0 7px 10px #21456725,inset 0 2px 0 #ffffffb0;background:linear-gradient(#edf9ff,#b9ddec);color:#365f79;text-shadow:0 1px 0 #fff}
.power-actions #power-confirm{background:linear-gradient(#ddf98c,#83d645);color:#315b20;box-shadow:0 5px 0 #529737,0 7px 10px #21456725,inset 0 2px 0 #f3ffd4}
.power-actions button:active{transform:translateY(3px);box-shadow:0 2px 0 #6495b2}
.power-actions #power-confirm:active{box-shadow:0 2px 0 #529737}
.aim-cancel{display:block;pointer-events:auto;margin:0 auto 10px;padding:8px 16px;background:#f5fbfff0;border:2px solid white;border-radius:18px;box-shadow:0 3px 0 #91bccd;font-weight:750;font-size:12px}
.powers>#power-budget{display:none}
@keyframes power-enter{0%{opacity:0;transform:scale(.65)}65%{opacity:1;transform:scale(1.045)}100%{opacity:1;transform:scale(1)}}
.power-dialog.reduced-effects .power-dialog-card{animation:none}
@media(max-height:500px){.power-dialog{padding:12px}.power-dialog-card{padding:14px 20px 18px;max-width:400px;border-radius:28px}.power-dialog-card h2{font-size:28px;margin-bottom:4px}.power-dialog-art{height:65px;margin-bottom:4px}.power-dialog-art [data-art]{width:63px;height:65px}#power-description{font-size:13px;margin-bottom:12px}.power-actions button{min-height:44px;padding:7px}}

/* Invasion: stable HUD above the logical playfield, compact controls below. */
.invasion-toolbar{display:grid;grid-template-columns:minmax(0,4fr) minmax(88px,1fr);gap:8px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));width:auto;top:calc(12px + env(safe-area-inset-top));height:72px}
.recharge{display:flex;position:relative;align-items:center;min-width:0;height:72px}
.swatter{position:absolute;left:0;top:0;width:76px;height:72px;z-index:2;filter:drop-shadow(0 3px 2px #24505c55)}
.gauge{position:relative;margin-left:48px;width:calc(100% - 48px);height:42px;border-radius:999px;border:1px solid #f5ffff;background:linear-gradient(#ffffff,#d0edf5 48%,#acd6e5 70%,#f2ffff);box-shadow:inset 0 1px 1px white,0 2px 3px #24505c30}
.gauge .progress{position:absolute;inset:3px;margin:0;padding:0;height:auto;border-radius:999px;background:#175365;box-shadow:inset 0 2px 3px #09283170;border:1px solid #b6eced}
.gauge .progress i{position:absolute;inset:0;width:100%;height:100%;background:linear-gradient(#cbffff,#44ecdf 45%,#13afbd 70%,#7ffff1);box-shadow:inset 0 2px 2px white;transition:none}
#shots-label{position:absolute;inset:0;display:grid;place-items:center;font-size:13px;color:#123e4e;text-shadow:0 1px 2px white;pointer-events:none}
.caught-total{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px;min-width:0;height:42px;padding:3px 8px 3px 4px;border:1px solid #f5ffff;border-radius:999px;background:linear-gradient(#fffffff2,#d9f2f6ed);box-shadow:inset 0 1px 1px white,0 2px 3px #24505c30;font-size:21px;color:#173e4c;font-variant-numeric:tabular-nums}
.caught-total [data-art]{display:block;width:32px;height:34px;flex-shrink:0}
.hud{top:calc(86px + env(safe-area-inset-top));left:20px;right:20px;width:auto}
.population-line{display:flex;align-items:center;gap:12px;font-size:12px;text-shadow:0 1px 3px white;color:#173e4c}
.population-line .icon-button{margin-left:auto;width:44px;height:44px;pointer-events:auto}
.population-line .danger{color:#a62b20;background:#fff0d9;border-radius:10px;padding:5px}
.reward-line{top:44px}.combo-badge{top:24px}
.play-area{top:calc(160px + env(safe-area-inset-top));bottom:calc(100px + env(safe-area-inset-bottom));left:0;right:0}
.powers{left:max(16px,env(safe-area-inset-left));right:auto;bottom:max(10px,env(safe-area-inset-bottom));top:auto;width:auto}
.power-items{flex-direction:row;justify-content:flex-start;gap:10px}
.power{min-width:48px;min-height:44px}.power [data-art]{width:48px;height:50px}.power b{min-width:44px;font-size:10px;padding:3px 6px}.power em{display:none}
@media(orientation:landscape) and (max-height:500px){
 .invasion-toolbar{height:50px;top:calc(4px + env(safe-area-inset-top));grid-template-columns:minmax(0,4fr) minmax(88px,1fr);gap:12px}
 .recharge{height:50px}.swatter{width:56px;height:52px}.gauge{height:38px;margin-left:38px;width:calc(100% - 38px)}
 .caught-total{height:38px}
 .hud{top:calc(54px + env(safe-area-inset-top));left:max(18px,env(safe-area-inset-left));right:max(18px,env(safe-area-inset-right));width:auto}
 .population-line{height:44px}.reward-line{top:10px;left:220px;right:50px}.status{font-size:11px}
 .play-area{top:calc(104px + env(safe-area-inset-top));bottom:68px;left:0;right:0}
 .powers{top:auto;bottom:max(4px,env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));right:auto;width:auto}
 .power{flex-direction:row}.power [data-art]{width:42px;height:44px}.power b{margin-left:-8px}.power-items{gap:8px}
 .combo-badge{top:27px}
}

#weather-fog{position:fixed;inset:0;z-index:3;pointer-events:none;background:radial-gradient(ellipse at 20% 35%,#fff 0%,#edf3f4 48%,#d7e4e9 100%)}
.weather-announcement-wrap{position:fixed;inset:0;z-index:4;display:grid;place-items:center;pointer-events:none;padding:24px}
#weather-announcement{max-width:620px;text-align:center;margin:0;font-family:ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:clamp(30px,7vw,54px);font-weight:900;line-height:1.15;color:#fff9de;-webkit-text-stroke:1px #236780;text-shadow:0 2px 0 #236780,0 4px 0 #17475f,0 7px 0 #13384c,0 10px 18px #153d6877;animation:power-enter .42s cubic-bezier(.22,.7,.35,1) both}
#weather-announcement.reduced-effects{animation:none}
@media(prefers-reduced-motion:reduce){#weather-announcement{animation:none}}
