SOURCE / PINNED RELEASE
Made of little things.
Arañas Pistoleras
- Release
- 2578a037ceaf…
- Author-recorded commit
- e35cc0733a7b…
- License
- Check the original source
- Author’s source reference
- nostr://npub1eg5pfnws6tg6rtp33tugpppqtv5u05crmf983qp438cdycwzngys0gxzcs/wss%3A%2F%2Fgit.napplet.soy%2F/n-7bf0a402584
The hash-verified playable HTML, which may contain bundled or minified code. This view does not execute it.
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Arañas Pistoleras</title>
<meta name="description" content="Arañas gigantes con pistolas en el colegio, la cocina, el dormitorio, la bodega y el bosque de noche. ¡Tócalas antes de que disparen!" />
<script type="module" crossorigin>var mo=Object.defineProperty;var po=(t,e,o)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Z=(t,e,o)=>po(t,typeof e!="symbol"?e+"":e,o);function go(){const t=new Map;function e(i,l){if(t.has(i))throw new Error(`NAP domain "${i}" is already registered`);t.set(i,l)}function o(i){const l=i.type.indexOf(".");if(l<=0)return!1;const n=i.type.slice(0,l),f=t.get(n);return f?(f(i),!0):!1}function a(){return Array.from(t.keys())}return{registerNap:e,dispatch:o,getRegisteredDomains:a}}var yo=go(),N0=yo.registerNap,t0="storage";N0(t0,t=>{});var o0="media";N0(o0,t=>{});function co(){const t=window;if(!t.napplet)throw new Error("window.napplet is unavailable -- runtime did not inject the napplet namespace");return t.napplet}function ue(t){const o=co()[t];if(!o)throw new Error(`window.napplet.${String(t)} is unavailable -- runtime did not inject this domain`);return o}var L0={getItem(t){return ue("storage").getItem(t)},setItem(t,e){return ue("storage").setItem(t,e)},removeItem(t){return ue("storage").removeItem(t)},keys(){return ue("storage").keys()},instance:{getItem(t){return ue("storage").instance.getItem(t)},setItem(t,e){return ue("storage").instance.setItem(t,e)},removeItem(t){return ue("storage").instance.removeItem(t)},keys(){return ue("storage").instance.keys()}}},wo={createSession(t){return ue("media").createSession(t)},updateSession(t,e){ue("media").updateSession(t,e)},destroySession(t){ue("media").destroySession(t)},reportState(t,e){ue("media").reportState(t,e)},reportCapabilities(t,e){ue("media").reportCapabilities(t,e)},sendCommand(t,e,o){ue("media").sendCommand(t,e,o)},onCommand(t,e){return ue("media").onCommand(t,e)},onState(t,e){return ue("media").onState(t,e)},onCapabilities(t,e){return ue("media").onCapabilities(t,e)},onControls(t,e){return ue("media").onControls(t,e)}};const ko="data:font/woff2;base64,d09GMgABAAAAAEewAA0AAAAAhGgAAEdYAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgUQRCAqB3UiBnA8BNgIkA4NYE5xqC4FuAAQgBYNAByAMBxvdYVVHaI8DoWFsORJhH5Sm/yMqOVdn/39cboyJ3oDV9wUypQQGQRvm7JgNy2kznGgraau8Od4Tb5B4UnKbaIaILzoEAjJlcaWHKQvn+q/iO/iHPkKTU+wDNLduUQULxjZyVK9hdEhESysgNtEWpdiAoGID2h8Wit2PYr36Lz0fB+vtn2YiCynghBIvkYADKmjym7OzA/z0T9xo61MzacARJ2Ynx28oN/8jf51ck5kIUokhbZ+4IOtd8V4u5ApXYhMDGgMqBnwxCWFdDsf9WVO/5zVuyWlMOqkTb/yPYFGLNDjPL7NmFsB//wPACvxJZ5+XNvUBYJuqIirTtHbrbR8NaMYwIDDt2bK9XwcAkhUCgtz2lmgOtH5focqEKRvV4J+q9ZKt1D4AFGnnTTPX+ledQwili4ZqpRbxAQS1WgSK1O3+sJIuOYXpb++HXDlNb/j4Ln2rd4DRoFejrzO65WpKtVAHCtjFiSfi4/P5fh6Pk1GSJMFs6bBt94Sixf9dWtLZu87O7GBNYyYgDQfQEDL6SpN0ZVa+vGcpbSxfijTImjTLaR3wIBK081NHXmKlepw6m1pYwngoDsJ5QfHfXVp7va2kLUyaFwi1v2fSPE/sXE8ET+VA5USOf6qLSjfjAWUM0IFYbQ11fMAFaj6VmiOsGSxr9ypfXYbLtjftvfsJUEESIpDyg8f5Sv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throw new Error("Unknown asset: "+t);return e}function Mo(t){const e=t.url.indexOf(",");if(!t.url.startsWith("data:")||e<0)throw new Error("Embedded asset is not a data URL. Rebuild with the single-file plugin.");const o=t.url.slice(e+1);let a;if(/;base64$/i.test(t.url.slice(0,e)))a=Uint8Array.from(atob(decodeURIComponent(o)),i=>i.charCodeAt(0));else{a=new TextEncoder().encode(o);let i=0;for(let l=0;l<a.length;l++)if(a[l]===37){const n=String.fromCharCode(a[l+1],a[l+2]);if(!/^[a-f0-9]{2}$/i.test(n))throw new Error("Invalid embedded asset data URL.");a[i++]=parseInt(n,16),l+=2}else a[i++]=a[l];a=a.subarray(0,i)}return new Blob([a],{type:t.mime})}async function D0(t){const e=V0(t);if(!bt.has(t)){const o=Promise.resolve().then(()=>e.url?Mo(e):window.napplet.resource.bytes("blossom:sha256:"+e.hash));bt.set(t,o),o.catch(()=>{bt.get(t)===o&&bt.delete(t)})}return bt.get(t)}async function So(t){const e=V0(t);if(e.url)return e.url;if(!mt.has(t)){const o=D0(t).then(a=>URL.createObjectURL(a));mt.set(t,o),o.catch(()=>{mt.get(t)===o&&mt.delete(t)})}return mt.get(t)}let U=null,Ke,Ue,at,Ze,oe,Ut,Fe=0,kt=80,ce=!0,j0=!0,To=0;function be(){return!!U&&U.state!=="closed"}function Y(){return U.currentTime+To}function Po(t,e=t.destination){if(U)return U===t;U=t;const o=U.createDynamicsCompressor();o.threshold.value=-12,o.knee.value=10,o.ratio.value=4,o.attack.value=.015,o.release.value=.25;const a=U.createDynamicsCompressor();a.threshold.value=-4,a.knee.value=0,a.ratio.value=20,a.attack.value=.001,a.release.value=.08;const i=U.createGain();i.gain.value=.85,Ke=U.createGain(),Ke.gain.value=1.5,Ke.connect(o).connect(a).connect(i).connect(e),Ue=U.createGain(),Ue.gain.value=ce?1:0,Ue.connect(Ke),Ze=U.createBiquadFilter(),Ze.type="lowpass",Ze.frequency.value=16e3,Ze.connect(Ke),at=U.createGain(),at.gain.value=0,at.connect(Ze);const l=Math.floor(U.sampleRate*2.1),n=U.createBuffer(2,l,U.sampleRate);for(let y=0;y<2;y++){const k=n.getChannelData(y);for(let T=0;T<l;T++)k[T]=(Math.random()*2-1)*Math.pow(1-T/l,3.4)}const f=U.createConvolver();f.buffer=n;const h=U.createGain();h.gain.value=.5,f.connect(h).connect(Ke);const d=U.createGain();d.gain.value=.22,Ue.connect(d).connect(f);const u=U.createGain();u.gain.value=.4,Ze.connect(u).connect(f),oe=K0(),Ut=U.createBuffer(1,U.sampleRate,U.sampleRate);const c=Ut.getChannelData(0);for(let y=0;y<c.length;y++)c[y]=Math.random()*2-1;return!0}function K0(){const t=U,e=t.createGain();e.connect(at);const o=t.createBiquadFilter();o.type="lowpass",o.frequency.value=1500,o.Q.value=.6,o.connect(e);const a=t.createGain();a.gain.value=.5;const i=t.createDelay(1);i.delayTime.value=.36;const l=t.createGain();l.gain.value=.34;const n=t.createBiquadFilter();return n.type="lowpass",n.frequency.value=2400,a.connect(i),i.connect(n).connect(l).connect(i),i.connect(e),{out:e,soft:o,echo:a}}function Ao(t,e){const o=U,a=o.createOscillator(),i=o.createGain();i.gain.value=0,a.connect(i).connect(Ke),a.onended=e,a.start(Y()),a.stop(Y()+t)}function Co(t,e){ce=t,j0=e,be()&&(Ue.gain.setTargetAtTime(t?1:0,Y(),.03),e||(at.gain.setTargetAtTime(0,Y(),.08),Ft=0))}function a0(t){const e=t.dest??Ue,o=U;if(t.pan===void 0||typeof o.createStereoPanner!="function")return e;const a=o.createStereoPanner();return a.pan.value=Math.max(-1,Math.min(1,t.pan)),a.connect(e),a}function Bt(t){Fe++,t.onended=()=>{Fe--}}function i0(t,e,o,a,i){t.gain.value=0,t.gain.setValueAtTime(1e-4,e),t.gain.exponentialRampToValueAtTime(Math.max(2e-4,a),e+o),t.gain.exponentialRampToValueAtTime(1e-4,e+Math.max(o+.01,i))}function B(t,e,o,a={}){if(!U||!be()||Fe>kt)return;const i=a.at??Y(),l=U.createOscillator(),n=U.createGain();if(l.type=a.type??"sine",l.frequency.setValueAtTime(t,i),a.slide&&l.frequency.exponentialRampToValueAtTime(Math.max(20,t*a.slide),i+e),a.detune&&(l.detune.value=a.detune),a.vibrato){const f=U.createOscillator(),h=U.createGain();f.frequency.value=a.rate??5.5,h.gain.value=0,h.gain.setValueAtTime(0,i),h.gain.linearRampToValueAtTime(a.vibrato,i+Math.min(.3,e*.5)),f.connect(h).connect(l.detune),f.start(i),f.stop(i+e+.03)}i0(n,i,a.attack??.004,o,e),l.connect(n).connect(a0(a)),l.start(i),l.stop(i+e+.03),Bt(l)}function F(t,e,o){if(!U||!be()||Fe>kt)return;const a=o.at??Y(),i=U.createBufferSource();i.buffer=Ut,i.loop=!0;const l=U.createBiquadFilter();l.type=o.type??"lowpass",l.frequency.setValueAtTime(o.f0,a),o.f1&&l.frequency.exponentialRampToValueAtTime(o.f1,a+t),l.Q.value=o.q??.8;const n=U.createGain();i0(n,a,o.attack??.003,e,t),i.connect(l).connect(n).connect(a0(o)),i.start(a,Math.random()*.9),i.stop(a+t+.03),Bt(i)}function te(t,e,o,a={}){if(!U||!be()||Fe>kt)return;const i=a.at??Y(),l=U.createOscillator(),n=U.createOscillator(),f=U.createGain(),h=U.createGain();l.frequency.setValueAtTime(t,i),a.slide&&l.frequency.exponentialRampToValueAtTime(Math.max(20,t*a.slide),i+e),n.frequency.setValueAtTime(t*(a.ratio??3.01),i);const d=t*(a.index??1.6);f.gain.setValueAtTime(d,i),f.gain.exponentialRampToValueAtTime(Math.max(.01,d*.04),i+e*.75),n.connect(f).connect(l.frequency),i0(h,i,a.attack??.003,o,e),l.connect(h).connect(a0(a)),l.start(i),n.start(i),l.stop(i+e+.03),n.stop(i+e+.03),Bt(l)}const y0=new Map;function Q(t,e){if(!be()||!ce||Fe>kt-20)return!1;const o=Y();return o-(y0.get(t)??-9)<e?!1:(y0.set(t,o),!0)}function X(t){return 440*Math.pow(2,(t-69)/12)}let De=null;function Ye(){return De||(De=U.createBiquadFilter(),De.type="lowpass",De.frequency.value=900,De.Q.value=1.4,De.connect(Ue)),De}function Nt(t,e,o=.2,a=Y()){for(let i=0;i<t;i++)F(.022,o,{type:"bandpass",q:1.2,f0:3600,at:a+i*.05*(.75+Math.random()*.5),pan:e})}let x=57;const c0=[0,3,5,7,10,12,15,17,19],$={click(){Q("click",.03)&&(B(740,.04,.04,{slide:.6}),F(.015,.02,{type:"highpass",f0:3e3}))},start(){if(!Q("start",.2))return;const t=Y();F(.5,.06,{type:"bandpass",f0:300,f1:2600,q:1.4,attack:.25}),[0,3,7].forEach((e,o)=>te(X(x+12+e),.6,.06,{ratio:3.01,index:1.3,at:t+o*.09}))},banner(){Q("banner",.3)&&(F(.6,.05,{type:"bandpass",f0:250,f1:2400,q:1.2,attack:.3}),B(X(x-12),.9,.12,{type:"triangle",attack:.1}))},miss(t){Q("miss",.05)&&(B(170,.07,.1,{slide:.5,pan:t}),F(.04,.05,{f0:900,pan:t}))},hit(t,e){Q("hit",.04)&&(F(.11,.17,{type:"bandpass",f0:e?600:950,f1:200,q:1.2,pan:t}),B(e?170:270,.1,.16,{slide:.4,pan:t}),e&&te(190,.25,.08,{ratio:1.41,index:2.6,pan:t}))},squeal(t,e){if(!Q("squeal",.06))return;const o=e==="mini"?2500:e==="hat"?1150:e==="boss"?420:1650,a=e==="boss"?1.1:e==="mini"?.16:.27;B(o,a,.1,{type:"sawtooth",slide:.45,vibrato:90,rate:28,pan:t,dest:e==="boss"?Ye():void 0}),B(o*1.5,a*.7,.04,{type:"square",slide:.5,pan:t})},pop(t,e,o){Q("pop",.05)&&(B(540-o*160,.11,.17,{type:"triangle",slide:.3,pan:t}),F(.2,.13,{f0:1900,f1:280,pan:t}),F(.05,.06,{type:"highpass",f0:3800,pan:t}),te(X(x+12+c0[Math.min(e,c0.length-1)]),.3,.07,{ratio:2,index:.9,pan:t}))},hatOff(t){if(!Q("hat",.08))return;const e=Y();B(230,.26,.13,{slide:2.3,pan:t}),B(540,.22,.08,{slide:.55,at:e+.14,pan:t})},spawn(t,e,o){Q("spawn",.08)&&o!=="boss"&&(e==="drop"?(B(o==="mini"?1700:1250,.5,.035,{slide:.36,attack:.08,pan:t}),F(.4,.015,{type:"bandpass",f0:5200,f1:1800,q:6,pan:t})):Nt(e==="crawl"?9:5,t,o==="mini"?.14:.2))},cock(t){if(!Q("cock",.07))return;const e=Y();te(1750,.04,.13,{ratio:5.4,index:1,pan:t}),F(.03,.11,{type:"bandpass",f0:2600,q:3,pan:t}),te(1250,.05,.15,{ratio:5.4,index:1.2,at:e+.1,pan:t}),F(.03,.13,{type:"bandpass",f0:1900,q:3,at:e+.1,pan:t})},warn(t){if(!Q("warn",.16))return;const e=Y();B(988,.07,.08,{type:"square",pan:t}),B(988,.07,.08,{type:"square",at:e+.11,pan:t})},bang(t,e){if(!ce||!be())return;const o=Y();for(const a of e?[o,o+.07]:[o])F(.3,.55,{f0:e?3200:4400,f1:220,pan:t,at:a}),B(e?130:175,.24,.6,{slide:.24,pan:t,at:a}),F(.045,.3,{type:"highpass",f0:3200,pan:t,at:a})},ouch(){if(!ce||!be())return;const t=Y();F(.4,.2,{type:"highpass",f0:2400,at:t+.03}),B(230,.5,.2,{type:"triangle",slide:.4,at:t+.03});for(let e=0;e<10;e++)te(1500+Math.random()*3800,.22,.04,{ratio:4.1,index:1.3,at:t+.04+Math.random()*.55,pan:Math.random()*2-1})},giggle(t){if(!Q("giggle",.3))return;const e=Y();for(let o=0;o<5;o++)B(1350-o*95,.06,.085,{type:"square",slide:1.25,at:e+o*.085,pan:t})},heartAppear(t){if(!Q("heartA",.2))return;const e=Y();[12,16,19].forEach((o,a)=>te(X(x+12+o),.4,.05,{ratio:3.01,index:1.2,at:e+a*.07,pan:t}))},heal(){if(!Q("heal",.1))return;const t=Y();te(X(x+24),.4,.09,{ratio:2,index:1}),te(X(x+31),.6,.09,{ratio:2,index:1,at:t+.1}),B(X(x+12),.5,.08,{type:"triangle",attack:.05,at:t+.1})},bossIntro(){if(!ce||!be())return;const t=Y();for(const e of[-12,12])B(X(x-24),2.3,.22,{type:"sawtooth",attack:.6,detune:e,dest:Ye()});F(2.4,.25,{f0:140,f1:60,attack:.7});for(const e of[0,.5,1,1.25,1.5])B(82,.5,.38,{slide:.6,at:t+e});for(const e of[0,1,6])for(const o of[-9,9])B(X(x+e),1.3,.06,{type:"sawtooth",attack:.12,detune:o,at:t+1,dest:Ye()});Nt(14,0,.1,t+.3)},bossStun(t){if(!Q("stun",.3))return;const e=Y();for(let o=0;o<8;o++)B(1250-o*115,.09,.11,{type:"triangle",slide:.8,at:e+o*.07,pan:t})},bossSummon(){Q("summon",.3)&&(B(92,.6,.3,{type:"sawtooth",slide:.7,dest:Ye()}),Nt(16,0,.11))},bossDie(){if(!ce||!be())return;const t=Y();B(210,1.7,.5,{slide:.14}),F(1.5,.4,{f0:3200,f1:80});for(let e=0;e<7;e++){const o=t+.15+e*.17;B(480-e*30,.1,.14,{type:"triangle",slide:.3,at:o,pan:Math.random()*2-1}),F(.16,.1,{f0:1800,f1:300,at:o})}},star(t){!ce||!be()||(te(X(x+24+[0,4,7][t%3]),.55,.1,{ratio:3.01,index:1.5}),F(.05,.03,{type:"highpass",f0:6e3}))},win(){if(!ce||!be())return;const t=Y();[0,4,7,12].forEach((e,o)=>{B(X(x+12+e),.3,.07,{type:"triangle",at:t+o*.13}),te(X(x+24+e),.4,.04,{at:t+o*.13})});for(const e of[0,4,7,12,16])for(const o of[-8,8])B(X(x+e),1.9,.02,{type:"sawtooth",attack:.06,detune:o,at:t+.52,dest:Ye()});B(82,.9,.2,{slide:.6,at:t+.52}),F(1.2,.04,{type:"highpass",f0:6e3,at:t+.52})},lose(){if(!ce||!be())return;const t=Y();[7,6,5,4].forEach((e,o)=>{const a=o===3;for(const i of[-7,7])B(X(x+e),a?1.2:.4,.09,{type:"sawtooth",slide:a?.8:.95,attack:.03,detune:i,at:t+o*.42,dest:Ye(),vibrato:a?40:0})});for(let e=0;e<2;e++)for(let o=0;o<5;o++)B(1350-o*95+e*200,.06,.04,{type:"square",slide:1.25,at:t+1.9+e*.5+o*.085,pan:e?.6:-.6})},drip(t){if(!Q("drip",.2))return;const e=Y();B(1450,.07,.1,{slide:.45,pan:t}),B(720,.1,.05,{slide:1.6,at:e+.05,pan:t})},tick(t){Q("tick",.4)&&F(.016,.14,{type:"bandpass",q:2,f0:3200,pan:t})},hoot(t){if(!Q("hoot",.5))return;const e=Y();B(392,.3,.13,{attack:.05,slide:.93,pan:t}),B(349,.2,.11,{attack:.04,at:e+.4,pan:t}),B(349,.4,.12,{attack:.04,slide:.9,at:e+.62,pan:t})},thunder(){Q("thunder",1)&&(F(.12,.25,{type:"highpass",f0:1800}),F(2.6,.36,{f0:500,f1:50,attack:.03}),B(55,1.8,.2,{slide:.6,attack:.05}))},bell(t){if(!Q("bell",.6))return;const e=Y();for(let o=0;o<12;o++)te(1568,.11,.07,{ratio:3.7,index:1.8,at:e+o*.06,pan:t})},clang(t){if(!Q("clang",.05))return;const e=260+Math.random()*180;te(e,1,.14,{ratio:2.32,index:3.2,pan:t}),te(e*2.7,.5,.07,{ratio:1.41,index:2,pan:t}),F(.04,.1,{type:"bandpass",f0:2400,q:2,pan:t})},globe(t){if(!Q("globe",.2))return;F(.5,.12,{type:"bandpass",f0:2400,f1:700,q:3,pan:t});const e=Y();for(let o=0;o<9;o++)F(.014,.08,{type:"highpass",f0:3e3,at:e+o*o*.007,pan:t})},squeak(t){if(!Q("squeak",.12))return;const e=Y();B(950,.12,.09,{type:"square",slide:1.7,pan:t}),B(1550,.16,.06,{type:"square",slide:.5,at:e+.12,pan:t})},buzz(t){if(!Q("buzz",.2))return;const e=Y();for(let o=0;o<4;o++)B(100,.07,.11,{type:"sawtooth",at:e+o*.1,pan:t}),F(.02,.08,{type:"highpass",f0:5e3,at:e+o*.1,pan:t})},bonk(t){Q("bonk",.08)&&(B(135,.28,.22,{slide:.6,pan:t}),te(205,.35,.1,{ratio:1.5,index:2,pan:t}))},chime(t){if(!Q("chime",.12))return;const e=Y();[7,12,15,19].forEach((o,a)=>te(X(x+24+o),.7,.05,{ratio:3.5,index:1.1,at:e+a*.08,pan:t}))},lamp(t){Q("lamp",.1)&&(F(.02,.09,{type:"highpass",f0:2500,pan:t}),B(1900,.02,.05,{pan:t}))},cricket(t){if(!Q("cricket",.8))return;const e=Y();for(let o=0;o<3;o++)for(let a=0;a<4;a++)B(4300,.018,.035,{at:e+o*.15+a*.03,pan:t})},bat(t){if(!Q("bat",1))return;const e=Y();for(let o=0;o<4;o++)B(6200,.03,.035,{slide:1.2,at:e+o*.22,pan:t-o*.3});for(let o=0;o<8;o++)F(.03,.035,{f0:600,at:e+o*.11,pan:t-o*.15})},flicker(){if(!Q("flicker",.5))return;const t=Y();for(let e=0;e<3;e++)B(120,.05,.06,{type:"sawtooth",at:t+e*.13}),F(.015,.06,{type:"highpass",f0:6e3,at:t+e*.13})},pot(t){if(!Q("pot",.5))return;const e=Y();for(let o=0;o<7;o++)te(2100+Math.random()*300,.04,.055,{ratio:3.7,index:1.2,at:e+o*.075,pan:t});F(.6,.02,{type:"highpass",f0:5e3,attack:.2,pan:t})}},vt=[0,2,4,7,9,12,14,16,19];function _e(t,e,o,a=Y()){for(let i=0;i<t;i++)F(.04,o,{type:"bandpass",f0:700+Math.random()*500,q:.8,at:a+i*.06,pan:e})}const Ae={flutter(t,e){Q("flutter",.08)&&(_e(e?5:7,t,.14),te(X(x+24+(e?16:7)),.3,.03,{ratio:3.5,index:1,pan:t}))},ready(t){if(!Q("ready",.07))return;const e=Y();te(X(x+31),.25,.07,{ratio:3.01,index:1.1,pan:t}),te(X(x+36),.32,.07,{ratio:3.01,index:1.1,at:e+.1,pan:t})},warn(t){if(!Q("bwarn",.16))return;const e=Y();for(let o=0;o<4;o++)te(X(x+36+(o%2?2:0)),.07,.06,{ratio:2,index:.8,at:e+o*.055,pan:t})},away(t,e){if(!ce||!be())return;const o=Y();F(.4,.2,{type:"bandpass",f0:500,f1:3600,q:1.2,attack:.05,pan:t}),B(e?380:520,.32,.12,{slide:3,pan:t}),_e(6,t,.08,o+.05),B(X(x+19),.22,.13,{type:"triangle",at:o+.3}),B(X(x+16),.5,.13,{type:"triangle",slide:.96,at:o+.52})},tap(t,e){Q("btap",.04)&&(te(X(x+(e?19:24)),.14,.12,{ratio:2,index:.7,pan:t}),F(.03,.05,{type:"highpass",f0:4e3,pan:t}))},caught(t,e,o){if(!Q("caught",.05))return;const a=Y(),i=Math.min(e,4);for(let l=0;l<4;l++)te(X(x+24+vt[i+l]),.3,.085,{ratio:3.01,index:1.2,at:a+l*.05,pan:t});B(X(x+12+vt[i]),.2,.07+.03*o,{type:"triangle",pan:t}),F(.25,.04,{type:"highpass",f0:6500,attack:.02,pan:t})},queenIntro(){if(!ce||!be())return;const t=Y(),e=[0,2,4,5,7,9,11];for(let o=0;o<15;o++)te(X(x+12+e[o%7]+12*Math.floor(o/7)),.5,.06,{ratio:2,index:.9,at:t+o*.06,pan:-.6+o*.08});for(const o of[0,4,7,12])for(const a of[-8,8])B(X(x+o),1.4,.04,{type:"sawtooth",attack:.1,detune:a,at:t+1,dest:Ye()});B(82,.5,.25,{slide:.6,at:t+1}),_e(12,0,.07,t+.2)},queenCalls(){if(!Q("calls",.3))return;const t=Y();_e(14,0,.08),[12,16,19].forEach((e,o)=>te(X(x+12+e),.3,.06,{ratio:3.5,index:1,at:t+o*.07}))},queenCaught(){if(!ce||!be())return;const t=Y();for(let e=0;e<18;e++)te(X(x+24+vt[Math.floor(Math.random()*9)]),.5,.05,{ratio:3.5,index:1.2,at:t+Math.random()*1.3,pan:Math.random()*2-1});for(let e=0;e<9;e++)te(X(x+12+vt[e]),.45,.08,{ratio:2,index:1,at:t+e*.07});B(110,.9,.25,{slide:.5}),F(1.2,.06,{type:"highpass",f0:6e3,attack:.1})},lose(){if(!ce||!be())return;const t=Y();[7,4,2,0].forEach((e,o)=>{B(X(x+12+e),o===3?1:.38,.11,{type:"triangle",attack:.03,at:t+o*.4,vibrato:o===3?25:0})}),_e(10,.5,.06,t+1.7),_e(10,-.5,.06,t+2)}};let it=!1;function vo(t){it=t}const n0={menu:{bpm:100,steps:6,key:50,lead:"celesta",backing:"waltz",chords:["Dm","Dm","Gm","Dm","Bb","Gm","A","A","Dm","Dm","Gm","Dm","Bb","A","Dm","Dm"],melody:["d5 - f5 - a5 -","g5 - f5 - e5 -","d5 - g5 - bb5 -","a5 - - - - -","bb5 - a5 - g5 -","g5 - bb5 - g5 -","e5 - a5 - c#6 -","a5 - - - - -","d6 - a5 - f5 -","e5 - f5 - d5 -","g5 - bb5 - d6 -","a5 - - - f5 -","bb5 - d6 - bb5 -","a5 - c#6 - e6 -","d6 - - - a5 -","d5 - - - - -"]},colegio:{bpm:112,steps:8,key:52,lead:"xylo",backing:"tiptoe",chords:["Em","Em","Am","Em","C","Am","B","Em","Em","Em","Am","Em","C","Am","B","Em"],melody:["e5 - g5 - f#5 g5 e5 -","b4 - e5 - d#5 e5 b4 -","a4 - c5 - b4 c5 a4 -","e5 - - - b4 - - -","c5 - e5 - g5 - e5 -","a4 - c5 - e5 - c5 -","b4 - d#5 - f#5 - a5 -","g5 f#5 e5 - - - - -","e5 g5 b5 - a5 g5 f#5 -","e5 - b4 - e5 - - -","a5 - g5 - f#5 - e5 -","d#5 - e5 - b4 - - -","c5 e5 g5 - c6 - g5 -","a5 - e5 - c5 - a4 -","b4 d#5 f#5 a5 b5 - a5 -","e5 - - - e4 - - -"]},cocina:{bpm:132,steps:6,key:55,lead:"glock",backing:"waltz",chords:["Gm","Gm","Cm","Gm","Eb","Cm","D","D","Gm","Gm","Cm","Gm","Eb","D","Gm","Gm"],melody:["g5 - bb5 - d6 -","d6 - c6 - bb5 -","c6 - eb6 - c6 -","bb5 - a5 - g5 -","eb5 - g5 - bb5 -","c6 - bb5 - g5 -","a5 - f#5 - d5 -","d5 - f#5 - a5 -","g5 - d6 - bb5 -","g5 - a5 - bb5 -","c6 - g5 - eb6 -","d6 - - - bb5 -","eb6 - d6 - c6 -","a5 - c6 - f#5 -","g5 - - - d5 -","g4 - - - - -"]},dormitorio:{bpm:84,steps:6,key:57,lead:"box",backing:"waltz",chords:["Am","Am","Dm","Am","F","Dm","E","E","Am","Am","Dm","Am","F","E","Am","Am"],melody:["e5 - - - c5 -","e5 - - - c5 -","f5 - e5 - d5 -","e5 - - - - -","f5 - - - a5 -","f5 - e5 - d5 -","e5 - g#5 - b5 -","e5 - - - - -","a5 - - - e5 -","c6 - b5 - a5 -","d6 - - - a5 -","e5 - a5 - c6 -","a5 - f5 - c5 -","b4 - e5 - g#5 -","a5 - - - e5 -","a4 - - - - -"]},bodega:{bpm:80,steps:8,key:48,lead:"theremin",backing:"drone",chords:["Cm","Cm","Ab","G","Cm","Fm","Db","G","Cm","Cm","Ab","Fm","Cm","Db","G","Cm"],melody:["g4 - - - - - eb4 -","c5 - - - - - - -","ab4 - - - c5 - eb5 -","d5 - - - b4 - - -","c5 - - - eb5 - - -","f5 - - - ab5 - f5 -","f5 - - - db5 - - -","d5 - - - g4 - - -","g5 - - - - - eb5 -","c5 - - - - - g4 -","ab4 - c5 - eb5 - - -","f5 - - - c5 - - -","eb5 - - - c5 - - -","db5 - - - - - f5 -","d5 - - - b4 - - -","c5 - - - - - - -"]},bosque:{bpm:168,steps:6,key:47,lead:"ocarina",backing:"six",chords:["Bm","Bm","G","F#","Bm","Em","F#","F#","Bm","G","Em","F#","Bm","Em","F#","Bm"],melody:["b4 - d5 f#5 - d5","b5 - - a5 - f#5","g5 - b5 d6 - b5","c#6 - - a#5 - f#5","b5 - d6 f#6 - d6","e6 - - b5 - g5","f#5 - a#5 c#6 - e6","f#6 - - - - -","f#6 - d6 b5 - f#5","g5 - b5 d6 - -","e6 - b5 g5 - e5","f#5 - - a#5 - c#6","b5 - - d6 - b5","g5 - e5 b5 - g5","f#5 - a#5 c#6 - a#5","b5 - - - - -"]}},w0=["colegio","cocina","dormitorio","bodega","bosque"],Z0={c:0,d:2,e:4,f:5,g:7,a:9,b:11};function qo(t){const e=/^([a-g])(#|b)?(\d)$/.exec(t);return e?12*(Number(e[3])+1)+Z0[e[1]]+(e[2]==="#"?1:e[2]==="b"?-1:0):-1}function Ro(t){const e=/^([A-G])(#|b)?(m)?$/.exec(t);return e?{root:(Z0[e[1].toLowerCase()]+(e[2]==="#"?1:e[2]==="b"?-1:0)+12)%12,third:e[3]?3:4}:{root:0,third:3}}const k0=new Map;function Wo(t,e){const o=((t-e)%12+12)%12;return o===3||o===8||o===10?t+1:t}function Eo(t,e){const o=((t.root-e)%12+12)%12,i={0:[0,4],1:[2,3],2:[2,3],3:[4,3],5:[5,4],7:[7,4],8:[9,3],10:[7,4]}[o];return i?{root:(e+i[0])%12,third:i[1]}:t}function Io(t){const e=t+(it?"+":"");let o=k0.get(e);if(o)return o;const a=n0[t],i=a.melody.map(l=>{const n=l.trim().split(/\s+/);return n.map((f,h)=>{const d=qo(f);if(d<0)return null;const u=it?Wo(d,a.key):d;let c=1;for(;h+c<n.length&&n[h+c]==="-";)c++;return{midi:u,len:c}})});return o={tune:a,notes:i,chords:a.chords.map(Ro).map(l=>it?Eo(l,a.key):l)},k0.set(e,o),o}let He={boss:!1,tension:0},Lt="",s0="menu",Vt=0,xe=0,Ft=-1,M0=-1;function Go(t,e=.22){if(He=t,!be())return;const o=j0&&t.mode!=="off",a=o?.95*(t.paused?.55:1):0;a!==Ft&&(at.gain.setTargetAtTime(a,Y(),o?.25:.12),Ft=a);const i=t.paused?600:16e3;if(i!==M0&&(Ze.frequency.setTargetAtTime(i,Y(),.12),M0=i),!o)return;const l=t.tune<0?"menu":w0[t.tune%w0.length],n=l+(it?"+":""),f=Y();if(n!==Lt){if(Lt){const d=oe;d.out.gain.setTargetAtTime(0,f,.07),Ao(.8,()=>d.out.disconnect()),oe=K0()}for(Lt=n,s0=l,Vt=0,xe=f+.1,x=n0[l].key+12;x>62;)x-=12}xe<f-.05&&(xe=f+.06);let h=0;for(;xe<f+e&&h++<4e3;)Oo(Vt,xe),xe+=Y0(),Vt++}function Y0(){return 60/(n0[s0].bpm*(He.boss?1.2:1)*(it?1.07:1))/2}function zo(t,e,o,a){const i=X(e);switch(t){case"celesta":te(i,.9,.075,{ratio:3.01,index:1.2,at:a,dest:oe.out}),B(i*2,.25,.012,{at:a,dest:oe.echo});break;case"xylo":te(i,.26,.12,{ratio:4,index:1,at:a,dest:oe.out}),B(i,.14,.045,{type:"triangle",at:a,dest:oe.echo});break;case"glock":te(i,.7,.06,{ratio:3.5,index:1.4,at:a,dest:oe.out}),B(i,.3,.025,{type:"triangle",at:a,dest:oe.echo});break;case"box":te(i,1.3,.075,{ratio:5.01,index:.8,at:a,dest:oe.out}),B(i,.6,.03,{at:a,dest:oe.echo});break;case"theremin":B(i,o+.15,.07,{attack:.12,vibrato:32,rate:5.6,at:a,dest:oe.out}),B(i*2,o,.008,{attack:.15,vibrato:32,rate:5.6,at:a,dest:oe.echo});break;default:B(i,o+.06,.065,{type:"triangle",attack:.03,vibrato:14,rate:5,at:a,dest:oe.out}),B(i,.25,.02,{at:a,dest:oe.echo})}}function Ge(t,e,o,a=.22){B(X(t),a,e,{type:"triangle",at:o,dest:oe.out}),B(X(t),a*.7,e*.4,{type:"sawtooth",at:o,dest:oe.soft})}function Oo(t,e){const o=Io(s0),a=o.tune,i=t%a.steps,l=Math.floor(t/a.steps)%o.notes.length,n=Y0(),f=o.chords[l],h=36+f.root,d=[f.root,f.root+f.third,f.root+7].map(c=>55+(c+5)%12),u=o.notes[l][i];switch(u&&zo(a.lead,u.midi,u.len*n,e),a.backing){case"waltz":if(i===0&&Ge(h,.16,e,.4),i===2||i===4)for(const c of d.slice(1))Ge(c,.035,e,.16);break;case"tiptoe":if((i===0||i===4)&&Ge(h,.15,e,.18),(i===2||i===6)&&Ge(h+7,.11,e,.16),i===3||i===7)for(const c of d.slice(1))Ge(c,.022,e,.1);break;case"drone":if(i===0){for(const c of[-6,6])B(X(h),n*a.steps*1.05,.05,{type:"sawtooth",attack:.5,detune:c,at:e,dest:oe.soft});B(X(h),n*a.steps,.1,{attack:.4,at:e,dest:oe.out})}i===4&&Ge(h+7,.07,e,.5),i===6&&l%2===1&&te(X(d[2]+24),.5,.025,{ratio:3.5,index:1,at:e,dest:oe.echo});break;default:i===0&&Ge(h,.16,e,.5),i===3&&Ge(h+7,.1,e,.4),(i===1||i===2||i===4||i===5)&&Ge(d[(i+l)%3]+12,.028,e,.18),i===0&&l%4===2&&F(n*12,.03,{type:"bandpass",f0:500,f1:1100,q:1.5,attack:n*5,at:e,dest:oe.out})}if(i===0&&(a.lead==="celesta"||a.lead==="box"||a.lead==="ocarina")&&Bo(d,e,n*a.steps,.012),He.tension>.25&&!He.boss&&(F(.025,.05*He.tension,{type:"highpass",f0:7e3,at:e,dest:oe.out}),i%2===0&&He.tension>.6&&B(X(h+12),.08,.05*He.tension,{type:"square",at:e,dest:oe.soft})),He.boss){const c=a.steps/2;if((i===0||a.steps===8&&i===5)&&(B(120,.2,.24,{slide:.3,at:e,dest:oe.out}),F(.02,.1,{type:"highpass",f0:2500,at:e,dest:oe.out})),(i===c||a.steps===6&&i===4)&&(F(.13,.15,{type:"bandpass",f0:1800,q:.7,at:e,dest:oe.out}),B(190,.09,.09,{type:"triangle",slide:.6,at:e,dest:oe.out})),F(.035,i%2?.04:.08,{type:"highpass",f0:6500,at:e,dest:oe.out}),i===0&&l%2===0)for(const y of[-7,7])B(X(h),n*a.steps*2,.03,{type:"sawtooth",attack:.3,detune:y,at:e,dest:oe.soft});l%4===3&&i>=a.steps-3&&B(200-(i-(a.steps-3))*34,.14,.16,{slide:.6,at:e,dest:oe.out})}}function Bo(t,e,o,a){if(!U||!be()||Fe>kt)return;const i=U.createBiquadFilter();i.type="lowpass",i.Q.value=.7,i.frequency.value=900;const l=U.createGain();l.gain.value=0,l.gain.setValueAtTime(1e-4,e),l.gain.linearRampToValueAtTime(a,e+Math.min(.5,o*.3)),l.gain.setValueAtTime(a,e+o*.8),l.gain.linearRampToValueAtTime(1e-4,e+o+.3),i.connect(l).connect(oe.out);for(const n of t)for(const f of[-8,8]){const h=U.createOscillator();h.type="sawtooth",h.frequency.value=X(n),h.detune.value=f,h.connect(i),h.start(e),h.stop(e+o+.35),Bt(h)}}const nt={widow:{body:"#15111d",bodyHi:"#3a3050",rim:"#8f7fc0",leg:"#15111d",band:null,eye:"#ff4338",eyeHi:"#ffd0a0",mark:"#ee2030",goo:"#8be04a",gun:"#59606e",gunHi:"#c9d2e0"},hat:{body:"#4b2e1f",bodyHi:"#93603a",rim:"#e0a56c",leg:"#3b2418",band:"#e8862e",eye:"#ffd23f",eyeHi:"#fff6c0",mark:"#f4a640",goo:"#b6e04a",gun:"#59606e",gunHi:"#c9d2e0"},mini:{body:"#24521f",bodyHi:"#6bb048",rim:"#c9ff8c",leg:"#1d431b",band:null,eye:"#e6ff5a",eyeHi:"#ffffff",mark:"#f0ff9a",goo:"#e8f04a",gun:"#59606e",gunHi:"#c9d2e0"},boss:{body:"#371545",bodyHi:"#7d359c",rim:"#e09cff",leg:"#2a1036",band:"#ffc933",eye:"#ff5ad8",eyeHi:"#ffe0fa",mark:"#ffc933",goo:"#d86bff",gun:"#b8860b",gunHi:"#ffe58a"}},Ho={body:"#ffffff",bodyHi:"#ffffff",rim:"#ffffff",leg:"#fff3d0",band:null,eye:"#ffffff",eyeHi:"#ffffff",mark:"#ffffff",goo:"#ffffff",gun:"#ffffff",gunHi:"#ffffff"},ne=Math.PI*2;function S0(t,e,o,a,i,l,n,f){t.beginPath();const h=l*2;for(let d=0;d<=h;d++){const u=d/h*ne+f,c=d%2?1+n:1,y=e+Math.cos(u)*a*c,k=o+Math.sin(u)*i*c;d===0?t.moveTo(y,k):t.lineTo(y,k)}t.closePath()}function Jo(t,e,o,a,i){const l=e.x-t.x,n=e.y-t.y,f=Math.max(Math.abs(o-a)+1,Math.min(o+a-1,Math.hypot(l,n))),h=Math.atan2(n,l),d=Math.acos(Math.max(-1,Math.min(1,(o*o+f*f-a*a)/(2*o*f)))),u={x:t.x+Math.cos(h+d)*o,y:t.y+Math.sin(h+d)*o},c={x:t.x+Math.cos(h-d)*o,y:t.y+Math.sin(h-d)*o};return i(u)>i(c)?u:c}const No=[{x:64,y:96},{x:116,y:90},{x:154,y:80},{x:176,y:66}],Lo=[{x:74,y:118},{x:150,y:84},{x:168,y:-6},{x:124,y:-104}];function T0(t,e,o){const a={x:e*30,y:4+o*6},i=t.hanging?Lo[o]:No[o],l=t.time*(t.hanging?2.1:13)+o*1.7+(e>0?0:Math.PI)+t.seed*9;let n=i.x,f=i.y;if(t.hanging)n+=Math.sin(l)*7,f+=Math.cos(l*.8)*7,t.dizzy&&(n+=Math.sin(t.time*22+o)*6);else{const u=t.walk;n+=Math.cos(l)*16*u,f-=Math.max(0,Math.sin(l))*16*u,f+=Math.sin(t.time*2+o)*1.5}const h={x:e*n,y:f},d=Jo(a,h,78,104,t.hanging?u=>Math.abs(u.x)*.6-u.y:u=>-u.y);return[a,d,h]}function P0(t,e,o){const[a,i,l]=o;t.lineCap="round",t.lineJoin="round",t.strokeStyle=e.rim,t.globalAlpha=.55,t.lineWidth=19,t.beginPath(),t.moveTo(a.x,a.y),t.lineTo(i.x,i.y),t.stroke(),t.lineWidth=14,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(l.x,l.y),t.stroke(),t.globalAlpha=1,t.strokeStyle=e.leg,t.lineWidth=15,t.beginPath(),t.moveTo(a.x,a.y),t.lineTo(i.x,i.y),t.stroke(),t.lineWidth=10,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(l.x,l.y),t.stroke(),e.band&&(t.strokeStyle=e.band,t.lineWidth=10,t.setLineDash([9,22]),t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(l.x,l.y),t.stroke(),t.setLineDash([])),t.fillStyle=e.bodyHi,t.beginPath(),t.arc(i.x,i.y,6,0,ne),t.fill()}function U0(t,e,o,a,i=1){t.save(),t.scale(i,i);const l=1-.88*e;if(t.save(),t.scale(1,l),t.fillStyle=o,t.beginPath(),t.roundRect(-6,-78,12,52,3),t.fill(),t.fillStyle=a,t.fillRect(-6,-78,4,52),t.fillStyle=o,t.fillRect(-9,-76,4,7),t.fillStyle="#2c313b",t.beginPath(),t.roundRect(-11,-30,22,24,5),t.fill(),t.fillStyle=a,t.globalAlpha=.5,t.fillRect(-7,-28,3,20),t.fillRect(1,-28,3,20),t.globalAlpha=1,t.fillStyle=o,t.beginPath(),t.roundRect(-9,-8,18,12,3),t.fill(),t.fillRect(6,-14,6,8),t.restore(),t.fillStyle="#6a3d1e",t.beginPath(),t.moveTo(-8,0),t.lineTo(9,0),t.lineTo(13,26*(.45+.55*l)+4),t.lineTo(-5,26*(.45+.55*l)+6),t.closePath(),t.fill(),t.fillStyle="#a5672f",t.fillRect(-4,3,4,14*(.45+.55*l)),e>.3){const n=(e-.3)/.7;t.globalAlpha=Math.min(1,n*1.6);const f=-18*(1-n)-10;t.fillStyle="#2c313b",t.beginPath(),t.arc(0,f+6,19*(.5+.5*n),0,ne),t.fill(),t.fillStyle=o,t.beginPath(),t.arc(0,f-6,15*(.5+.5*n),0,ne),t.fill(),t.strokeStyle=a,t.lineWidth=2.5,t.beginPath(),t.arc(0,f-6,13*(.5+.5*n),Math.PI*.9,Math.PI*1.7),t.stroke(),t.fillStyle="#05060a",t.beginPath(),t.arc(0,f-6,8.5*(.5+.5*n),0,ne),t.fill(),t.globalAlpha=1}t.restore()}function F0(t,e,o){const a=o===0?{x:80,y:34}:{x:112,y:-8},i=o===0?{x:46,y:70}:{x:92,y:44},l=t.aim,n=Math.sin(t.time*2.4+o+t.seed*5)*2.5;return{x:e*(a.x+(i.x-a.x)*l),y:a.y+(i.y-a.y)*l+n}}function Vo(t){const e=t.kind==="boss"?2:1,o=[],a=t.kind==="boss"?1.05:1.15;for(let i=0;i<e;i++)for(const l of[-1,1]){const n=F0(t,l,i),f=78*(1-.88*t.aim)+(t.aim>.3?16*((t.aim-.3)/.7):0);o.push({x:n.x,y:n.y-f*a*(1-t.aim*.55)})}return o}function qt(t,e,o,a,i,l,n){t.save(),t.translate(o,a),t.scale(1,n),t.fillStyle="#0a0710",t.beginPath(),t.arc(0,0,i+2.2,0,ne),t.fill();const f=t.createRadialGradient(-i*.3,-i*.3,i*.1,0,0,i);if(f.addColorStop(0,e.eyeHi),f.addColorStop(.55,e.eye),f.addColorStop(1,e.eye),t.fillStyle=f,t.beginPath(),t.arc(0,0,i,0,ne),t.fill(),l.dizzy){t.strokeStyle="#0a0710",t.lineWidth=Math.max(1.4,i*.18),t.beginPath();for(let h=0;h<=24;h++){const d=h/24*ne*1.6+l.time*9,u=h/24*i*.8;h===0?t.moveTo(Math.cos(d)*u,Math.sin(d)*u):t.lineTo(Math.cos(d)*u,Math.sin(d)*u)}t.stroke()}else{const h=l.lookX*i*.38,d=l.lookY*i*.32;t.fillStyle="#0a0710",t.beginPath(),t.ellipse(h,d,i*(.36-.14*l.aim),i*.66,0,0,ne),t.fill(),t.fillStyle="rgba(255,255,255,0.9)",t.beginPath(),t.arc(h-i*.3,d-i*.36,i*.17,0,ne),t.fill()}t.restore()}function l0(t,e,o){const a=Math.sin(o*3)*.25;switch(e){case 0:{t.fillStyle="#1b1d2b",t.beginPath(),t.roundRect(-30,-16,60,22,6),t.fill(),t.fillStyle="#2b2e44",t.beginPath(),t.moveTo(-62,-22),t.lineTo(0,-40),t.lineTo(62,-22),t.lineTo(0,-6),t.closePath(),t.fill(),t.strokeStyle="#ffd23f",t.lineWidth=3.5,t.beginPath(),t.moveTo(0,-23),t.lineTo(44,-14),t.lineTo(44+a*20,10),t.stroke(),t.fillStyle="#ffd23f",t.beginPath(),t.arc(44+a*20,14,6,0,ne),t.fill();break}case 1:{t.fillStyle="#f4f1e8";for(const[i,l,n]of[[-26,-44,24],[0,-56,28],[26,-44,24]])t.beginPath(),t.arc(i,l,n,0,ne),t.fill();t.beginPath(),t.roundRect(-34,-40,68,44,6),t.fill(),t.fillStyle="#cfc9ba",t.fillRect(-34,-8,68,5),t.fillRect(-14,-36,3,22),t.fillRect(10,-36,3,22);break}case 2:{const l=-18+a*16;t.fillStyle="#3f6fd1",t.beginPath(),t.moveTo(-40,4),t.quadraticCurveTo(-30,-66,16,-60),t.quadraticCurveTo(52,-56,64,l),t.quadraticCurveTo(36,-34,40,4),t.closePath(),t.fill(),t.strokeStyle="#ffffff",t.globalAlpha=.75,t.lineWidth=5,t.beginPath(),t.moveTo(-28,-22),t.quadraticCurveTo(0,-30,34,-22),t.moveTo(-16,-44),t.quadraticCurveTo(8,-50,38,-40),t.stroke(),t.globalAlpha=1,t.fillStyle="#ffffff",t.beginPath(),t.roundRect(-44,-4,88,14,7),t.fill(),t.beginPath(),t.arc(64,l,12,0,ne),t.fill();break}case 3:{t.fillStyle="#f2b824",t.beginPath(),t.arc(0,0,44,Math.PI,0),t.closePath(),t.fill(),t.fillStyle="#c98d12",t.beginPath(),t.roundRect(-54,-6,108,12,6),t.fill(),t.fillRect(-4,-44,8,40),t.fillStyle="#3a3f4b",t.beginPath(),t.arc(0,-20,13,0,ne),t.fill(),t.fillStyle="#fff6b0",t.beginPath(),t.arc(0,-20,9,0,ne),t.fill();break}case 4:{t.fillStyle="#2a1b3d",t.beginPath(),t.ellipse(0,0,66,15,0,0,ne),t.fill(),t.beginPath(),t.moveTo(-36,-2),t.quadraticCurveTo(-20,-60,8,-84),t.quadraticCurveTo(26,-98,44+a*10,-92),t.quadraticCurveTo(26,-76,36,-2),t.closePath(),t.fill(),t.fillStyle="#7a3fb0",t.beginPath(),t.moveTo(-36,-4),t.quadraticCurveTo(0,-14,36,-4),t.lineTo(34,-18),t.quadraticCurveTo(0,-27,-31,-18),t.closePath(),t.fill(),t.fillStyle="#ffd23f",t.fillRect(-9,-24,18,15),t.fillStyle="#2a1b3d",t.fillRect(-4,-20,8,7);break}default:{t.fillStyle="#ffc933",t.beginPath(),t.moveTo(-46,6),t.lineTo(-54,-44),t.lineTo(-28,-20),t.lineTo(-14,-56),t.lineTo(0,-22),t.lineTo(14,-56),t.lineTo(28,-20),t.lineTo(54,-44),t.lineTo(46,6),t.closePath(),t.fill(),t.fillStyle="#e09a12",t.fillRect(-46,-4,92,10);const i=[[-54,-46,"#ff4a6a"],[-14,-58,"#5ad8ff"],[14,-58,"#7dff6a"],[54,-46,"#ff4a6a"],[0,-1,"#d86bff"]];for(const[l,n,f]of i)t.fillStyle=f,t.beginPath(),t.arc(l,n,6.5,0,ne),t.fill()}}}function Do(t,e,o){t.fillStyle=o.mark,t.strokeStyle=o.mark;const a=-66;if(e==="widow"||e==="boss"){if(t.beginPath(),t.moveTo(-17,a-24),t.lineTo(17,a-24),t.lineTo(0,a),t.closePath(),t.fill(),t.beginPath(),t.moveTo(-15,a+20),t.lineTo(15,a+20),t.lineTo(0,a),t.closePath(),t.fill(),e==="boss")for(const i of[-36,36])t.beginPath(),t.arc(i,a-6,6,0,ne),t.fill()}else if(e==="hat"){t.lineWidth=7,t.lineCap="round";for(let i=0;i<3;i++)t.beginPath(),t.moveTo(-26+i*3,a-26+i*15),t.lineTo(0,a-14+i*15),t.lineTo(26-i*3,a-26+i*15),t.stroke()}else for(const[i,l,n]of[[-20,a-14,8],[18,a-18,7],[0,a+6,9],[-26,a+12,5],[28,a+8,5]])t.beginPath(),t.arc(i,l,n,0,ne),t.fill()}function jo(t,e){const o=e.hurt?Ho:nt[e.kind],a=e.kind==="boss";e.threadTop!==void 0&&(t.strokeStyle="rgba(235,240,255,0.75)",t.lineWidth=Math.max(1.5,(a?4.5:2.6)*Math.sqrt(e.scale)),t.beginPath(),t.moveTo(e.x,e.threadTop),t.lineTo(e.x,e.y-100*e.scale*e.squashY),t.stroke()),t.save();const i=e.heat>.72?(e.heat-.72)*9:0;t.translate(e.x+Math.sin(e.time*61)*i,e.y+Math.cos(e.time*53)*i),t.scale(e.scale*e.squashX,e.scale*e.squashY);const l=1+Math.sin(e.time*2.6+e.seed*7)*.015;e.grounded&&(t.fillStyle="rgba(0,0,0,0.3)",t.beginPath(),t.ellipse(0,94,150,16,0,0,ne),t.fill());for(const y of[3,2])for(const k of[-1,1])P0(t,o,T0(e,k,y));S0(t,0,-62,66*l,60*l,22,.085,e.seed);const n=t.createRadialGradient(-22,-92,6,0,-62,80);n.addColorStop(0,o.bodyHi),n.addColorStop(1,o.body),t.fillStyle=n,t.fill(),t.strokeStyle=o.rim,t.globalAlpha=.7,t.lineWidth=3,t.stroke(),t.globalAlpha=1,Do(t,e.kind,o);for(const y of[1,0])for(const k of[-1,1])P0(t,o,T0(e,k,y));S0(t,0,14,54,48,18,.08,e.seed*3);const f=t.createRadialGradient(-16,-12,5,0,14,62);f.addColorStop(0,o.bodyHi),f.addColorStop(1,o.body),t.fillStyle=f,t.fill(),t.strokeStyle=o.rim,t.globalAlpha=.7,t.lineWidth=3,t.stroke(),t.globalAlpha=1;for(const y of[-1,1])t.fillStyle=o.bodyHi,t.beginPath(),t.ellipse(y*13,46,12,14,0,0,ne),t.fill(),t.fillStyle=e.hurt?"#ffffff":"#fff8e6",t.beginPath(),t.moveTo(y*6,52),t.lineTo(y*20,52),t.quadraticCurveTo(y*16,68,y*8,80),t.quadraticCurveTo(y*9,64,y*6,52),t.fill();const h=(e.time*.45+e.seed*3)%1.6;h<1&&!e.hurt&&(t.fillStyle=o.goo,t.globalAlpha=1-h,t.beginPath(),t.ellipse(8,82+h*h*70,3.6,5.5,0,0,ne),t.fill(),t.globalAlpha=1);const u=(e.time*.31+e.seed*5)%1>.965&&e.aim<.2?.12:1;for(const y of[-1,1])qt(t,o,y*32,-20,5.5,e,u),qt(t,o,y*12,-17,6.5,e,u),qt(t,o,y*43,-2,8,e,u),qt(t,o,y*20,8,14.5,e,u);if(e.aim>.05&&!e.dizzy){t.fillStyle=o.body;for(const y of[-1,1])t.beginPath(),t.moveTo(y*2,-9),t.lineTo(y*38,-12),t.lineTo(y*38,-12+6*e.aim),t.lineTo(y*2,-9+17*e.aim),t.closePath(),t.fill()}const c=a?2:1;for(let y=c-1;y>=0;y--)for(const k of[-1,1]){const T=F0(e,k,y),b={x:k*(40+y*6),y:26-y*24},g={x:(b.x+T.x)/2+k*14,y:Math.max(b.y,T.y)+14};t.lineCap="round",t.lineJoin="round",t.strokeStyle=o.rim,t.globalAlpha=.55,t.lineWidth=16,t.beginPath(),t.moveTo(b.x,b.y),t.quadraticCurveTo(g.x,g.y,T.x,T.y+10),t.stroke(),t.globalAlpha=1,t.strokeStyle=o.leg,t.lineWidth=12,t.stroke(),t.save(),t.translate(T.x,T.y),t.rotate(k*(.3*(1-e.aim)-.5*e.flash)),t.scale(k,1),U0(t,e.aim,o.gun,o.gunHi,a?1.05:1.15),t.restore(),t.fillStyle=o.leg,t.beginPath(),t.arc(T.x,T.y+12,9,0,ne),t.fill()}(e.hat>=0||a)&&(t.save(),t.translate(0,-30),t.rotate(Math.sin(e.time*1.9+e.seed)*.04),l0(t,a?9:e.hat,e.time+e.seed*4),t.restore()),t.restore()}function Ko(t,e,o){const a=nt[e.kind];t.save(),t.translate(e.x,e.y),t.scale(e.scale*e.squashX,e.scale*e.squashY);const i=[[20,8,34],[43,-2,18],[12,-17,14],[32,-20,12]];t.globalAlpha=(e.dizzy?.1:.2+.22*e.aim)*(e.kind==="hat"||e.kind==="mini"?.5:1);for(const n of[-1,1])for(const[f,h,d]of i)pt(t,o,n*f,h,d*1.5,a.eye);e.hat===3&&e.kind==="hat"&&(t.globalAlpha=.45,pt(t,o,0,-50,44,"#fff0a0"));const l=Vo(e);if(e.heat>.02){const n=e.heat>.6?.75+.25*Math.sin(e.time*26):1;t.globalAlpha=Math.min(1,(.25+.75*e.heat)*n);for(const f of l)pt(t,o,f.x,f.y,26+46*e.heat,"#ff3020")}if(e.flash>.02){t.globalAlpha=Math.min(1,e.flash*1.4);for(const n of l){pt(t,o,n.x,n.y,150*e.flash+40,"#ffd070"),t.fillStyle="#fff6d0",t.beginPath();const f=7;for(let h=0;h<f*2;h++){const d=h/(f*2)*ne+e.seed*6,u=(h%2?22:74)*e.flash,c=n.x+Math.cos(d)*u,y=n.y+Math.sin(d)*u;h===0?t.moveTo(c,y):t.lineTo(c,y)}t.closePath(),t.fill()}}t.restore()}const A0=new Map;function pt(t,e,o,a,i,l){let n=A0.get(l);if(!n){n=document.createElement("canvas"),n.width=n.height=64;const f=n.getContext("2d");f.drawImage(e,0,0,64,64),f.globalCompositeOperation="source-in",f.fillStyle=l,f.fillRect(0,0,64,64),A0.set(l,n)}t.drawImage(n,o-i,a-i,i*2,i*2)}function Zo(){const t=document.createElement("canvas");t.width=t.height=64;const e=t.getContext("2d"),o=e.createRadialGradient(32,32,0,32,32,32);return o.addColorStop(0,"rgba(255,255,255,1)"),o.addColorStop(.35,"rgba(255,255,255,0.45)"),o.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=o,e.fillRect(0,0,64,64),t}function et(t,e,o,a,i,l){pt(t,e,o,a,i,l)}const Ne={widow:{wing:"#ff8a1e",wingHi:"#ffd35a",edge:"#2a1608",spot:"#ffffff",body:"#3a2414",glow:"#ffb84a"},hat:{wing:"#2f7df0",wingHi:"#7fe3ff",edge:"#0d1b4a",spot:"#d9f6ff",body:"#22305e",glow:"#6fd0ff"},mini:{wing:"#ff6fb4",wingHi:"#ffe66a",edge:"#6a1e4a",spot:"#ffffff",body:"#5a2a4a",glow:"#ff9ad0"},boss:{wing:"#b04cf0",wingHi:"#ff7ad8",edge:"#2e0f52",spot:"#ffe58a",body:"#3a1a5e",glow:"#e09cff"}},Yo={wing:"#ffffff",wingHi:"#ffffff",edge:"#fff3d0",spot:"#ffffff",body:"#ffffff"},he=Math.PI*2;function Uo(t){const e=6.5+9*t.aim+10*t.heat+8*t.walk,o=.5+.5*Math.sin(t.time*e+t.seed*9);return Math.max(.3+.7*o,t.flash)}function X0(t){return Math.sin(t.time*4.6+t.seed*5)*7-16*t.aim}function It(t,e,o,a,i){t.save(),t.scale(o*a,1),t.lineJoin="round",t.beginPath(),t.moveTo(6,0),t.bezierCurveTo(70,6,132,34,112,86),t.bezierCurveTo(98,126,54,130,30,96),t.bezierCurveTo(16,74,8,46,6,30),t.closePath();const l=t.createRadialGradient(20,20,6,60,60,110);l.addColorStop(0,e.wingHi),l.addColorStop(1,e.wing),t.fillStyle=l,t.fill(),t.strokeStyle=e.edge,t.lineWidth=9,t.stroke(),i&&(t.beginPath(),t.moveTo(66,112),t.quadraticCurveTo(104,172,60,222),t.quadraticCurveTo(54,170,22,104),t.closePath(),t.fillStyle=e.wing,t.fill(),t.stroke()),t.fillStyle=e.spot;for(const[f,h,d]of[[84,66,9],[62,98,7],[100,96,5]])t.beginPath(),t.arc(f,h,d,0,he),t.fill();t.beginPath(),t.moveTo(6,-6),t.bezierCurveTo(40,-92,118,-150,166,-118),t.bezierCurveTo(196,-96,178,-22,126,4),t.bezierCurveTo(84,22,30,18,6,8),t.closePath();const n=t.createRadialGradient(24,-10,8,80,-50,150);n.addColorStop(0,e.wingHi),n.addColorStop(1,e.wing),t.fillStyle=n,t.fill(),t.strokeStyle=e.edge,t.lineWidth=10,t.stroke(),t.lineWidth=3,t.globalAlpha=.45,t.beginPath(),t.moveTo(10,-2),t.quadraticCurveTo(70,-60,150,-104),t.moveTo(10,2),t.quadraticCurveTo(84,-24,156,-52),t.moveTo(10,4),t.quadraticCurveTo(70,6,122,-4),t.stroke(),t.globalAlpha=1,t.fillStyle=e.edge,t.beginPath(),t.arc(118,-70,23,0,he),t.fill(),t.fillStyle=e.spot,t.beginPath(),t.arc(118,-70,14,0,he),t.fill(),t.fillStyle=e.wingHi,t.beginPath(),t.arc(114,-74,6,0,he),t.fill(),t.fillStyle=e.spot;for(const[f,h,d]of[[160,-104,6],[172,-78,5],[168,-50,5],[150,-22,4.5]])t.beginPath(),t.arc(f,h,d,0,he),t.fill();t.restore()}function Fo(t,e){const o=e.hurt?Yo:Ne[e.kind],a=e.kind==="boss",i=Uo(e);t.save();const l=e.heat>.72?(e.heat-.72)*9:0;t.translate(e.x+Math.sin(e.time*61)*l,e.y+Math.cos(e.time*53)*l),t.scale(e.scale*e.squashX,e.scale*e.squashY),e.grounded&&(t.fillStyle="rgba(0,0,0,0.25)",t.beginPath(),t.ellipse(0,130,110*(.6+.4*i),13,0,0,he),t.fill()),t.translate(0,X0(e)),t.rotate(Math.sin(e.time*2.3+e.seed*3)*.06),It(t,o,-1,i,a),It(t,o,1,i,a),t.fillStyle=o.body,t.beginPath(),t.ellipse(0,46,15,50,0,0,he),t.fill(),t.strokeStyle=o.wingHi,t.globalAlpha=.5,t.lineWidth=4;for(let h=0;h<4;h++)t.beginPath(),t.moveTo(-12+h*1.5,34+h*15),t.lineTo(12-h*1.5,34+h*15),t.stroke();t.globalAlpha=1,t.fillStyle=o.body,t.beginPath(),t.ellipse(0,-2,19,24,0,0,he),t.fill(),t.strokeStyle=o.body,t.lineWidth=4.5,t.lineCap="round";for(const h of[-1,1]){const d=Math.sin(e.time*3.1+h+e.seed*4)*6;t.beginPath(),t.moveTo(h*10,-62),t.quadraticCurveTo(h*16,-104,h*(40+d),-112),t.stroke(),t.fillStyle=o.wingHi,t.beginPath(),t.arc(h*(40+d),-112,7,0,he),t.fill()}t.fillStyle=o.body,t.beginPath(),t.arc(0,-44,31,0,he),t.fill(),t.strokeStyle=o.wingHi,t.globalAlpha=.6,t.lineWidth=3,t.stroke(),t.globalAlpha=1;const f=(e.time*.33+e.seed*5)%1>.96?.12:1;for(const h of[-1,1]){if(t.save(),t.translate(h*13,-48),t.scale(1,f),t.fillStyle="#ffffff",t.beginPath(),t.ellipse(0,0,10.5,12.5,0,0,he),t.fill(),e.dizzy){t.strokeStyle="#1a1020",t.lineWidth=2.2,t.beginPath();for(let d=0;d<=20;d++){const u=d/20*he*1.6+e.time*9,c=d/20*8;d===0?t.moveTo(Math.cos(u)*c,Math.sin(u)*c):t.lineTo(Math.cos(u)*c,Math.sin(u)*c)}t.stroke()}else{const d=e.lookX*3.6,u=e.lookY*4;t.fillStyle="#1a1020",t.beginPath(),t.arc(d,u+1,6.2,0,he),t.fill(),t.fillStyle="#ffffff",t.beginPath(),t.arc(d-2.2,u-1.6,2.3,0,he),t.fill()}t.restore(),t.fillStyle="rgba(255,120,150,0.55)",t.beginPath(),t.ellipse(h*21,-33,6,4,0,0,he),t.fill()}t.strokeStyle="#ffffff",t.lineWidth=2.6,t.beginPath(),e.aim>.5?t.arc(0,-29,4.5,0,he):t.arc(0,-34,9,.25*Math.PI,.75*Math.PI),t.stroke(),(e.hat>=0||a)&&(t.save(),t.translate(0,-70),t.scale(.62,.62),t.rotate(Math.sin(e.time*1.9+e.seed)*.05),l0(t,a?9:e.hat,e.time+e.seed*4),t.restore()),t.restore()}function Xo(t,e,o){const a=Ne[e.kind];t.save(),t.translate(e.x,e.y),t.scale(e.scale,e.scale),t.translate(0,X0(e)),t.globalAlpha=.16+.2*e.aim;for(const i of[-1,1])et(t,o,i*80,-40,120,a.glow);if(e.heat>.02){const i=e.heat>.6?.75+.25*Math.sin(e.time*26):1;t.globalAlpha=Math.min(1,(.2+.6*e.heat)*i),et(t,o,0,-10,70+130*e.heat,"#fff0a0");const l=7;for(let n=0;n<l;n++){const f=e.time*(2+5*e.heat)+n/l*he,h=190-50*e.heat;t.globalAlpha=Math.min(1,e.heat*1.6)*(.5+.5*Math.sin(e.time*9+n*2)),et(t,o,Math.cos(f)*h,-10+Math.sin(f)*h*.62,16,"#ffffff")}}e.flash>.02&&(t.globalAlpha=Math.min(1,e.flash*1.3),et(t,o,0,-10,150+240*e.flash,"#fff6d0")),t.restore()}function Qo(t,e,o,a,i,l,n){const f=Ne[e];t.save(),t.translate(o,a),t.scale(i,i),t.globalAlpha=n;const h=.3+.7*(.5+.5*Math.sin(l*26));It(t,f,-1,h,!1),It(t,f,1,h,!1),t.fillStyle=f.body,t.beginPath(),t.ellipse(0,30,15,64,0,0,he),t.fill(),t.beginPath(),t.arc(0,-44,28,0,he),t.fill(),t.restore()}class $o{constructor(e,o,a={}){Z(this,"context");Z(this,"output");Z(this,"session","");Z(this,"pending",!1);Z(this,"blocked",!1);Z(this,"disposed",!1);Z(this,"muted",!1);Z(this,"volume",1);Z(this,"stopped",!1);Z(this,"listener");this.media=e,this.title=o,this.options=a}activate(){var e,o;if(!this.media||this.disposed||this.blocked)return!1;try{return this.context||(this.context=((o=(e=this.options).createContext)==null?void 0:o.call(e))??new AudioContext,this.output=this.context.createGain(),this.output.gain.value=0,this.output.connect(this.context.destination),this.context.onstatechange=()=>this.report()),!this.session&&!this.pending&&(this.pending=!0,this.register()),this.context.state!=="running"&&this.resume(),this.audible}catch{return this.dispose(),!1}}get audible(){var e;return!!this.session&&!this.disposed&&!this.blocked&&!this.muted&&((e=this.context)==null?void 0:e.state)==="running"}setMuted(e){this.muted=e,this.applyGain(),this.report()}applyGain(){this.output&&(this.output.gain.value=this.audible?this.volume:0)}report(){var e,o;if(this.applyGain(),(o=(e=this.options).onChange)==null||o.call(e),!(!this.session||this.disposed))try{this.media.reportState(this.session,{status:this.audible?"playing":this.stopped?"stopped":"paused",volume:this.muted?0:this.volume})}catch{this.dispose()}}async resume(){var e;try{await((e=this.context)==null?void 0:e.resume()),this.report()}catch{this.applyGain()}}async register(){try{const e=await this.media.createSession({owner:"napplet",metadata:{title:this.title,mediaType:"audio"},capabilities:["play","pause","stop","volume"]});if(this.disposed){e.sessionId&&this.media.destroySession(e.sessionId);return}if(e.error||!e.sessionId||e.owner!=="napplet"){e.sessionId&&this.media.destroySession(e.sessionId),this.dispose();return}this.session=e.sessionId,this.listener=this.media.onCommand(this.session,(o,a)=>{var i;this.disposed||(o==="pause"||o==="stop"?(this.blocked=!0,this.stopped=o==="stop",this.applyGain(),(i=this.context)==null||i.suspend().then(()=>this.report()).catch(()=>{})):o==="play"?(this.blocked=!1,this.stopped=!1,this.resume()):o==="volume"&&typeof a=="number"&&Number.isFinite(a)&&(this.volume=Math.max(0,Math.min(1,a))),this.report())}),this.report()}catch{this.dispose()}finally{this.pending=!1}}dispose(){var e;if(!this.disposed){this.disposed=!0,this.applyGain();try{(e=this.listener)==null||e.close()}catch{}if(this.context&&(this.context.onstatechange=null,this.context.close().catch(()=>{})),this.session)try{this.media.destroySession(this.session)}catch{}this.session=""}}}function _o(t,e){return!!(t!=null&&t[e])}function Ht(t){return _o(window.napplet,t)}const se=Math.PI*2,Dt=["¡PAF!","¡ZAS!","¡PUM!","¡SPLAT!","¡TOMA!","¡PLAF!","¡CHAO!"];class xo{constructor(){Z(this,"parts",[]);Z(this,"words",[]);Z(this,"cracks",[]);Z(this,"decals",[]);Z(this,"shake",0);Z(this,"red",0);Z(this,"white",0);Z(this,"calm",!1);Z(this,"view",{w:1265,h:790});Z(this,"lastWord",-1)}clear(){this.parts=[],this.words=[],this.cracks=[],this.decals=[],this.shake=this.red=this.white=0}add(e){this.parts.length>520&&this.parts.shift(),this.parts.push({vx:0,vy:0,rot:0,vr:0,age:0,life:1,size:10,color:"#fff",color2:"#fff",floor:1/0,n:0,bounced:0,sx:0,sy:0,tx:0,ty:0,kind:"widow",...e})}update(e){this.shake=Math.max(0,this.shake-e*3.2),this.red=Math.max(0,this.red-e*1.7),this.white=Math.max(0,this.white-e*9);for(let o=this.parts.length-1;o>=0;o--){const a=this.parts[o];if(a.age+=e,a.age>=a.life){this.parts.splice(o,1);continue}switch(a.type){case"goo":case"leg":case"gun":case"hat":case"confetti":case"heartHalf":a.vy+=(a.type==="confetti"?380:1500)*e,a.type==="confetti"&&(a.vx*=Math.pow(.3,e),a.vy=Math.min(a.vy,210));break;case"smoke":a.vy-=26*e,a.vx*=Math.pow(.25,e),a.size+=34*e;break;case"spark":a.vy+=500*e;break;case"ghost":a.vx=Math.sin(a.age*4+a.n)*34;break;case"fly":{const i=a.age/a.life,l=i*i*(3-2*i);a.x=a.sx+(a.tx-a.sx)*l+Math.sin(i*Math.PI)*a.n*90,a.y=a.sy+(a.ty-a.sy)*l-Math.sin(i*Math.PI)*70;break}}a.x+=a.vx*e,a.y+=a.vy*e,a.rot+=a.vr*e,a.y>a.floor&&a.vy>0&&(a.y=a.floor,a.type==="goo"?(this.stain(a.x,a.y,a.size*1.4,a.color,.35),this.parts.splice(o,1)):(a.vy*=-.42,a.vx*=.6,a.vr*=.5,a.bounced++,Math.abs(a.vy)<80&&(a.vy=0,a.vr=0,a.floor=1/0,a.vx=0,a.life=Math.min(a.life,a.age+.9))))}for(let o=this.words.length-1;o>=0;o--){const a=this.words[o];a.age+=e,a.y-=36*e,a.age>=a.life&&this.words.splice(o,1)}for(let o=this.cracks.length-1;o>=0;o--)this.cracks[o].age+=e,this.cracks[o].age>=this.cracks[o].life&&this.cracks.splice(o,1);for(let o=this.decals.length-1;o>=0;o--)this.decals[o].age+=e,this.decals[o].age>=this.decals[o].life&&this.decals.splice(o,1)}impact(e,o,a){if(this.add({type:"ring",x:e,y:o,life:.28,size:a?70:34,color:a?"#fff3b0":"rgba(255,255,255,0.7)"}),!a){for(let i=0;i<5;i++){const l=Math.random()*se;this.add({type:"dust",x:e,y:o,vx:Math.cos(l)*60,vy:Math.sin(l)*60-20,life:.45,size:6+Math.random()*5,color:"rgba(225,225,235,0.6)"})}return}for(let i=0;i<9;i++){const l=Math.random()*se,n=260+Math.random()*380;this.add({type:"spark",x:e,y:o,vx:Math.cos(l)*n,vy:Math.sin(l)*n,life:.3+Math.random()*.2,size:3.5,color:"#fff0a0"})}this.shake=Math.max(this.shake,.25)}word(e,o,a=58,i,l="#ffe14a"){let n=Math.floor(Math.random()*Dt.length);n===this.lastWord&&(n=(n+1)%Dt.length),this.lastWord=n;const f=i??Dt[n],h=f.length*a*.27,d=Math.max(h+10,Math.min(this.view.w-h-10,e)),u=Math.max(a*.7+90,Math.min(this.view.h-a,o));this.words.push({x:d,y:u,text:f,age:0,life:.85,size:a,color:l,tilt:(Math.random()-.5)*.4})}stain(e,o,a,i,l=1){this.decals.length>16&&this.decals.shift();const n=[],f=a>30?9:3;for(let d=0;d<f;d++){const u=Math.random()*se,c=Math.random()*a*.9;n.push([Math.cos(u)*c,Math.sin(u)*c*(a>30?1:.4),a*(.25+Math.random()*.5)])}const h=[];if(a>30)for(let d=0;d<4;d++)h.push([(Math.random()-.5)*a*1.4,a*(.5+Math.random()*1.3),4+Math.random()*5]);this.decals.push({x:e,y:o,age:0,life:7*l,color:i,blobs:n,drips:h})}burst(e,o,a,i,l,n={}){const f=n.big?2.2:1;this.stain(e,o,58*a,i.goo);const h=Math.round((n.big?46:16)*(this.calm?.5:1));for(let u=0;u<h;u++){const c=Math.random()*se,y=(160+Math.random()*560)*Math.sqrt(a)*(n.big?1.3:1);this.add({type:"goo",x:e+Math.cos(c)*20*a,y:o+Math.sin(c)*20*a,vx:Math.cos(c)*y,vy:Math.sin(c)*y-260,life:1.6,size:(5+Math.random()*9)*Math.sqrt(a),color:i.goo,floor:l+40+Math.random()*150})}for(let u=0;u<8;u++){const c=u<4?-1:1,y=-Math.PI/2+c*(.4+u%4*.45),k=420+Math.random()*300;this.add({type:"leg",x:e+c*40*a,y:o,vx:Math.cos(y)*k*f*.7,vy:Math.sin(y)*k-150,rot:Math.random()*se,vr:(Math.random()-.5)*22,life:2.2,size:62*a,color:i.leg,color2:i.rim,floor:l+50+Math.random()*130})}const d=n.pistols??2;for(let u=0;u<d;u++){const c=u%2?1:-1;this.add({type:"gun",x:e+c*60*a,y:o+30*a,vx:c*(130+Math.random()*200),vy:-520-Math.random()*240,rot:0,vr:c*(9+Math.random()*8),life:3,size:a*1.1,color:i.gun,color2:i.gunHi,floor:l+70+Math.random()*110})}n.hat!==void 0&&n.hat>=0&&this.hat(e,o-60*a,a,n.hat,l);for(let u=0;u<7;u++){const c=Math.random()*se;this.add({type:"smoke",x:e+Math.cos(c)*30*a,y:o+Math.sin(c)*30*a,vx:Math.cos(c)*80,vy:Math.sin(c)*60-30,life:.7+Math.random()*.4,size:26*a,color:"235,235,245"})}this.add({type:"ring",x:e,y:o,life:.4,size:150*a,color:i.goo}),this.add({type:"ghost",x:e,y:o-20*a,vy:-84,life:1.9,size:30*Math.sqrt(a),n:Math.random()*6}),this.shake=Math.max(this.shake,n.big?1:.45)}collect(e,o,a,i,l,n,f,h=!1){const d=Math.round((h?40:14)*(this.calm?.5:1));for(let c=0;c<d;c++){const y=Math.random()*se,k=(80+Math.random()*300)*(h?1.6:1);this.add({type:"twinkle",x:e,y:o,vx:Math.cos(y)*k,vy:Math.sin(y)*k,life:.5+Math.random()*.6,size:9+Math.random()*12,color:c%3?l:"#ffffff"})}this.add({type:"ring",x:e,y:o,life:.4,size:150*a,color:l});const u=h?9:1;for(let c=0;c<u;c++)this.add({type:"fly",x:e,y:o,sx:e+(h?(Math.random()-.5)*200:0),sy:o+(h?(Math.random()-.5)*140:0),tx:n,ty:f,kind:h&&c?["widow","hat","mini"][c%3]:i,life:.75+c*.09,size:a*(h&&c?.5:1),n:Math.random()<.5?-1:1});this.shake=Math.max(this.shake,h?.6:.15)}flee(e,o,a){this.red=.55;for(let i=0;i<16;i++){const l=Math.random()*se,n=120+Math.random()*360;this.add({type:"twinkle",x:e,y:o,vx:Math.cos(l)*n,vy:Math.sin(l)*n-80,life:.6+Math.random()*.5,size:10+Math.random()*12,color:i%2?a:"#ffffff"})}this.add({type:"ring",x:e,y:o,life:.5,size:220,color:"#ffffff"})}hat(e,o,a,i,l){const n=Math.random()<.5?-1:1;this.add({type:"hat",x:e,y:o,vx:n*(120+Math.random()*160),vy:-640,rot:0,vr:n*7,life:3.2,size:a,n:i,floor:l+60+Math.random()*100})}gunSmoke(e,o){for(let a=0;a<5;a++)this.add({type:"smoke",x:e+(Math.random()-.5)*16,y:o,vx:(Math.random()-.5)*50,vy:-50-Math.random()*50,life:.9+Math.random()*.5,size:12+Math.random()*8,color:"220,220,230"})}crack(e){const o=e.w*(.22+Math.random()*.56),a=e.h*(.25+Math.random()*.45),i=[],l=9+Math.floor(Math.random()*4);for(let f=0;f<l;f++){const h=f/l*se+Math.random()*.4,d=80+Math.random()*170,u=[0,0];let c=0,y=0;const k=3+Math.floor(Math.random()*2);for(let T=1;T<=k;T++){const b=h+(Math.random()-.5)*.5;c+=Math.cos(b)*d/k,y+=Math.sin(b)*d/k,u.push(c,y)}i.push(u)}const n=[];for(let f=0;f<7;f++)n.push([26+Math.random()*90,Math.random()*se,.3+Math.random()*.6]);this.cracks.length>4&&this.cracks.shift(),this.cracks.push({x:o,y:a,age:0,life:4.5,lines:i,rings:n}),this.red=1,this.white=1,this.shake=1.3;for(let f=0;f<12;f++){const h=Math.random()*se,d=200+Math.random()*500;this.add({type:"spark",x:o,y:a,vx:Math.cos(h)*d,vy:Math.sin(h)*d,life:.5,size:4,color:"#e8f4ff"})}}heartBreak(e,o,a){for(const i of[-1,1])this.add({type:"heartHalf",x:e,y:o,vx:i*130,vy:-330,rot:0,vr:i*5,life:1.3,size:a,n:i})}sparkle(e,o,a,i=10){for(let l=0;l<i;l++){const n=Math.random()*se,f=60+Math.random()*220;this.add({type:"twinkle",x:e,y:o,vx:Math.cos(n)*f,vy:Math.sin(n)*f,life:.5+Math.random()*.5,size:8+Math.random()*10,color:a})}}confetti(e,o=70){const a=["#ffe14a","#ff5ad8","#7dff6a","#5ad8ff","#ff7a4a","#ffffff"];for(let i=0;i<o;i++)this.add({type:"confetti",x:Math.random()*e.w,y:-20-Math.random()*e.h*.4,vx:(Math.random()-.5)*260,vy:120+Math.random()*160,rot:Math.random()*se,vr:(Math.random()-.5)*12,life:5,size:9+Math.random()*9,color:a[i%a.length],n:Math.random()*6})}drawBack(e){for(const o of this.decals){const a=o.age/o.life;e.globalAlpha=Math.min(1,(1-a)*2.2)*.85,e.fillStyle=o.color;const i=Math.min(1,o.age*9);for(const[l,n,f]of o.blobs)e.beginPath(),e.arc(o.x+l*i,o.y+n*i,f*i,0,se),e.fill();for(const[l,n,f]of o.drips){const h=n*Math.min(1,o.age*.7);e.beginPath(),e.roundRect(o.x+l-f/2,o.y,f,h,f/2),e.fill(),e.beginPath(),e.arc(o.x+l,o.y+h,f*.8,0,se),e.fill()}}e.globalAlpha=1}draw(e){for(const o of this.parts){const a=o.age/o.life;switch(o.type){case"goo":e.fillStyle=o.color,e.beginPath(),e.ellipse(o.x,o.y,o.size*.8,o.size*1.15,Math.atan2(o.vy,o.vx)+Math.PI/2,0,se),e.fill();break;case"smoke":e.fillStyle=`rgba(${o.color},${(1-a)*.42})`,e.beginPath(),e.arc(o.x,o.y,o.size,0,se),e.fill();break;case"dust":e.globalAlpha=1-a,e.fillStyle=o.color,e.beginPath(),e.arc(o.x,o.y,o.size*(.6+a),0,se),e.fill(),e.globalAlpha=1;break;case"leg":e.save(),e.translate(o.x,o.y),e.rotate(o.rot),e.globalAlpha=Math.min(1,(1-a)*4),e.lineCap="round",e.lineJoin="round";for(const[i,l]of[[14,o.color2],[10,o.color]])e.strokeStyle=l,e.lineWidth=i*o.size/62,e.beginPath(),e.moveTo(-o.size*.5,o.size*.15),e.lineTo(0,-o.size*.3),e.lineTo(o.size*.55,o.size*.25),e.stroke();e.restore();break;case"gun":e.save(),e.translate(o.x,o.y),e.rotate(o.rot),e.globalAlpha=Math.min(1,(1-a)*4),U0(e,0,o.color,o.color2,o.size),e.restore();break;case"hat":e.save(),e.translate(o.x,o.y),e.rotate(o.rot),e.scale(o.size,o.size),e.globalAlpha=Math.min(1,(1-a)*4),l0(e,o.n,0),e.restore();break;case"ghost":ea(e,o.x,o.y,o.size,Math.min(1,(1-a)*2)*Math.min(1,o.age*5),o.age);break;case"confetti":e.save(),e.translate(o.x+Math.sin(o.age*3+o.n)*20,o.y),e.rotate(o.rot),e.globalAlpha=Math.min(1,(1-a)*3),e.fillStyle=o.color,e.fillRect(-o.size/2,-o.size/4*Math.cos(o.age*9+o.n),o.size,o.size/2*Math.cos(o.age*9+o.n)),e.restore();break;case"ring":e.strokeStyle=o.color,e.globalAlpha=1-a,e.lineWidth=7*(1-a)+1,e.beginPath(),e.arc(o.x,o.y,o.size*(.3+.7*Math.sqrt(a)),0,se),e.stroke(),e.globalAlpha=1;break;case"fly":Qo(e,o.kind,o.x,o.y,o.size*(1-.8*a)*.8,o.age,Math.min(1,(1-a)*5));break;case"heartHalf":e.save(),e.translate(o.x,o.y),e.rotate(o.rot),e.globalAlpha=1-a,e.beginPath(),e.rect(o.n<0?-o.size*2:0,-o.size*2,o.size*2,o.size*4),e.clip(),r0(e,0,0,o.size),e.fillStyle="#ff4a6a",e.fill(),e.restore();break}}e.globalAlpha=1}drawGlow(e,o){for(const a of this.parts){const i=a.age/a.life;a.type==="spark"?(e.strokeStyle=a.color,e.globalAlpha=1-i,e.lineWidth=a.size,e.lineCap="round",e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(a.x-a.vx*.035,a.y-a.vy*.035),e.stroke()):a.type==="twinkle"&&(e.globalAlpha=(1-i)*.9,et(e,o,a.x,a.y,a.size*(1.4-i),a.color))}e.globalAlpha=1}drawWords(e,o){for(const a of this.words){const i=a.age/a.life,l=i<.18?.4+i/.18*.85:1.25-Math.min(.25,(i-.18)*1.6);e.save(),e.translate(a.x,a.y),e.rotate(a.tilt),e.scale(l,l),e.globalAlpha=i>.7?(1-i)/.3:1,e.font=`${a.size}px ${o}`,e.textAlign="center",e.textBaseline="middle",e.lineJoin="round",e.strokeStyle="#1a0f24",e.lineWidth=a.size*.2,e.strokeText(a.text,0,0),e.fillStyle=a.color,e.fillText(a.text,0,0),e.restore()}}drawScreen(e,o){for(const a of this.cracks){const i=a.age/a.life,l=i>.6?(1-i)/.4:1,n=Math.min(1,a.age*14);e.save(),e.translate(a.x,a.y),e.globalAlpha=l,e.lineCap="round",e.lineJoin="round";for(const[f,h]of[[5,"rgba(10,14,30,0.5)"],[2.2,"rgba(235,245,255,0.95)"]]){e.strokeStyle=h,e.lineWidth=f;for(const d of a.lines){e.beginPath(),e.moveTo(0,0);for(let u=2;u<d.length;u+=2)e.lineTo(d[u]*n,d[u+1]*n);e.stroke()}for(const[d,u,c]of a.rings)e.beginPath(),e.arc(0,0,d*n,u,u+c),e.stroke()}e.fillStyle="#05060a",e.beginPath(),e.arc(0,0,13,0,se),e.fill(),e.strokeStyle="rgba(235,245,255,0.9)",e.lineWidth=3,e.stroke(),e.restore()}if(this.red>0){const a=e.createRadialGradient(o.w/2,o.h/2,Math.min(o.w,o.h)*.25,o.w/2,o.h/2,Math.hypot(o.w,o.h)*.6);a.addColorStop(0,"rgba(255,30,40,0)"),a.addColorStop(1,`rgba(255,30,40,${.6*this.red})`),e.fillStyle=a,e.fillRect(0,0,o.w,o.h)}this.white>0&&!this.calm&&(e.fillStyle=`rgba(255,250,235,${.4*this.white})`,e.fillRect(0,0,o.w,o.h))}offset(e){if(this.calm||this.shake<=0)return{x:0,y:0};const o=Math.min(1.2,this.shake)*13;return{x:Math.sin(e*71)*o,y:Math.cos(e*59)*o}}}function r0(t,e,o,a){t.beginPath(),t.moveTo(e,o+a*.95),t.bezierCurveTo(e-a*1.5,o-a*.1,e-a*.8,o-a*1.25,e,o-a*.45),t.bezierCurveTo(e+a*.8,o-a*1.25,e+a*1.5,o-a*.1,e,o+a*.95),t.closePath()}function ea(t,e,o,a,i,l){t.save(),t.translate(e,o),t.globalAlpha=i*.85,t.strokeStyle="#eef2ff",t.lineWidth=a*.14,t.lineCap="round";for(let n=0;n<4;n++)for(const f of[-1,1]){const h=Math.sin(l*7+n)*a*.12;t.beginPath(),t.moveTo(f*a*.7,-a*.2+n*a*.3),t.quadraticCurveTo(f*a*1.4,-a*.5+n*a*.4+h,f*a*1.7,n*a*.5+h),t.stroke()}t.fillStyle="#eef2ff",t.beginPath(),t.arc(0,0,a,0,se),t.fill(),t.strokeStyle="#3a3050",t.lineWidth=a*.13;for(const n of[-1,1])t.beginPath(),t.moveTo(n*a*.4-a*.16,-a*.3),t.lineTo(n*a*.4+a*.16,a*.02),t.moveTo(n*a*.4+a*.16,-a*.3),t.lineTo(n*a*.4-a*.16,a*.02),t.stroke();t.beginPath(),t.arc(0,a*.5,a*.16,0,se),t.stroke(),t.strokeStyle="#ffe58a",t.lineWidth=a*.14,t.beginPath(),t.ellipse(0,-a*1.35,a*.6,a*.2,0,0,se),t.stroke(),t.restore()}const ht=[{id:"colegio",name:"El Colegio",quota:12,alive:[1,2],gap:[2.2,1.7],aim:[3.4,2.9],hats:0,minis:0,shots:1,bossHp:8,bossAim:3.4},{id:"cocina",name:"La Cocina",quota:15,alive:[2,2],gap:[2,1.6],aim:[3.2,2.8],hats:.28,minis:0,shots:1,bossHp:10,bossAim:3.2},{id:"dormitorio",name:"El Dormitorio",quota:18,alive:[2,3],gap:[1.9,1.5],aim:[3.1,2.7],hats:.25,minis:.2,shots:2,bossHp:12,bossAim:3},{id:"bodega",name:"La Bodega",quota:21,alive:[2,3],gap:[1.8,1.4],aim:[3,2.6],hats:.28,minis:.24,shots:2,bossHp:14,bossAim:2.9},{id:"bosque",name:"El Bosque de Noche",quota:25,alive:[2,3],gap:[1.7,1.25],aim:[2.9,2.4],hats:.3,minis:.28,shots:2,bossHp:18,bossAim:2.8}],tt=5,ta=1;function lt(t){let e=t>>>0;return()=>{e=e+1831565813>>>0;let o=e;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function Se(t,e,o){return t+(e-t)*o}function je(t,e,o){return Math.max(e,Math.min(o,t))}function jt(t){const o=t-1;return 1+(1.4+1)*o*o*o+1.4*o*o}function C0(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}function Rt(t,e){return t==="mini"?.58:t==="hat"?1.12:t==="boss"?Math.min(1.8,e.w/460,e.h/420):1}function oa(t){return 74*t.scale+26}class aa{constructor(e,o=0,a=1){Z(this,"def");Z(this,"phase","intro");Z(this,"phaseT",0);Z(this,"time",0);Z(this,"hearts",tt);Z(this,"heartsLost",0);Z(this,"kills",0);Z(this,"escaped",0);Z(this,"spiders",[]);Z(this,"pickups",[]);Z(this,"events",[]);Z(this,"boss",null);Z(this,"view",{w:1265,h:790});Z(this,"spots",[]);Z(this,"floorY",540);Z(this,"combo",0);Z(this,"comboT",0);Z(this,"rng");Z(this,"nextId",1);Z(this,"spawnT",.2);Z(this,"shotLock",0);Z(this,"summoned",0);Z(this,"lastSpot",-1);Z(this,"level");Z(this,"mercy");this.level=e,this.mercy=o,this.def=ht[e],this.rng=lt(a*7919+e*104729+17)}setStage(e,o,a){this.view=e,this.spots=o,this.floorY=a;for(const i of this.spiders)this.place(i)}get progress(){return je(this.kills/this.def.quota,0,1)}get stars(){return this.heartsLost<=1?3:this.heartsLost<=3?2:1}get slow(){return 1+.25*Math.min(this.mercy,4)}setPhase(e){this.phase=e,this.phaseT=0}update(e){switch(this.time+=e,this.phaseT+=e,this.shotLock=Math.max(0,this.shotLock-e),this.comboT-=e,this.comboT<=0&&(this.combo=0),this.phase){case"intro":this.phaseT>1.9&&this.setPhase("waves");break;case"waves":this.runWaves(e);break;case"bossIntro":!this.boss&&this.phaseT>1&&this.spawnBoss(),this.phaseT>2.6&&this.setPhase("boss");break;case"boss":break;case"outro":this.phaseT>2.6&&(this.setPhase("won"),this.events.push({type:"win",stars:this.stars}));break}for(let o=this.spiders.length-1;o>=0;o--){const a=this.spiders[o];this.stepSpider(a,e),a.state==="leave"&&a.t>=a.dur&&(this.spiders.splice(o,1),a.kind!=="boss"&&this.escaped++)}for(let o=this.pickups.length-1;o>=0;o--){const a=this.pickups[o];a.t+=e,a.y-=30*e,a.t>a.life&&this.pickups.splice(o,1)}}runWaves(e){const o=this.def,a=this.spiders.filter(n=>n.state!=="leave").length;if(this.kills>=o.quota){for(const n of this.spiders)n.state!=="leave"&&n.state!=="fire"&&this.flee(n);this.spiders.length===0&&(this.setPhase("bossIntro"),this.events.push({type:"bossIntro"}));return}const i=this.progress,l=Math.max(1,Math.round(Se(o.alive[0],o.alive[1],i))-Math.floor((Math.min(this.mercy,4)+1)/2));this.spawnT-=e,this.spawnT<=0&&a<l&&this.kills+a<o.quota&&(this.spawn()?this.spawnT=Se(o.gap[0],o.gap[1],i)*(.8+this.rng()*.4):this.spawnT=.3)}pickKind(){const e=this.def;if(this.kills+this.spiders.length<2&&this.level===0)return"widow";const o=this.rng();return o<e.minis?"mini":o<e.minis+e.hats?"hat":"widow"}freeSpot(e){const o=Rt(e,this.view),a=[];return this.spots.forEach((i,l)=>{if(l===this.lastSpot||e==="mini"&&i.mode==="peek")return;const n=this.homeOf(i,o);for(const f of this.spiders){const h=f.spot>=0?this.homeOf(this.spots[f.spot],f.scale):{x:f.toX,y:f.toY};if(f.spot===l)return;const d=115*(o+f.scale);if(Math.hypot(n.x-h.x,n.y-h.y)<d)return}a.push(l)}),a.length?a[Math.floor(this.rng()*a.length)]:-1}spawn(e=this.pickKind()){const o=this.freeSpot(e);if(o<0)return null;this.lastSpot=o;const a=this.spots[o],i=Rt(e,this.view),l={id:this.nextId++,kind:e,mode:a.mode,spot:o,state:"enter",t:0,dur:a.mode==="drop"?1.05:a.mode==="crawl"?e==="mini"?.75:1.1:.8,hp:e==="hat"?2:1,maxHp:e==="hat"?2:1,hat:e==="hat",shots:this.def.shots,x:0,y:0,scale:i,age:0,seed:this.rng(),flinch:0,sinceShot:9,aimHits:0,fromX:0,fromY:0,toX:0,toY:0,out:0};return this.place(l),this.spiders.push(l),this.events.push({type:"spawn",s:l}),l}spawnBoss(){const e=this.view,o=Rt("boss",e),a=this.bossAnchor(1),i={id:this.nextId++,kind:"boss",mode:"drop",spot:-1,state:"enter",t:0,dur:1.5,hp:this.def.bossHp,maxHp:this.def.bossHp,hat:!1,shots:1e9,x:a.x,y:-260*o,scale:o,age:0,seed:this.rng(),flinch:0,sinceShot:9,aimHits:0,fromX:a.x,fromY:-260*o,toX:a.x,toY:a.y,out:1};this.boss=i,this.spiders.push(i),this.events.push({type:"spawn",s:i})}bossAnchor(e){const o=this.view,a=Rt("boss",o),i=Math.min(o.w*.3,170*a),l=Se(i,o.w-i,e/2),n=je(o.h*(e===1?.4:.34),150*a,this.floorY-40);return{x:l,y:n}}homeOf(e,o){if(e.mode==="peek"){const a=e.edge??e.y;return e.dir==="left"?{x:a-70*o,y:e.y}:e.dir==="right"?{x:a+70*o,y:e.y}:{x:e.x,y:a-94*o}}return{x:e.x,y:e.y}}place(e){if(e.spot<0){const l=je(e.t/e.dur,0,1);if(e.state==="enter")e.x=e.toX,e.y=Se(e.fromY,e.toY,jt(l));else if(e.state==="move"){const n=C0(l);e.x=Se(e.fromX,e.toX,n),e.y=Se(e.fromY,e.toY,n)+Math.sin(n*Math.PI)*46*e.scale}else e.state==="leave"?(e.x=e.toX,e.y=Se(e.toY,-300*e.scale,l*l)):(e.x=e.toX+Math.sin(e.age*1.1)*14,e.y=e.toY+Math.sin(e.age*1.7)*6);e.out=1;return}const o=this.spots[e.spot];if(!o)return;const a=this.homeOf(o,e.scale);let i=1;if(e.state==="enter"?i=je(e.t/e.dur,0,1):e.state==="leave"&&(i=1-je(e.t/e.dur,0,1)),e.out=i,o.mode==="drop"){const l=e.state==="enter"?jt(i):i*i,n=Math.sin(e.age*1.3+e.seed*6)*10*Math.min(1,a.y/300);e.x=a.x+n,e.y=Se(-190*e.scale,a.y,l)}else if(o.mode==="crawl"){const n=(o.from??-1)<0?-190*e.scale:this.view.w+190*e.scale;e.x=Se(n,a.x,C0(i)),e.y=a.y}else{const l=e.state==="enter"?jt(i):i,n=250*e.scale;o.dir==="left"?(e.x=Se(a.x+n,a.x,l),e.y=a.y):o.dir==="right"?(e.x=Se(a.x-n,a.x,l),e.y=a.y):(e.x=a.x,e.y=Se(a.y+n,a.y,l))}}aimTime(e){if(e.kind==="boss")return this.def.bossAim*this.slow;const o=this.def;return Se(o.aim[0],o.aim[1],this.progress)*this.slow*(e.kind==="mini"?.9:1)}enter(e,o,a){e.state=o,e.t=0,e.dur=a}flee(e){this.enter(e,"leave",e.kind==="boss"?1.2:e.mode==="crawl"?.9:.7),this.events.push({type:"leave",s:e})}stepSpider(e,o){e.age+=o,e.t+=o,e.flinch=Math.max(0,e.flinch-o),e.sinceShot+=o;const a=this.phase==="lost"||this.phase==="won"||this.phase==="outro";switch(e.state){case"enter":e.t>=e.dur&&this.enter(e,"lurk",.55+this.rng()*.35);break;case"lurk":e.t>=e.dur&&!a&&(this.enter(e,"aim",this.aimTime(e)),e.aimHits=0,this.events.push({type:"aim",s:e}));break;case"aim":a?this.enter(e,"lurk",9):e.t>=e.dur&&(this.shotLock>0?e.t=e.dur:(this.enter(e,"fire",.55),e.sinceShot=0,e.shots--,this.shotLock=ta,this.hurt(),this.events.push({type:"fire",s:e,hurt:!0})));break;case"fire":e.t>=e.dur&&(e.kind==="boss"?this.bossMove(e):e.shots>0&&!a?this.enter(e,"lurk",.7+this.rng()*.3):this.flee(e));break;case"stun":e.t>=e.dur&&(e.kind==="boss"?this.bossMove(e):this.enter(e,"lurk",.35));break;case"move":e.t>=e.dur&&this.enter(e,"lurk",.6);break}this.place(e)}bossMove(e){const o=[0,1,2].map(i=>this.bossAnchor(i)).sort((i,l)=>Math.abs(l.x-e.toX)-Math.abs(i.x-e.toX)).slice(0,2),a=o[Math.floor(this.rng()*o.length)];e.fromX=e.x,e.fromY=e.y,e.toX=a.x,e.toY=a.y,this.enter(e,"move",.95)}hurt(){this.phase==="lost"||this.hearts<=0||(this.hearts--,this.heartsLost++,this.hearts<=0&&(this.setPhase("lost"),this.events.push({type:"lose"})))}click(e,o){if(this.phase==="won"||this.phase==="lost")return!1;for(let l=this.pickups.length-1;l>=0;l--){const n=this.pickups[l];if(Math.hypot(e-n.x,o-n.y)<78)return this.pickups.splice(l,1),this.hearts<tt&&this.hearts++,this.events.push({type:"heal",p:n}),!0}let a=null,i=1/0;for(const l of this.spiders){if(l.state==="leave"&&l.t>l.dur*.6||l.mode==="peek"&&l.out<.35)continue;const n=Math.hypot(e-l.x,o-l.y),f=oa(l);if(n>f)continue;const h=l.state==="aim"?(l.dur-l.t)*.02:.1,d=n/f+h;d<i&&(i=d,a=l)}return a?(this.hit(a,e,o),!0):(this.events.push({type:"miss",x:e,y:o}),!1)}hit(e,o,a){if(e.hp--,e.flinch=.14,this.events.push({type:"hit",s:e,x:o,y:a}),e.kind==="boss"){if(e.hp<=0){this.killBoss(e);return}e.state==="aim"&&(e.aimHits++,e.aimHits>=3&&(this.enter(e,"stun",1.4),this.events.push({type:"bossStun",s:e})));const i=Math.floor((e.maxHp-e.hp)*3/e.maxHp);i>this.summoned&&i<3&&(this.summoned=i,this.events.push({type:"bossSummon",s:e}),this.spawn("mini")&&this.level>=2&&this.spawn("mini"),this.hearts<tt&&this.dropHeart(e.x,e.y+60*e.scale));return}if(e.hp<=0){this.kill(e);return}e.hat&&(e.hat=!1,this.events.push({type:"hatOff",s:e}),e.state!=="enter"&&e.state!=="leave"&&this.enter(e,"stun",.9))}kill(e){const o=this.spiders.indexOf(e);o>=0&&this.spiders.splice(o,1),this.combo=this.comboT>0?this.combo+1:0,this.comboT=1.6,this.phase==="waves"&&this.kills++,this.events.push({type:"die",s:e,combo:this.combo}),e.kind==="hat"&&this.hearts<tt&&this.pickups.length===0&&this.rng()<.45&&this.dropHeart(e.x,e.y)}dropHeart(e,o){const a={id:this.nextId++,x:je(e,70,this.view.w-70),y:je(o,200,this.view.h-60),t:0,life:7,seed:this.rng()};this.pickups.push(a),this.events.push({type:"heart",p:a})}killBoss(e){const o=this.spiders.indexOf(e);o>=0&&this.spiders.splice(o,1),this.boss=null,this.events.push({type:"bossDie",s:e});for(const a of this.spiders.slice())this.spiders.splice(this.spiders.indexOf(a),1),this.events.push({type:"die",s:a,combo:0});this.setPhase("outro")}}const le=Math.PI*2;function I(t,e,o,a,i,l,n){t.fillStyle=n,t.beginPath(),t.roundRect(e,o,a,i,l),t.fill()}function H(t,e,o,a,i,l){t.fillStyle=l,t.fillRect(e,o,a,i)}function G(t,e,o,a,i){t.fillStyle=i,t.beginPath(),t.arc(e,o,a,0,le),t.fill()}function de(t,e,o,a,i,l){t.fillStyle=l,t.beginPath(),t.ellipse(e,o,a,i,0,0,le),t.fill()}function ke(t,e,o,a){const i=t.createLinearGradient(0,e,0,o);return a.forEach((l,n)=>i.addColorStop(n/(a.length-1),l)),i}function ze(t,e,o){t.fillStyle=o,t.beginPath(),t.moveTo(e[0],e[1]);for(let a=2;a<e.length;a+=2)t.lineTo(e[a],e[a+1]);t.closePath(),t.fill()}function We(t,e,o,a,i,l,n=.34){t.save(),t.strokeStyle=`rgba(230,236,255,${n})`,t.lineWidth=1.6;const f=6;for(let h=0;h<=f;h++){const d=i+(l-i)*h/f;t.beginPath(),t.moveTo(e,o),t.lineTo(e+Math.cos(d)*a,o+Math.sin(d)*a),t.stroke()}for(let h=1;h<=4;h++){const d=a*h/4.4;t.beginPath();for(let u=0;u<f;u++){const c=i+(l-i)*u/f,y=i+(l-i)*(u+1)/f,k=(c+y)/2,T=e+Math.cos(c)*d,b=o+Math.sin(c)*d;u===0&&t.moveTo(T,b),t.quadraticCurveTo(e+Math.cos(k)*d*.82,o+Math.sin(k)*d*.82,e+Math.cos(y)*d,o+Math.sin(y)*d)}t.stroke()}t.restore()}function f0(t,e,o,a){const i=t.createRadialGradient(e,o,a*.8,e,o,a*3.2);i.addColorStop(0,"rgba(210,225,255,0.34)"),i.addColorStop(1,"rgba(210,225,255,0)"),t.fillStyle=i,t.fillRect(e-a*3.3,o-a*3.3,a*6.6,a*6.6),G(t,e,o,a,"#f2f0d8"),G(t,e-a*.3,o-a*.2,a*.2,"#dcd9bd"),G(t,e+a*.34,o+a*.3,a*.26,"#dcd9bd"),G(t,e+a*.2,o-a*.46,a*.12,"#dcd9bd")}function Mt(t,e,o=.55){const a=t.createRadialGradient(e.w/2,e.h*.48,Math.min(e.w,e.h)*.35,e.w/2,e.h*.5,Math.hypot(e.w,e.h)*.62);a.addColorStop(0,"rgba(4,5,14,0)"),a.addColorStop(1,`rgba(4,5,14,${o})`),t.fillStyle=a,t.fillRect(0,0,e.w,e.h)}function Q0(t,e,o,a,i,l){t.fillStyle=ke(t,o,e.h,[i,a]),t.fillRect(0,o,e.w,e.h-o),t.strokeStyle=l,t.lineWidth=2;const n=e.w/2,f=o-(e.h-o)*1.1;for(let h=-14;h<=14;h++){const d=n+h*e.w*.11,u=n+(d-n)*(o-f)/(e.h-f);t.beginPath(),t.moveTo(u,o),t.lineTo(d,e.h),t.stroke()}t.fillStyle="rgba(0,0,0,0.28)",t.fillRect(0,o,e.w,7)}function St(t,e){const o=e+(t.h-e)*.5-44;return[{mode:"crawl",x:t.w*.28,y:o,from:-1},{mode:"crawl",x:t.w*.72,y:o+12,from:1}]}function Tt(t,e,o){return e.map((a,i)=>({mode:"drop",x:t.w*a,y:t.h*o[i%o.length]}))}function Pt(t){return Math.max(.6,Math.min(1.15,t.w/1265))}function ia(t){const e=Pt(t),o=t.h*.69,a=lt(11),i=Math.min(t.w*.46,560*e),l=i*.46,n=t.w/2-i/2,f=o-190*e-l,h=o-72*e,d=[.2,.5,.8].map(s=>t.w*s),u={x:t.w*.88,y:Math.max(70*e,o-400*e),r:44*e},c={x:t.w*.88,y:u.y+120*e,r:26*e},y={x:d[2]+52*e,y:h-48*e,r:34*e},k=[t.w*.28,t.w*.72];let T=0,b=5,g=-9,J=0,O=0,q=-1;const V=[...Tt(t,[.13,.36,.64,.87],[.33,.27,.3,.36]),...d.map(s=>({mode:"peek",x:s,y:0,dir:"up",edge:h})),...f>230?[{mode:"peek",x:t.w/2,y:0,dir:"up",edge:f-10*e}]:[],...St(t,o)];return{view:t,floorY:o,spots:V,toys:[{id:"bell",...c,r:c.r+22},{id:"globe",...y,r:y.r+18}],paintStatic(s){s.fillStyle=ke(s,0,o,["#2e4a52","#44686a","#507a74"]),s.fillRect(0,0,t.w,o),H(s,0,o-150*e,t.w,150*e,"#35544f"),H(s,0,o-156*e,t.w,8*e,"#27403c");for(let R=0;R<t.w;R+=46*e)H(s,R,o-148*e,2,148*e,"rgba(0,0,0,0.13)");Q0(s,t,o,"#6a4a31","#553a27","rgba(0,0,0,0.25)");const P=150*e,E=220*e,C=t.w*.12-P/2,W=Math.max(60*e,o-440*e);I(s,C-10*e,W-10*e,P+20*e,E+20*e,6,"#cfc6ae"),s.fillStyle=ke(s,W,W+E,["#2a1f4f","#6a3566","#d9703f"]),s.fillRect(C,W,P,E),s.strokeStyle="#150f1f",s.lineCap="round",s.lineWidth=7*e,s.beginPath(),s.moveTo(C,W+E*.8),s.quadraticCurveTo(C+P*.4,W+E*.6,C+P*.9,W+E*.25),s.stroke(),s.lineWidth=3.5*e,s.beginPath(),s.moveTo(C+P*.42,W+E*.58),s.lineTo(C+P*.5,W+E*.3),s.moveTo(C+P*.66,W+E*.43),s.lineTo(C+P*.95,W+E*.5),s.stroke(),H(s,C+P/2-4*e,W,8*e,E,"#cfc6ae"),H(s,C,W+E*.45,P,8*e,"#cfc6ae"),I(s,C-18*e,W+E+8*e,P+36*e,12*e,4,"#b8ae95"),I(s,n-14*e,f-14*e,i+28*e,l+28*e,8,"#8a5a33"),s.fillStyle=ke(s,f,f+l,["#24453a","#1b352d"]),s.fillRect(n,f,i,l),s.save(),s.beginPath(),s.rect(n,f,i,l),s.clip(),s.strokeStyle="rgba(255,255,255,0.05)",s.lineWidth=26*e;for(let R=0;R<5;R++)s.beginPath(),s.moveTo(n+a()*i,f+a()*l),s.quadraticCurveTo(n+a()*i,f+a()*l,n+a()*i,f+a()*l),s.stroke();s.fillStyle="rgba(245,245,235,0.88)",s.strokeStyle="rgba(245,245,235,0.88)",s.font=`${Math.round(l*.2)}px "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive`,s.textBaseline="middle",s.fillText("2 + 2 = 4",n+i*.06,f+l*.2),s.fillStyle="rgba(255,214,120,0.9)",s.fillText("A B C",n+i*.08,f+l*.5);const L=n+i*.72,p=f+l*.42,m=l*.14;s.lineWidth=3.4*e,s.lineCap="round",s.beginPath(),s.arc(L,p,m,0,le),s.stroke();for(let R=0;R<4;R++)for(const K of[-1,1]){const A=-.6+R*.42;s.beginPath(),s.moveTo(L+K*m*Math.cos(A),p+m*Math.sin(A)),s.lineTo(L+K*m*1.9,p+m*(Math.sin(A)*1.4-.5)),s.lineTo(L+K*m*2.5,p+m*(Math.sin(A)*1.8+.5)),s.stroke()}G(s,L-m*.35,p-m*.15,m*.15,"rgba(245,245,235,0.9)"),G(s,L+m*.35,p-m*.15,m*.15,"rgba(245,245,235,0.9)"),s.strokeStyle="rgba(255,110,110,0.9)",s.lineWidth=5*e,s.beginPath(),s.moveTo(L-m*2.4,p-m*1.7),s.lineTo(L+m*2.4,p+m*1.7),s.moveTo(L+m*2.4,p-m*1.7),s.lineTo(L-m*2.4,p+m*1.7),s.stroke(),s.strokeStyle="rgba(255,214,120,0.85)",s.lineWidth=3*e;const v=n+i*.42,S=f+l*.78;s.beginPath(),s.arc(v,S,l*.07,0,le),s.stroke();for(let R=0;R<8;R++){const K=R/8*le;s.beginPath(),s.moveTo(v+Math.cos(K)*l*.1,S+Math.sin(K)*l*.1),s.lineTo(v+Math.cos(K)*l*.15,S+Math.sin(K)*l*.15),s.stroke()}s.strokeStyle="rgba(160,220,255,0.85)";const D=n+i*.12,j=f+l*.9;s.beginPath(),s.rect(D,j-l*.16,l*.2,l*.16),s.moveTo(D-l*.03,j-l*.16),s.lineTo(D+l*.1,j-l*.28),s.lineTo(D+l*.23,j-l*.16),s.stroke(),s.restore(),I(s,n-4*e,f+l+12*e,i+8*e,10*e,3,"#6d4526"),I(s,n+i*.7,f+l+2*e,40*e,12*e,3,"#d8d0c0"),H(s,n+i*.2,f+l+6*e,22*e,6*e,"#ffffff"),H(s,n+i*.27,f+l+6*e,16*e,6*e,"#ffd678");const M=c.y+70*e,_=["#e9d8a6","#c7e0d0","#f0c7c0"];for(let R=0;R<3;R++){const K=t.w*.82+R*44*e-20*e;if(M+60*e>o-160*e)break;s.save(),s.translate(K,M),s.rotate((a()-.5)*.2),H(s,-17*e,0,34*e,44*e,_[R]),s.strokeStyle=["#c0392b","#2e7d6b","#5b4fc0"][R],s.lineWidth=2.4*e,s.beginPath(),s.arc(0,20*e,8*e,0,le),s.moveTo(-10*e,36*e),s.lineTo(10*e,36*e),s.stroke(),G(s,0,3*e,2.6*e,"#d23"),s.restore()}G(s,u.x,u.y,u.r+7*e,"#2a2f3a"),G(s,u.x,u.y,u.r,"#efe9d6");for(let R=0;R<12;R++){const K=R/12*le;G(s,u.x+Math.cos(K)*u.r*.82,u.y+Math.sin(K)*u.r*.82,(R%3?1.8:3.4)*e,"#2a2f3a")}for(const R of k)H(s,R-3*e,0,6*e,20*e,"#1c2228"),I(s,R-92*e,18*e,184*e,16*e,6,"#2b343c");d.forEach((R,K)=>{const A=212*e;I(s,R-52*e,h-74*e,104*e,70*e,12*e,"#5f7a34"),H(s,R-40*e,h-10*e,8*e,30*e,"#3a4048"),H(s,R+32*e,h-10*e,8*e,30*e,"#3a4048");for(const ee of[-A/2+12*e,A/2-20*e])H(s,R+ee,h+10*e,9*e,138*e,"#444b55");H(s,R-A/2+6*e,h+142*e,36*e,7*e,"#30363e"),H(s,R+A/2-42*e,h+142*e,36*e,7*e,"#30363e"),I(s,R-A/2+14*e,h+12*e,A-28*e,50*e,5,"#8f6238"),I(s,R-A/2+26*e,h+22*e,A-52*e,30*e,4,"#2a1c12"),I(s,R-A/2,h,A,17*e,5,"#c79657"),H(s,R-A/2+6*e,h+2*e,A-12*e,3*e,"rgba(255,255,255,0.2)"),K===0?(I(s,R-70*e,h-14*e,70*e,14*e,3,"#a8323a"),I(s,R-64*e,h-26*e,60*e,12*e,3,"#3b6fb5"),G(s,R+44*e,h-16*e,16*e,"#c8322c"),G(s,R+39*e,h-21*e,5*e,"rgba(255,255,255,0.35)"),H(s,R+43*e,h-37*e,3*e,8*e,"#3d2a16")):K===1?(I(s,R-62*e,h-34*e,28*e,34*e,4,"#3d8a8a"),["#f2c531","#e2574c","#6fbf5a"].forEach((re,ut)=>{s.save(),s.translate(R-56*e+ut*8*e,h-32*e),s.rotate(-.18+ut*.18),H(s,-2.5*e,-30*e,5*e,30*e,re),s.restore()}),ze(s,[R+10*e,h-4*e,R+84*e,h-22*e,R+46*e,h-2*e],"#f1efe6"),ze(s,[R+46*e,h-2*e,R+84*e,h-22*e,R+60*e,h-1*e],"#c9c6ba")):(H(s,y.x-3*e,h-14*e,6*e,14*e,"#6d4526"),I(s,y.x-22*e,h-6*e,44*e,7*e,3,"#6d4526"))}),We(s,0,0,210*e,0,Math.PI/2),We(s,t.w,0,170*e,Math.PI/2,Math.PI),Mt(s,t,.5)},paintLive(s,P){const E=1-T;for(const m of k)I(s,m-84*e,30*e,168*e,8*e,4,`rgba(230,255,240,${.25+.75*E})`),s.fillStyle=`rgba(200,255,230,${.07*E})`,s.beginPath(),s.moveTo(m-84*e,38*e),s.lineTo(m+84*e,38*e),s.lineTo(m+300*e,o),s.lineTo(m-300*e,o),s.closePath(),s.fill();const C=Math.floor(P);s.lineCap="round",s.strokeStyle="#2a2f3a",s.lineWidth=5*e,s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(u.x+u.r*.45,u.y-u.r*.25),s.stroke(),s.lineWidth=3.5*e;const W=P/60*le-Math.PI/2;s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(u.x+Math.cos(W)*u.r*.72,u.y+Math.sin(W)*u.r*.72),s.stroke(),s.strokeStyle="#c0392b",s.lineWidth=2*e;const L=C/60*le*5-Math.PI/2;s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(u.x+Math.cos(L)*u.r*.8,u.y+Math.sin(L)*u.r*.8),s.stroke(),G(s,u.x,u.y,4*e,"#2a2f3a");const p=Math.max(0,1-(P-g)/1.2);s.save(),s.translate(c.x+Math.sin(P*70)*4*e*p,c.y),G(s,0,0,c.r,"#b3261e"),G(s,0,0,c.r*.72,"#d6402f"),G(s,0,0,c.r*.2,"#f1c9a0"),H(s,-5*e,c.r-2*e,10*e,12*e,"#2a2f3a"),s.restore(),s.save(),s.translate(y.x,y.y),G(s,0,0,y.r,"#2f79b8"),s.beginPath(),s.arc(0,0,y.r,0,le),s.clip(),s.fillStyle="#5fae58";for(let m=0;m<4;m++){const v=((m*.5+J/le)%2+2)%2*y.r*2-y.r*2;s.beginPath(),s.ellipse(v,(m%2?-1:1)*y.r*.25,y.r*.36,y.r*(.3+.12*m),.4,0,le),s.fill()}s.restore(),s.strokeStyle="#d9c9a0",s.lineWidth=3*e,s.beginPath(),s.arc(y.x,y.y,y.r+4*e,-1.2,1.9),s.stroke()},paintFront(){},step(s,P,E){b-=s,b<=0&&(T=1,b=6+Math.random()*9,E("flicker",t.w/2)),T=T>.02?Math.max(0,T-s*2.2)*(Math.sin(P*50)>.2?1:.4):0,J+=O*s,O*=Math.pow(.4,s);const C=Math.floor(P);C!==q&&(q=C,E("tick",u.x))},darkness(){return{level:.26+.4*T,lights:k.map(s=>({x:s,y:o*.45,r:430*e,power:.5*(1-T)}))}},poke(s,P){return s==="bell"?(g=P,"bell"):(O=9,"globe")}}}function na(t){const e=Pt(t),o=t.h*.69,a=o-96*e,i=t.w*.27,l=t.w*.78,n={x:t.w*.13,w:172*e,top:Math.max(225,o-345*e),bottom:o+58*e},f=i+(l-i)*.26,h=i+(l-i)*.72,d=t.w*.89,u=o-66*e,c=Math.max(70*e,o-410*e),y=[0,1,2].map(s=>({x:t.w*.82+s*62*e,swing:0,vel:0,r:(30-s*4)*e})),k={x:t.w*.5,y:Math.max(90*e,o-470*e)};let T=0,b=0,g=3;const J=[],O=Math.max(96*e,o-410*e),q={x:i+8*e,w:(l-i)*.44,h:128*e},V=[...Tt(t,[.3,.44,.63,.83],[.3,.38,.29,.36]),{mode:"peek",x:n.x,y:0,dir:"up",edge:n.top},{mode:"peek",x:i+(l-i)*.5,y:0,dir:"up",edge:a},{mode:"peek",x:l-40*e,y:0,dir:"up",edge:a},{mode:"peek",x:d,y:0,dir:"up",edge:u},...St(t,o)];return{view:t,floorY:o,spots:V,toys:y.map((s,P)=>({id:`pan${P}`,x:s.x,y:c+70*e,r:46*e})),paintStatic(s){s.fillStyle=ke(s,0,o,["#3d3040","#5a4544","#6d5646"]),s.fillRect(0,0,t.w,o);const P=34*e,E=a-P*4;for(let A=E;A<a;A+=P)for(let ee=0;ee<t.w;ee+=P){const re=(Math.round(ee/P)+Math.round((A-E)/P))%5===0;H(s,ee+1,A+1,P-2,P-2,re?"#5e8a84":"#b9ad92")}H(s,0,E-6*e,t.w,6*e,"#7a6a50");const C=t.w/2,W=t.h-o,L=5;for(let A=0;A<L;A++){const ee=o+W*Math.pow(A/L,1.7),re=o+W*Math.pow((A+1)/L,1.7),ut=.5+(ee-o)/W,p0=.5+(re-o)/W;for(let Ve=-9;Ve<9;Ve++){const Ct=t.w*.13;s.fillStyle=A+Ve&1?"#3a3542":"#93896f",s.beginPath(),s.moveTo(C+Ve*Ct*ut,ee),s.lineTo(C+(Ve+1)*Ct*ut,ee),s.lineTo(C+(Ve+1)*Ct*p0,re),s.lineTo(C+Ve*Ct*p0,re),s.closePath(),s.fill()}}s.fillStyle=ke(s,o,t.h,["rgba(10,8,20,0.5)","rgba(10,8,20,0)"]),s.fillRect(0,o,t.w,W);const p=170*e,m=150*e,v=h-p/2,S=O-6*e;I(s,v-9*e,S-9*e,p+18*e,m+18*e,6,"#d9cfb4"),s.fillStyle=ke(s,S,S+m,["#0e1638","#263c6a"]),s.fillRect(v,S,p,m),s.save(),s.beginPath(),s.rect(v,S,p,m),s.clip(),f0(s,v+p*.62,S+m*.4,26*e),s.restore(),H(s,v+p/2-3*e,S,6*e,m,"#d9cfb4");for(const A of[0,1]){const ee=A?v+p-44*e:v;s.fillStyle="#b5413b",s.beginPath(),s.moveTo(ee,S),s.lineTo(ee+44*e,S),s.quadraticCurveTo(ee+(A?44:0)*e,S+m*.5,ee+(A?26:18)*e,S+m),s.lineTo(ee+(A?44*e:0),S+m),s.closePath(),s.fill(),s.fillStyle="rgba(255,255,255,0.3)";for(let re=0;re<4;re++)s.fillRect(ee,S+8*e+re*36*e,44*e,8*e)}I(s,q.x,O,q.w,q.h,6,"#7c5a3c");const D=3;for(let A=0;A<D;A++){const ee=q.x+6*e+A*(q.w-12*e)/D,re=(q.w-12*e)/D-6*e;A===1?(I(s,ee,O+6*e,re,q.h-12*e,4,"#0d0a10"),I(s,ee+re*.55,O+6*e,re*.5,q.h-12*e,4,"#946d48")):(I(s,ee,O+6*e,re,q.h-12*e,4,"#946d48"),I(s,ee+8*e,O+14*e,re-16*e,q.h-28*e,3,"#876140"),G(s,ee+(A?10*e:re-10*e),O+q.h*.7,4*e,"#d9c9a0"))}I(s,n.x-n.w/2,n.top,n.w,n.bottom-n.top,14*e,"#c9d3d6"),I(s,n.x-n.w/2,n.top,n.w*.12,n.bottom-n.top,6*e,"#aab6ba");const j=n.top+(n.bottom-n.top)*.34;H(s,n.x-n.w/2,j,n.w,5*e,"#8d999d"),I(s,n.x+n.w*.3,j-62*e,9*e,48*e,4,"#7c888c"),I(s,n.x+n.w*.3,j+20*e,9*e,80*e,4,"#7c888c"),s.save(),s.translate(n.x-14*e,j+60*e),s.rotate(-.06),H(s,-34*e,0,68*e,80*e,"#fbf6e4"),s.strokeStyle="#7a3fb0",s.lineWidth=3*e,s.lineCap="round",s.beginPath(),s.arc(0,38*e,13*e,0,le);for(let A=0;A<4;A++)s.moveTo(-12*e,30*e+A*5*e),s.lineTo(-27*e,22*e+A*11*e),s.moveTo(12*e,30*e+A*5*e),s.lineTo(27*e,22*e+A*11*e);s.stroke(),G(s,-5*e,35*e,2.4*e,"#d23"),G(s,5*e,35*e,2.4*e,"#d23"),G(s,0,5*e,5*e,"#e2574c"),s.restore(),G(s,n.x-40*e,n.top+40*e,8*e,"#f2c531"),G(s,n.x+10*e,n.top+64*e,7*e,"#6fbf5a"),I(s,i,a,l-i,o+56*e-a,4,"#7c5a3c");const M=4;for(let A=0;A<M;A++){const ee=i+8*e+A*(l-i-16*e)/M,re=(l-i-16*e)/M-8*e;A!==1&&(I(s,ee,a+26*e,re,o+44*e-a-26*e,4,"#946d48"),G(s,ee+re/2,a+44*e,4.5*e,"#d9c9a0"))}I(s,i-8*e,a,l-i+16*e,16*e,4,"#d8d2c2"),H(s,i-8*e,a+13*e,l-i+16*e,3*e,"#a59f8f");const _=(l-i)/M-4*e,R=f-_/2;I(s,R,a+16*e,_,o+44*e-a-16*e,4,"#30333c"),I(s,R+12*e,a+52*e,_-24*e,62*e,6,"#12131a"),I(s,R+10*e,a+38*e,_-20*e,6*e,3,"#9aa3ad");for(let A=0;A<4;A++)G(s,R+18*e+A*(_-36*e)/3,a+27*e,5*e,"#c9d2e0");I(s,f-46*e,a-6*e,92*e,7*e,3,"#1b1d24"),I(s,f-40*e,a-58*e,80*e,52*e,8*e,"#b8493c"),I(s,f-40*e,a-58*e,16*e,52*e,6*e,"#d76a59"),I(s,f-56*e,a-46*e,18*e,8*e,4,"#2b2e36"),I(s,f+38*e,a-46*e,18*e,8*e,4,"#2b2e36"),I(s,h-62*e,a-4*e,124*e,12*e,4,"#8f9aa6"),s.strokeStyle="#aab4c0",s.lineWidth=8*e,s.lineCap="round",s.beginPath(),s.moveTo(h+34*e,a-2*e),s.lineTo(h+34*e,a-52*e),s.quadraticCurveTo(h+34*e,a-74*e,h+8*e,a-70*e),s.lineTo(h+2*e,a-56*e),s.stroke();for(let A=0;A<4;A++)I(s,i+14*e,a-8*e-A*6*e,62*e,6*e,3,A%2?"#e9e4d6":"#cfc9ba");I(s,h-110*e,a-42*e,30*e,42*e,5,"#5e8a84"),s.strokeStyle="#c9a36a",s.lineWidth=5*e;for(let A=0;A<3;A++)s.beginPath(),s.moveTo(h-102*e+A*7*e,a-40*e),s.lineTo(h-110*e+A*12*e,a-78*e),s.stroke();H(s,y[0].x-44*e,c,y[2].x-y[0].x+88*e,7*e,"#4a4f58"),H(s,y[0].x-38*e,c-22*e,5*e,24*e,"#4a4f58"),H(s,y[2].x+33*e,c-22*e,5*e,24*e,"#4a4f58");const K=190*e;H(s,d-K/2+14*e,u,10*e,o+70*e-u,"#5a3d29"),H(s,d+K/2-24*e,u,10*e,o+70*e-u,"#5a3d29"),s.fillStyle="#e6dfcd",s.beginPath(),s.moveTo(d-K/2,u),s.lineTo(d+K/2,u),s.lineTo(d+K/2+6*e,u+62*e);for(let A=5;A>=0;A--){const ee=d-K/2-6*e+(K+12*e)*A/5;s.quadraticCurveTo(ee+(K+12*e)/10,u+78*e,ee,u+62*e)}s.closePath(),s.fill(),s.fillStyle="rgba(181,65,59,0.5)";for(let A=0;A<5;A++)s.fillRect(d-K/2+10*e+A*38*e,u+2*e,12*e,58*e);I(s,d-50*e,u-10*e,100*e,10*e,4,"#e9e4d6"),I(s,d-38*e,u-46*e,76*e,38*e,8*e,"#f4d9d0"),I(s,d-38*e,u-50*e,76*e,14*e,7*e,"#e2574c"),G(s,d,u-56*e,7*e,"#c8322c"),H(s,k.x-2*e,0,4*e,k.y-30*e,"#1b1d24"),ze(s,[k.x-22*e,k.y-32*e,k.x+22*e,k.y-32*e,k.x+62*e,k.y+8*e,k.x-62*e,k.y+8*e],"#d8a03a"),de(s,k.x,k.y+8*e,62*e,9*e,"#fff0b8"),We(s,0,0,190*e,0,Math.PI/2),We(s,t.w,0,220*e,Math.PI/2,Math.PI),Mt(s,t,.5)},paintLive(s,P){const E=(q.w-12*e)/3,C=q.x+6*e+E*1.25,W=O+q.h*.5;P*.37%1<.93&&(G(s,C,W,5*e,"#ffe14a"),G(s,C+20*e,W,5*e,"#ffe14a"),G(s,C+Math.sin(P)*2*e,W,2*e,"#0d0a10"),G(s,C+20*e+Math.sin(P)*2*e,W,2*e,"#0d0a10"));for(let m=0;m<5;m++){const v=f-30*e+m*15*e,S=(7+Math.sin(P*17+m*2)*2.5)*e;ze(s,[v-5*e,a-6*e,v+5*e,a-6*e,v,a-6*e-S],"#59c7ff")}for(const m of J)s.fillStyle=`rgba(235,240,245,${m.a*.3})`,s.beginPath(),s.arc(m.x,m.y,m.r,0,le),s.fill();const L=b>0?Math.abs(Math.sin(b*30))*6*e:0;s.save(),s.translate(f,a-58*e-L),s.rotate(b>0?Math.sin(b*41)*.06:0),I(s,-44*e,-8*e,88*e,10*e,5,"#8f2f26"),G(s,0,-12*e,7*e,"#2b2e36"),s.restore();const p=T%2.6;p<.5?de(s,h+2*e,a-52*e+p*p*190*e,3*e,5*e,"#bfe6ff"):p>2.2&&de(s,h+2*e,a-52*e,3*e*((p-2.2)/.4),4*e*((p-2.2)/.4),"#bfe6ff"),y.forEach((m,v)=>{s.save(),s.translate(m.x,c+6*e),s.rotate(m.swing),H(s,-2*e,0,4*e,16*e,"#9aa3ad"),I(s,-5*e,14*e,10*e,46*e,4,"#2b2e36"),G(s,0,60*e+m.r,m.r,v===1?"#b8733a":"#3a3f4b"),G(s,0,60*e+m.r,m.r*.78,v===1?"#d99450":"#565d6b"),s.fillStyle="rgba(255,255,255,0.18)",s.beginPath(),s.arc(0,60*e+m.r,m.r*.6,3.6,4.9),s.lineTo(0,60*e+m.r),s.fill(),s.restore()}),s.fillStyle="rgba(255,225,150,0.07)",s.beginPath(),s.moveTo(k.x-60*e,k.y+8*e),s.lineTo(k.x+60*e,k.y+8*e),s.lineTo(k.x+380*e,o+40*e),s.lineTo(k.x-380*e,o+40*e),s.closePath(),s.fill()},paintFront(){},step(s,P,E){const C=T%2.6;T+=s,C<.5&&T%2.6>=.5&&E("drip",h),g-=s,g<=0&&(b=.7,g=5+Math.random()*6,E("pot",f)),b=Math.max(0,b-s),Math.random()<s*5&&J.push({x:f+(Math.random()-.5)*50*e,y:a-66*e,a:1,r:(8+Math.random()*8)*e});for(let W=J.length-1;W>=0;W--){const L=J[W];L.y-=40*e*s,L.x+=Math.sin(P*2+W)*8*s,L.r+=9*e*s,L.a-=s*.55,L.a<=0&&J.splice(W,1)}for(const W of y)W.vel+=-W.swing*38*s,W.vel*=Math.pow(.35,s),W.swing+=W.vel*s},darkness(){return{level:.36,lights:[{x:k.x,y:k.y+150*e,r:470*e,power:.75},{x:f,y:a-10*e,r:110*e,power:.35}]}},poke(s){const P=y[Number(s.slice(3))];return P?(P.vel+=(Math.random()<.5?-1:1)*3.2,"clang"):null}}}function sa(t){const e=Pt(t),o=t.h*.69,a=lt(33),i={x:t.w*.12,w:184*e,top:Math.max(225,o-400*e),bottom:o+52*e},l={x0:t.w*.47,x1:t.w*.86,top:o-74*e,bottom:o+76*e},n={x:t.w*.34,y:Math.max(90*e,o-420*e),w:170*e,h:240*e},f={x:Math.min(t.w-60*e,t.w*.935),top:o-40*e},h={x:f.x,y:f.top-62*e},d={x:t.w*.33,y:o+62*e},u={x:t.w*.66,len:Math.max(70*e,o-460*e)};let c=!0,y=0;const k=[];for(let b=0;b<46;b++)k.push([a()*t.w,a()*(o-30),a()]);const T=[...Tt(t,[.22,.5,.7,.88],[.28,.34,.26,.33]),{mode:"peek",x:i.x,y:0,dir:"up",edge:i.top},{mode:"peek",x:0,y:o-150*e,dir:"right",edge:i.x+i.w/2},{mode:"peek",x:(l.x0+l.x1)/2-30*e,y:0,dir:"up",edge:l.top-4*e},...St(t,o)];return{view:t,floorY:o,spots:T,toys:[{id:"lamp",x:h.x,y:h.y,r:58*e},{id:"teddy",x:d.x,y:d.y-34*e,r:54*e}],paintStatic(b){b.fillStyle=ke(b,0,o,["#1c2350","#2a3368","#354078"]),b.fillRect(0,0,t.w,o);for(const[E,C,W]of k)if(b.fillStyle=`rgba(200,210,255,${.1+W*.12})`,W>.75)b.beginPath(),b.arc(E,C,8*e,.6,3.9),b.arc(E+4*e,C-2*e,6.5*e,3.6,.9,!0),b.fill();else{b.beginPath();for(let L=0;L<10;L++){const p=L/10*le-Math.PI/2,m=(L%2?2.6:6.5)*e;b.lineTo(E+Math.cos(p)*m,C+Math.sin(p)*m)}b.fill()}H(b,0,o-22*e,t.w,22*e,"#1a2046"),Q0(b,t,o,"#4c372a","#3a2a22","rgba(0,0,0,0.3)");const g=o+(t.h-o)*.62;de(b,t.w*.52,g,t.w*.3,(t.h-o)*.3,"#7a3f5a"),de(b,t.w*.52,g,t.w*.24,(t.h-o)*.23,"#9a5672"),de(b,t.w*.52,g,t.w*.15,(t.h-o)*.14,"#7a3f5a"),I(b,n.x-n.w/2-10*e,n.y-10*e,n.w+20*e,n.h+20*e,6,"#e6e0d0"),b.fillStyle=ke(b,n.y,n.y+n.h,["#0a1030","#1d3160"]),b.fillRect(n.x-n.w/2,n.y,n.w,n.h),b.save(),b.beginPath(),b.rect(n.x-n.w/2,n.y,n.w,n.h),b.clip(),f0(b,n.x+12*e,n.y+n.h*.34,40*e);for(let E=0;E<12;E++)G(b,n.x-n.w/2+a()*n.w,n.y+a()*n.h,1.6*e,"rgba(255,255,255,0.8)");ze(b,[n.x-n.w/2,n.y+n.h,n.x-n.w*.2,n.y+n.h*.72,n.x+n.w*.1,n.y+n.h*.85,n.x+n.w/2,n.y+n.h*.7,n.x+n.w/2,n.y+n.h],"#0a1124"),b.restore(),H(b,n.x-4*e,n.y,8*e,n.h,"#e6e0d0"),H(b,n.x-n.w/2,n.y+n.h*.5,n.w,8*e,"#e6e0d0"),b.fillStyle="rgba(190,210,255,0.1)",b.beginPath(),b.moveTo(n.x-n.w/2,o),b.lineTo(n.x+n.w/2,o),b.lineTo(n.x+n.w*1.5,t.h),b.lineTo(n.x-n.w*.2,t.h),b.closePath(),b.fill();const J=Math.min(t.w*.64,l.x0+110*e),O=Math.max(n.y+20*e,o-330*e);I(b,J-46*e,O,92*e,74*e,5,"#8a5a33"),H(b,J-38*e,O+8*e,76*e,58*e,"#d9cfb4");for(const[E,C]of[[-18,1],[8,.8],[26,.55]]){G(b,J+E*e,O+44*e,11*e*C,"#2a1b3d"),b.strokeStyle="#2a1b3d",b.lineWidth=2*e;for(let W=0;W<4;W++)b.beginPath(),b.moveTo(J+E*e-9*e*C,O+40*e+W*3*e*C),b.lineTo(J+E*e-18*e*C,O+34*e+W*7*e*C),b.moveTo(J+E*e+9*e*C,O+40*e+W*3*e*C),b.lineTo(J+E*e+18*e*C,O+34*e+W*7*e*C),b.stroke();G(b,J+E*e-4*e*C,O+42*e,2.2*e*C,"#fff"),G(b,J+E*e+4*e*C,O+42*e,2.2*e*C,"#fff")}I(b,i.x-i.w/2,i.top,i.w,i.bottom-i.top,8,"#5b3a2a"),I(b,i.x-i.w/2-8*e,i.top-6*e,i.w+16*e,16*e,5,"#6d4732"),I(b,i.x-i.w/2+10*e,i.top+22*e,i.w/2-14*e,i.bottom-i.top-60*e,5,"#734a34"),I(b,i.x+4*e,i.top+22*e,i.w/2-14*e,i.bottom-i.top-60*e,5,"#0b0812"),I(b,i.x+24*e,i.top+22*e,i.w/2-34*e,i.bottom-i.top-60*e,5,"#734a34"),G(b,i.x-10*e,i.top+(i.bottom-i.top)*.5,6*e,"#d9c9a0"),G(b,i.x+34*e,i.top+(i.bottom-i.top)*.5,6*e,"#d9c9a0"),H(b,i.x-i.w/2+10*e,i.bottom-8*e,14*e,14*e,"#3a251b"),H(b,i.x+i.w/2-24*e,i.bottom-8*e,14*e,14*e,"#3a251b");const q=l.x1-l.x0;I(b,l.x1-26*e,l.top-120*e,40*e,l.bottom-l.top+120*e,14*e,"#6d4732"),I(b,l.x0-10*e,l.top-20*e,26*e,l.bottom-l.top+20*e,10*e,"#6d4732"),H(b,l.x0,l.bottom-36*e,q,36*e,"#07060c"),I(b,l.x0,l.top,q,70*e,14*e,"#e9e4f2"),I(b,l.x1-132*e,l.top-30*e,110*e,44*e,20*e,"#ffffff"),b.save(),b.beginPath(),b.roundRect(l.x0-4*e,l.top-4*e,q*.72,l.bottom-l.top-30*e,16*e),b.clip();const V=["#c6504a","#e0a13a","#4f8f7a","#5a6fc4","#a05aa8"],s=44*e;for(let E=l.top-4*e,C=0;E<l.bottom;E+=s,C++)for(let W=l.x0-4*e,L=0;W<l.x0+q*.72;W+=s,L++)H(b,W,E,s,s,V[(C*2+L*3)%V.length]),H(b,W,E,s,2,"rgba(0,0,0,0.2)"),H(b,W,E,2,s,"rgba(0,0,0,0.2)");b.restore(),I(b,f.x-44*e,f.top,88*e,o+60*e-f.top,5,"#5b3a2a"),I(b,f.x-36*e,f.top+14*e,72*e,30*e,4,"#734a34"),G(b,f.x,f.top+29*e,5*e,"#d9c9a0");const P=d.x-150*e;P>i.x+i.w/2-30*e&&(I(b,P-66*e,o+8*e,132*e,74*e,8,"#3f6fb5"),I(b,P-70*e,o-4*e,140*e,20*e,8,"#5486cf"),G(b,P,o+44*e,12*e,"#f2c531")),H(b,d.x+70*e,o+70*e,30*e,30*e,"#e2574c"),H(b,d.x+104*e,o+76*e,26*e,26*e,"#6fbf5a"),H(b,d.x+86*e,o+46*e,26*e,26*e,"#f2c531"),We(b,0,0,200*e,0,Math.PI/2),We(b,t.w,0,230*e,Math.PI/2,Math.PI),Mt(b,t,.55)},paintLive(b,g){for(const q of[-1,1]){const V=Math.sin(g*.9+q)*9*e,s=n.x+q*n.w/2+q*12*e;b.fillStyle="#7b5fb8",b.beginPath(),b.moveTo(s,n.y-16*e),b.lineTo(s-q*58*e,n.y-16*e),b.quadraticCurveTo(s-q*(70*e+V),n.y+n.h*.55,s-q*(40*e+V*1.6),n.y+n.h+30*e),b.lineTo(s+q*4*e,n.y+n.h+30*e),b.closePath(),b.fill(),b.strokeStyle="rgba(255,255,255,0.14)",b.lineWidth=3*e,b.beginPath(),b.moveTo(s-q*26*e,n.y-10*e),b.quadraticCurveTo(s-q*(36*e+V),n.y+n.h*.5,s-q*(22*e+V),n.y+n.h+24*e),b.stroke()}if(H(b,n.x-n.w/2-30*e,n.y-24*e,n.w+60*e,9*e,"#3a251b"),!(g*.29%1>.94))for(const[q,V]of[[.28,"#ff5a4a"],[.62,"#ffe14a"]]){const s=l.x0+(l.x1-l.x0)*q+Math.sin(g*.5+q*9)*8*e,P=l.bottom-18*e;G(b,s,P,5*e,V),G(b,s+18*e,P,5*e,V),G(b,s,P,2*e,"#07060c"),G(b,s+18*e,P,2*e,"#07060c")}if(H(b,h.x-4*e,h.y+20*e,8*e,42*e,"#c9a36a"),I(b,h.x-20*e,f.top-8*e,40*e,8*e,4,"#c9a36a"),ze(b,[h.x-20*e,h.y-26*e,h.x+20*e,h.y-26*e,h.x+38*e,h.y+24*e,h.x-38*e,h.y+24*e],c?"#ffd98a":"#6a5a7a"),c){const q=b.createRadialGradient(h.x,h.y,6*e,h.x,h.y,170*e);q.addColorStop(0,"rgba(255,220,140,0.34)"),q.addColorStop(1,"rgba(255,220,140,0)"),b.fillStyle=q,b.fillRect(h.x-170*e,h.y-170*e,340*e,340*e)}const O=Math.max(0,y);if(b.save(),b.translate(d.x,d.y),b.scale(1+O*.25,1-O*.25),G(b,-34*e,2*e,14*e,"#a8743f"),G(b,34*e,2*e,14*e,"#a8743f"),de(b,0,0,34*e,38*e,"#b98548"),de(b,0,6*e,20*e,24*e,"#d9ab72"),G(b,-22*e,-64*e,12*e,"#a8743f"),G(b,22*e,-64*e,12*e,"#a8743f"),G(b,0,-46*e,28*e,"#b98548"),de(b,0,-38*e,13*e,10*e,"#d9ab72"),G(b,-10*e,-52*e,3.4*e,"#1b1420"),G(b,10*e,-52*e,3.4*e,"#1b1420"),G(b,0,-41*e,3.6*e,"#1b1420"),G(b,-22*e,34*e,13*e,"#a8743f"),G(b,22*e,34*e,13*e,"#a8743f"),b.restore(),u.len>60*e){const q=Math.sin(g*.8)*.08;b.save(),b.translate(u.x,0),b.rotate(q),b.strokeStyle="rgba(230,236,255,0.6)",b.lineWidth=2*e,b.beginPath(),b.moveTo(0,0),b.lineTo(0,u.len),b.moveTo(-60*e,u.len),b.lineTo(60*e,u.len),b.stroke();const V=["#ffe58a","#a8d8ff","#ffb0c8"];[-60,0,60].forEach((s,P)=>{const E=(26+P*10)*e;b.beginPath(),b.moveTo(s*e,u.len),b.lineTo(s*e,u.len+E),b.stroke(),b.fillStyle=V[P],b.beginPath();for(let C=0;C<10;C++){const W=C/10*le-Math.PI/2+g*(P-1)*.6,L=(C%2?6:14)*e;b.lineTo(s*e+Math.cos(W)*L,u.len+E+12*e+Math.sin(W)*L)}b.fill()}),b.restore()}},paintFront(){},step(b){y=Math.max(0,y-b*3)},darkness(){const b=[{x:n.x,y:n.y+n.h*.6,r:330*e,power:.5}];return c&&b.push({x:h.x,y:h.y+30*e,r:420*e,power:.8}),{level:c?.46:.6,lights:b}},poke(b){return b==="lamp"?(c=!c,"lamp"):(y=1,"squeak")}}}function la(t){const e=Pt(t),o=t.h*.69,a=lt(44),i={x0:t.w*.04,x1:t.w*.33,top:Math.max(225,o-330*e),bottom:o+40*e},l=[{x:t.w*.55,w:150*e,top:o-118*e,bottom:o+66*e},{x:t.w*.71,w:128*e,top:o-70*e,bottom:o+88*e}],n={x:t.w*.9,w:150*e,top:o-150*e,bottom:o+70*e},f={x:t.w*.45,len:Math.max(110*e,o-380*e)},h=64*e,d=t.w*.64;let u=.1,c=0,y=0,k=1;const T=()=>({x:f.x+Math.sin(u)*f.len,y:36*e+Math.cos(u)*f.len}),b=[...Tt(t,[.2,.38,.62,.83],[.3,.36,.27,.33]),{mode:"peek",x:(i.x0+i.x1)/2,y:0,dir:"up",edge:i.top},{mode:"peek",x:l[0].x,y:0,dir:"up",edge:l[0].top},{mode:"peek",x:l[1].x,y:0,dir:"up",edge:l[1].top},{mode:"peek",x:n.x,y:0,dir:"up",edge:n.top},...St(t,o)];return{view:t,floorY:o,spots:b,toys:[{id:"bulb",x:f.x,y:36*e+f.len,r:60*e},{id:"barrel",x:l[0].x,y:(l[0].top+l[0].bottom)/2+20*e,r:60*e}],paintStatic(g){H(g,0,0,t.w,o,"#3f3136");const J=26*e,O=62*e;for(let m=0,v=0;m<o;m+=J,v++)for(let S=-(v%2)*O*.5;S<t.w;S+=O){const D=a();g.fillStyle=D>.8?"#5a4148":D>.4?"#4c383d":"#44323a",g.fillRect(S+1.5,m+1.5,O-3,J-3)}g.fillStyle=ke(g,0,o,["rgba(8,6,14,0.6)","rgba(8,6,14,0.1)","rgba(8,6,14,0.35)"]),g.fillRect(0,0,t.w,o);for(let m=0;m<5;m++)de(g,a()*t.w,o-a()*120*e,(40+a()*60)*e,(20+a()*30)*e,"rgba(40,70,60,0.2)");g.fillStyle=ke(g,o,t.h,["#2c2b33","#3d3c46"]),g.fillRect(0,o,t.w,t.h-o),g.strokeStyle="rgba(0,0,0,0.32)",g.lineWidth=2.5;const q=t.h-o;for(let m=1;m<4;m++){const v=o+q*Math.pow(m/4,1.6);g.beginPath(),g.moveTo(0,v),g.lineTo(t.w,v),g.stroke();for(let S=m%2*90*e;S<t.w;S+=180*e*(.7+m*.2))g.beginPath(),g.moveTo(S,v),g.lineTo(S+(S-t.w/2)*.12,o+q*Math.pow((m+1)/4,1.6)),g.stroke()}H(g,0,o,t.w,7,"rgba(0,0,0,0.4)");const V=t.w*.8,s=Math.max(86*e,o-430*e);I(g,V-58*e,s-8*e,116*e,76*e,8,"#221a20"),g.fillStyle=ke(g,s,s+60*e,["#12204a","#2a4472"]),g.fillRect(V-50*e,s,100*e,60*e),G(g,V+18*e,s+24*e,14*e,"#f2f0d8");for(let m=0;m<4;m++)H(g,V-40*e+m*26*e,s,6*e,60*e,"#15121a");g.fillStyle="rgba(180,205,255,0.07)",g.beginPath(),g.moveTo(V-50*e,s+60*e),g.lineTo(V+50*e,s+60*e),g.lineTo(V-60*e,t.h),g.lineTo(V-330*e,t.h),g.closePath(),g.fill(),H(g,0,0,t.w,30*e,"#2a1c14");for(let m=t.w*.1;m<t.w;m+=t.w*.27)H(g,m,0,26*e,42*e,"#38261a");H(g,0,h,t.w,14*e,"#5a6a62"),H(g,0,h,t.w,4*e,"#7d9086");for(const m of[t.w*.22,d,t.w*.92])I(g,m-9*e,h-4*e,18*e,22*e,3,"#46544d");G(g,t.w*.22,h+7*e,14*e,"#a8322a"),G(g,t.w*.22,h+7*e,6*e,"#5a1c18"),de(g,d,o+q*.18,46*e,9*e,"rgba(120,170,200,0.3)");const P=i.x1-i.x0;H(g,i.x0,i.top,12*e,i.bottom-i.top,"#3a281c"),H(g,i.x1-12*e,i.top,12*e,i.bottom-i.top,"#3a281c");const E=["#7bbf5a","#d9574a","#e8c23a","#c98bd8","#6fb8d0"],C=3;for(let m=0;m<=C;m++){const v=i.top+m*(i.bottom-i.top-30*e)/C;if(I(g,i.x0-6*e,v,P+12*e,13*e,3,"#5b4030"),m===0)continue;let S=i.x0+22*e;for(;S<i.x1-50*e;){const D=a(),j=(26+a()*14)*e,M=(34+a()*26)*e;if(D<.6){const _=E[Math.floor(a()*E.length)];g.globalAlpha=.85,I(g,S,v-M,j,M,6*e,_),g.globalAlpha=1,I(g,S+3*e,v-M-6*e,j-6*e,8*e,3,"#c9c2ae"),H(g,S+4*e,v-M+6*e,4*e,M-14*e,"rgba(255,255,255,0.35)")}else D<.85?(I(g,S,v-M*.8,j*1.3,M*.8,3,"#8a6a48"),H(g,S,v-M*.5,j*1.3,4*e,"#5b4030")):(I(g,S,v-M*.7,j,M*.7,4,"#4f6fa0"),H(g,S,v-M*.7,j,6*e,"#c9d2e0"));S+=j*1.4+6*e}}for(const m of l){const v=m.bottom-m.top;g.fillStyle="#7a4f2c",g.beginPath(),g.moveTo(m.x-m.w*.42,m.top),g.quadraticCurveTo(m.x-m.w*.62,m.top+v/2,m.x-m.w*.42,m.bottom),g.lineTo(m.x+m.w*.42,m.bottom),g.quadraticCurveTo(m.x+m.w*.62,m.top+v/2,m.x+m.w*.42,m.top),g.closePath(),g.fill(),g.save(),g.clip();for(let S=-3;S<=3;S++)H(g,m.x+S*m.w*.15-1.5,m.top,3,v,"rgba(0,0,0,0.22)");H(g,m.x-m.w,m.top+v*.14,m.w*2,12*e,"#3a3f4b"),H(g,m.x-m.w,m.top+v*.76,m.w*2,12*e,"#3a3f4b"),H(g,m.x-m.w*.5,m.top,m.w*.22,v,"rgba(255,255,255,0.08)"),g.restore(),de(g,m.x,m.top,m.w*.42,9*e,"#93643a")}const W=n.w,L=(n.bottom-n.top)/2;for(let m=0;m<2;m++){const v=n.x-W/2+(m?0:14*e),S=n.top+m*L,D=W-(m?0:28*e);I(g,v,S,D,L,4,"#8a6a48"),g.strokeStyle="#5b4030",g.lineWidth=7*e,g.strokeRect(v+5*e,S+5*e,D-10*e,L-10*e),g.beginPath(),g.moveTo(v+8*e,S+8*e),g.lineTo(v+D-8*e,S+L-8*e),g.stroke()}const p=t.w*.4;g.fillStyle="#a8946a",g.beginPath(),g.moveTo(p-50*e,o+60*e),g.quadraticCurveTo(p-64*e,o-30*e,p-14*e,o-40*e),g.lineTo(p-22*e,o-62*e),g.lineTo(p+20*e,o-62*e),g.lineTo(p+14*e,o-40*e),g.quadraticCurveTo(p+62*e,o-30*e,p+50*e,o+60*e),g.closePath(),g.fill(),H(g,p-18*e,o-44*e,36*e,6*e,"#6d5a3a"),We(g,0,30*e,260*e,0,Math.PI/2,.42),We(g,t.w,30*e,240*e,Math.PI/2,Math.PI,.42),We(g,i.x1,i.top+13*e,90*e,Math.PI/2,Math.PI,.3),Mt(g,t,.6)},paintLive(g,J){const O=t.w*.47,q=o-16*e;g.fillStyle="#0a0810",g.beginPath(),g.arc(O,q+16*e,24*e,Math.PI,0),g.fill(),J*.23%1<.9&&(G(g,O-7*e,q+4*e,3*e,"#ff8a7a"),G(g,O+7*e,q+4*e,3*e,"#ff8a7a"));const V=k%3.4;V<.75&&de(g,d,h+18*e+V*V*(o-h)*1.9,3*e,6*e,"#bfe6ff");const s=T(),P=y>0?Math.sin(J*60)>0?1:.3:1;g.strokeStyle="#15121a",g.lineWidth=3*e,g.beginPath(),g.moveTo(f.x,30*e),g.lineTo(s.x,s.y-18*e),g.stroke(),g.save(),g.translate(s.x,s.y),g.rotate(-u),I(g,-9*e,-24*e,18*e,16*e,3,"#3a3f4b"),G(g,0,0,15*e,`rgba(255,236,160,${.5+.5*P})`),g.restore();const E=g.createRadialGradient(s.x,s.y,4*e,s.x,s.y,150*e);E.addColorStop(0,`rgba(255,225,140,${.4*P})`),E.addColorStop(1,"rgba(255,225,140,0)"),g.fillStyle=E,g.fillRect(s.x-150*e,s.y-150*e,300*e,300*e)},paintFront(g,J){const O=T();g.fillStyle="rgba(255,240,200,0.3)";for(let q=0;q<14;q++){const V=q*2.4+J*.1,s=(40+q*53%190)*e,P=O.x+Math.cos(V)*s,E=O.y+60*e+Math.sin(V*1.3+J*.2)*s*.7;g.fillRect(P,E,2.4*e,2.4*e)}},step(g,J,O){c+=-u*5.5*g,c*=Math.pow(.82,g),u+=c*g,Math.abs(u)<.05&&Math.abs(c)<.08&&(c+=(Math.random()-.5)*.5),y=Math.max(0,y-g);const q=k%3.4;k+=g,q<.75&&k%3.4>=.75&&O("drip",d)},darkness(g){const J=T(),O=y>0?Math.sin(g*60)>0?1:.25:1;return{level:.58,lights:[{x:J.x,y:J.y+110*e,r:520*e,power:.92*O},{x:t.w*.72,y:o-40*e,r:260*e,power:.3}]}},poke(g){return g==="bulb"?(c+=(u>=0?1:-1)*1.9,y=.5,"buzz"):"bonk"}}}function ra(t){const e=Pt(t),o=t.h*.69,a=lt(55),i={x:t.w*.68,y:t.h*.2,r:78*e},l={x:t.w*.05,w:130*e},n={x:t.w*.95,w:120*e},f={x:t.w*.21,w:220*e,top:o-62*e},h={x:t.w*.8,w:200*e,top:o-50*e},d={x:t.w*.5,w:250*e,top:o+4*e},u={x:n.x-6*e,y:Math.max(t.h*.3,o-330*e)},c=[t.w*.36,t.w*.63,t.w*.67].map((p,m)=>({x:p,y:o+(t.h-o)*(.5+m*.12),s:(1-m*.2)*e})),y=[];for(let p=0;p<90;p++)y.push([a()*t.w,a()*o*.85,a()]);const k=Array.from({length:12},()=>({x:a()*t.w,y:o-160*e+a()*300*e,p:a()*le}));let T=0,b=7+Math.random()*6,g=[],J=-1,O=-1,q=4,V=-9,s=-9,P=2;const E=[...Tt(t,[.2,.4,.6,.8],[.3,.37,.28,.35]),{mode:"peek",x:f.x,y:0,dir:"up",edge:f.top},{mode:"peek",x:h.x,y:0,dir:"up",edge:h.top},{mode:"peek",x:d.x,y:0,dir:"up",edge:d.top},{mode:"peek",x:0,y:o-190*e,dir:"right",edge:l.x+l.w/2},{mode:"peek",x:0,y:o-230*e,dir:"left",edge:n.x-n.w/2},...St(t,o)];function C(p,m,v,S,D,j){const M=lt(j);p.fillStyle=D;for(let _=-S;_<t.w+S;_+=S*(.6+M()*.6)){const R=v*(.6+M()*.6),K=R*.42;p.beginPath(),p.moveTo(_,m-R);for(let A=1;A<=4;A++)p.lineTo(_+K*A/4,m-R+R*A/4),p.lineTo(_+K*A/4-K*.12,m-R+R*A/4);p.lineTo(_-K+K*.12,m);for(let A=4;A>=1;A--)p.lineTo(_-K*A/4+K*.12,m-R+R*A/4),p.lineTo(_-K*A/4,m-R+R*A/4);p.closePath(),p.fill()}p.fillRect(0,m-2,t.w,6)}function W(p,m,v){p.fillStyle="#0d1116",p.beginPath(),p.moveTo(m.x-m.w*.62,t.h),p.quadraticCurveTo(m.x-m.w*.44,o,m.x-m.w/2+v*10*e,0),p.lineTo(m.x+m.w/2+v*10*e,0),p.quadraticCurveTo(m.x+m.w*.44,o,m.x+m.w*.66,t.h),p.closePath(),p.fill(),p.strokeStyle="rgba(70,95,110,0.4)",p.lineWidth=3*e;for(let D=0;D<6;D++){const j=m.x-m.w*.35+a()*m.w*.7,M=a()*t.h*.8;p.beginPath(),p.moveTo(j,M),p.quadraticCurveTo(j+8*e,M+40*e,j-4*e,M+90*e),p.stroke()}p.strokeStyle="rgba(150,185,215,0.3)",p.lineWidth=4*e,p.beginPath();const S=m.x+(v>0?1:-1)*m.w*.46;p.moveTo(S+v*8*e,0),p.quadraticCurveTo(S-v*4*e,o,S+v*16*e,t.h),p.stroke()}function L(p,m,v){p.fillStyle=v;const S=o+40*e-m.top;for(let D=0;D<7;D++){const j=D/6,M=m.w*(.2+.08*Math.sin(D*2.1));p.beginPath(),p.arc(m.x-m.w/2+j*m.w,m.top+M*.9+Math.abs(j-.5)*S/2.2,M,0,le),p.fill()}p.fillRect(m.x-m.w/2,m.top+S*.5,m.w,S*.7)}return{view:t,floorY:o,spots:E,toys:[{id:"owl",x:u.x,y:u.y,r:52*e},...c.map((p,m)=>({id:`shroom${m}`,x:p.x,y:p.y-20*p.s,r:46*e}))],paintStatic(p){p.fillStyle=ke(p,0,o,["#070b22","#12224a","#2a4c66","#4a6f78"]),p.fillRect(0,0,t.w,o+10);for(const[S,D,j]of y)G(p,S,D,(.8+j*1.6)*e,`rgba(255,255,255,${.35+j*.5})`);f0(p,i.x,i.y,i.r),C(p,o-26*e,150*e,70*e,"#1c3a4e",3),C(p,o,230*e,110*e,"#102536",8),p.fillStyle=ke(p,o,t.h,["#0e1e20","#16302a"]),p.fillRect(0,o,t.w,t.h-o),p.fillStyle="rgba(110,120,100,0.22)",p.beginPath(),p.moveTo(t.w*.42,o),p.quadraticCurveTo(t.w*.62,o+(t.h-o)*.4,t.w*.3,t.h),p.lineTo(t.w*.74,t.h),p.quadraticCurveTo(t.w*.78,o+(t.h-o)*.4,t.w*.5,o),p.closePath(),p.fill(),p.strokeStyle="#27503c",p.lineWidth=3*e,p.lineCap="round";for(let S=0;S<90;S++){const D=a()*t.w,j=o+a()*(t.h-o),M=(10+a()*16)*e*(.6+(j-o)/(t.h-o));p.beginPath(),p.moveTo(D,j),p.quadraticCurveTo(D+(a()-.5)*12*e,j-M*.6,D+(a()-.5)*18*e,j-M),p.stroke()}const m=t.w*.33;ze(p,[m-26*e,o+20*e,m-14*e,0,m+16*e,0,m+30*e,o+20*e],"#0d1a24"),p.strokeStyle="#0d1a24",p.lineWidth=12*e,p.beginPath(),p.moveTo(m+8*e,o*.42),p.quadraticCurveTo(m+90*e,o*.34,m+150*e,o*.2),p.moveTo(m-6*e,o*.58),p.quadraticCurveTo(m-70*e,o*.5,m-110*e,o*.36),p.stroke(),L(p,f,"#11261f"),L(p,h,"#0f221c"),I(p,d.x-d.w/2,d.top,d.w,66*e,30*e,"#2c2019"),de(p,d.x+d.w/2-16*e,d.top+33*e,18*e,33*e,"#4a382b"),de(p,d.x+d.w/2-16*e,d.top+33*e,10*e,20*e,"#35271e"),H(p,d.x-d.w*.3,d.top+6*e,d.w*.5,4*e,"rgba(150,185,215,0.22)"),de(p,d.x-d.w*.2,d.top+4*e,34*e,9*e,"#1f4a36"),W(p,l,1),W(p,n,-1),p.strokeStyle="#0d1116",p.lineCap="round";const v=(S,D,j,M,_,R,K)=>{p.lineWidth=K,p.beginPath(),p.moveTo(S,D),p.quadraticCurveTo(j,M,_,R),p.stroke()};v(l.x,t.h*.16,t.w*.22,t.h*.02,t.w*.46,t.h*.07,34*e),v(t.w*.3,t.h*.05,t.w*.36,t.h*.13,t.w*.42,t.h*.16,12*e),v(n.x,t.h*.12,t.w*.8,t.h*.01,t.w*.56,t.h*.05,30*e),v(t.w*.74,t.h*.03,t.w*.7,t.h*.1,t.w*.63,t.h*.12,10*e),v(l.x,t.h*.34,t.w*.13,t.h*.26,t.w*.19,t.h*.27,18*e),p.fillStyle="#0b1612";for(let S=0;S<26;S++){const D=a()*t.w,j=a()*t.h*.08;p.beginPath(),p.ellipse(D,j,(40+a()*50)*e,(18+a()*22)*e,a()*.6-.3,0,le),p.fill()}de(p,u.x,u.y,36*e,46*e,"#05070a");for(const S of c)I(p,S.x-7*S.s,S.y-26*S.s,14*S.s,30*S.s,5,"#d9d2c0");We(p,l.x+l.w*.5,t.h*.16,150*e,-.2,1.3,.3),Mt(p,t,.5)},paintLive(p,m){for(let M=0;M<y.length;M+=6){const[_,R]=y[M],K=.5+.5*Math.sin(m*2.2+M);G(p,_,R,2.6*e*K,`rgba(255,255,255,${.7*K})`)}for(let M=0;M<2;M++){const _=(m*(9+M*5)+M*t.w*.6)%(t.w+500*e)-250*e,R=i.y+(M?46:-20)*e;p.fillStyle="rgba(16,24,48,0.6)";for(const[K,A,ee]of[[-70,6,40],[-20,-10,54],[40,0,46],[90,10,32]])p.beginPath(),p.arc(_+K*e,R+A*e,ee*e,0,le),p.fill()}if(T>.5&&g.length){p.strokeStyle="rgba(235,240,255,0.95)",p.lineWidth=4*e,p.lineJoin="miter",p.beginPath(),p.moveTo(g[0],g[1]);for(let M=2;M<g.length;M+=2)p.lineTo(g[M],g[M+1]);p.stroke()}if(O>=0){const M=t.w*1.1-O*t.w*1.2,_=t.h*.18+Math.sin(O*9)*40*e,R=Math.sin(m*22)*.6;p.fillStyle="#05070c";for(const K of[-1,1])p.beginPath(),p.moveTo(M,_),p.quadraticCurveTo(M+K*16*e,_-18*e*(.4+R),M+K*34*e,_-6*e*R*2),p.quadraticCurveTo(M+K*20*e,_+4*e,M,_+6*e),p.fill();G(p,M,_,6*e,"#05070c")}const v=Math.max(0,1-(m-s)/.9),S=u.y+8*e-v*6*e;de(p,u.x,S,24*e,30*e,"#4a3b2c"),de(p,u.x,S+8*e,15*e,18*e,"#75603f");const D=m*.21%1>.93&&v===0;for(const M of[-1,1])G(p,u.x+M*10*e,S-9*e,9.5*e,D?"#4a3b2c":"#ffd84a"),D||G(p,u.x+M*10*e+Math.sin(m*.7)*2*e,S-9*e,(4+v*2)*e,"#0a0a0a"),ze(p,[u.x+M*6*e,S-28*e,u.x+M*20*e,S-36*e,u.x+M*18*e,S-22*e],"#4a3b2c");ze(p,[u.x-4*e,S-2*e,u.x+4*e,S-2*e,u.x,S+6*e],"#e8a03a");const j=Math.max(0,1-(m-V)/1.4);for(const M of c){const _=.25+.12*Math.sin(m*1.6+M.x)+j*.5,R=p.createRadialGradient(M.x,M.y-30*M.s,2,M.x,M.y-30*M.s,70*M.s);R.addColorStop(0,`rgba(120,255,210,${_})`),R.addColorStop(1,"rgba(120,255,210,0)"),p.fillStyle=R,p.fillRect(M.x-70*M.s,M.y-100*M.s,140*M.s,140*M.s),p.fillStyle="#d6402f",p.beginPath(),p.ellipse(M.x,M.y-26*M.s,26*M.s,20*M.s,0,Math.PI,0),p.fill(),G(p,M.x-10*M.s,M.y-36*M.s,4*M.s,"#fff3e0"),G(p,M.x+8*M.s,M.y-32*M.s,3.4*M.s,"#fff3e0"),G(p,M.x+1*M.s,M.y-42*M.s,3*M.s,"#fff3e0")}},paintFront(p,m){for(let v=0;v<3;v++){const S=o+(t.h-o)*(.1+v*.3),D=m*(14+v*7)%(t.w*1.5)-t.w*.25,j=p.createLinearGradient(0,S-50*e,0,S+50*e);j.addColorStop(0,"rgba(170,200,215,0)"),j.addColorStop(.5,`rgba(170,200,215,${.1+v*.02})`),j.addColorStop(1,"rgba(170,200,215,0)"),p.fillStyle=j,p.beginPath(),p.ellipse(D,S,t.w*.6,50*e,0,0,le),p.ellipse(D+t.w*.9,S+12*e,t.w*.5,44*e,0,0,le),p.fill()}for(const v of k){const S=v.x+Math.sin(m*.5+v.p)*60*e,D=v.y+Math.cos(m*.37+v.p*2)*40*e,j=.5+.5*Math.sin(m*2.4+v.p*5);if(j<.2)continue;const M=p.createRadialGradient(S,D,0,S,D,16*e);M.addColorStop(0,`rgba(230,255,140,${j})`),M.addColorStop(1,"rgba(230,255,140,0)"),p.fillStyle=M,p.fillRect(S-16*e,D-16*e,32*e,32*e)}T>0&&(p.fillStyle=`rgba(215,228,255,${T*.22})`,p.fillRect(0,0,t.w,t.h))},step(p,m,v){if(b-=p,b<=0){b=13+Math.random()*12,T=1,J=.35+Math.random()*.5,g=[];let S=t.w*(.2+Math.random()*.6),D=0;for(;D<o*.8;)g.push(S,D),S+=(Math.random()-.5)*90*e,D+=(30+Math.random()*50)*e}T=Math.max(0,T-p*2.4),J>=0&&(J-=p,J<0&&v("thunder",t.w/2)),q-=p,O<0&&q<=0&&(O=0,v("bat",t.w*.8)),O>=0&&(O+=p/4.5,O>1&&(O=-1,q=9+Math.random()*10)),P-=p,P<=0&&(P=2.5+Math.random()*4,v("cricket",Math.random()*t.w))},darkness(){const p=T>.5?1:T*1.4;return{level:.42*(1-Math.min(1,p)),lights:[{x:i.x,y:i.y,r:300*e,power:.7},{x:t.w*.5,y:o+60*e,r:520*e,power:.5}]}},poke(p,m){return p==="owl"?(s=m,"hoot"):(V=m,"chime")}}}const v0=[ia,na,sa,la,ra];function $0(t,e){const o=v0[t%v0.length],a=Math.max(e.w,e.h*.8);if(a<e.w+2)return o(e);const i=o({w:a,h:e.h}),l=(a-e.w)/2,n=(d,u)=>d>u&&d<e.w-u,f=[];for(const d of i.spots)if(d.mode==="peek"&&d.dir!=="up"&&d.edge!==void 0){const u=d.edge-l;n(u+(d.dir==="left"?-70:70),60)&&f.push({...d,edge:u})}else d.mode==="crawl"?f.push({...d,x:Math.max(190,Math.min(e.w-190,d.x-l))}):n(d.x-l,110)&&f.push({...d,x:d.x-l});f.push({mode:"drop",x:e.w*.3,y:e.h*.5},{mode:"drop",x:e.w*.72,y:e.h*.45});const h=d=>(u,c)=>{u.save(),u.translate(-l,0),d(u,c),u.restore()};return{view:e,floorY:i.floorY,spots:f,toys:i.toys.map(d=>({...d,x:d.x-l})).filter(d=>n(d.x,10)),paintStatic:d=>h(u=>i.paintStatic(u))(d,0),paintLive:h((d,u)=>i.paintLive(d,u)),paintFront:h((d,u)=>i.paintFront(d,u)),step:(d,u,c)=>i.step(d,u,(y,k)=>c(y,k-l)),darkness:d=>{const u=i.darkness(d);return{level:u.level,lights:u.lights.map(c=>({...c,x:c.x-l}))}},poke:(d,u)=>i.poke(d,u)}}const Te=Math.PI*2,Ce=document.querySelector("#game"),r=Ce.getContext("2d"),yt=document.createElement("canvas"),qe=document.createElement("canvas"),rt=Zo(),z={night:"#120a24",panel:"rgba(22,12,40,0.94)",edge:"#5a3b8a",slime:"#9be84a",slimeDark:"#3f7a1c",ink:"#1a0f24",bone:"#f4efe0",pink:"#ff5ad8",gold:"#ffd23f",heart:"#ff4a6a",dim:"#8c7aa8"};let Me='"Chalkboard SE", "Comic Sans MS", "Trebuchet MS", sans-serif',Xt=0,q0=0,ct=1,Pe=1,w={w:1265,h:790},Ee="menu",ae=null,Et=0,we=0,me=null,pe=null;const N=new xo;let Oe=0,Xe=0,ft={x:600,y:400},R0=0,Qt=0,st=-1;const Qe=new Set,fe={stars:ht.map(()=>0),sound:2,mode:0};function ve(){return fe.mode===1}function _0(t){ve()?Fo(r,t):jo(r,t)}function x0(t){ve()?Xo(r,t,rt):Ko(r,t,rt)}const $t=ht.map(()=>0),eo="aranas-pistoleras-progress",to=new Set,W0=new Map;function oo(t,e){return Promise.race([t,new Promise((o,a)=>setTimeout(()=>a(new Error("timeout")),e))])}async function fa(){if(Ht(t0))try{const t=await oo(L0.getItem(eo),3e3);if(!t)return;const e=JSON.parse(t);Array.isArray(e.stars)&&(fe.stars=ht.map((o,a)=>{var i;return Math.max(fe.stars[a],Math.max(0,Math.min(3,Number((i=e.stars)==null?void 0:i[a])||0)))})),typeof e.sound=="number"&&(fe.sound=Math.max(0,Math.min(2,Math.round(e.sound)))),e.mode===1&&!ao&&io(1),u0()}catch{}}function h0(){if(Ht(t0))try{oo(L0.setItem(eo,JSON.stringify(fe)),3e3).catch(()=>{})}catch{}}let ao=!1;function io(t){fe.mode=t,vo(t===1),ye=null,wt=.25}function ha(){ao=!0,io(fe.mode===1?0:1),$.chime(0),h0()}function _t(t){return t===0||fe.stars[t-1]>0||to.has(t)}function no(){return Ht(o0)}let ge=null;function da(){const t=Ht(o0)?wo:void 0;return ge??(ge=new $o(t,"Arañas Pistoleras"))}function so(){var t;return no()&&((t=ge==null?void 0:ge.context)==null?void 0:t.state)!=="closed"}function d0(){if(fe.sound===0||!no())return;const t=da();t.activate(),t.context&&t.output&&Po(t.context,t.output)&&u0()}function u0(){Co(fe.sound>0,fe.sound>1),ge==null||ge.setMuted(fe.sound===0)}function Jt(){so()&&(fe.sound=(fe.sound+2)%3,d0(),u0(),$.click(),h0())}function ie(t){return(t/w.w-.5)*1.3}document.addEventListener("visibilitychange",()=>{document.hidden&&Ee==="play"&&ae===null&&At("pause"),!(!(ge!=null&&ge.context)||ge.context.state==="closed")&&(document.hidden?ge.context.suspend().catch(()=>{}):ge.activate())});window.addEventListener("pagehide",()=>ge==null?void 0:ge.dispose());function ua(){const t=Ce.clientWidth,e=Ce.clientHeight;if(t<2||e<2)return;const o=Math.min(window.devicePixelRatio||1,2),a=Math.round(t*o),i=Math.round(e*o);a===Ce.width&&i===Ce.height&&t===Xt&&e===q0||(Xt=t,q0=e,Ce.width=yt.width=a,Ce.height=yt.height=i,Pe=Math.sqrt(t*e)/1e3,ct=Pe*o,w={w:t/Pe,h:e/Pe},N.view=w,qe.width=Math.max(8,Math.round(a/6)),qe.height=Math.max(8,Math.round(i/6)),b0())}function b0(){const t=yt.getContext("2d");t.setTransform(ct,0,0,ct,0,0),t.clearRect(0,0,w.w,w.h),Ee==="play"?(pe=$0(we,w),pe.paintStatic(t),me==null||me.setStage(w,pe.spots,pe.floorY)):(pe=null,wa(t))}function xt(t){we=t,Ee="play",ae=null,st=-1,R0++,me=new aa(t,$t[t],R0),N.clear(),Qe.clear(),Xe=0,b0(),$.banner()}function ba(){Ee="menu",ae=null,me=null,N.clear(),ye=null,wt=.4,b0()}function At(t){ae=t,Et=0,Re=0,Qt=0}function ma(t,e){return{x:t.x+e*46*t.scale,y:t.y+44*t.scale}}const gt=["¡LINDA!","¡BRAVO!","¡TE TENGO!","¡QUÉ BELLA!","¡WOW!","¡SÍ!"];let E0=-1;function I0(){return{x:w.w/2,y:dt()*.75}}function pa(t){const e=me;switch(t.type){case"spawn":return t.s.kind!=="boss"&&Ae.flutter(ie(t.s.x),t.s.kind==="mini"),!0;case"aim":return Qe.delete(t.s.id),Ae.ready(ie(t.s.x)),!0;case"fire":{Ae.away(ie(t.s.x),t.s.kind==="boss"),N.flee(t.s.x,t.s.y,Ne[t.s.kind].glow),N.word(t.s.x,t.s.y-150*t.s.scale,54,"¡ADIÓS!","#ffffff");const o=zt(e.hearts);return N.heartBreak(o.x,o.y,o.s),!0}case"hit":return N.impact(t.x,t.y,!0),Ae.tap(ie(t.x),t.s.kind==="boss"),t.s.kind==="boss"&&t.s.hp>0&&N.sparkle(t.x,t.y,Ne.boss.glow,8),!0;case"die":{const o=t.s,a=I0();N.collect(o.x,o.y,o.scale,o.kind,Ne[o.kind].glow,a.x,a.y);let i=Math.floor(Math.random()*gt.length);i===E0&&(i=(i+1)%gt.length),E0=i;const l=t.combo===1?"¡DOBLE!":t.combo===2?"¡TRIPLE!":t.combo>=3?"¡COMBO!":gt[i];return N.word(o.x,o.y-120*o.scale,t.combo>0?66:54,l,t.combo>0?z.pink:z.gold),Ae.caught(ie(o.x),t.combo,o.scale),Qe.delete(o.id),!0}case"bossIntro":return Ae.queenIntro(),!0;case"bossSummon":return Ae.queenCalls(),!0;case"bossDie":{const o=t.s,a=I0();return N.collect(o.x,o.y,o.scale,"boss",Ne.boss.glow,a.x,a.y,!0),N.word(o.x,o.y-160*o.scale,84,"¡LA ATRAPASTE!",z.pink),N.confetti(w),Ae.queenCaught(),!0}default:return!1}}function ga(t){const e=me;if(!(ve()&&pa(t)))switch(t.type){case"spawn":$.spawn(ie(t.s.x),t.s.mode,t.s.kind);break;case"aim":Qe.delete(t.s.id),$.cock(ie(t.s.x));break;case"fire":{const o=t.s.kind==="boss";$.bang(ie(t.s.x),o),$.ouch(),N.crack(w);for(const i of[-1,1]){const l=ma(t.s,i);N.gunSmoke(l.x,l.y)}const a=zt(e.hearts);N.heartBreak(a.x,a.y,a.s);break}case"hit":{const o=t.s.kind==="boss";N.impact(t.x,t.y,!0),$.hit(ie(t.x),o),o&&t.s.hp>0&&(N.sparkle(t.x,t.y,nt.boss.goo,6),t.s.hp%3===0&&N.word(t.s.x,t.s.y-150*t.s.scale,54));break}case"hatOff":N.hat(t.s.x,t.s.y-60*t.s.scale,t.s.scale,we,e.floorY),N.word(t.s.x,t.s.y-130*t.s.scale,44,"¡UY!","#ffffff"),$.hatOff(ie(t.s.x));break;case"die":{const o=t.s;N.burst(o.x,o.y,o.scale,nt[o.kind],e.floorY);const a=t.combo===1?"¡DOBLE!":t.combo===2?"¡TRIPLE!":t.combo>=3?"¡COMBO!":void 0;N.word(o.x,o.y-110*o.scale,a?66:56,a,a?z.pink:z.gold),$.pop(ie(o.x),t.combo,o.scale),$.squeal(ie(o.x),o.kind),Qe.delete(o.id);break}case"leave":t.s.shots<e.def.shots&&e.phase!=="lost"&&$.giggle(ie(t.s.x));break;case"miss":{const o=pe==null?void 0:pe.toys.find(i=>Math.hypot(t.x-i.x,t.y-i.y)<i.r),a=o?pe==null?void 0:pe.poke(o.id,Xe):null;o&&a?(lo(a,o.x),N.sparkle(o.x,o.y,"#fff0b0",5)):(N.impact(t.x,t.y,!1),$.miss(ie(t.x)));break}case"heart":$.heartAppear(ie(t.p.x)),N.sparkle(t.p.x,t.p.y,z.heart,8);break;case"heal":$.heal(),N.sparkle(t.p.x,t.p.y,z.heart,16),N.word(t.p.x,t.p.y-50,50,"+1",z.heart);break;case"bossIntro":$.bossIntro(),N.shake=1;break;case"bossStun":$.bossStun(ie(t.s.x)),N.word(t.s.x,t.s.y-170*t.s.scale,60,"¡MAREADA!","#ffffff");break;case"bossSummon":$.bossSummon();break;case"bossDie":{const o=t.s;N.burst(o.x,o.y,o.scale,nt.boss,e.floorY,{hat:9,pistols:4,big:!0}),N.word(o.x,o.y-160*o.scale,90,"¡CATAPLUM!",z.pink),N.confetti(w),$.bossDie(),$.squeal(ie(o.x),"boss");break}case"win":fe.stars[we]=Math.max(fe.stars[we],t.stars),$t[we]=0,h0(),At("won"),N.confetti(w,50),$.win();break;case"lose":$t[we]++,st=1.3;break}}function lo(t,e){const o=ie(e);switch(t){case"thunder":$.thunder();break;case"flicker":$.flicker();break;default:$[t](o)}}function ya(t){const e=t.state==="aim";let o=0;e?o=$e(Math.min(1,t.t/.42)):t.state==="fire"&&(o=1-$e(Math.max(0,Math.min(1,(t.t-.28)/.27))));const a=e?Math.min(1,t.t/t.dur):0,i=t.state==="enter"||t.state==="leave";let l=1,n=1;if(t.flinch>0)l=1.14,n=.86;else if(t.state==="lurk"&&t.t<.3&&t.age<2){const f=Math.sin(t.t/.3*Math.PI);l=1+.07*f,n=1-.07*f}return{kind:t.kind,x:t.x,y:t.y,scale:t.scale,time:t.age,seed:t.seed,hanging:t.mode==="drop",grounded:t.mode==="crawl",walk:t.mode==="crawl"&&i?1:t.state==="move"?.5:.06,aim:o,heat:a,flash:t.sinceShot<.18?1-t.sinceShot/.18:0,hurt:t.flinch>.07,dizzy:t.state==="stun",hat:t.hat?we:-1,lookX:Ie((ft.x-t.x)/300,-1,1),lookY:Ie((ft.y-t.y)/300,-1,1),squashX:l,squashY:n,threadTop:t.mode==="drop"?-30:void 0}}function $e(t){return t*t*(3-2*t)}function Ie(t,e,o){return Math.max(e,Math.min(o,t))}let ye=null,wt=.6,ot=0;const Kt=[];function ca(t){if(!Kt[t]){const e=document.createElement("canvas");e.width=400,e.height=250;const o=e.getContext("2d"),a={w:1265,h:790};o.scale(e.width/a.w,e.height/a.h);const i=$0(t,a);i.paintStatic(o),i.paintLive(o,3),i.paintFront(o,3),Kt[t]=e}return Kt[t]}function ro(){const t=Math.max(18,Math.min(w.w,w.h)*.04),e=w.w>=w.h*1.12,o=[];if(e){const T=Math.min(w.h*.17,w.w*.1),b=t+T*.62,g=b+T*1.55,J=t*.6,O=w.h-g-t,q=Math.min((w.w-2*t-4*J)/5,O*1.12),V=q/1.12,s=5*q+4*J,P=g+(O-V)*.5;for(let C=0;C<5;C++)o.push({x:(w.w-s)/2+C*(q+J),y:P,w:q,h:V});const E=Math.min(1.25,(g-t)/300);return{titleSize:T,titleX:w.w*.4,titleY:b,spider:{x:w.w*.76,y:t+150*E,scale:E},cards:o}}const a=Math.min(w.w*.19,w.h*.1),i=t+a*.62+dt()*.75,l=i+a*1.6,n=t*.6,f=w.h-l-t,h=Math.min((w.w-2*t-n)/2,(f-2*n)/3*1.12),d=h/1.12,u=2*h+n,c=3*d+2*n,y=l+(f-c)/2;for(let T=0;T<5;T++)o.push({x:(w.w-u)/2+T%2*(h+n),y:y+Math.floor(T/2)*(d+n),w:h,h:d});const k=Math.min(1,d/330);return{titleSize:a,titleX:w.w/2,titleY:i,spider:{x:(w.w-u)/2+h+n+h/2,y:y+2*(d+n)+d*.5,scale:k},cards:o}}function wa(t){const e=t.createLinearGradient(0,0,0,w.h);e.addColorStop(0,"#0d0720"),e.addColorStop(.55,"#231040"),e.addColorStop(1,"#3a1a50"),t.fillStyle=e,t.fillRect(0,0,w.w,w.h);let o=7;const a=()=>(o=o*16807%2147483647,o/2147483647);for(let y=0;y<110;y++)t.fillStyle=`rgba(255,255,255,${.2+a()*.6})`,t.beginPath(),t.arc(a()*w.w,a()*w.h,.8+a()*1.8,0,Te),t.fill();const i=w.w*.16,l=w.h*.2,n=Math.min(w.w,w.h)*.2,f=t.createRadialGradient(i,l,n*.7,i,l,n*2.6);f.addColorStop(0,"rgba(190,160,255,0.3)"),f.addColorStop(1,"rgba(190,160,255,0)"),t.fillStyle=f,t.fillRect(0,0,w.w,w.h),t.fillStyle="#d9cdf0",t.beginPath(),t.arc(i,l,n,0,Te),t.fill(),t.fillStyle="rgba(120,95,170,0.35)";for(const[y,k,T]of[[-.3,-.2,.2],[.34,.3,.26],[.2,-.46,.12],[-.4,.4,.1]])t.beginPath(),t.arc(i+y*n,l+k*n,T*n,0,Te),t.fill();const h=(y,k,T,b,g)=>{t.strokeStyle="rgba(230,225,255,0.3)",t.lineWidth=2;const J=7;for(let O=0;O<=J;O++){const q=b+(g-b)*O/J;t.beginPath(),t.moveTo(y,k),t.lineTo(y+Math.cos(q)*T,k+Math.sin(q)*T),t.stroke()}for(let O=1;O<=6;O++){const q=T*O/6.4;t.beginPath();for(let V=0;V<J;V++){const s=b+(g-b)*V/J,P=b+(g-b)*(V+1)/J,E=(s+P)/2;V===0&&t.moveTo(y+Math.cos(s)*q,k+Math.sin(s)*q),t.quadraticCurveTo(y+Math.cos(E)*q*.84,k+Math.sin(E)*q*.84,y+Math.cos(P)*q,k+Math.sin(P)*q)}t.stroke()}};h(w.w,0,Math.min(w.w,w.h)*.75,Math.PI/2,Math.PI);const d=w.h-Math.min(w.h*.09,70);t.fillStyle="#0b0618",t.beginPath(),t.moveTo(0,w.h),t.lineTo(0,d+10),t.quadraticCurveTo(w.w*.3,d-34,w.w*.6,d+6),t.quadraticCurveTo(w.w*.85,d+30,w.w,d-8),t.lineTo(w.w,w.h),t.closePath(),t.fill(),t.strokeStyle="#0b0618",t.lineCap="round";for(let y=w.w*.04;y<w.w*.5;y+=46){t.lineWidth=7;const k=(a()-.5)*12;t.beginPath(),t.moveTo(y,d+14),t.lineTo(y+k,d-38-a()*14),t.stroke()}t.lineWidth=4,t.beginPath(),t.moveTo(w.w*.03,d-16),t.lineTo(w.w*.5,d-22),t.stroke();const u=w.w*.7;t.lineWidth=13,t.beginPath(),t.moveTo(u,d+20),t.quadraticCurveTo(u-8,d-50,u+10,d-104),t.stroke(),t.lineWidth=6,t.beginPath(),t.moveTo(u+2,d-60),t.quadraticCurveTo(u+40,d-80,u+58,d-124),t.moveTo(u+6,d-84),t.quadraticCurveTo(u-30,d-104,u-40,d-140),t.moveTo(u+44,d-96),t.lineTo(u+74,d-102),t.stroke(),h(0,0,Math.min(w.w,w.h)*.3,0,Math.PI/2);const c=t.createRadialGradient(w.w/2,w.h/2,Math.min(w.w,w.h)*.3,w.w/2,w.h/2,Math.hypot(w.w,w.h)*.62);c.addColorStop(0,"rgba(5,2,12,0)"),c.addColorStop(1,"rgba(5,2,12,0.6)"),t.fillStyle=c,t.fillRect(0,0,w.w,w.h)}function fo(t){const e=ye;if(!e)return null;const o=Math.min(1,e.age/.9),a=1-Math.pow(1-o,3),i=t.spider.scale*(e.kind==="mini"?.62:e.kind==="boss"?1.15:1),l=t.spider.x+Math.sin(e.age*1.2)*10,n=-200+(t.spider.y+200)*a+Math.sin(e.age*1.9)*5,f=e.age%5,h=f>3?$e(Math.min(1,(f-3)/.4))*(f>4.6?$e((5-f)/.4):1):0;return{kind:e.kind,x:l,y:n,scale:i,time:e.age,seed:e.seed,hanging:!0,grounded:!1,walk:0,aim:h,heat:0,flash:0,hurt:e.flinch>0,dizzy:!1,hat:e.kind==="hat"?e.hat:-1,lookX:Ie((ft.x-l)/300,-1,1),lookY:Ie((ft.y-n)/300,-1,1),squashX:1,squashY:1,threadTop:-30}}function ka(t){const e=t.titleSize;r.save(),r.textAlign="center",r.textBaseline="middle",r.lineJoin="round";const o=ve(),a=o?["MARIPOSAS","MÁGICAS"]:["ARAÑAS","PISTOLERAS"],i=w.w>=w.h*1.12?w.w*.46:w.w*.86;a.forEach((l,n)=>{let f=n===0?e:e*.78;r.font=`${f}px ${Me}`;const h=r.measureText(l).width;h>i&&(f*=i/h);const d=t.titleY+(n===0?0:e*.86),u=Math.sin(Oe*1.4+n*1.3)*.012;r.save(),r.translate(t.titleX,d),r.rotate(-.035+u),r.font=`${f}px ${Me}`,r.strokeStyle=z.ink,r.lineWidth=f*.2,r.strokeText(l,0,f*.04);const c=r.createLinearGradient(0,-f*.45,0,f*.5);if(o?(c.addColorStop(0,n===0?"#fff29a":"#a8f0ff"),c.addColorStop(1,n===0?"#ff9a3a":"#4a8cf0")):n===0?(c.addColorStop(0,"#e2ff8a"),c.addColorStop(1,"#6fcf2a")):(c.addColorStop(0,"#ffc0f0"),c.addColorStop(1,"#ff4fc4")),r.fillStyle=c,r.fillText(l,0,0),n===0&&!o){const y=r.measureText(l).width;r.fillStyle="#6fcf2a";for(const[k,T,b]of[[-.36,.34,0],[-.08,.5,2],[.2,.28,4],[.41,.42,1]]){const g=f*T*(.75+.25*Math.sin(Oe*.9+b)),J=f*.075;r.beginPath(),r.roundRect(k*y-J/2,f*.3,J,g,J/2),r.fill(),r.beginPath(),r.arc(k*y,f*.3+g,J*.8,0,Te),r.fill()}}r.restore()}),r.restore()}function Gt(t,e,o,a,i,l){t.beginPath();for(let n=0;n<10;n++){const f=n/10*Te-Math.PI/2,h=n%2?a*.46:a;t.lineTo(e+Math.cos(f)*h,o+Math.sin(f)*h)}t.closePath(),t.fillStyle=i,t.fill(),l&&(t.strokeStyle=l,t.lineWidth=Math.max(1.5,a*.14),t.stroke())}const Ma=["Colegio","Cocina","Dormitorio","Bodega","Bosque"];function Sa(t){r.drawImage(yt,0,0,w.w,w.h);const e=ro();if(ye)ye.age+=t,ye.flinch=Math.max(0,ye.flinch-t);else if(wt-=t,wt<=0){const n=["widow","hat","mini","widow","hat","boss"];ye={kind:n[ot%n.length],hat:ot%5,age:0,seed:Math.random(),flinch:0}}const o=fo(e);o&&_0(o),ka(e);const a=ht.findIndex((n,f)=>_t(f)&&fe.stars[f]===0);e.cards.forEach((n,f)=>{const h=_t(f),d=Le&&Re===f,u=f===a,c=u?Math.sin(Oe*3.2)*n.h*.012:0;r.save(),r.translate(n.x+n.w/2,n.y+n.h/2+c),r.rotate((f%2?1:-1)*.012);const y=-n.w/2,k=-n.h/2;r.fillStyle="rgba(0,0,0,0.4)",r.beginPath(),r.roundRect(y+n.w*.02,k+n.w*.035,n.w,n.h,n.w*.07),r.fill(),r.fillStyle=u?z.slime:h?"#6a4a9a":"#3a2a52",r.beginPath(),r.roundRect(y,k,n.w,n.h,n.w*.07),r.fill();const T=n.w*.035,b=(n.w-2*T)/1.6;r.save(),r.beginPath(),r.roundRect(y+T,k+T,n.w-2*T,b,n.w*.045),r.clip(),r.drawImage(ca(f),y+T,k+T,n.w-2*T,b),h||(r.fillStyle="rgba(14,8,26,0.78)",r.fillRect(y+T,k+T,n.w-2*T,b)),r.restore(),h||Pa(0,k+T+b/2,b*.26);const g=n.w*.085;r.fillStyle=z.ink,r.beginPath(),r.arc(y+T+g*1.1,k+T+g*1.1,g,0,Te),r.fill(),r.fillStyle=h?z.bone:z.dim,r.font=`${g*1.5}px ${Me}`,r.textAlign="center",r.textBaseline="middle",r.fillText(String(f+1),y+T+g*1.1,k+T+g*1.16);const J=k+T+b,O=n.h-T-b;r.fillStyle=u?z.ink:h?z.bone:z.dim;const q=Math.min(O*.52,n.w*.13);r.font=`${q}px ${Me}`,r.textAlign="left",r.fillText(Ma[f],y+T*1.6,J+O*.54,n.w*.5);const V=Math.min(O*.25,n.w*.046);for(let s=0;s<3;s++){const P=fe.stars[f]>s;Gt(r,y+n.w-T*1.6-V-(2-s)*V*2.2,J+O*.5,V,P?z.gold:"rgba(0,0,0,0.35)",P?z.ink:void 0)}d&&(r.strokeStyle=z.bone,r.lineWidth=Math.max(3,n.w*.02),r.beginPath(),r.roundRect(y-5,k-5,n.w+10,n.h+10,n.w*.08),r.stroke()),r.restore(),Be.push({id:`level${f}`,x:n.x,y:n.y,w:n.w,h:n.h,tap:()=>Ta(f)})}),N.draw(r),r.globalCompositeOperation="lighter",o&&x0(o),N.drawGlow(r,rt),r.globalCompositeOperation="source-over",N.drawWords(r,Me);const i=dt();Ot("sound",w.w-i*1.25,i*.25,i,m0(),Jt,5);const l=w.w>=w.h*1.12;Aa(l?w.w-i*3.7:i*.25,i*.25,i,6)}function Ta(t){if(_t(t)){$.start(),xt(t);return}const e=(W0.get(t)??0)+1;W0.set(t,e),$.bonk(0),e>=5&&(to.add(t),$.chime(0))}function Pa(t,e,o){r.strokeStyle=z.bone,r.lineWidth=o*.26,r.beginPath(),r.arc(t,e-o*.35,o*.5,Math.PI,0),r.stroke(),r.fillStyle=z.bone,r.beginPath(),r.roundRect(t-o*.8,e-o*.35,o*1.6,o*1.25,o*.2),r.fill(),r.fillStyle=z.ink,r.beginPath(),r.arc(t,e+o*.15,o*.2,0,Te),r.fill(),r.fillRect(t-o*.08,e+o*.15,o*.16,o*.42)}let Be=[],Re=0,Le=!1;function dt(){return Math.max(Ie(Math.min(w.w,w.h)*.075,44,64),17/Pe)}function zt(t){const e=dt(),o=e*.36;return{x:e*.62+t*o*2.5,y:e*.75,s:o}}function m0(){return so()?fe.sound===2?"sound2":fe.sound===1?"sound1":"sound0":"nosound"}function e0(t,e,o,a,i){switch(r.fillStyle=i,r.strokeStyle=i,r.lineCap="round",r.lineJoin="round",t){case"pause":r.beginPath(),r.roundRect(e-a*.34,o-a*.4,a*.24,a*.8,a*.06),r.roundRect(e+a*.1,o-a*.4,a*.24,a*.8,a*.06),r.fill();break;case"play":r.beginPath(),r.moveTo(e-a*.26,o-a*.4),r.lineTo(e+a*.42,o),r.lineTo(e-a*.26,o+a*.4),r.closePath(),r.fill();break;case"retry":r.lineWidth=a*.16,r.beginPath(),r.arc(e,o,a*.34,-.9,Math.PI*1.35),r.stroke(),r.beginPath(),r.moveTo(e+a*.02,o-a*.56),r.lineTo(e+a*.36,o-a*.36),r.lineTo(e+a*.04,o-a*.1),r.closePath(),r.fill();break;case"levels":for(let l=0;l<2;l++)for(let n=0;n<2;n++)r.beginPath(),r.roundRect(e-a*.38+n*a*.42,o-a*.38+l*a*.42,a*.34,a*.34,a*.07),r.fill();break;default:r.beginPath(),r.moveTo(e-a*.42,o-a*.14),r.lineTo(e-a*.22,o-a*.14),r.lineTo(e+a*.02,o-a*.36),r.lineTo(e+a*.02,o+a*.36),r.lineTo(e-a*.22,o+a*.14),r.lineTo(e-a*.42,o+a*.14),r.closePath(),r.fill(),r.lineWidth=a*.09,(t==="sound2"||t==="sound1")&&(r.beginPath(),r.arc(e+a*.04,o,a*.24,-.8,.8),r.stroke()),t==="sound2"&&(r.beginPath(),r.arc(e+a*.04,o,a*.42,-.8,.8),r.stroke()),(t==="sound0"||t==="nosound")&&(r.beginPath(),r.moveTo(e+a*.16,o-a*.2),r.lineTo(e+a*.46,o+a*.2),r.moveTo(e+a*.46,o-a*.2),r.lineTo(e+a*.16,o+a*.2),r.stroke())}}function Ot(t,e,o,a,i,l,n=-1){const f=i==="nosound";r.fillStyle="rgba(18,10,36,0.72)",r.beginPath(),r.roundRect(e,o,a,a,a*.28),r.fill(),r.strokeStyle=Le&&Re===n?z.bone:z.edge,r.lineWidth=Math.max(1.5,a*.05),r.stroke(),e0(i,e+a/2,o+a/2,a*.86,f?z.dim:z.bone);const h=Math.max(a,44/Pe);Be.push({id:t,x:e+a/2-h/2,y:Math.max(0,o+a/2-h/2),w:h,h,tap:l})}function G0(t,e,o,a,i){if(r.fillStyle=i,r.strokeStyle=i,r.lineCap="round",t){for(const l of[-1,1])r.beginPath(),r.ellipse(e+l*a*.23,o-a*.12,a*.2,a*.26,l*.5,0,Te),r.ellipse(e+l*a*.17,o+a*.2,a*.14,a*.17,-l*.4,0,Te),r.fill();r.lineWidth=a*.09,r.beginPath(),r.moveTo(e,o-a*.26),r.lineTo(e,o+a*.3),r.stroke()}else{r.beginPath(),r.arc(e,o,a*.2,0,Te),r.fill(),r.lineWidth=a*.07;for(const l of[-1,1])for(let n=0;n<4;n++){const f=-.9+n*.6;r.beginPath(),r.moveTo(e+l*a*.14,o+Math.sin(f)*a*.1),r.lineTo(e+l*a*.34,o+Math.sin(f)*a*.3-a*.08),r.lineTo(e+l*a*.44,o+Math.sin(f)*a*.36+a*.06),r.stroke()}}}function Aa(t,e,o,a){const i=o*2.2,l=ve();r.fillStyle="rgba(18,10,36,0.78)",r.beginPath(),r.roundRect(t,e,i,o,o*.5),r.fill(),r.strokeStyle=Le&&Re===a?z.bone:z.edge,r.lineWidth=Math.max(1.5,o*.05),r.stroke();const n=t+(l?i-o*1.1:0)+o*.08;r.fillStyle=l?z.pink:z.slime,r.beginPath(),r.roundRect(n,e+o*.08,o*1.02,o*.84,o*.42),r.fill(),G0(!1,t+o*.59,e+o/2,o*.86,l?z.dim:z.ink),G0(!0,t+i-o*.59,e+o/2,o*.86,l?z.ink:z.dim);const f=Math.max(o,44/Pe);Be.push({id:"mode",x:t,y:Math.max(0,e+o/2-f/2),w:i,h:f,tap:ha})}function Ca(t){const e=dt();for(let n=0;n<tt;n++){const f=zt(n),h=n<t.hearts,d=h&&t.hearts===1,u=f.s*(d?1+.12*Math.sin(Oe*9):1);r0(r,f.x,f.y,u),r.fillStyle=h?z.heart:"rgba(18,10,36,0.6)",r.fill(),r.strokeStyle=h?z.ink:"rgba(255,255,255,0.3)",r.lineWidth=Math.max(1.5,u*.16),r.stroke(),h&&(r.fillStyle="rgba(255,255,255,0.55)",r.beginPath(),r.ellipse(f.x-u*.42,f.y-u*.3,u*.2,u*.13,-.6,0,Te),r.fill())}const o=t.phase==="bossIntro"||t.phase==="boss"||t.phase==="outro",a=w.w-e*3.05,i=zt(tt-1).x+e*.7,l=Math.min(a-i,460);if(l>e*2){const n=i+(a-i-l)/2,f=e*.75,h=e*.3,d=o?t.boss?t.boss.hp/t.boss.maxHp:t.phase==="outro"?0:1:t.progress;r.fillStyle="rgba(18,10,36,0.72)",r.beginPath(),r.roundRect(n-4,f-h/2-4,l+8,h+8,h),r.fill(),r.fillStyle=o?z.pink:z.slime,d>.01&&(r.beginPath(),r.roundRect(n,f-h/2,Math.max(h,l*d),h,h/2),r.fill(),r.fillStyle="rgba(255,255,255,0.3)",r.beginPath(),r.roundRect(n+h*.3,f-h*.32,Math.max(0,l*d-h*.6),h*.22,h*.1),r.fill());const u=o?n-e*.1:n+l+e*.02,c=e*.3;r.fillStyle=z.gold,r.strokeStyle=z.ink,r.lineWidth=Math.max(1.2,c*.14),r.lineJoin="round",r.beginPath(),r.moveTo(u-c,f+c*.7),r.lineTo(u-c*1.1,f-c*.6),r.lineTo(u-c*.5,f),r.lineTo(u,f-c*.9),r.lineTo(u+c*.5,f),r.lineTo(u+c*1.1,f-c*.6),r.lineTo(u+c,f+c*.7),r.closePath(),r.fill(),r.stroke()}Ot("sound",w.w-e*2.5,e*.25,e,m0(),Jt),Ot("pause",w.w-e*1.25,e*.25,e,"pause",()=>{$.click(),At("pause")})}function va(t){let e="",o="",a=0,i=z.slime;if(t.phase==="intro")a=t.phaseT/1.9,e=t.def.name,o=`Nivel ${we+1}`;else if(t.phase==="bossIntro")a=t.phaseT/2.6,e=ve()?"¡LA REINA MARIPOSA!":"¡LA REINA ARAÑA!",i=z.pink;else return;const l=a<.15?a/.15:a>.8?(1-a)/.2:1,n=(1-$e(Math.min(1,a/.2)))*w.w*.4,f=Math.min(w.w*.1,w.h*.16,130);r.save(),r.globalAlpha=Ie(l,0,1),r.fillStyle="rgba(10,5,22,0.6)",r.fillRect(0,w.h*.42-f*.95,w.w,f*1.9),r.textAlign="center",r.textBaseline="middle",r.lineJoin="round";const h=t.phase==="bossIntro"&&!N.calm?Math.sin(Oe*40)*4:0;r.font=`${f}px ${Me}`,r.strokeStyle=z.ink,r.lineWidth=f*.16,r.strokeText(e,w.w/2-n+h,w.h*.42+(o?f*.16:0),w.w*.92),r.fillStyle=i,r.fillText(e,w.w/2-n+h,w.h*.42+(o?f*.16:0),w.w*.92),o&&(r.font=`${f*.4}px ${Me}`,r.fillStyle=z.bone,r.fillText(o,w.w/2+n,w.h*.42-f*.58)),r.restore()}function qa(t){if(we!==0||fe.stars[0]>0||t.kills>0||t.phase!=="waves")return;const e=t.spiders.find(h=>h.state==="lurk"||h.state==="aim");if(!e)return;const o=Oe*1.4%1;r.strokeStyle=`rgba(255,255,255,${1-o})`,r.lineWidth=6,r.beginPath(),r.arc(e.x,e.y,70+o*70,0,Te),r.stroke();const a=Math.abs(Math.sin(Oe*4))*22,i=e.x+104*e.scale+a*.5,l=e.y+132*e.scale+a*.5;r.save(),r.translate(i,l),r.rotate(-.6),r.fillStyle=z.bone,r.strokeStyle=z.ink,r.lineWidth=5,r.lineJoin="round",r.beginPath(),r.roundRect(-13,-62,26,70,13),r.roundRect(-34,-6,68,60,20),r.stroke(),r.fill(),r.restore();const n=Math.max(46,18/Pe);r.font=`${n}px ${Me}`,r.textAlign="center",r.textBaseline="middle",r.lineJoin="round",r.strokeStyle=z.ink,r.lineWidth=n*.2;const f=e.y>w.h*.5?e.y-150:e.y+190;r.strokeText("¡TÓCALA!",Ie(e.x,150,w.w-150),f),r.fillStyle=z.gold,r.fillText("¡TÓCALA!",Ie(e.x,150,w.w-150),f)}function z0(t,e,o,a,i,l,n,f,h,d){const u=Le&&Re===h;r.fillStyle="rgba(0,0,0,0.35)",r.beginPath(),r.roundRect(e,o+i*.1,a,i,i*.32),r.fill(),r.fillStyle=f?z.slime:"#4a3272",r.beginPath(),r.roundRect(e,o,a,i,i*.32),r.fill(),r.strokeStyle=u?z.bone:f?z.slimeDark:z.edge,r.lineWidth=Math.max(2,i*(u?.09:.05)),r.stroke();const c=f?z.ink:z.bone,y=Math.min(i*.5,(a-i)/(l.length*.5));r.font=`${y}px ${Me}`,r.textBaseline="middle",r.textAlign="left";const k=i*.6;if(y<i*.24)e0(n,e+a/2,o+i/2,k,c);else{const T=r.measureText(l).width,b=e+(a-(k+T+i*.12))/2;e0(n,b+k/2,o+i/2,k,c),r.fillStyle=c,r.fillText(l,b+k+i*.12,o+i*.53)}Be.push({id:t,x:e,y:o,w:a,h:i,tap:d})}function Ra(t,e){Et+=e;const o=Math.min(1,Et/.25);r.fillStyle=`rgba(8,4,18,${.66*o})`,r.fillRect(0,0,w.w,w.h),Be=[];const a=we===ht.length-1,i=ve(),l=ae==="pause"?"PAUSA":ae==="won"?a?i?"¡ATRAPASTE A LA REINA!":"¡VENCISTE A LA REINA!":"¡GANASTE!":"¡OH, NO!",h=ae==="lost"?i?"Las mariposas se escaparon…":"Las arañas ganaron esta vez…":ae==="won"&&a?i?"¡Eres la mejor cazadora de mariposas!":"¡Eres la mejor cazadora de arañas!":t.def.name,d=[],u=ae==="won"&&!a;ae==="pause"&&d.push({id:"resume",label:"Seguir",icon:"play",tap:()=>ae=null}),u&&d.push({id:"next",label:"Siguiente",icon:"play",tap:()=>xt(we+1)}),d.push({id:"retry",label:"Otra vez",icon:"retry",tap:()=>xt(we)}),d.push({id:"levels",label:"Niveles",icon:"levels",tap:ba});const c=w.w<900,y=Math.min(w.w*.92,760),k=Math.max(Ie(w.h*.105,64,92),30/Pe),T=k*.22,b=Math.min(y/(l.length*.5),w.h*.15,120),g=ae==="won"?Math.min(y*.085,w.h*.07):0,J=Math.max(b*.3,Math.min(34,13/Pe)),O=c?d.length:1,q=b*1.15+J*1.5+(g?g*2.9:0)+O*(k+T)+k*.6,V=.9+.1*$e(o);r.save(),r.translate(w.w/2,w.h/2),r.scale(V,V),r.globalAlpha=o;const s=-y/2;let P=-q/2;if(r.fillStyle=z.panel,r.beginPath(),r.roundRect(s,P,y,q,30),r.fill(),r.strokeStyle=ae==="lost"?"#8a3b5a":z.edge,r.lineWidth=5,r.stroke(),r.textAlign="center",r.textBaseline="middle",r.lineJoin="round",P+=k*.3+b*.55,r.font=`${b}px ${Me}`,r.strokeStyle=z.ink,r.lineWidth=b*.14,r.strokeText(l,0,P,y*.92),r.fillStyle=ae==="lost"?"#ff7a8a":ae==="won"?z.gold:z.bone,r.fillText(l,0,P,y*.92),P+=b*.6+J*.7,r.font=`${J}px ${Me}`,r.fillStyle=z.dim,r.fillText(h,0,P,y*.9),P+=J*.8,g){P+=g*1.35;for(let C=0;C<3;C++){const W=.5+C*.4,L=C<t.stars,p=Ie((Et-W)/.25,0,1),m=(C-1)*g*2.5;if(Gt(r,m,P+(C===1?-g*.2:0),g,"rgba(0,0,0,0.4)"),L&&p>0){const v=g*(1.6-.6*$e(p));Gt(r,m,P+(C===1?-g*.2:0),v,z.gold,z.ink),Qt<=C&&(Qt=C+1,$.star(C),N.sparkle(w.w/2+m*V,w.h/2+(P+(C===1?-g*.2:0))*V,z.gold,14))}}P+=g*1.55}P+=T,r.restore();const E=w.h/2+P;if(c){const C=y*.8;d.forEach((W,L)=>z0(W.id,w.w/2-C/2,E+L*(k+T),C,k,W.label,W.icon,L===0,L,W.tap))}else{const C=(y*.92-(d.length-1)*T)/d.length;d.forEach((W,L)=>z0(W.id,w.w/2-y*.46+L*(C+T),E,C,k,W.label,W.icon,L===0,L,W.tap))}if(r.globalAlpha=1,ae==="pause"){const C=dt();Ot("sound",w.w-C*2.5,C*.25,C,m0(),Jt,d.length)}N.draw(r),r.globalCompositeOperation="lighter",N.drawGlow(r,rt),r.globalCompositeOperation="source-over"}function Wa(t){const e=t.darkness(Xe);if(ve()&&(e.level*=.5),e.level<.02)return;const o=qe.getContext("2d"),a=qe.width/w.w,i=qe.height/w.h;o.setTransform(1,0,0,1,0,0),o.globalCompositeOperation="source-over",o.clearRect(0,0,qe.width,qe.height),o.fillStyle=`rgba(5,6,20,${e.level})`,o.fillRect(0,0,qe.width,qe.height),o.globalCompositeOperation="destination-out",o.setTransform(a,0,0,i,0,0);for(const l of e.lights){if(l.power<=.01)continue;const n=o.createRadialGradient(l.x,l.y,0,l.x,l.y,l.r);n.addColorStop(0,`rgba(0,0,0,${l.power})`),n.addColorStop(.5,`rgba(0,0,0,${l.power*.55})`),n.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=n,o.fillRect(l.x-l.r,l.y-l.r,l.r*2,l.r*2)}r.drawImage(qe,0,0,w.w,w.h)}function O0(t){if(t.mode!=="peek"||!pe)return!1;const e=pe.spots[t.spot];return!e||e.edge===void 0?!1:(r.save(),r.beginPath(),e.dir==="left"?r.rect(-50,-50,e.edge+50,w.h+100):e.dir==="right"?r.rect(e.edge,-50,w.w-e.edge+50,w.h+100):r.rect(-50,-50,w.w+100,e.edge+50),r.clip(),!0)}const B0={peek:0,drop:1,crawl:2};function Ea(t){const e=me,o=pe,a=N.offset(Oe);r.fillStyle=z.night,r.fillRect(0,0,w.w,w.h),r.save(),r.translate(a.x,a.y),r.drawImage(yt,0,0,w.w,w.h),o.paintLive(r,Xe),N.drawBack(r);const i=e.spiders.slice().sort((n,f)=>B0[n.mode]-B0[f.mode]||(n.kind==="boss"?-1:0)-(f.kind==="boss"?-1:0)||n.y-f.y),l=i.map(ya);i.forEach((n,f)=>{const h=O0(n);if(_0(l[f]),h&&r.restore(),n.state==="stun")for(let d=0;d<3;d++){const u=n.age*5+d*Te/3;Gt(r,n.x+Math.cos(u)*62*n.scale,n.y-96*n.scale+Math.sin(u)*16*n.scale,13*n.scale,z.gold,z.ink)}});for(const n of e.pickups){const f=n.life-n.t<2?Math.sin(n.t*16)>0?1:.35:1,h=30*(1+.1*Math.sin(n.t*6)),d=n.x+Math.sin(n.t*2.2+n.seed*6)*16;r.globalAlpha=f*Math.min(1,n.t*4),r0(r,d,n.y,h),r.fillStyle=z.heart,r.fill(),r.strokeStyle="#ffffff",r.lineWidth=4,r.stroke(),r.globalAlpha=1}N.draw(r),o.paintFront(r,Xe),Wa(o),r.globalCompositeOperation="lighter",i.forEach((n,f)=>{const h=O0(n);x0(l[f]),h&&r.restore()});for(const n of e.pickups)r.globalAlpha=.6,et(r,rt,n.x+Math.sin(n.t*2.2+n.seed*6)*16,n.y,80,z.heart);r.globalAlpha=1,N.drawGlow(r,rt),r.globalCompositeOperation="source-over",N.drawWords(r,Me),r.restore(),N.drawScreen(r,w),va(e),Ca(e),qa(e),ae&&Ra(e,t)}const Zt=1/60;let Wt=0;function Ia(t){const e=me,o=pe;Wt+=t;let a=0;for(;Wt>=Zt&&a++<5;){Wt-=Zt,e.update(Zt);for(const l of e.events.splice(0))ga(l)}a>=5&&(Wt=0),Xe+=t,o.step(t,Xe,lo);let i=0;for(const l of e.spiders){if(l.state!=="aim")continue;const n=l.t/l.dur;i=Math.max(i,n),n>.72&&!Qe.has(l.id)&&(Qe.add(l.id),ve()?Ae.warn(ie(l.x)):$.warn(ie(l.x)))}ho=i,st>=0&&(st-=t,st<0&&(At("lost"),ve()?Ae.lose():$.lose()))}let ho=0,Yt=0;function uo(t){if(requestAnimationFrame(uo),ua(),Xt<2)return;const e=Math.min(.05,Yt?(t-Yt)/1e3:.016);Yt=t,Oe+=e,Be=[],r.setTransform(ct,0,0,ct,0,0),Ee==="play"&&me&&pe?(ae===null&&Ia(e),N.update(e),Ea(e)):(N.update(e),Sa(e));const o=!!me&&(me.phase==="bossIntro"||me.phase==="boss");Go({mode:ae==="won"||ae==="lost"||st>=0||(me==null?void 0:me.phase)==="outro"?"off":"on",tune:Ee==="menu"?-1:we,boss:o,tension:Ee==="play"?ho:0,paused:ae==="pause"})}function bo(t){const e=Ce.getBoundingClientRect();return{x:(t.clientX-e.left)/Pe,y:(t.clientY-e.top)/Pe}}Ce.addEventListener("pointermove",t=>{ft=bo(t)});Ce.addEventListener("pointerdown",t=>{t.preventDefault(),d0(),Le=!1;const e=bo(t);ft=e;for(let o=Be.length-1;o>=0;o--){const a=Be[o];if(e.x>=a.x&&e.x<=a.x+a.w&&e.y>=a.y&&e.y<=a.y+a.h){a.id!=="sound"&&a.id!=="mode"&&!a.id.startsWith("level")&&$.click(),a.tap();return}}if(Ee==="menu"){Ga(e);return}ae===null&&me&&me.click(e.x,e.y)});function Ga(t){const e=ro(),o=fo(e);if(o&&ye&&Math.hypot(t.x-o.x,t.y-o.y)<100*o.scale+30){const a=ye.kind==="boss";N.impact(t.x,t.y,!0),ve()?(N.collect(o.x,o.y,o.scale,ye.kind,Ne[ye.kind].glow,w.w/2,-40,a),N.word(o.x,o.y-120*o.scale,56,gt[ot%gt.length]),Ae.caught(ie(o.x),ot%5,o.scale)):(N.burst(o.x,o.y,o.scale,nt[ye.kind],w.h-60,{hat:a?9:o.hat,pistols:a?4:2,big:a}),N.word(o.x,o.y-110*o.scale,60),$.hit(ie(o.x),a),$.pop(ie(o.x),ot%6,o.scale),$.squeal(ie(o.x),ye.kind)),ye=null,wt=1.1,ot++;return}N.impact(t.x,t.y,!1),$.miss(ie(t.x))}window.addEventListener("keydown",t=>{if(t.metaKey||t.ctrlKey||t.altKey)return;d0();const e=t.key;if(e==="m"||e==="M"){Jt();return}if(Ee==="play"&&ae===null){(e==="Escape"||e==="p"||e==="P"||e===" ")&&(At("pause"),t.preventDefault());return}if(ae==="pause"&&(e==="Escape"||e==="p"||e==="P")){ae=null;return}const o=Be.filter(i=>i.id!=="pause");if(!o.length)return;const a=Ee==="menu"&&ae===null&&w.w<w.h*1.12?2:1;if(e==="ArrowRight"||e==="ArrowDown"||e==="Tab"&&!t.shiftKey)Re=(Re+(e==="ArrowDown"?a:1))%o.length,Le=!0,t.preventDefault();else if(e==="ArrowLeft"||e==="ArrowUp"||e==="Tab"&&t.shiftKey)Re=(Re-(e==="ArrowUp"?a:1)+o.length*2)%o.length,Le=!0,t.preventDefault();else if(e==="Enter"||e===" "){const i=o[Math.min(Re,o.length-1)];i.id!=="sound"&&!i.id.startsWith("level")&&$.click(),i.tap(),Le=!0,t.preventDefault()}});Ce.addEventListener("contextmenu",t=>t.preventDefault());async function za(){let t;try{t=new FontFace("Creepster",await(await D0("creepster")).arrayBuffer()),await t.load()}catch{try{t=new FontFace("Creepster",`url(${await So("creepster")})`),await t.load()}catch{return}}document.fonts.add(t),Me=`"Creepster", ${Me}`}var H0;const Je=(H0=window.matchMedia)==null?void 0:H0.call(window,"(prefers-reduced-motion: reduce)");N.calm=!!(Je!=null&&Je.matches);var J0;(J0=Je==null?void 0:Je.addEventListener)==null||J0.call(Je,"change",t=>N.calm=t.matches);za();fa();requestAnimationFrame(uo);
</script>
<style>:root{color-scheme:dark;--night: #120a24}html,body,#app{height:100%;margin:0}body{background:var(--night);overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}#game{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}
</style>
<meta name="napplet-type" content="aranas-pistoleras">
<meta name="napplet-config-schema" content="{"$schema":"http://json-schema.org/draft-07/schema#","$version":1,"type":"object","additionalProperties":false,"properties":{}}">
</head>
<body>
<main id="app" class="app">
<canvas id="game" aria-label="Arañas Pistoleras: toca las arañas antes de que disparen"></canvas>
</main>
</body>
</html>
