PageSourceSearch

https://mock-dream.net/assets/play-CBZldcQb.js

js mock-dream.net collected 2026-10-02 02:02:33 UTC 175,943 bytes, 16 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MapsSection-CWBwxSQs.js","assets/index-CDarmjNK.js","assets/CatalogCard-udQmjOKi.js","assets/MicroSimCanvas-DiXBUn6m.js","assets/SectionHeader-D3Bfjg4J.js","assets/floor-render-BL3jmBWz.js","assets/biome-floor-volcano-bT8gJOPW.js","assets/prop-render-Dtyccgzb.js","assets/weather-tp4nzlQx.js","assets/tilemap-BZ5Qp4t2.js","assets/mascot-HKzT898Z.js","assets/PersonagemSection-CBQwgWAb.js","assets/WeaponsSection-2FSkwWS4.js","assets/CatalogShell-BF4uLHrC.js","assets/ougi-CylKyCFr.js","assets/ougi-CkYp0sFW.js","assets/registry-DYLlubx_.js","assets/EnemiesSection-7eGjYkKF.js","assets/enemy-showcase-COFu8r9n.js","assets/tunings-Fu4QSqRO.js","assets/parts-CZx9oBO2.js","assets/BossesSection-DTNRIZkh.js","assets/skeleton-D81ZJ4WM.js","assets/anchors-QcN_5-J-.js","assets/DropsSection-B3hgvPTQ.js","assets/engine-BmfGk2c3.js","assets/catalog-BDbpgQ9r.js","assets/wallet-CaFBWQFZ.js","assets/families-store-BvTt-0_I.js","assets/lab-master-token-Dgq_qWKx.js","assets/createServerFn-CNGAtMsd.js","assets/boss-bridge-xwRJ3CUr.js","assets/procedural-CTeED5MO.js","assets/slots-vmWYUx5W.js","assets/active-map-C-xEYSxi.js","assets/FxSection-DBeNld7n.js","assets/HudSection-DpgRiieg.js","assets/useRafTime-D0zIwqIm.js","assets/LobbySection-BSbn1dVp.js"])))=>i.map(i=>d[i]);
2import{s as Q,r as l,j as e,c as Pa,S as Rt,d as Ot,B as ws,e as ge,f as De,g as Ns,u as _a,_ as ee,h as Ss,i as Cs,k as la,L as ca}from"./index-CDarmjNK.js";import{B as st}from"./button-DwYvOD__.js";import{u as Ms,G as $s}from"./GameCanvas-BCt5Xtza.js";import{O as he,g as Is,h as Es,e as Ps,S as _s,M as da,a as Ls,b as Ts}from"./SiteNav-CqfcnVdd.js";import{b as As,g as zs}from"./engine-BmfGk2c3.js";import{A as Rs,W as Ge,a as de,V as $t,C as et,b as nt,s as It,l as pa,c as Os,g as ma,d as Et,e as We,f as He,h as ke,i as La,T as kt}from"./catalog-BDbpgQ9r.js";import{o as Ds,m as Fs,t as Bs,h as Ws,a as Hs,b as qs}from"./ougi-CylKyCFr.js";import{r as Us,u as ce,g as Ta,a as Vs}from"./profile.functions-B2AZlmZo.js";import{c as Aa}from"./createServerFn-CNGAtMsd.js";import{a as Ys}from"./tunings-Fu4QSqRO.js";import"./lab-master-token-Dgq_qWKx.js";import"./boss-bridge-xwRJ3CUr.js";import{V as tt}from"./VariantArt-BrwHzb9c.js";import{r as pe,s as Ve,t as Ks,b as Xs,a as Gs,c as Js,d as Qs,e as Zs,f as en,g as tn,h as Pt,i as an,j as za,k as sn}from"./wallet-CaFBWQFZ.js";import{g as Ra,s as nn,a as Oa,b as Da,T as Fa,M as rn}from"./active-map-C-xEYSxi.js";import{l as xa,s as on,g as Ba}from"./families-store-BvTt-0_I.js";import{t as W,P as Dt}from"./index-Bg5P62Jv.js";import{g as ln}from"./ghost-fly-C5blPNM4.js";import{M as ua,g as cn}from"./map-art-CuajGk46.js";import{M as dn}from"./minimize-2-BbtGcfDm.js";import{M as pn}from"./FlagIcon-Ugqt_BYW.js";import{c as re}from"./createLucideIcon-BfXV4Vl5.js";import{P as it}from"./play-XXm1fob8.js";import{C as te,L as ve,R as Wa}from"./rotate-ccw-B5YpvlLe.js";import{S as ot}from"./sparkles-C5_N6dO6.js";import{T as Fe,C as mn}from"./trophy-DuIbameN.js";import{X as xn}from"./x-CN7kWqNg.js";import{W as _t}from"./registry-DYLlubx_.js";import{d as un}from"./render-rX4YECNf.js";import{P as Ft,C as qe}from"./power-BPa2lXU1.js";import{U as fn,S as bn}from"./upload-DO_-nyXr.js";import{C as hn}from"./CatalogShell-BF4uLHrC.js";import"./parts-CZx9oBO2.js";import"./procedural-CTeED5MO.js";import"./slots-vmWYUx5W.js";import"./anchors-QcN_5-J-.js";import"./skeleton-D81ZJ4WM.js";import"./mascot-HKzT898Z.js";import"./weather-tp4nzlQx.js";import"./prop-render-Dtyccgzb.js";import"./floor-render-BL3jmBWz.js";import"./biome-floor-volcano-bT8gJOPW.js";import"./static-bg-DbRqatrZ.js";import"./ougi-CkYp0sFW.js";import"./github-CmuTs4Mo.js";import"./tilemap-BZ5Qp4t2.js";const gn=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Lt=re("book-open",gn);const kn=[["path",{d:"M17.596 12.768a2 2 0 1 0 2.829-2.829l-1.768-1.767a2 2 0 0 0 2.828-2.829l-2.828-2.828a2 2 0 0 0-2.829 2.828l-1.767-1.768a2 2 0 1 0-2.829 2.829z",key:"9m4mmf"}],["path",{d:"m2.5 21.5 1.4-1.4",key:"17g3f0"}],["path",{d:"m20.1 3.9 1.4-1.4",key:"1qn309"}],["path",{d:"M5.343 21.485a2 2 0 1 0 2.829-2.828l1.767 1.768a2 2 0 1 0 2.829-2.829l-6.364-6.364a2 2 0 1 0-2.829 2.829l1.768 1.767a2 2 0 0 0-2.828 2.829z",key:"1t2c92"}
2],["path",{d:"m9.6 14.4 4.8-4.8",key:"6umqxw"}]],vn=re("dumbbell",kn);const jn=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Tt=re("loader-circle",jn);const yn=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],wn=re("log-in",yn);const Nn=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Sn=re("log-out",Nn);const Cn=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Mn=re("map",Cn);const $n=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],In=re("skull",$n);const En=[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]],Bt=re("swords",En);const Pn=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Wt=re("user",Pn),Ha=200;function qa(t){return t.replace(/\s+/g," ").trim().slice(0,Ha)}function _n(t,a,s){const n=Q.channel(`md-chat:${t}`,{config:{broadcast:{self:!1,ack:!1}}});return n.on("broadcast",{event:"msg"},r=>{const c=r.payload;!c||c.memberId===a||typeof c.text!="string"||!c.text.trim()||s({...c,text:c.text.slice(0,Ha)})}),n.subscribe(),{send:(r,c)=>{const d=qa(c);if(!d)return;const i={memberId:a,nick:r,text:d,ts:Date.now()};n.send({type:"broadcast",event:"msg",payload:i}),s(i)},close:()=>{Q.removeChannel(n)}}}const fa=30,vt=12e3;function Ln({identity:t,channels:a,position:s="bottom-left",onAnyMessage:n,enableHotkey:r=!0}){const[c,d]=l.useState([]),[i,p]=l.useState(0),[m,g]=l.useState(!1),[x,h]=l.useState(""),f=l.useRef(null),k=l.useRef(new Map),w=l.useRef(n);l.useEffect(()=>{w.current=n},[n]);const u=l.useMemo(()=>a.map(y=>y.key).join("|"),[a]);l.useEffect(()=>{if(!t)return;const y=[];k.current.clear();for(const C of a){const $=_n(C.key,t.id,A=>{d(_=>{const P=[..._,{...A,channelKey:C.key}];return P.length>fa?P.slice(P.length-fa):P}),w.current?.(C.key,A)});k.current.set(C.key,$.send),y.push($.close)}return()=>{y.forEach(C=>C()),k.current.clear()}},[t?.id,u]),l.useEffect(()=>{const y=setInterval(()=>{const C=Date.now()-vt*2;d($=>$.filter(A=>A.ts>C))},4e3);return()=>clearInterval(y)},[]);const N=l.useCallback(()=>{g(!0),setTimeout(()=>f.current?.focus(),0)},[]);l.useEffect(()=>{if(!r||!t)return;const y=C=>{if(C.key!=="Enter"&&C.key!=="Escape")return;const $=C.target?.tagName,A=$==="INPUT"||$==="TEXTAREA"||$==="SELECT";C.key==="Enter"&&!m&&!A?(C.preventDefault(),N()):C.key==="Escape"&&m&&(C.preventDefault(),g(!1),h(""))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[r,t,m,N]);const j=l.useCallback(()=>{const y=a[i];if(!y||!t)return;const C=qa(x);if(!C){g(!1),h("");return}k.current.get(y.key)?.(t.nick,C),h(""),g(!1)},[i,a,t,x]);if(!t||!a.length)return null;const I={"bottom-left":"bottom-3 left-3 items-start","bottom-right":"bottom-3 right-3 items-end","top-left":"top-12 left-3 items-start","top-right":"top-12 right-3 items-end"}[s],S=a[i],b=c.filter(y=>Date.now()-y.ts<vt).slice(-6);return e.jsxs("div",{className:`absolute z-30 flex flex-col gap-1 ${I} pointer-events-none max-w-[280px]`,children:[e.jsx("div",{className:"flex flex-col gap-1 pointer-events-none",children:b.map((y,C)=>{const $=a.find(V=>
2V.key===y.channelKey),A=Date.now()-y.ts,_=Math.max(.25,1-A/vt*.8),P=$?.tone??"cobalt",U={cobalt:"bg-ink-cobalt",cinnabar:"bg-ink-cinnabar",jade:"bg-ink-jade",mustard:"bg-ink-mustard"}[P];return e.jsxs("div",{className:"border-2 border-ink bg-paper/95 shadow-flat px-2 py-1 font-mono text-[11px] leading-tight max-w-[260px]",style:{opacity:_},children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:`inline-block w-1.5 h-1.5 ${U}`,"aria-hidden":!0}),e.jsx("span",{className:"font-bold text-ink truncate",children:y.nick}),$&&a.length>1&&e.jsx("span",{className:"text-ink-3 text-[9px] uppercase tracking-wider",children:$.label})]}),e.jsx("div",{className:"text-ink-2 break-words whitespace-pre-wrap",children:y.text})]},`${y.memberId}-${y.ts}-${C}`)})}),e.jsxs("div",{className:"pointer-events-auto flex flex-col gap-1 w-[260px]",children:[a.length>1&&e.jsx("div",{className:"flex gap-1",children:a.map((y,C)=>e.jsx("button",{type:"button",onClick:()=>{p(C),m&&f.current?.focus()},className:`border-2 border-ink px-2 py-0.5 font-mono text-[9px] uppercase tracking-wider shadow-flat ${C===i?"bg-ink text-paper":"bg-paper text-ink"}`,title:y.label,children:y.label},y.key))}),m?e.jsxs("form",{onSubmit:y=>{y.preventDefault(),j()},className:"flex border-2 border-ink bg-paper shadow-flat",children:[e.jsx("input",{ref:f,value:x,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),g(!1),h(""))},maxLength:200,placeholder:`falar em ${S.label}…`,className:"flex-1 bg-transparent px-2 py-1 font-mono text-[12px] outline-none text-ink placeholder:text-ink-3"}),e.jsx("button",{type:"submit",className:"border-l-2 border-ink bg-ink text-paper px-2 font-mono text-[10px] uppercase tracking-wider",children:"↵"})]}):e.jsx("button",{type:"button",onClick:N,className:"border-2 border-ink bg-paper/80 hover:bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-wider text-ink-3 shadow-flat text-left",children:"⏎ enter pra falar"})]})]})}const Tn=Aa({method:"POST"}).middleware([Us]).handler(Pa("e1e8a805a0a11ffcca427f92c3343057c5cecffbdc8368aaa1987f43c8ada949")),An=Aa({method:"GET"}).handler(Pa("ab0e962835f918e59cd7e7abe60a7cbe5cb744cbc30e6b9bff7758595d375e9b")),ba="md.multi.guestId",Ua="md.multi.guestNick";function zn(){return typeof window>"u"?null:localStorage.getItem(Ua)}function Rn(t){localStorage.setItem(Ua,t)}function Va(){let t=localStorage.getItem(ba);return t||(t=`guest_${crypto.randomUUID()}`,localStorage.setItem(ba,t)),t}async function On(){const{data:t}=await Q.auth.getSession();if(t.session?.user){const s=t.session.user.id,{data:n}=await Q.from("profiles").select("display_name").eq("user_id",s).maybeSingle();return n?.display_name?{id:s,nick:n.display_name,isGuest:!1}:null}const a=zn();return a?{id:Va(),nick:a,isGuest:!0}:null}function Dn(t,a,s,n,r){const c=typeof s=="function"?{onPose:s,onLeave:n,onArena:r}:s,d=`multi-pose:${t}`,i=Q.channel(d,{config:{broadcast:{self:!1,ack:!1},presence:{key:a}}});let p=0,m=0;const g=[],x=new Map;let h=1,f={ping:0,pps:0,aps:0,players:1};i.on("broadcast",{event:"pose"},N=>{const j=N.payload;!j||j.memberId===a||(p++,c.onPose(j))}),i.on("broadcast",{event:"arena"},N=>{const j=N.payload;!j?.snapshot||j.memberId===a||(m++,c.onArena?.(j.snapshot))}),i.on("broadcast",{event:"ping"},N=>{const j=N.payload;!j?.from||j.from===a||typeof j.id!="number"||i.send({type:"broadcast",event:"pong",payload:{to:j.from,id:j.id,from:a}})}),i.on("broadcast",{event:"pong"},N=>{const j=N.payload;if(j?.to!==a||typeof j.id!="number")return;const I=x.get(j.id);if(I==null)return;x.delete(j.id);const S=performance.now()-I;g.push(S),g.length>5&&g.shift()}),i.on("presence",{event:"leave"},({key:N})=>{N&&N!==a&&c.onLeave?.(N)}),i.subscribe(async N=>{if(N==="SUBSCRIBED")try{await i.track({memberId:a,joinedAt:Date.now()})}catch{}});const k=window.setInterval(()=>{const N=i.presenceState(),j=Math.max(1,Object.keys(N).length),I=g.length===0?0:[...g].sort((S,b)=>S-b)[Math.floor(g.length/2)];f={ping:Math.round(I),pps:p,aps:m,players:j},p=0,m=0,c.onStats?.(f)},1e3),w=window.setInterval(()=>{const N=h++;x.set(N,performance.now()),window.setTimeout(()=>x.delete(N),4e3),i.send({type:"broadcast",event:"ping",payload:{from:a,id:N}})},2e3);let u=!1;return{sendPose:N=>{const j={...N,memberId:a,ts:Date.now()};i.send({type:"broadcast",event:"pose",payload:j})},sendArena:N=>{i.send({type:"broadcast",event:"arena",payload:{memberId:a,snapshot:N,keyframe:u}}
2),u=!1},requestKeyframe:()=>{u=!0},getStats:()=>f,close:()=>{window.clearInterval(k),window.clearInterval(w),Q.removeChannel(i)}}}const Fn=/^[\p{L}\p{N} _\-]{2,16}$/u;function Bn({open:t,onClose:a,onConfirm:s}){const[n,r]=l.useState(""),[c,d]=l.useState(null);if(!t)return null;const i=()=>{const p=n.trim();if(!Fn.test(p)){d("2-16 caracteres (letras, números, espaço, _ ou -)");return}Rn(p);const m=Va();s(p,m)};return e.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-ink/60 backdrop-blur-sm p-4",children:e.jsxs("div",{className:"w-full max-w-sm border-4 border-ink bg-paper p-6 shadow-flat-lg",children:[e.jsx("h2",{className:"font-display text-2xl text-ink mb-1",children:"escolhe um apelido"}),e.jsx("p",{className:"font-mono text-xs text-ink-3 mb-4 uppercase tracking-wider",children:"modo visitante · não vale rank · só pra jogar com amigos"}),e.jsx("input",{autoFocus:!0,value:n,onChange:p=>{r(p.target.value),d(null)},onKeyDown:p=>p.key==="Enter"&&i(),placeholder:"ex: kuro-san",className:"w-full border-2 border-ink bg-paper-2 px-3 py-2 font-mono text-sm text-ink focus:outline-none focus:border-postit-cinnabar",maxLength:16}),c&&e.jsx("p",{className:"mt-2 font-mono text-[11px] text-postit-cinnabar",children:c}),e.jsxs("div",{className:"mt-5 flex gap-2 justify-end",children:[e.jsx(st,{variant:"outline",onClick:a,children:"cancelar"}),e.jsx(st,{onClick:i,children:"confirmar"})]})]})})}function Wn({size:t=120,opacity:a=.85,pos:s="left",offsetX:n=12,offsetY:r=12,onVector:c}){const d=l.useRef(null),i=l.useRef(null),[p,m]=l.useState({x:0,y:0}),g=t/2,x=t*.32,h=l.useCallback((u,N)=>{const j=d.current;if(!j)return;const I=j.getBoundingClientRect(),S=I.left+I.width/2,b=I.top+I.height/2;let y=u-S,C=N-b;const $=Math.hypot(y,C),A=g-x*.6;$>A&&(y=y/$*A,C=C/$*A),m({x:y,y:C}),c(y/A,C/A)},[g,x,c]),f=l.useCallback(()=>{i.current=null,m({x:0,y:0}),c(0,0)},[c]);l.useEffect(()=>{const u=d.current;if(!u)return;const N=S=>{i.current===null&&(i.current=S.pointerId,u.setPointerCapture(S.pointerId),h(S.clientX,S.clientY),S.preventDefault())},j=S=>{i.current===S.pointerId&&(h(S.clientX,S.clientY),S.preventDefault())},I=S=>{i.current===S.pointerId&&f()};return u.addEventListener("pointerdown",N),u.addEventListener("pointermove",j),u.addEventListener("pointerup",I),u.addEventListener("pointercancel",I),u.addEventListener("lostpointercapture",I),()=>{u.removeEventListener("pointerdown",N),u.removeEventListener("pointermove",j),u.removeEventListener("pointerup",I),u.removeEventListener("pointercancel",I),u.removeEventListener("lostpointercapture",I)}},[h,f]),l.useEffect(()=>()=>c(0,0),[c]);const k=Math.max(0,Math.min(1,a)),w=s==="center"?{left:"50%",bottom:r,transform:"translateX(-50%)"}:s==="right"?{right:n,bottom:r}:{left:n,bottom:r};return e.jsxs("div",{ref:d,className:"absolute touch-none select-none rounded-full",style:{...w,width:t,height:t,opacity:k,border:k>0?"2px solid var(--ink)":"none",background:k>0?"color-mix(in oklab, var(--paper) 70%, transparent)":"transparent",backdropFilter:k>0?"blur(2px)":void 0,boxShadow:k>0?"3px 3px 0 0 var(--ink)":void 0},"aria-label":"analógico de movimento",children:[k>0&&e.jsx("div",{className:"absolute inset-0 rounded-full pointer-events-none",style:{opacity:.25,backgroundImage:"radial-gradient(circle, var(--ink) 0.6px, transparent 0.8px)",backgroundSize:"6px 6px"}}),e.jsx("div",{className:"absolute rounded-full pointer-events-none",style:{width:x*2,height:x*2,left:`calc(50% - ${x}px)`,top:`calc(50% - ${x}px)`,transform:`translate(${p.x}px, ${p.y}px)`,transition:p.x===0&&p.y===0?"transform 120ms ease-out":"none",border:k>0?"2px solid var(--ink)":"none",background:k>0?"var(--ink-cobalt)":"transparent",boxShadow:k>0?"3px 3px 0 0 var(--ink)":void 0}})]})}function Hn({lives:t,maxLives:a,shieldHp:s,shieldMax:n,shieldTier:r,level:c,xp:d,xpToNext:i}){return e.jsxs("div",{className:"absolute z-20 pointer-events-none select-none flex flex-col gap-1",style:{to
2p:48,left:8,width:"min(190px, 52vw)"},children:[e.jsx(qn,{cur:t,max:a}),n>0&&e.jsx(Un,{cur:s,max:n,tier:r}),e.jsx(Vn,{level:c,xp:d,xpToNext:i})]})}function qn({cur:t,max:a}){const s=Math.max(0,Math.min(1,t/Math.max(1,a))),n=s<=.25;return e.jsxs("div",{className:"flex items-center gap-1.5","aria-label":`vida ${t}/${a}`,title:`vida ${t}/${a}`,children:[e.jsx("span",{className:`text-lg leading-none font-display ${n?"animate-pulse":""}`,style:{color:"var(--ink-cinnabar)",textShadow:lt},children:"♥"}),e.jsx("div",{className:"flex-1 h-3 border-2 border-ink bg-paper relative overflow-hidden shadow-flat",children:e.jsx("div",{className:"absolute inset-y-0 left-0 transition-[width] duration-200",style:{width:`${s*100}%`,background:"var(--ink-cinnabar)"}})}),e.jsxs("span",{className:"font-mono text-[10px] tabular-nums text-ink",style:{textShadow:Ye},children:[t,"/",a]})]})}function Un({cur:t,max:a,tier:s}){const n=s===3?"var(--ink-jade)":s===2?"var(--ink-cobalt)":"var(--ink-violet)",r=Math.min(a,14);return e.jsxs("div",{className:"flex items-center gap-1.5","aria-label":`escudo ${t}/${a}`,title:`escudo ${t}/${a} · tier ${s}`,children:[e.jsx("span",{className:"text-sm leading-none font-display",style:{color:n,textShadow:lt},children:"◉"}),e.jsx("div",{className:"flex-1 flex gap-[2px]",children:Array.from({length:r}).map((c,d)=>{const i=d<t;return e.jsx("div",{className:"flex-1 h-2 border border-ink",style:{background:i?n:"var(--paper)"}},d)})}),e.jsxs("span",{className:"font-mono text-[9px] tabular-nums text-ink/70",style:{textShadow:Ye},children:["T",s]})]})}function Vn({level:t,xp:a,xpToNext:s}){const n=s>0?Math.max(0,Math.min(1,a/s)):0;return e.jsxs("div",{className:"flex items-center gap-1.5","aria-label":`xp lv ${t} ${a}/${s}`,children:[e.jsxs("span",{className:"font-display font-black text-[10px] tabular-nums leading-none",style:{color:"var(--ink-cobalt)",textShadow:lt},children:["LV",t]}),e.jsx("div",{className:"flex-1 h-1.5 border-2 border-ink bg-paper relative overflow-hidden",children:e.jsx("div",{className:"absolute inset-y-0 left-0 transition-[width] duration-300",style:{width:`${n*100}%`,background:"var(--ink-cobalt)"}})}),e.jsxs("span",{className:"font-mono text-[8px] tabular-nums text-ink/60",style:{textShadow:Ye},children:[Math.round(n*100),"%"]})]})}function Yn({wave:t,killCount:a,score:s,bossWave:n,coinsEst:r,tierLabel:c,mapLabel:d}){const i=n?`${String(t).padStart(2,"0")}/${n}`:String(t).padStart(2,"0");return e.jsxs("div",{className:"absolute z-20 pointer-events-none select-none flex items-start gap-1 flex-wrap max-w-[92vw] sm:max-w-[60vw]",style:{top:8,left:8},children:[d&&e.jsx(ze,{label:c?`MAPA·${c}`:"MAPA",value:d,color:"var(--ink-cobalt)",wide:!0}),e.jsx(ze,{label:n?"WAVE/BOSS":"WAVE",value:i,color:"var(--ink)",animateKey:t,wide:!!n}),a>0&&e.jsx(ze,{label:"KILLS",value:String(a),color:"var(--ink-cinnabar)",animateKey:a}),e.jsx(ze,{label:"SCORE",value:s.toLocaleString("pt-BR"),color:"var(--ink-mustard)",animateKey:s,wide:!0}),typeof r=="number"&&r>0&&e.jsx(ze,{label:"¥",value:`~${r}`,color:"var(--ink-jade)",animateKey:r})]})}function ze({label:t,value:a,color:s,wide:n,animateKey:r}){return e.jsxs("div",{className:`border-2 bg-paper shadow-flat px-1 py-0.5 flex flex-col items-center leading-none ${n?"min-w-[48px]":"min-w-[30px]"}`,style:{borderColor:s},children:[e.jsx("span",{className:"text-[7px] tracking-[0.18em] text-ink/55 font-mono uppercase leading-none",children:t}),e.jsx("span",{className:"font-display font-semibold text-[13px] tabular-nums mt-0.5 animate-scale-in leading-none",style:{color:s,textShadow:Ye},children:a},r)]})}function Kn({boss:t}){if(!t||t.bannerMs<=0)return null;const a=t.bannerMs,n=(1-(a>2200?(2400-a)/200:a<400?a/400:1))*120;return e.jsx("div",{className:"absolute left-0 right-0 z-30 pointer-events-none select-none overflow-hidden",style:{top:"26%"},"aria-hidden":"true",children:e.jsxs("div",{className:"border-y-4 border-ink text-paper text-center py-2 px-3 mx-auto",style:{transform:`translateX(${n}%)`,background:"var(--ink-cinnabar)",maxWidth:"min(92vw, 480px)",boxShadow:"0 6px 0 0 #0a0a0a"},children:[e.jsx("p",{className:"text-[10px] font-mono tracking-[0.35em] opacity-80 leading-none",children:"ボス · BOSS APPROACHES"}),e.jsx("p",{className:"font-display font-black tracking-tight uppercase text-xl leading-tight mt-0.5",children:t.name||"BOSS"}),t.title&&e.jsx("p",{className:"text-[10px] font-mono tracking-widest opacity-85 leading-none mt-0.5",children:t.title})]})})}function Xn({ms:t,maxMs:a,tier:s}){if(t<=0||s===0)return null;const n=a>0?Math.max(0,Math.min(1,t/a)):0,r=s===3?"var(--ink-violet)":s===2?"var(--ink-cinnabar)":"var(--ink-mustard)",c=175.9;return e.jsxs("div",{className:"absolute z-20 pointer-events-none select-none flex flex-col items-center",style:{to
2p:164,right:56},title:`Artilharia ativa · ${(t/1e3).toFixed(1)}s`,children:[e.jsx("div",{className:"relative w-12 h-12",children:e.jsxs("svg",{viewBox:"0 0 64 64",className:"absolute inset-0",children:[e.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"#0a0a0a",strokeWidth:"2",fill:"#f5f0e6"}),e.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:r,strokeWidth:"5",fill:"none",strokeDasharray:`${n*c} ${c}`,transform:"rotate(-90 32 32)",style:{transition:"stroke-dasharray 200ms linear"}}),e.jsx("text",{x:"32",y:"38",textAnchor:"middle",fontSize:"18",fontFamily:"ui-monospace, monospace",fontWeight:"900",fill:"#0a0a0a",children:(t/1e3).toFixed(t<5e3?1:0)})]})}),e.jsxs("span",{className:"text-[8px] font-mono uppercase tracking-[0.2em] text-ink mt-0.5",style:{textShadow:Ye},children:["☄ T",s]})]})}function Gn({chain:t,msLeft:a,best:s}){const n=t>=2&&a>0;if(!n&&s<5)return null;if(!n)return e.jsxs("div",{className:"absolute z-20 pointer-events-none select-none border-2 border-ink/60 bg-paper px-1.5 py-0.5 flex items-center gap-1",style:{to
2p:228,right:56},title:`Maior combo desta run: ${s}`,children:[e.jsx("span",{className:"text-[8px] font-mono uppercase tracking-[0.15em] text-ink/60",children:"BEST"}),e.jsxs("span",{className:"font-display font-black text-xs tabular-nums text-ink",children:["×",s]})]});const r=t>=20?"S":t>=12?"A":t>=6?"B":"C",c=r==="S"?"var(--ink-violet)":r==="A"?"var(--ink-cinnabar)":r==="B"?"var(--ink-mustard)":"var(--ink)",d=Math.max(.4,Math.min(1,a/2500));return e.jsxs("div",{className:"absolute z-20 pointer-events-none select-none border-2 border-ink bg-paper shadow-flat px-1.5 py-0.5 flex items-center gap-1.5",style:{top:228,right:56,opacity:d},title:`Combo ×${t} · rank ${r}`,children:[e.jsx("span",{className:"font-display font-black text-2xl leading-none animate-scale-in",style:{color:c,textShadow:lt},children:r},r),e.jsxs("div",{className:"flex flex-col items-start leading-none",children:[e.jsxs("span",{className:"font-display font-black text-sm tabular-nums text-ink animate-scale-in",children:["×",t]},`x${t}`),e.jsx("span",{className:"text-[7px] font-mono uppercase tracking-[0.15em] text-ink/60",children:"COMBO"})]})]})}const lt="-1px -1px 0 #0a0a0a, 1px -1px 0 #0a0a0a, -1px 1px 0 #0a0a0a, 1px 1px 0 #0a0a0a",Ye="0 0 2px var(--paper), 1px 0 0 var(--paper), -1px 0 0 var(--paper), 0 1px 0 var(--paper), 0 -1px 0 var(--paper)",Ya="md.onboarding.v1";function Jn(){if(typeof window>"u")return new Set;try{const t=localStorage.getItem(Ya);if(!t)return new Set;const a=JSON.parse(t);return new Set(Array.isArray(a)?a:[])}catch{return new Set}}function Qn(t){if(!(typeof window>"u"))try{localStorage.setItem(Ya,JSON.stringify([...t]))}catch{}}function Zn({wave:t,isLevelup:a,lives:s}){const[n,r]=l.useState(()=>Jn()),[c,d]=l.useState(null);function i(p){n.has(p.id)||(d(p),r(m=>{if(m.has(p.id))return m;const g=new Set(m);return g.add(p.id),Qn(g),g}),window.setTimeout(()=>{d(m=>m?.id===p.id?null:m)},p.durationMs))}return l.useEffect(()=>{if(n.has("move"))return;const p=window.setTimeout(()=>{i({id:"move",glyph:"⌨",text:"WASD ou setas",sub:"mira segue o cursor",durationMs:4200})},700);return()=>window.clearTimeout(p)},[]),l.useEffect(()=>{a&&i({id:"level",glyph:"✦",text:"Escolha 1 bênção",sub:"ela vale pra run inteira",durationMs:3600})},[a]),l.useEffect(()=>{t>=2&&i({id:"dash",glyph:"≫",text:"Shift = dash",sub:"invuln curto, cooldown 5s",durationMs:3600})},[t]),l.useEffect(()=>{s===1&&i({id:"lowhp",glyph:"♥",text:"Vida crítica",sub:"evite hits — drop ❤ cura",durationMs:2800})},[s]),c?e.jsx("div",{className:"pointer-events-none absolute left-1/2 -translate-x-1/2 bottom-20 z-30 select-none animate-fade-in",role:"status","aria-live":"polite",children:e.jsxs("div",{className:"border-2 border-ink bg-paper px-3 py-2 shadow-flat flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-2xl font-display leading-none text-ink-cobalt",children:c.glyph}),e.jsxs("span",{className:"flex flex-col leading-tight",children:[e.jsx("span",{className:"text-sm font-display font-bold text-ink",children:c.text}),c.sub&&e.jsx("span",{className:"text-[10px] text-ink-3",children:c.sub})]})]})}):null}const Ka="md.analogSettings",Xa={enabled:!1,autoFire:!0,side:"left",size:120,opacity:.85,offsetX:12,offsetY:12,layout:"default",dashSide:"left",dashVSide:"bottom"};function er(){if(typeof window>"u")return!1;try{const t=window.matchMedia?.("(pointer: coarse)")?.matches??!1,a=window.matchMedia?.("(hover: none)")?.matches??!1;return t&&a}catch{return!1}}function Je(t,a,s){return Number.isFinite(t)?Math.max(a,Math.min(s,t)):a}function jt(t){const a={...Xa,enabled:er()};if(!t||typeof t!="object")return a;const s=t,n=s.layout==="em-pe"||s.layout==="deitado"?s.layout:"default";return{enabled:typeof s.enabled=="boolean"?s.enabled:a.enabled,autoFire:typeof s.autoFire=="boolean"?s.autoFire:a.autoFire,side:s.side==="right"?"right":"left",size:Je(Number(s.size??a.size),80,200),opacity:Je(Number(s.opacity??a.opacity),0,1),offsetX:Je(Number(s.offsetX??a.offsetX),0,200),offsetY:Je(Number(s.offsetY??a.offsetY),0,200),layout:n,dashSide:s.dashSide==="right"?"right":"left",dashVSide:s.dashVSide==="top"?"top":"bottom"}}function ha(t){switch(t.layout){case"em-pe":return{analogPos:"left",analogSide:"left",dashSide:"right",dashVSide:"bottom",bottomOffset:24,edgeOffset:20};case"deitado":return{analogPos:"left",analogSide:"left",dashSide:"right",dashVSide:"bottom",bottomOffset:40,edgeOffset:40};default:return{analogPos:"center",analogSide:"left",dashSide:t.dashSide,dashVSide:t.dashVSide,bottomOffset:20,edgeOffset:20}}}function tr(){if(typeof window>"u")return{...Xa};try{const t=window.sessionStorage.getItem(Ka);return jt(t?JSON.parse(t):null)}catch{return jt(null)}}function ar(t){try{window.sessionStorage.setItem(Ka,JSON.stringify(t))}catch{}}function sr(t){let a=2166136261;for(let s=0;s<t.length;s++)a^=t.charCodeAt(s),a=Math.imul(a,16777619)>>>0;return a>>>0}function nr(t){let a=t>>>0;return()=>{a=a+1831565813>>>0;let s=a;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function rr(t){const a=nr(t),s=Math.round((a()-.5)*36),n=Math.round(a()*12)/100,r=`tom #${(t%4096).toString(16).toUpperCase().padStart(3,"0")}`;return{hueShift:s,satBoost:n,label:r}}
2function ir(t,a){if(!t)return;if(a==null){t.style.removeProperty("filter"),t.dataset.roomPalette="";return}const s=rr(a);t.style.filter=`hue-rotate(${s.hueShift}deg) saturate(${(1+s.satBoost).toFixed(2)})`,t.dataset.roomPalette=s.label}class or{map=new Map;renderDelayMs;staleMs;constructor(a={}){this.renderDelayMs=a.renderDelayMs??100,this.staleMs=a.staleMs??3e3}push(a,s){let n=this.map.get(a);if(!n){n={samples:[s],last:s},this.map.set(a,n);return}const r=n.samples[n.samples.length-1]?.ts??0;s.ts<r||(n.samples.push(s),n.last=s,n.samples.length>4&&n.samples.shift())}remove(a){this.map.delete(a)}prune(a){for(const[s,n]of this.map)a-n.last.ts>this.staleMs&&this.map.delete(s)}sample(a){const s=a-this.renderDelayMs,n=[];for(const r of this.map.values()){const c=r.samples;if(c.length===0)continue;if(s<=c[0].ts){n.push({...r.last,x:c[0].x,y:c[0].y,aimX:c[0].aimX,aimY:c[0].aimY});continue}const d=c[c.length-1];if(s>=d.ts){n.push({...r.last,x:d.x,y:d.y,aimX:d.aimX,aimY:d.aimY});continue}for(let i=0;i<c.length-1;i++){const p=c[i],m=c[i+1];if(s>=p.ts&&s<=m.ts){const g=(s-p.ts)/Math.max(1,m.ts-p.ts);n.push({...r.last,x:p.x+(m.x-p.x)*g,y:p.y+(m.y-p.y)*g,aimX:p.aimX+(m.aimX-p.aimX)*g,aimY:p.aimY+(m.aimY-p.aimY)*g});break}}}return n}size(){return this.map.size}}function lr({prefs:t,onChange:a}){const[s,n]=l.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx("button",{type:"button",onClick:()=>n(r=>!r),className:"rounded-md border-2 border-ink bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-widest text-ink shadow-sm transition hover:bg-paper-tinted",title:"preferências de exibição (FX)",children:"👁 fx"}),s&&e.jsxs("div",{className:"absolute right-0 top-full z-40 mt-1 w-64 rounded-md border-2 border-ink bg-paper p-3 font-mono text-[11px] shadow-lg",children:[e.jsx("div",{className:"mb-2 text-[10px] uppercase tracking-widest text-ink/70",children:"exibição"}),e.jsxs("label",{className:"mb-2 block",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"tiros/mira dos aliados"}),e.jsxs("span",{className:"text-ink/60",children:[Math.round(t.allyAim*100),"%"]})]}),e.jsx("input",{type:"range",min:0,max:100,step:5,value:Math.round(t.allyAim*100),onChange:r=>a({allyAim:Number(r.target.value)/100}),className:"w-full accent-ink"})]}),e.jsx(Se,{label:"halo colorido dos aliados",value:t.allyHalo,onChange:r=>a({allyHalo:r})}),e.jsx(Se,{label:"nomes flutuantes",value:t.allyNames,onChange:r=>a({allyNames:r})}),e.jsx(Se,{label:"balões de chat na arena",value:t.allyChat,onChange:r=>a({allyChat:r})}),e.jsx(Se,{label:"HUD de rede (ping)",value:t.netHud,onChange:r=>a({netHud:r})}),e.jsxs("div",{className:"mb-1",children:[e.jsx("div",{className:"mb-1",children:"números de dano (Sumi)"}),e.jsx("div",{className:"grid grid-cols-3 gap-1",children:["stack","dps","off"].map(r=>e.jsx("button",{type:"button",onClick:()=>a({damageMode:r}),className:`border-2 border-ink px-1 py-0.5 text-[9px] uppercase tracking-wider ${t.damageMode===r?"bg-ink text-paper":"bg-paper"}`,title:r==="stack"?"Sumi Strike: cada hit vira número que empilha":r==="dps"?"Sumi DPS: um número por bicho, dano/segundo":"esconder",children:r==="stack"?"stack":r==="dps"?"dps":"off"},r))})]}),e.jsxs("div",{className:"mt-2 border-t border-ink/20 pt-2",children:[e.jsx(Se,{label:"cenário simplificado (perf)",value:t.simpleScene,onChange:r=>a({simpleScene:r})}),e.jsx(Se,{label:"scanlines (CRT)",value:t.scanlines,onChange:r=>a({scanlines:r})})]}),e.jsx("div",{className:"mt-2 text-[9px] leading-tight text-ink/50",children:"tudo só no seu cliente — não afeta os outros nem gasta banda."})]})]})}function Se({label:t,value:a,onChange:s}){return e.jsxs("label",{className:"mb-1 flex cursor-pointer items-center justify-between gap-2 py-0.5",children:[e.jsx("span",{children:t}),e.jsx("input",{type:"checkbox",checked:a,onChange:n=>s(n.target.checked),className:"h-3.5 w-3.5 accent-ink"})]})}function cr({stats:t,visible:a}){if(!a||!t)return null;const s=t.ping<80?"text-postit-jade":t.ping<180?"text-postit-mustard":"text-postit-cinnabar";return e.jsxs("div",{className:"pointer-events-none absolute top-14 right-2 z-10 select-none rounded-md border border-ink/30 bg-paper/85 px-2 py-1 font-mono text-[10px] leading-tight text-ink shadow-sm backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:s,children:["● ",t.ping,"ms"]}),e.jsx("span",{className:"text-ink/60",children:"·"}),e.jsxs("span",{children:[t.players,"p"]})]}),e.jsxs("div",{className:"text-ink/60",children:["in: ",t.pps,"/s pose · ",t.aps,"/s arena"]})]})}const ga={fire:"bg-postit-cinnabar/30",ice:"bg-postit-sky/40",poison:"bg-postit-jade/40",shock:"bg-postit-mustard/50",arcane:"bg-postit-lilac/40",void:"bg-ink/15",holy:"bg-paper-2",neutral:"bg-paper"};function dr({open:t,onClose:a,initial:s,onConfirm:n}){const[r,c]=l.useState(s&&s.length>0?s:[{variantId:"hissen",level:1}]),[d,i]=l.useState(""),[p,m]=l.useState("all"),[g,x]=l.useState(null),h=l.useMemo(()=>Rs,[]),f=l.useMemo(()=>{const b=new Set;return h.forEach(y=>b.add(y.behavior)),["all",...Array.from(b)]},[h]),k=l.useMemo(()=>{const b=d.trim().toLowerCase();return h.filter(y=>p!=="all"&&y.behavior!==p?!1:b?y.name.toLowerCase().includes(b)||y.id.toLowerCase().includes(b)||y.element.toLowerCase().includes(b)||(y.desc??"").toLowerCase().includes(b):!0)},[d,p,h]);if(!t)return null;const w=b=>{c(y=>y.find($=>$.variantId===b)?y.filter($=>$.variantId!==b):y.length>=Ge?y:[...y,{variantId:b,level:1}])},u=(b,y)=>{c(C=>C.map($=>$.variantId===b?{...$,level:y}:$))},N=b=>c(y=>y.filter(C=>C.variantId!==b)),j=()=>c(b=>b.map(y=>({...y,level:de}))),I=()=>c([]),S=()=>{r.length!==0&&n(r)};return e.jsx("div",{className:"absolute inset-0 z-[60] flex items-center justify-center bg-ink/70 p-2 sm:p-4",onClick:a,children:e.jsxs("div",{className:"relative w-full max-w-3xl border-2 border-ink bg-paper shadow-flat-lg max-h-full flex flex-col",style:{maxHeight:"min(90%, 720px)"},onClick:b=>b.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b-2 border-ink bg-paper-2 px-4 py-3 shrink-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"inline-flex items-center gap-2 border border-ink bg-postit-mustard px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider",children:"🎯 training area"}),e.jsx("h3",{className:"mt-1 font-display text-xl font-black leading-none",children:"build your loadout"}),e.jsxs("p",{className:"mt-1 font-mono text-[11px] text-ink-2",children:[h.length," weapons no roster MVP-6 — pick up to ",Ge," and a starting level."]})]}),e.jsx("button",{type:"button",onClick:a,className:"border-2 border-ink bg-paper px-2 py-1 font-mono text-xs shadow-flat hover:-translate-y-[1px] transition-transform","aria-label":"close",children:"✕"})]}),r.length>0&&e.jsxs("div",{className:"border-b-2 border-ink bg-postit-jade/30 px-4 py-2 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-ink-2",children:["selected ",r.length,"/",Ge]}),e.jsxs("div",{className:"ml-auto flex gap-1",children:[e.jsxs("button",{type:"button",onClick:j,className:"border-2 border-ink bg-paper px-2 py-0.5 font-mono text-[10px] uppercase shadow-flat hover:-translate-y-[1px] transition-transform",children:["all lv ",de]}),e.jsx("button",{type:"button",onClick:I,className:"border-2 border-ink bg-paper px-2 py-0.5 font-mono text-[10px] uppercase shadow-flat hover:-translate-y-[1px] transition-transform",children:"clear"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(b=>{const y=$t[b.variantId];return y?e.jsxs("div",{className:"border-2 border-ink bg-paper shadow-flat px-2 py-1 flex items-center gap-2",children:[e.jsx("span",{className:"shrink-0",children:e.jsx(tt,{v:y,size:20})}),e.jsx("span",{className:"font-display font-black text-[11px]",children:y.name}),e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:de},(C,$)=>$+1).map(C=>e.jsx("button",{type:"button",onClick:()=>u(b.variantId,C),className:`w-5 h-5 border border-ink font-mono text-[9px] font-black ${b.level===C?"bg-ink text-paper":"bg-paper text-ink hover:bg-paper-2"}`,title:`level ${C}`,children:C},C))}),e.jsx("button",{type:"button",onClick:()=>N(b.variantId),className:"ml-1 border border-ink bg-paper px-1 font-mono text-[10px] hover:bg-postit-cinnabar/30","aria-label":"remove",children:"✕"})]},b.variantId):null})})]}),e.jsxs("div",{className:"border-b-2 border-ink bg-paper-2 px-4 py-2 flex flex-wrap items-center gap-2 shrink-0",children:[e.jsx("input",{type:"text",value:d,onChange:b=>i(b.target.value),placeholder:"search name, element…",className:"flex-1 min-w-[140px] border-2 border-ink bg-paper px-2 py-1 font-mono text-[11px] focus:outline-none focus:bg-postit-mustard/20"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:f.map(b=>e.jsx("button",{type:"button",onClick:()=>m(b),className:`border-2 border-ink px-2 py-1 font-mono text-[10px] uppercase shadow-flat ${p===b?"bg-ink text-paper":"bg-paper hover:bg-paper-2"}`,children:b==="all"?"todas":et[b]??b},b))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2",children:[k.map(b=>{const C=!!r.find(_=>_.variantId===b.id),$=!C&&r.length>=Ge,A=ga[b.element]??"bg-paper";return e.jsxs("button",{type:"button",onClick:()=>w(b.id),onMouseEnter:()=>x(b.id),onMouseLeave:()=>x(_=>_===b.id?null:_),disabled:$,className:`text-left border-2 shadow-flat p-2 transition-transform ${C?"border-ink bg-postit-jade -translate-y-[2px]":$?"border-ink-3/40 bg-paper-2 opacity-40 cursor-not-allowed":`border-ink ${A} hover:-translate-y-[1px]`}`,children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"shrink-0",children:e.jsx(tt,{v:b,size:32})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-display font-black text-[11px] leading-tight truncate",children:b.name}),e.jsxs("div",{className:"font-mono text-[8px] uppercase tracking-wider text-ink-2 leading-tight",children:[et[b.behavior]??b.behavior," · ",b.element]})]})]}),e.jsx("div",{className:"mt-1 font-mono text-[9px] text-ink-2 leading-tight line-clamp-2",children:b.tradeoff})]},b.id)}),k.length===0&&e.jsx("div",{className:"col-span-full text-center font-mono text-[11px] text-ink-2 py-8",children:"no weapons foun
2d"})]})}),g&&(()=>{const b=$t[g];if(!b)return null;const y=ga[b.element]??"bg-paper",C=b.statMult??{dmg:1,cd:1,range:1,aoe:1},$=A=>{const _=Math.round((A-1)*100);return _===0?"—":_>0?`+${_}%`:`${_}%`};return e.jsxs("div",{className:"pointer-events-none absolute bottom-20 right-3 z-10 w-72 border-2 border-ink bg-paper shadow-flat-lg p-3 hidden md:block",children:[e.jsxs("div",{className:`flex items-center gap-2 border-2 border-ink ${y} px-2 py-1.5`,children:[e.jsx("span",{className:"shrink-0",children:e.jsx(tt,{v:b,size:40})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-display font-black text-sm leading-tight truncate",children:b.name}),e.jsxs("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-2",children:[et[b.behavior]??b.behavior," · ",b.element]})]})]}),b.desc&&e.jsx("p",{className:"mt-2 font-mono text-[10px] leading-snug text-ink",children:b.desc}),e.jsxs("p",{className:"mt-2 font-mono text-[10px] leading-snug text-ink-cobalt border-l-2 border-ink-cobalt/40 pl-2",children:["👁 ",nt(b)]}),b.tradeoff&&e.jsxs("p",{className:"mt-1 font-mono text-[10px] leading-snug text-ink-2 italic",children:["⚖ ",b.tradeoff]}),e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 font-mono text-[10px]",children:[e.jsxs("div",{className:"border border-ink-3 px-1.5 py-0.5 flex justify-between",children:[e.jsx("span",{children:"damage"}),e.jsx("b",{children:$(C.dmg)})]}),e.jsxs("div",{className:"border border-ink-3 px-1.5 py-0.5 flex justify-between",children:[e.jsx("span",{children:"cd"}),e.jsx("b",{children:$(C.cd)})]}),e.jsxs("div",{className:"border border-ink-3 px-1.5 py-0.5 flex justify-between",children:[e.jsx("span",{children:"range"}),e.jsx("b",{children:$(C.range)})]}),e.jsxs("div",{className:"border border-ink-3 px-1.5 py-0.5 flex justify-between",children:[e.jsx("span",{children:"area"}),e.jsx("b",{children:$(C.aoe)})]})]})]})})(),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-end p-3 border-t-2 border-ink bg-paper-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:a,className:"border-2 border-ink bg-paper px-3 py-2 font-display font-bold text-sm shadow-flat hover:-translate-y-[1px] transition-transform",children:"cancel"}),e.jsx("button",{type:"button",onClick:S,disabled:r.length===0,className:"border-2 border-ink bg-postit-cinnabar text-paper px-4 py-2 font-display font-bold text-sm shadow-flat hover:-translate-y-[1px] transition-transform disabled:opacity-40 disabled:cursor-not-allowed",children:"🎯 start training"})]})]})})}const yt=768;function pr(){const[t,a]=l.useState(void 0);return l.useEffect(()=>{const s=window.matchMedia(`(max-width: ${yt-1}px)`),n=()=>{a(window.innerWidth<yt)};return s.addEventListener("change",n),a(window.innerWidth<yt),()=>s.removeEventListener("change",n)},[]),!!t}const mr=[{id:"all",label:"Tudo"},{id:"today",label:"Hoje"},{id:"7d",label:"7 dias"},{id:"30d",label:"30 dias"},{id:"month",label:"Este mês"}];function Ga({initial:t,compact:a=!1}){const s=ce(An),[n,r]=l.useState("all"),[c,d]=l.useState(""),[i,p]=l.useState(t??{entries:[],total:0}),[m,g]=l.useState(!t),x=l.useRef(!!t&&n==="all"&&c==="");l.useEffect(()=>{if(x.current){x.current=!1;return}let k=!1;g(!0);const w=setTimeout(async()=>{try{const u=await s({data:{limit:50,period:n,search:c}});k||p(u)}catch(u){console.error(u)}finally{k||g(!1)}},c?250:0);return()=>{k=!0,clearTimeout(w)}},[n,c,s]);const h=l.useMemo(()=>i.entries.slice(0,3),[i.entries]),f=l.useMemo(()=>i.entries.slice(3,50),[i.entries]);return e.jsxs("section",{className:"w-full max-w-4xl mx-auto",children:[e.jsxs("header",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:`font-display font-black tracking-tight ${a?"text-xl":"text-3xl"}`,children:"🏆 Ranking dos caçadores"}),e.jsxs("p",{className:"text-xs text-ink-3 mt-0.5",children:[i.total," ",i.total===1?"caçador":"caçadores"," no total · mostrando top ",i.entries.length]})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("input",{type:"text",value:c,onChange:k=>d(k.target.value),placeholder:"buscar caçador…",className:"h-8 px-2 border-2 border-ink bg-paper shadow-flat font-mono text-xs w-40 focus:outline-none focus:bg-paper-2"})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1 mb-4 border-2 border-ink bg-paper p-1 shadow-flat",children:[mr.map(k=>e.jsx("button",{type:"button",onClick:()=>r(k.id),className:`px-3 py-1 font-mono text-[10px] uppercase tracking-wider transition-all ${n===k.id?"bg-ink text-paper shadow-flat-sm":"hover:bg-paper-2 text-ink-3 hover:text-ink"}`,children:k.label},k.id)),m&&e.jsx("span",{className:"ml-auto pr-2 text-[10px] font-mono text-ink-3 animate-pulse",children:"carregando…"})]}),h.length>
20?e.jsx(xr,{entries:h}):e.jsx("div",{className:"border-2 border-dashed border-ink-3 bg-paper p-8 text-center mb-4",children:e.jsx("p",{className:"font-display text-lg text-ink-3",children:"nenhum score nesse filtro"})}),f.length>0&&e.jsx("div",{className:"border-2 border-ink shadow-flat-lg bg-paper-2 overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"font-display text-[10px] uppercase tracking-widest text-ink-3 border-b-2 border-ink bg-paper",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left w-10",children:"#"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"caçador"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"score"}),e.jsx("th",{className:"px-3 py-2 text-right hidden sm:table-cell",children:"lv"}),e.jsx("th",{className:"px-3 py-2 text-right hidden sm:table-cell",children:"wave"}),e.jsx("th",{className:"px-3 py-2 text-right hidden md:table-cell",children:"kills"})]})}),e.jsx("tbody",{children:f.map((k,w)=>e.jsxs("tr",{className:"border-b border-ink/10 hover:bg-paper transition-colors",children:[e.jsx("td",{className:"px-3 py-2 font-display font-black text-ink-3",children:w+4}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 shrink-0 border border-ink bg-paper-2 overflow-hidden flex items-center justify-center",children:k.avatarUrl?e.jsx("img",{src:k.avatarUrl,alt:"",className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-sm",children:"👻"})}),e.jsx("span",{className:"font-bold truncate max-w-[180px]",children:k.name})]})}),e.jsx("td",{className:"px-3 py-2 text-right font-display font-black tabular-nums",children:k.score.toLocaleString("pt-BR")}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums hidden sm:table-cell",children:k.level}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums hidden sm:table-cell",children:k.wave}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums hidden md:table-cell text-ink-3",children:k.kills})]},k.id))})]})})]})}function xr({entries:t}){const[a,s,n]=[t[0],t[1],t[2]],r=[{e:s,place:2,heightCls:"h-32 sm:h-40",bg:"bg-paper-2",medal:"🥈",accent:"var(--ink-3)"},{e:a,place:1,heightCls:"h-44 sm:h-56",bg:"bg-postit-mustard/40",medal:"🥇",accent:"var(--ink-mustard)"}
2,{e:n,place:3,heightCls:"h-24 sm:h-32",bg:"bg-postit-cinnabar/30",medal:"🥉",accent:"var(--ink-cinnabar)"}];return e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:gap-4 items-end mb-6",children:r.map((c,d)=>c.e?e.jsx(ur,{entry:c.e,place:c.place,heightCls:c.heightCls,bg:c.bg,medal:c.medal,accent:c.accent},c.e.id):e.jsx("div",{className:`${c.heightCls} border-2 border-dashed border-ink-3/40 bg-paper/40`},`empty-${d}`))})}function ur({entry:t,place:a,heightCls:s,bg:n,medal:r,accent:c}){const d=fr(t.score);return e.jsxs("div",{className:`relative ${s} ${n} border-2 border-ink shadow-flat-lg flex flex-col items-center justify-end p-2 sm:p-3 ${a===1?"scale-105":""}`,style:{borderColor:a===1?"var(--ink)":void 0},children:[e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 text-2xl sm:text-3xl drop-shadow-md",children:r}),e.jsx("div",{className:"w-12 h-12 sm:w-16 sm:h-16 border-2 border-ink bg-paper overflow-hidden flex items-center justify-center mb-1 sm:mb-2",style:{boxShadow:`0 0 0 2px ${c}`},children:t.avatarUrl?e.jsx("img",{src:t.avatarUrl,alt:"",className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-2xl",children:"👻"})}),e.jsx("div",{className:"font-display font-black text-[11px] sm:text-sm leading-tight truncate w-full text-center",children:t.name}),e.jsx("div",{className:`font-display font-black tabular-nums leading-none mt-0.5 ${a===1?"text-lg sm:text-2xl":"text-sm sm:text-lg"} ${d.text}`,children:t.score.toLocaleString("pt-BR")}),e.jsxs("div",{className:"text-[9px] sm:text-[10px] font-mono text-ink-3 mt-0.5",children:["Lv ",t.level," · W",t.wave]}),e.jsxs("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 px-2 py-0.5 border-2 border-ink bg-paper font-display font-black text-xs",style:{color:c},children:["#",a]})]})}function fr(t){return t>=25e3?{text:"text-ink-violet"}:t>=1e4?{text:"text-ink-violet"}:t>=5e3?{text:"text-ink-cinnabar"}:t>=2e3?{text:"text-ink-mustard"}:t>=500?{text:"text-ink-jade"}:{text:"text-ink"}}const br=7e3,Qe=1600,ka=5,hr=2200,gr={"oni-blot-family":"blob-horn","karakasa-family":"umbrella","nure-onna-family":"serpent","mokumokuren-family":"eye-wall","tengu-family":"beak-wing"},Ce=[...Ot].sort((t,a)=>t.trailOrder-a.trailOrder);function kr(){const[t,a]=l.useState(0),[s,n]=l.useState("hold"),r=l.useRef(null),c=l.useRef([]),d=l.useRef(-1),i=l.useMemo(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]);l.useEffect(()=>{if(i)return;let h,f;const k=()=>{h=window.setTimeout(()=>{n("fade"),f=window.setTimeout(()=>{a(w=>(w+1)%Ce.length),n("hold"),k()},Qe)},br)};return k(),()=>{window.clearTimeout(h),window.clearTimeout(f)}},[i]),l.useEffect(()=>{if(i||d.current===t)return;d.current=t;const h=Ce[t],f=h.cardHeroFamilyIds.length?h.cardHeroFamilyIds:["oni-blot-family"];performance.now();for(let k=0;k<ka;k++){const w=k/ka*hr+Math.random()*200,u=f[k%f.length],N=gr[u]??"blob-horn";window.setTimeout(()=>{c.current.push(vr(N,performance.now()))},w)}},[t,i]),l.useEffect(()=>{const h=r.current;if(!h)return;const f=h.getContext("2d");if(!f)return;let k=0,w=performance.now(),u=!0;const N=()=>{const b=Math.min(window.devicePixelRatio||1,2),y=h.clientWidth,C=h.clientHeight;h.width=Math.max(1,Math.floor(y*b)),h.height=Math.max(1,Math.floor(C*b)),f.setTransform(b,0,0,b,0,0)};N();const j=new ResizeObserver(()=>{requestAnimationFrame(N)});j.observe(h);const I=()=>{document.hidden?u=!1:u||(u=!0,w=performance.now(),S(w))};document.addEventListener("visibilitychange",I);const S=b=>{if(!u)return;const y=Math.min(.05,(b-w)/1e3);w=b;const C=h.clientWidth,$=h.clientHeight;f.clearRect(0,0,C,$);const A=c.current;for(let _=A.length-1;_>=0;_--){const P=A[_],U=(b-P.born)/1e3;P.y+=P.vy*y,P.x+=P.vx*y+Math.sin(U*.8+P.swayPhase)*P.swayAmp*y,P.spin+=P.spinV*y;const V=(b-P.born)/P.life;let Y=1;if(V<.1?Y=V/.1:V>.85&&(Y=Math.max(0,(1-V)/.15)),P.y>1.15||V>=1){A.splice(_,1);continue}jr(f,P,C,$,Y)}k=requestAnimationFrame(S)};return k=requestAnimationFrame(S),()=>{u=!1,cancelAnimationFrame(k),j.disconnect(),document.removeEventListener("visibilitychange",I)}},[]);const p=Ce[t],m=Ce[(t+1)%Ce.length],g=ua[p.id],x=ua[m.id];
2return e.jsxs("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:[g&&e.jsx("img",{src:g.src,alt:"",draggable:!1,className:"absolute inset-0 w-full h-full object-cover select-none",style:{objectPosition:g.position??"center",opacity:s==="fade"?0:.55,transform:`scale(${(g.scale??1)*1.08})`,transition:`opacity ${Qe}ms ease`,animation:"menubg-kenburns 16s ease-in-out both",filter:"grayscale(0.55) contrast(1.1) brightness(0.7)"}},`a-${p.id}-${t}`),x&&s==="fade"&&e.jsx("img",{src:x.src,alt:"",draggable:!1,className:"absolute inset-0 w-full h-full object-cover select-none",style:{objectPosition:x.position??"center",opacity:.55,transform:`scale(${(x.scale??1)*1.04})`,transition:`opacity ${Qe}ms ease`,animation:`menubg-fadein ${Qe}ms ease both`,filter:"grayscale(0.55) contrast(1.1) brightness(0.7)"}},`b-${m.id}-${t}`),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(11,11,14,0.25) 0%, rgba(11,11,14,0.85) 78%)"}}),e.jsx("canvas",{ref:r,className:"absolute inset-0 w-full h-full pointer-events-none",style:{mixBlendMode:"multiply",opacity:.78}}),e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.07]",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1.5px)",backgroundSize:"10px 10px"}}),e.jsxs("div",{className:"absolute bottom-2 left-2 right-2 z-10 pointer-events-none flex justify-between items-end font-mono text-[10px] uppercase tracking-widest text-paper/55",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"text-paper/40 tabular-nums",children:[String(p.trailOrder).padStart(2,"0")," / ",Ce.length]}),e.jsx("span",{className:"text-paper/80 font-display text-xs font-black",children:p.displayName}),e.jsx("span",{className:"text-paper/40 italic normal-case tracking-wide max-w-[60vw] truncate",children:Rt[p.id]??""})]}),e.jsxs("span",{className:"hidden sm:inline text-paper/30",children:["próx · ",m.displayName]})]}),e.jsx("style",{children:`
3        @keyframes menubg-kenburns {
4          0%   { transform: scale(1.04) translate(0, 0); }
5          100% { transform: scale(1.14) translate(-2%, 1%); }
6        }
7        @keyframes menubg-fadein {
8          0%   { opacity: 0; }
9          100% { opacity: 0.55; }
10        }
11      `})]})}function vr(t,a){const s=Math.random()<.5;return{shape:t,x:s?-.05+Math.random()*.15:.9+Math.random()*.15,y:-.1-Math.random()*.1,vy:.06+Math.random()*.05,vx:(s?1:-1)*(.015+Math.random()*.025),swayPhase:Math.random()*Math.PI*2,swayAmp:.04+Math.random()*.06,size:38+Math.random()*32,spin:(Math.random()-.5)*.4,spinV:(Math.random()-.5)*.3,born:a,life:14e3+Math.random()*4e3,ink:.05+Math.random()*.2}}function jr(t,a,s,n,r){const c=a.x*s,d=a.y*n,i=a.size*(n/900);t.save(),t.translate(c,d),t.rotate(a.spin),t.globalAlpha=r*.9;const p=Math.round(a.ink*255),m=`rgb(${p},${p},${p})`,g="rgba(8,8,10,0.85)";switch(a.shape){case"blob-horn":yr(t,i,m,g);break;case"umbrella":wr(t,i,m,g);break;case"serpent":Nr(t,i,m,g);break;case"eye-wall":Sr(t,i,m,g);break;case"beak-wing":Cr(t,i,m,g);break}t.restore()}function yr(t,a,s,n){t.fillStyle=s,t.strokeStyle=n,t.lineWidth=Math.max(1.5,a*.06),t.beginPath(),t.moveTo(-a,a*.2),t.bezierCurveTo(-a*1.1,-a*.8,-a*.4,-a*1.1,0,-a*.9),t.bezierCurveTo(a*.5,-a*1.1,a*1.1,-a*.6,a,a*.2),t.bezierCurveTo(a*1.1,a,a*.4,a*1.2,0,a),t.bezierCurveTo(-a*.6,a*1.2,-a*1.1,a*.8,-a,a*.2),t.closePath(),t.fill(),t.stroke(),t.beginPath(),t.moveTo(-a*.45,-a*.85),t.lineTo(-a*.3,-a*1.45),t.lineTo(-a*.05,-a*.85),t.closePath(),t.moveTo(a*.05,-a*.85),t.lineTo(a*.3,-a*1.45),t.lineTo(a*.45,-a*.85),t.closePath(),t.fill(),t.stroke(),t.fillStyle="#f5f0e0",t.beginPath(),t.arc(0,-a*.1,a*.18,0,Math.PI*2),t.fill(),t.fillStyle="#0a0a0a",t.beginPath(),t.arc(0,-a*.1,a*.09,0,Math.PI*2),t.fill()}function wr(t,a,s,n){t.fillStyle=s,t.strokeStyle=n,t.lineWidth=Math.max(1.5,a*.06),t.beginPath(),t.moveTo(0,0),t.lineTo(a*.12,a*1.3),t.lineTo(a*.45,a*1.45),t.lineTo(a*.35,a*1.55),t.lineTo(-a*.05,a*1.4),t.closePath(),t.fill(),t.stroke(),t.beginPath(),t.moveTo(-a*1.1,0),t.quadraticCurveTo(0,-a*1.2,a*1.1,0),t.lineTo(a*.95,a*.15),t.quadraticCurveTo(0,-a*.55,-a*.95,a*.15),t.closePath(),t.fill(),t.stroke(),t.beginPath();for(let r=-2;r<=2;r++)t.moveTo(0,-a*.05),t.lineTo(r*a*.45,a*.05);t.stroke(),t.fillStyle="#f5f0e0",t.beginPath(),t.arc(0,a*.35,a*.16,0,Math.PI*2),t.fill(),t.fillStyle="#0a0a0a",t.beginPath(),t.arc(0,a*.35,a*.08,0,Math.PI*2),t.fill()}function Nr(t,a,s,n){t.fillStyle=s,t.strokeStyle=n,t.lineWidth=Math.max(2,a*.18),t.lineCap="round",t.beginPath(),t.moveTo(-a*.9,-a*.7),t.bezierCurveTo(-a*.2,-a*.4,a*.2,a*.2,a*.9,a*.4),t.stroke(),t.fillStyle=s,t.beginPath(),t.ellipse(a*.95,a*.45,a*.32,a*.22,.4,0,Math.PI*2),t.fill(),t.stroke(),t.fillStyle="#f5f0e0",t.beginPath(),t.arc(a*1.05,a*.4,a*.08,0,Math.PI*2),t.fill(),t.fillStyle="#0a0a0a",t.beginPath(),t.arc(a*1.07,a*.4,a*.04,0,Math.PI*2),t.fill()}function Sr(t,a,s,n){t.fillStyle=s,t.strokeStyle=n,t.lineWidth=Math.max(1.5,a*.06);const r=a*.18;t.beginPath(),t.moveTo(-a+r,-a),t.lineTo(a-r,-a),t.quadraticCurveTo(a,-a,a,-a+r),t.lineTo(a,a-r),t.quadraticCurveTo(a,a,a-r,a),t.lineTo(-a+r,a),t.quadraticCurveTo(-a,a,-a,a-r),t.lineTo(-a,-a+r),t.quadraticCurveTo(-a,-a,-a+r,-a),t.closePath(),t.fill(),t.stroke(),t.beginPath(),t.moveTo(0,-a),t.lineTo(0,a),t.moveTo(-a,0
11),t.lineTo(a,0),t.stroke();const c=[[-a*.5,-a*.5],[a*.5,-a*.5],[-a*.5,a*.5],[a*.5,a*.5],[0,0]];for(const[d,i]of c)t.fillStyle="#f5f0e0",t.beginPath(),t.arc(d,i,a*.13,0,Math.PI*2),t.fill(),t.fillStyle="#0a0a0a",t.beginPath(),t.arc(d,i+a*.02,a*.06,0,Math.PI*2),t.fill()}function Cr(t,a,s,n){t.fillStyle=s,t.strokeStyle=n,t.lineWidth=Math.max(1.5,a*.06),t.beginPath(),t.moveTo(0,0),t.quadraticCurveTo(-a*1.3,-a*.2,-a*1.5,a*.4),t.quadraticCurveTo(-a*.8,a*.1,0,a*.2),t.closePath(),t.fill(),t.stroke(),t.beginPath(),t.moveTo(0,0),t.quadraticCurveTo(a*1.3,-a*.2,a*1.5,a*.4),t.quadraticCurveTo(a*.8,a*.1,0,a*.2),t.closePath(),t.fill(),t.stroke(),t.beginPath(),t.ellipse(0,-a*.1,a*.4,a*.55,0,0,Math.PI*2),t.fill(),t.stroke(),t.beginPath(),t.moveTo(0,-a*.2),t.lineTo(0,-a*.95),t.lineTo(a*.18,-a*.25),t.closePath(),t.fill(),t.stroke(),t.fillStyle="#f5f0e0",t.beginPath(),t.arc(a*.15,-a*.05,a*.08,0,Math.PI*2),t.fill(),t.fillStyle="#0a0a0a",t.beginPath(),t.arc(a*.17,-a*.05,a*.04,0,Math.PI*2),t.fill()}function Mr({profile:t,onStart:a,onTraining:s,onOpenPanel:n,isFullscreen:r,onToggleFullscreen:c}){const[d,i]=l.useState(!1),[p,m]=l.useState(0),[g,x]=l.useState(!1),[h,f]=l.useState(null),[k,w]=l.useState("start");l.useEffect(()=>{const S=window.setTimeout(()=>i(!0),40);try{m(pe().coins);const b=!!Ra();x(b),w(b?"start":"maps")}catch{}return()=>window.clearTimeout(S)},[]);const u=S=>{h||S==="training"&&!s||(w(S),f(S),window.setTimeout(()=>{S==="start"?a():S==="training"?s?.():n(S)},280))};l.useEffect(()=>{const S=b=>{b.key==="Enter"&&(b.preventDefault(),u(k))};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[k,h]);const N=[{key:"maps",label:"Mapas",kana:"マップ",icon:e.jsx(Mn,{size:16}),accent:"bg-paper",desc:"trilha 10 mapas"},{key:"loadout",label:"Loadout",kana:"ロードアウト",icon:e.jsx(Bt,{size:16}),accent:"bg-paper",desc:"arma starter + buffs"},{key:"store",label:"Loja",kana:"ストア",icon:e.jsx(te,{size:16}),accent:"bg-postit-mustard",desc:"comprar armas / passivas"},{key:"passives",label:"Passivas",kana:"パッシブ",icon:e.jsx(ot,{size:16}),accent:"bg-postit-jade",desc:"árvore de skills"},{key:"ranking",label:"Ranking",kana:"ランキング",icon:e.jsx(Fe,{size:16}),accent:"bg-paper",desc:"top caçadores global"},{key:"catalog",label:"Catálogo",kana:"ズカン",icon:e.jsx(Lt,{size:16}),accent:"bg-postit-violet text-paper",desc:"bestiário · armas · fx"},{key:"manga",label:"Mangá",kana:"マンガ",icon:e.jsx(Lt,{size:16}),accent:"bg-postit-cinnabar text-paper",desc:"álbum de descobertas · ganha moedas"},{key:"profile",label:"Perfil",kana:"プロフィール",icon:e.jsx(Wt,{size:16}),accent:"bg-paper",desc:"nome · foto · login"},{key:"training",label:"Treino",kana:"トレーニング",icon:e.jsx(vn,{size:16}),accent:"bg-paper",desc:s?"área de treino · tudo destravado · não-rankeado":"🔒 capstone na árvore de passivas",locked:!s}],j=S=>h===S,I=S=>k===S;return e.jsxs("div",{role:"dialog","aria-label":"Mock Dream — menu",className:"absolute inset-0 z-30 flex items-center justify-center px-3 py-4 overflow-y-auto bg-ink",children:[e.jsx(kr,{}),c&&e.jsxs("button",{type:"button",onClick:c,title:r?"sair de tela cheia":"tela cheia","aria-label":r?"sair de tela cheia":"tela cheia",className:`absolute top-3 right-3 z-10 inline-flex items-center gap-1.5 border-2 border-ink ${r?"bg-postit-cobalt text-paper":"bg-paper text-ink"} px-2.5 py-1.5 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform`,children:[r?e.jsx(dn,{size:12}):e.jsx(pn,{size:12}),r?"sair":"full"]}),e.jsxs("div",{className:"relative w-full max-w-[640px] flex flex-col items-center text-center my-auto",style:{opacity:d?1:0,transform:d?"translateY(0) scale(1)":"translateY(12px) scale(0.96)",transition:"opacity 480ms ease, transform 520ms cubic-bezier(.2,.7,.2,1)"},children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:ln,alt:"MD",draggable:!1,className:"w-24 sm:w-32 animate-[float_3.5s_ease-in-out_infinite] select-none",style:{filter:"drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 2px #fff) drop-shadow(6px 6px 0 rgba(0,0,0,0.55))"}}),d&&e.jsx("div",{className:"absolute -top-2 -right-6 pointer-events-none",children:e.jsx(he,{text:"ふわ",tone:"cobalt"})})]}),e.jsx("p",{className:"mt-2 font-mono text-[10px] uppercase tracking-[0.4em] text-paper/60",children:"エムディ · ドリフト"}),e.jsx("h1",{className:"font-display text-2xl sm:text-4xl font-black text-paper leading-none mt-1",children:"MD’s DRIFT"}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-[11px] font-mono uppercase tracking-wider",children:[e.jsx("span",{className:"border-2 border-paper/40 bg-ink text-paper px-2 py-1",children:t?.displayName??"convidado"}),e.jsxs("span",{className:"border-2 border-paper/40 bg-postit-mustard text-ink px-2 py-1 tabular-nums",children:["¥ ",p]})]}),e.jsx("button",{onClick:()=>u("start"),onMouseEnter:()=>w("start"),onFocus:()=>w("start"),disabled:!!h,autoFocus:!0,className:`mt-5 w-full inline-flex items-center justify-center gap-3 border-2 border-ink bg-postit-cinnabar text-paper px-6 py-4 font-display text-xl sm:text-2xl font-black uppercase tracking-wider shadow-[6px_6px_0_0_rgba(0,0,0,0.6)] hover:-translate-y-[2px] hover:shadow-[8px_8px_0_0_rgba(0,0,0,0.7)] transition-all disabled:opacity-80 disabled:hover:translate-y-0 ${I("start")?"outline outline-2 outline-offset-[3px] outline-paper":""}`,children:j("start")?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{size:22,className:"animate-spin"}),"carregando…"]}
11):e.jsxs(e.Fragment,{children:[e.jsx(it,{size:22,fill:"currentColor"}),g?"começar run":"escolher mapa"]})}),e.jsx("div",{className:"mt-4 grid grid-cols-2 sm:grid-cols-4 gap-2 w-full",children:N.map(S=>{const b=j(S.key),y=I(S.key);return e.jsxs("button",{onClick:()=>u(S.key),onMouseEnter:()=>w(S.key),onFocus:()=>w(S.key),disabled:!!h||!!S.locked,className:`group relative border-2 border-ink ${S.accent} px-2 py-3 font-display text-xs sm:text-sm font-black uppercase tracking-wider shadow-flat transition-all flex flex-col items-center gap-1.5 disabled:opacity-80 ${S.locked?"opacity-50 border-dashed cursor-not-allowed":""} ${y&&!S.locked?"-translate-y-[1px] outline outline-2 outline-offset-[3px] outline-paper shadow-[4px_4px_0_0_rgba(0,0,0,0.6)]":"hover:-translate-y-[1px]"} ${b?"animate-pulse":""}`,title:S.desc,"aria-pressed":y,"aria-busy":b,children:[e.jsx("span",{className:"absolute top-0.5 right-1 font-serif text-[8px] tracking-widest opacity-50",children:S.kana}),b?e.jsx(Tt,{size:16,className:"animate-spin"}):S.icon,e.jsx("span",{children:b?"abrindo…":S.label})]},S.key)})}),e.jsx("p",{className:"mt-4 font-mono text-[10px] uppercase tracking-widest text-paper/40",children:"enter · abrir selecionado   ·   esc fecha painéis"})]}),e.jsx("style",{children:`
12        @keyframes float {
13          0%, 100% { transform: translateY(0); }
14          50% { transform: translateY(-8px); }
15        }
16      `})]})}const $r={paper:"bg-paper-2",cinnabar:"bg-postit-cinnabar text-paper",mustard:"bg-postit-mustard",jade:"bg-postit-jade",violet:"bg-postit-violet text-paper"};function ie({title:t,kana:a,onBack:s,children:n,accent:r="paper",headerRight:c,contentPad:d="comum"}){const[i,p]=l.useState(!0);return l.useEffect(()=>{const m=window.setTimeout(()=>p(!1),320);return()=>window.clearTimeout(m)},[]),l.useEffect(()=>{const m=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),s())};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[s]),e.jsxs("div",{role:"dialog","aria-label":t,className:"absolute inset-0 z-40 flex flex-col bg-paper text-ink overflow-hidden animate-fade-in",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-[0.06] pointer-events-none",style:{backgroundImage:"radial-gradient(#0b0b0e 1px, transparent 1.5px)",backgroundSize:"12px 12px"}}),e.jsxs("header",{className:`relative z-10 flex items-center justify-between gap-3 border-b-2 border-ink px-4 py-3 ${$r[r]}`,children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1 border-2 border-ink bg-paper text-ink px-2.5 py-1.5 text-xs font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform","aria-label":"voltar pro menu",children:[e.jsx(mn,{size:12})," menu"]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.25em] opacity-60 truncate",children:a}),e.jsx("h2",{className:"font-display text-xl sm:text-2xl font-black leading-none truncate",children:t})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c,e.jsx("button",{type:"button",onClick:s,className:"hidden sm:inline-flex h-8 w-8 items-center justify-center border-2 border-ink bg-paper text-ink shadow-flat hover:-translate-y-[1px] transition-transform","aria-label":"fechar",children:e.jsx(xn,{size:14})})]})]}),e.jsxs("div",{className:`relative z-10 flex-1 min-h-0 overflow-y-auto ${d==="comum"?"px-4 sm:px-6 py-5":""}`,children:[e.jsx("div",{className:i?"opacity-0":"animate-fade-in","aria-busy":i,children:n}),i&&e.jsxs("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-paper/60 backdrop-blur-[1px]",children:[e.jsx(Tt,{size:28,className:"animate-spin text-ink"}),e.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-ink/60",children:["carregando ",t.toLowerCase(),"…"]})]})]}),e.jsxs("footer",{className:"relative z-10 border-t border-ink/20 bg-paper-2/70 px-4 py-1.5 font-mono text-[9px] uppercase tracking-widest text-ink/50 flex items-center justify-between",children:[e.jsx("span",{children:"esc · voltar"}),e.jsx("span",{className:"opacity-60",children:a})]})]})}const Ir={normal:"N",medium:"M",hard:"H",endless:"∞"},Er={normal:"Normal",medium:"Médio",hard:"Difícil",endless:"Infinito"},va={normal:1,medium:2,hard:3,endless:4},Pr={coins:0,ownedWeaponIds:[],ownedPassiveIds:[],disabledWeaponIds:[],disabledPassiveIds:[],mapProgress:{},ownedCharacterIds:["md-classic"],disabledCharacterIds:[],activeCharacterId:"md-classic"};function _r({onBack:t,onOpenPanel:a}){const[s,n]=l.useState(Pr),[r,c]=l.useState(()=>xa());l.useEffect(()=>(n(pe()),Ve(n)),[]),l.useEffect(()=>(c(xa()),on(c)),[]);const d=l.useMemo(()=>[...r].sort((x,h)=>
16x.trailOrder-h.trailOrder),[r]),i=l.useMemo(()=>{const x=new Set;let h=!0;for(const f of d)h&&x.add(f.id),h=!!s.mapProgress[f.id];return x},[d,s.mapProgress]),p=d.filter(x=>s.mapProgress[x.id]).length,m=d.filter(x=>s.mapProgress[x.id]==="endless").length,g=(x,h)=>{try{localStorage.setItem("md.meta.activeMap",x),nn(h)}catch{}a("loadout")};return e.jsx(ie,{title:"Caminho do Pincel",kana:"マップ · trilha",accent:"cinnabar",onBack:t,headerRight:e.jsxs("div",{className:"hidden md:flex items-center gap-2 font-mono text-[10px] uppercase tracking-wider",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-mustard text-ink px-2 py-1 shadow-flat",children:[e.jsx(te,{size:11}),e.jsx("span",{className:"font-bold tabular-nums",children:s.coins})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-jade text-ink px-2 py-1 shadow-flat",children:[e.jsx(ot,{size:11}),e.jsxs("span",{className:"font-bold tabular-nums",children:[p,"/",d.length]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-violet text-paper px-2 py-1 shadow-flat",children:[e.jsx(Fe,{size:11}),e.jsx("span",{className:"font-bold tabular-nums",children:m})]})]}),children:e.jsx("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:d.map(x=>{const h=ws[x.biomeId],k=x.cardHeroFamilyIds.map(N=>Ba(N)).filter(Boolean)[0],w=i.has(x.id),u=s.mapProgress[x.id]??null;return e.jsx(Lr,{mapId:x.id,order:x.trailOrder,name:x.displayName,tagline:Rt[x.id]??"",paper:h?.palette.paper??"#f5f0e6",accent:h?.palette.accent??"#b9382f",haze:h?.palette.haze??"#dcd3c2",bossName:k?.displayName??"Boss",unlocked:w,progress:u,onLaunch:N=>g(x.id,N)},x.id)})})})}function Lr({mapId:t,order:a,name:s,tagline:n,paper:r,accent:c,haze:d,bossName:i,unlocked:p,progress:m,onLaunch:g}){const x=["normal","medium","hard","endless"],h=m?va[m]:0,f=cn(t);return e.jsxs("article",{className:ge("relative border-2 border-ink shadow-flat-lg overflow-hidden flex flex-col",!p&&"opacity-70"),style:{background:r},children:[e.jsxs("div",{className:"relative aspect-[4/3] border-b-2 border-ink overflow-hidden",style:{background:`linear-gradient(180deg, ${d} 0%, ${r} 100%)`},children:[f&&e.jsxs(e.Fragment,{children:[e.jsx("img",{src:f.src,alt:"","aria-hidden":!0,draggable:!1,className:"absolute inset-0 h-full w-full pointer-events-none select-none",style:{objectFit:f.fit??"cover",objectPosition:f.position??"center",transform:f.scale&&f.scale!==1?`scale(${f.scale})`:void 0,transformOrigin:"center"}}),f.tint&&f.tint>0?e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 pointer-events-none mix-blend-multiply",style:{background:c,opacity:f.tint}}):null]}),e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-50 mix-blend-multiply pointer-events-none",style:{backgroundImage:`radial-gradient(circle, ${c}55 1px, transparent 1.4px)`,backgroundSize:"9px 9px"}}),e.jsx("div",{"aria-hidden":!0,className:"absolute top-0 left-0 right-0 h-1.5",style:{background:c}}),e.jsx("span",{className:"absolute top-2 left-2 grid h-10 w-10 place-items-center border-2 border-ink bg-paper font-display text-xl font-black",style:{color:c},children:String(a).padStart(2,"0")}),!p&&e.jsx("div",{className:"absolute inset-0 grid place-items-center bg-ink/55 text-paper p-3 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(ve,{size:26,strokeWidth:2.5}),e.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-widest leading-tight",children:["conclua o mapa anterior",e.jsx("br",{}),"(derrote o boss da wave 15",e.jsx("br",{}),"em qualquer dificuldade)"]})]})})]}),e.jsxs("div",{className:"p-3 flex flex-col gap-2 flex-1",children:[e.jsx("h3",{className:"font-display text-base font-black leading-tight",children:s}),e.jsx("p",{className:"text-[11px] text-ink/70 italic leading-snug min-h-[2.2em]",children:n}),e.jsxs("div",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/60 flex flex-wrap gap-x-2 gap-y-0.5",children:[e.jsxs("span",{children:["boss: ",e.jsx("span",{className:"text-ink font-bold",children:i})]}),e.jsx("span",{children:"· 15 waves até o boss"})]}),e.jsx("div",{className:"mt-2 grid grid-cols-4 gap-1.5",children:x.map(k=>{const w=va[k],u=h>=w,N=p&&(w===1||h>=w-1);return e.jsx("button",{type:"button",disabled:!N,onClick:()=>N&&g(k),title:`${Er[k]}`,className:ge("h-10 border-2 border-ink font-display text-lg font-black grid place-items-center transition-transform",u&&"bg-postit-jade text-ink shadow-flat hover:-translate-y-[1px]",!u&&N&&"bg-paper text-ink hover:-translate-y-[1px] shadow-flat",!N&&"bg-paper-2 text-ink/30 cursor-not-allowed"),children:Ir[k]},k)})}),e.jsxs("button",{type:"button",disabled:!p,onClick:()=>p&&g("normal"),className:ge("mt-2 inline-flex items-center justify-center gap-1.5 border-2 border-ink px-3 py-2 font-display text-sm font-bold shadow-flat transition-transform",p?"bg-ink text-paper hover:-translate-y-[1px]":"bg-paper-2 text-ink/40 cursor-not-allowed"),children:[e.jsx(it,{size:13,fill:"
16currentColor"}),p?"jogar normal":"bloqueado"]})]})]})}const ja="md.meta.starterWeapon";function Tr({onBack:t,onOpenPanel:a,onConfirm:s}){const[n,r]=l.useState(()=>pe()),[c,d]=l.useState("hissen");l.useEffect(()=>{try{const f=localStorage.getItem(ja);f&&d(f)}catch{}return Ve(r)},[]);const i=Oa(),p=Da()??"normal",m=Fa[p],g=It(),x=l.useMemo(()=>{const f=new Set(n.disabledWeaponIds??[]),k=n.ownedWeaponIds.filter(w=>!f.has(w)).map(w=>_t[w]).filter(Boolean);return k.length>0?k:n.ownedWeaponIds.map(w=>_t[w]).filter(Boolean)},[n.ownedWeaponIds,n.disabledWeaponIds]),h=()=>{try{localStorage.setItem(ja,c)}catch{}s()};return e.jsx(ie,{title:"Loadout",kana:"ロードアウト · loadout",accent:"paper",onBack:t,children:i?e.jsxs("div",{className:"grid lg:grid-cols-[1.2fr_1fr] gap-6 max-w-5xl mx-auto",children:[e.jsxs("article",{className:"relative border-2 border-ink bg-paper shadow-[6px_6px_0_0_rgba(11,11,14,0.5)]",children:[e.jsx("span",{className:"absolute top-2 right-3 font-serif text-[10px] tracking-widest text-ink/40",children:"マップ"}),e.jsxs("header",{className:"px-4 py-3 border-b border-ink/40",children:[e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50",children:"mapa selecionado"}),e.jsx("h3",{className:"font-display text-2xl font-black leading-tight",children:i.displayName}),e.jsxs("p",{className:"text-xs italic text-ink/70 mt-1",children:["bioma · ",i.biomeId]})]}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50 mb-1",children:"tier"}),e.jsx(Ar,{tier:p})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[e.jsx(se,{label:"HP inimigos",value:`×${m.hp.toFixed(2)}`}),e.jsx(se,{label:"Moedas",value:`×${m.coin.toFixed(2)}`}),e.jsx(se,{label:"Affixes",value:`+${m.affixBonus}`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50 mb-1",children:"famílias"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.cardHeroFamilyIds.map(f=>e.jsx("span",{className:"border border-ink/40 px-2 py-0.5 text-[10px] font-mono",children:f.replace("-family","")},f))})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("article",{className:"relative border-2 border-ink bg-paper shadow-flat",children:[e.jsxs("header",{className:"px-4 py-3 border-b border-ink/40 flex items-center gap-2",children:[e.jsx(Bt,{size:16}),e.jsx("p",{className:"font-display font-black",children:"Arma starter"})]}),e.jsx("div",{className:"p-3 grid grid-cols-2 gap-2",children:x.map(f=>e.jsxs("button",{type:"button",onClick:()=>d(f.id),className:`text-left border-2 border-ink p-2 shadow-flat transition-transform hover:-translate-y-[1px] ${c===f.id?"bg-postit-cinnabar text-paper":"bg-paper"}`,children:[e.jsx("p",{className:"font-display font-black text-xs",children:f.name.split(" · ")[0]}),e.jsxs("p",{className:"text-[10px] font-mono uppercase opacity-70",children:[f.family," · ",f.function]})]},f.id))}),x.length===1&&e.jsxs("p",{className:"px-3 pb-3 text-[10px] text-ink/60",children:["Compra mais armas na"," ",e.jsx("button",{type:"button",onClick:()=>a("store"),className:"underline",children:"loja"}),"."]})]}),e.jsxs("article",{className:"border-2 border-ink bg-paper-2 p-3 shadow-flat",children:[e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50 mb-2",children:"buffs ativos"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-[11px]",children:[e.jsx(se,{label:"HP",value:wt(g?.maxHpMul)}),e.jsx(se,{label:"DMG",value:wt(g?.damageMul)}),e.jsx(se,{label:"AoE",value:wt(g?.aoeMul)}),e.jsx(se,{label:"Pierce",value:`+${g?.pierceAdd??0}`}),e.jsx(se,{label:"Proj",value:`+${g?.projAdd??0}`}),e.jsx(se,{label:"Coin",value:`×${(g?.coinMul??1).toFixed(2)}`})]})]}),e.jsxs("button",{type:"button",onClick:h,className:"w-full inline-flex items-center justify-center gap-3 border-2 border-ink bg-postit-cinnabar text-paper px-6 py-4 font-display text-xl font-black uppercase tracking-wider shadow-[6px_6px_0_0_rgba(11,11,14,0.5)] hover:-translate-y-[2px] hover:shadow-[8px_8px_0_0_rgba(11,11,14,0.6)] transition-all",children:[e.jsx(it,{size:22})," entrar na run"]})]})]}):e.jsxs("div",{className:"max-w-md mx-auto text-center border-2 border-ink bg-paper p-8 shadow-flat",children:[e.jsx("p",{className:"font-display text-xl font-black",children:"Nenhum mapa selecionado"}),e.jsx("p",{className:"text-sm text-ink/60 mt-2",children:"Volta pra trilha e escolhe um."}),e.jsx("button",{type:"button",onClick:()=>a("maps"),className:"mt-4 inline-block border-2 border-ink bg-postit-cinnabar text-paper px-4 py-2 text-xs font-mono uppercase tracking-wider shadow-flat",children:"ir pra trilha →"})]})})}const ya={normal:{bg:"bg-postit-jade",label:"Normal"},medium:{bg:"bg-postit-mustard",label:"Médio"},hard:{bg:"bg-postit-cinnabar text-paper",label:"Difícil"},endless:{bg:"bg-postit-violet text-paper",label:"∞ Endless"}};function Ar({tier:t}){return e.jsx("span",{className:`inline-block border-2 border-ink px-3 py-1 text-xs font-display font-black uppercase shadow-flat ${ya[t].bg}`,children:ya[t].label})}function se({label:t,value:a}){return e.jsxs("div",{className:"border border-ink/30 bg-paper px-2 py-1",children:[e.jsx("p",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/50",children:t}),e.jsx("p",{className:"font-display font-black text-sm tabular-nums",children:a})]})}function wt(t){const a=t??0;return`${a>=0?"+":""}${Math.round(a*100)}%`}function zr({onBack:t,onOpenPanel:a}){const[s,n]=l.useState("weapons"),[r,c]=l.useState(()=>pe());l.useEffect(()=>Ve(c),[]);function d(i){if(i==="passives"){a("passives");return}n(i)}return e.jsx(ie,{title:"Loja",kana:"ストア · meta",accent:"mustard",onBack:t,headerRight:e.jsxs("span",{className:"inline-flex items-center gap-1 border-2 border-ink bg-paper text-ink px-2 py-1 shadow-flat font-mono text-[11px]",children:[e.jsx(te,{size:11}),e.jsx("span",{className:"font-bold tabular-nums",children:r.coins})]}),children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-6 flex-wrap",children:[e.jsx(Nt,{active:s==="weapons",onClick:()=>d("weapons"),icon:e.jsx(Bt,{size:16}),label:"Armas",kana:"ブキ"}),e.jsx(Nt,{active:!1,onClick:()=>d("passives"),icon:e.jsx(ot,{size:16}),label:"Passivas",kana:"パッシブ · árvore"}),e.jsx(Nt,{active:s==="characters",onClick:()=>d("characters"),icon:e.jsx(Wt,{size:16}),label:"Personagens",kana:"キャラ"})]}),s==="weapons"&&e.jsx(Rr,{wallet:r}),s==="characters"&&e.jsx(Dr,{wallet:r})]})})}function Nt({active:t,onClick:a,icon:s,label:n,kana:r}){return e.jsxs("button",{type:"button",onClick:a,className:`relative inline-flex items-center gap-2 border-2 border-ink px-4 py-2 text-sm font-display font-black shadow-flat transition-transform hover:-translate-y-[1px] ${t?"bg-postit-cinnabar text-paper":"bg-paper text-ink"}`,children:[s,e.jsx("span",{children:n}),e.jsx("span",{className:`text-[10px] font-mono tracking-widest ${t?"text-paper/70":"text-ink/40"}`,children:r})]})}function Rr({wallet:t}){const a=De.weaponShop,s=new Set(t.disabledWeaponIds??[]);return e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(n=>{const r=_t[n.weaponId],c=t.ownedWeaponIds.includes(n.weaponId),d=t.coins>=n.cost&&!c,i=c&&!s.has(n.weaponId);return e.jsxs("article",{className:`relative bg-paper border-2 border-ink shadow-[4px_4px_0_0_rgba(11,11,14,0.5)] transition-opacity ${c&&!i?"opacity-60":""}`,children:[e.jsx("span",{className:"absolute top-1.5 right-2 font-serif text-[10px] tracking-widest text-ink/40",children:r?.kanji}),e.jsxs("header",{className:"px-3 py-2 border-b border-ink/40",children:[e.jsx("h3",{className:"font-display text-base font-black leading-tight",children:n.displayName}),e.jsxs("p",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:[r?.family," · ",r?.function]})]}),e.jsxs("div",{className:"px-3 py-3 space-y-2 min-h-[100px]",children:[e.jsxs("p",{className:"italic text-xs text-ink/70 leading-snug",children:['"',r?.tagline??n.desc,'"']}),e.jsxs("p",{className:"text-xs text-ink/90 leading-snug",children:["→ ",n.desc]})]}),e.jsxs("footer",{className:"px-3 py-2 border-t border-ink/30 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"inline-flex items-center gap-1 font-mono text-xs",children:[e.jsx(te,{size:12}),e.jsx("span",{className:"font-bold tabular-nums",children:n.cost})]}),c?e.jsx(Or,{active:i,onToggle:()=>{const p=Ks(n.weaponId);W.success(`${n.displayName} ${p?"ativada":"desligada"}`)}}):e.jsx("button",{type:"button",disabled:!d,onClick:()=>{const p=Xs(n.weaponId,n.cost);p.ok?W.success(`${n.displayName} destravada!`):p.reason==="not-enough-coins"&&W.error("Moedas insuficientes.")},className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-cinnabar text-paper px-3 py-1 text-[11px] font-mono uppercase tracking-wider shadow-flat disabled:opacity-40 disabled:cursor-not-allowed hover:-translate-y-[1px] transition-transform",children:d?"comprar":e.jsxs(e.Fragment,{children:[e.jsx(ve,{size:10})," trancada"]}
16)})]})]},n.id)})})}function Or({active:t,onToggle:a}){return e.jsxs("button",{type:"button",onClick:a,"aria-pressed":t,title:t?"clique pra desligar":"clique pra ativar",className:`inline-flex items-center gap-1.5 border-2 border-ink px-2 py-1 text-[10px] font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform ${t?"bg-postit-jade text-ink":"bg-paper text-ink/60"}`,children:[t?e.jsx(Ft,{size:12}):e.jsx(Dt,{size:12}),t?"ativa":"desligada"]})}function Dr({wallet:t}){const[a,s]=l.useState(()=>pa());l.useEffect(()=>Os(()=>s(pa())),[]);const n=a.filter(d=>!d.parentId),r=d=>a.filter(i=>i.parentId===d),c=d=>t.ownedCharacterIds.includes(d.id)||d.meta.inShop;return e.jsxs("div",{className:"space-y-6",children:[n.filter(c).map(d=>{const i=r(d.id).filter(c);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(wa,{def:d,wallet:t}),i.length>0&&e.jsxs("div",{className:"ml-6 pl-3 border-l-2 border-ink/30 space-y-2",children:[e.jsxs("p",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:["skins de ",d.name]}),i.map(p=>e.jsx(wa,{def:p,wallet:t,isSkin:!0},p.id))]})]},d.id)}),n.filter(c).length===0&&e.jsx("div",{className:"border-2 border-dashed border-ink/30 p-8 text-center text-xs text-ink/60",children:'Nenhum personagem na loja ainda. Cria um no /lab e marca "Aparece na loja".'})]})}function wa({def:t,wallet:a,isSkin:s}){const n=a.ownedCharacterIds.includes(t.id),r=a.disabledCharacterIds.includes(t.id),c=a.activeCharacterId===t.id,d=!n&&a.coins>=t.meta.shopCost;return e.jsxs("article",{className:`relative bg-paper border-2 border-ink shadow-[4px_4px_0_0_rgba(11,11,14,0.5)] flex gap-3 p-3 transition-opacity ${n&&r?"opacity-60":""} ${s?"scale-95":""}`,children:[e.jsx(Fr,{def:t}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[e.jsxs("header",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-display text-base font-black leading-tight truncate",children:t.name}),e.jsxs("p",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:[t.kana??t.dna.baseVariant,s&&" · skin"]})]}),c&&e.jsx("span",{className:"text-[9px] font-bold uppercase border border-ink px-1 py-0.5 bg-postit-jade",children:"ativo"})]}),t.tagline&&e.jsxs("p",{className:"italic text-xs text-ink/70 leading-snug line-clamp-2",children:['"',t.tagline,'"']}),e.jsxs("p",{className:"text-[10px] text-ink/60 mt-auto",children:[t.kit.moveProfile," · ",t.kit.dashAbility," · ",t.kit.passiveTrait]}),e.jsx("footer",{className:"flex items-center justify-between gap-2 mt-1",children:n?e.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[t.id!=="md-classic"&&e.jsxs("button",{type:"button",onClick:()=>{const i=Js(t.id);W.success(`${t.name} ${i?"ativado":"desligado"}`)},className:`inline-flex items-center gap-1 border-2 border-ink px-2 py-1 text-[10px] font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform ${r?"bg-paper/60 text-ink/60":"bg-paper text-ink"}`,children:[r?e.jsx(Dt,{size:11}):e.jsx(Ft,{size:11}),r?"off":"on"]}),e.jsx("button",{type:"button",disabled:c||r,onClick:()=>{Qs(t.id)&&W.success(`${t.name} equipado.`)},className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-jade text-ink px-3 py-1 text-[11px] font-mono uppercase tracking-wider shadow-flat disabled:opacity-40 disabled:cursor-not-allowed hover:-translate-y-[1px] transition-transform",children:c?e.jsxs(e.Fragment,{children:[e.jsx(qe,{size:11})," ativo"]}):"equipar"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"inline-flex items-center gap-1 font-mono text-xs",children:[e.jsx(te,{size:12}),e.jsx("span",{className:"font-bold tabular-nums",children:t.meta.shopCost})]}),e.jsx("button",{type:"button",disabled:!d,onClick:()=>{const i=Gs(t.id,t.meta.shopCost);i.ok?W.success(`${t.name} desbloqueado!`):i.reason==="not-enough-coins"&&W.error("Moedas insuficientes.")},className:"inline-flex items-center gap-1 border-2 border-ink bg-postit-cinnabar text-paper px-3 py-1 text-[11px] font-mono uppercase tracking-wider shadow-flat disabled:opacity-40 disabled:cursor-not-allowed hover:-translate-y-[1px] transition-transform",children:d?"comprar":e.jsxs(e.Fragment,{children:[e.jsx(ve,{size:10})," trancado"]})})]})})]})]})}function Fr({def:t}){const a=l.useRef(null);return l.useEffect(()=>{const s=a.current;if(!s)return;const n=s.getContext("2d");if(!n)return;let r=0;const c=performance.now(),d=()=>{const i=s.clientWidth,p=s.clientHeight,m=window.devicePixelRatio||1;(s.width!==Math.floor(i*m)||s.height!==Math.floor(p*m))&&(s.width=Math.floor(i*m),s.height=Math.floor(p*m),n.setTransform(m,0,0,m,0,0)),n.clearRect(0,0,i,p);const g=(performance.now()-c)/1e3;un(n,i/2,p/2,Math.min(i,p)*.35,g,t,{glow:.3}),r=requestAnimationFrame(d)};return r=requestAnimationFrame(d),()=>cancelAnimationFrame(r)},[t]),e.jsx("div",{className:"shrink-0 w-20 h-20 border-2 border-ink bg-[hsl(40_30%_96%)] overflow-hidden",children:e.jsx("canvas",{ref:a,className:"w-full h-full block"})})}const Br={vitalidade:{bg:"bg-postit-jade",label:"Vitalidade",kana:"ヴィタ",subtitle:"HP · regen · armor · revive"},tinta:{bg:"bg-postit-violet text-paper",label:"Tinta",kana:"スミ",subtitle:"dano 
16· AoE · pierce · crit · projéteis"},sorte:{bg:"bg-postit-mustard",label:"Sorte",kana:"ウン",subtitle:"drop · moedas · XP · reroll"}},Wr={vitalidade:"linear-gradient(180deg, rgba(167,210,182,0.18) 0%, rgba(245,240,228,0.6) 100%)",tinta:"linear-gradient(180deg, rgba(120,90,160,0.14) 0%, rgba(245,240,228,0.55) 100%)",sorte:"linear-gradient(180deg, rgba(232,196,90,0.20) 0%, rgba(245,240,228,0.6) 100%)"};function Hr({branch:t,width:a,height:s}){const n="absolute inset-0 pointer-events-none";return t==="vitalidade"?e.jsxs("svg",{className:n,width:a,height:s,viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"none",children:[e.jsxs("g",{stroke:"#3a7a5a",strokeWidth:"2.5",fill:"none",opacity:"0.16",children:[e.jsx("path",{d:`M ${a*.18} ${s*.55} a 70 70 0 1 1 0.1 0`,strokeLinecap:"round",strokeDasharray:"320 60"}),e.jsx("path",{d:`M ${a*.78} ${s*.32} a 48 48 0 1 1 0.1 0`,strokeLinecap:"round",strokeDasharray:"200 50"})]}),e.jsx("g",{fill:"#3a7a5a",opacity:"0.10",children:[.45,.62,.88].map((r,c)=>e.jsxs("g",{transform:`translate(${a*r}, ${s*(.7+c%2*.1)}) rotate(${c*35})`,children:[e.jsx("ellipse",{cx:"0",cy:"-10",rx:"6",ry:"14"}),e.jsx("ellipse",{cx:"9",cy:"-5",rx:"6",ry:"14",transform:"rotate(40)"}),e.jsx("ellipse",{cx:"-9",cy:"-5",rx:"6",ry:"14",transform:"rotate(-40)"})]},c))})]}):t==="tinta"?e.jsxs("svg",{className:n,width:a,height:s,viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"none",children:[e.jsxs("g",{stroke:"#2a1f3d",strokeLinecap:"round",opacity:"0.14",children:[e.jsx("path",{d:`M ${a*.05} ${s*.85} Q ${a*.3} ${s*.2}, ${a*.55} ${s*.55}`,strokeWidth:"14",fill:"none"}),e.jsx("path",{d:`M ${a*.6} ${s*.15} Q ${a*.75} ${s*.5}, ${a*.95} ${s*.35}`,strokeWidth:"9",fill:"none"})]}),e.jsx("g",{fill:"#2a1f3d",opacity:"0.18",children:[[.12,.3,3],[.22,.7,2],[.4,.18,4],[.55,.78,3],[.7,.42,2.5],[.82,.65,3.5],[.92,.22,2],[.32,.5,1.8],[.48,.92,2.2]].map(([r,c,d],i)=>e.jsx("circle",{cx:a*Number(r),cy:s*Number(c),r:Number(d)},i))}),e.jsx("text",{x:a*.5,y:s*.7,fontFamily:"serif",fontSize:Math.min(s*.9,180),fill:"#2a1f3d",opacity:"0.05",textAnchor:"middle",fontWeight:"900",children:"力"})]}):e.jsxs("svg",{className:n,width:a,height:s,viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"none",children:[e.jsx("defs",{children:e.jsx("pattern",{id:"asanoha",x:"0",y:"0",width:"48",height:"56",patternUnits:"userSpaceOnUse",children:e.jsx("g",{stroke:"#a8821c",strokeWidth:"0.8",fill:"none",opacity:"0.55",children:e.jsx("path",{d:"M24 0 L24 28 M0 14 L48 14 M0 42 L48 42 M24 28 L0 14 M24 28 L48 14 M24 28 L0 42 M24 28 L48 42"})})})}),e.jsx("rect",{x:"0",y:"0",width:a,height:s,fill:"url(#asanoha)",opacity:"0.35"}),e.jsx("g",{opacity:"0.18",children:[[.15,.4],[.78,.6],[.5,.25]].map(([r,c],d)=>e.jsxs("g",{transform:`translate(${a*Number(r)},${s*Number(c)}) rotate(${d*25-15})`,children:[e.jsx("ellipse",{cx:"0",cy:"0",rx:"22",ry:"13",fill:"#c9a84c",stroke:"#7a5d10",strokeWidth:"1.5"}),e.jsx("text",{x:"0",y:"4",fontFamily:"serif",fontSize:"14",fill:"#7a5d10",textAnchor:"middle",fontWeight:"900",children:"両"})]},d))})]})}const at=148,Ie=84,Ja=28,At=16,zt=50,qr=18,Na=5,Sa={vitalidade:3,tinta:4,sorte:3};function St(t,a){const s=Ns[t.id];if(!s)return null;const n=16+(s.col-1)*(at+Ja),r=a+zt+s.row*(Ie+At);return{x:n,y:r}}function Ur({onBack:t,onOpenPanel:a}){const[s,n]=l.useState(()=>pe()),[r,c]=l.useState(null);l.useEffect(()=>(c(It()),Ve(m=>{n(m),c(It())})),[]);const d=["vitalidade","tinta","sorte"],i=l.useMemo(()=>{const m={vitalidade:0,tinta:0,sorte:0};let g=8;for(const f of d){m[f]=g;const k=Sa[f];g+=zt+k*Ie+(k-1)*At+qr+8}const x=g,h=32+Na*at+(Na-1)*Ja;return{branchTops:m,totalHeight:x,width:h}},[]);function p(m){if(s.ownedPassiveIds.includes(m.id)){const h=en(m.id);W.success(`${m.displayName} ${h?"ativada":"desligada"}`);return}const x=tn(m.id,m.cost,m.requires);x.ok?W.success(`${m.displayName} aprendida.`):x.reason==="not-enough-coins"?W.error("Moedas insuficientes."):x.reason==="requires-missing"&&W.error("Compre o nó anterior primeiro.")}return e.jsx(ie,{title:"Passivas",kana:"パッシブ · árvore",accent:"jade",onBack:t,headerRight:e.jsxs("span",{className:"inline-flex items-center gap-1 border-2 border-ink bg-paper text-ink px-2 py-1 shadow-flat font-mono text-[11px]",children:[e.jsx(te,{size:11}),e.jsx("span",{className:"font-bold tabular-nums",children:s.coins})]}),children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-6 max-w-6xl mx-auto",children:[e.jsxs("div",{className:"border-2 border-ink bg-paper shadow-flat overflow-x-auto",children:[e.jsxs("div",{className:"relative",style:{width:i.width,height:i.totalHeight},children:[d.map(m=>{const g=i.branchTops[m],x=Br[m],h=Sa[m],f=zt+h*Ie+(h-1)*At;return e.jsxs("div",{className:"absolute left-0 right-0 border-b-2 border-dashed border-ink/15 overflow-hidden",style:{to
16p:g,height:f,background:Wr[m]},children:[e.jsx(Hr,{branch:m,width:i.width,height:f}),e.jsxs("div",{className:`relative inline-flex items-baseline gap-2 m-2 px-2 py-1 border-2 border-ink text-[10px] font-mono uppercase tracking-widest shadow-flat ${x.bg}`,children:[e.jsx("span",{className:"font-display font-black text-xs not-italic",children:x.label}),e.jsx("span",{className:"opacity-70",children:x.kana}),e.jsxs("span",{className:"opacity-70 normal-case tracking-normal",children:["— ",x.subtitle]})]})]},`bg-${m}`)}),e.jsx("svg",{className:"absolute inset-0 pointer-events-none",width:i.width,height:i.totalHeight,children:De.nodes.map(m=>(m.requires??[]).map(g=>{const x=De.nodes.find(I=>I.id===g);if(!x)return null;const h=St(x,i.branchTops[x.branch]),f=St(m,i.branchTops[m.branch]);if(!h||!f)return null;const k=s.ownedPassiveIds.includes(g),w=h.x+at,u=h.y+Ie/2,N=f.x,j=f.y+Ie/2;return e.jsx("path",{d:`M ${w} ${u} C ${w+30} ${u}, ${N-30} ${j}, ${N} ${j}`,stroke:k?"#0b0b0e":"rgba(11,11,14,0.22)",strokeWidth:k?2:1.5,fill:"none",strokeDasharray:k?"":"4 3"},`${g}-${m.id}`)}))}),De.nodes.map(m=>{const g=St(m,i.branchTops[m.branch]);if(!g)return null;const x=s.ownedPassiveIds.includes(m.id),h=(s.disabledPassiveIds??[]).includes(m.id),f=x&&!h,k=(m.requires??[]).filter(I=>!s.ownedPassiveIds.includes(I)),w=!x&&k.length>0,u=!x&&!w&&s.coins>=m.cost,N=f?"bg-postit-cinnabar text-paper":x&&h?"bg-paper-2 opacity-70":w?"bg-paper-2 opacity-60":u?"bg-paper hover:bg-postit-jade/40":"bg-paper opacity-80",j=x?`Clique pra ${f?"DESLIGAR":"ATIVAR"} (${m.displayName})`:w?`Bloqueada — falta: ${k.join(", ")}`:u?`Comprar (${m.cost} moedas)`:`Faltam ${m.cost-s.coins} moedas`;return e.jsxs("button",{type:"button",onClick:()=>p(m),title:j,disabled:!x&&!u,className:`absolute border-2 border-ink shadow-flat p-1.5 text-left transition-transform hover:-translate-y-[1px] disabled:hover:translate-y-0 disabled:cursor-not-allowed ${N}`,style:{left:g.x,top:g.y,width:at,height:Ie},children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsxs("span",{className:"text-[9px] font-mono uppercase opacity-70",children:["T",m.tier]}),x?f?e.jsx(Ft,{size:11}):e.jsx(Dt,{size:11,className:"opacity-60"}):w?e.jsx(ve,{size:11,className:"opacity-60"}):e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-mono",children:[e.jsx(te,{size:9}),e.jsx("span",{className:"tabular-nums font-bold",children:m.cost})]})]}),e.jsx("p",{className:"font-display text-[11px] font-black leading-tight mt-0.5 line-clamp-1",children:m.displayName}),e.jsx("p",{className:"text-[10px] leading-snug mt-0.5 opacity-85 line-clamp-2",children:m.desc}),x&&e.jsx("p",{className:"absolute bottom-1 right-1.5 text-[8px] font-mono uppercase tracking-widest opacity-75",children:f?"on":"off"}),x&&f&&e.jsx(qe,{size:10,className:"absolute bottom-1 left-1.5 opacity-90"})]},m.id)})]}),e.jsx(Vr,{wallet:s})]}),e.jsxs("aside",{className:"space-y-3",children:[e.jsxs("div",{className:"border-2 border-ink bg-paper-2 shadow-flat p-4",children:[e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50",children:"アクティブ · ativos"}),e.jsx("p",{className:"font-display text-2xl font-black leading-none",children:r?.ownedCount??0}),e.jsx("p",{className:"text-[11px] text-ink/60 mt-1",children:"nós aprendidos"})]}),e.jsxs("div",{className:"border-2 border-ink bg-paper shadow-flat p-4 space-y-2 text-xs",children:[e.jsx(Me,{label:"HP máx",value:Ct(r?.maxHpMul)}),e.jsx(Me,{label:"Dano",value:Ct(r?.damageMul)}),e.jsx(Me,{label:"Raio AoE",value:Ct(r?.aoeMul)}),e.jsx(Me,{label:"Pierce",value:`+${r?.pierceAdd??0}`}),e.jsx(Me,{label:"Projéteis",value:`+${r?.projAdd??0}`}),e.jsx(Me,{label:"Moedas",value:`×${(r?.coinMul??1).toFixed(2)}`})]}),e.jsxs("div",{className:"border-2 border-ink bg-paper shadow-flat p-3 space-y-2 text-[10px] text-ink/75 font-mono uppercase tracking-wider",children:[e.jsx("p",{className:"font-display text-xs font-black tracking-normal normal-case text-ink",children:"como usar"}),e.jsx("p",{children:"· clique vazio = compra (custa moedas)"}),e.jsx("p",{children:"· clique comprado = liga/desliga"}),e.jsx("p",{children:"· bloqueado = compre o anterior"})]}),e.jsxs("button",{type:"button",onClick:()=>{confirm("Refazer caminho devolve todas as passivas (gratuito). Continuar?")&&(Zs(),W.success("Passivas zeradas. Refaça seu caminho."))},className:"block w-full text-center inline-flex items-center justify-center gap-2 border-2 border-ink bg-paper px-3 py-2 text-xs font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(Wa,{size:12})," refazer caminho"]}),e.jsx("button",{type:"button",onClick:()=>a("store"),className:"block w-full text-center border-2 border-ink bg-postit-cinnabar text-paper px-3 py-2 text-xs font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:"ir pra loja →"})]})]})})}function Ct(t){const a=t??0;return`${a>=0?"+":""}${Math.round(a*100)}%`}function Me({label:t,value:a}){return e.jsxs("div",{className:"flex items-center justify-between border-b border-ink/15 pb-1",children:[e.jsx("span",{className:"text-ink/60 font-mono uppercase text-[10px] tracking-wider",children:t}),e.jsx("span",{className:"font-display font-black tabular-nums",children:a})]})}function Vr({wallet:t}){const a=De.metaUnlocks??[];return a.length===0?null:e.jsxs("div",{className:"border-t-4 border-double border-ink/40 px-3 py-4 bg-paper-2/40",children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black uppercase tracking-wide text-base",children:"Maestria"}),e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-ink/50",children:"マスタリー · ramificação final · não-rankeado"})]}),e.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:"requer os 3 capstones"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(s=>{const n=Pt(t,s.id),r=s.requires.filter(p=>!t.ownedPassiveIds.includes(p)),c=!n&&r.length>0,d=!n&&!c&&t.coins>=s.cost,i=n?`${s.displayName} — destravado. Usar tira a run do ranking.`:c?`Falta concluir: ${r.j
16oin(", ")}`:d?`Comprar (${s.cost} moedas) — destrava a feature. Usar tira a run do ranking.`:`Faltam ${s.cost-t.coins} moedas`;return e.jsxs("article",{title:i,className:`relative border-2 border-ink shadow-flat p-3 ${n?"bg-postit-cinnabar text-paper":c?"bg-paper opacity-60":"bg-paper"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"font-display font-black text-sm leading-tight",children:[e.jsx("span",{className:"mr-1",children:s.icon}),s.displayName]}),e.jsxs("p",{className:"text-[10px] font-mono uppercase tracking-wider opacity-70",children:["capstone · ",s.cost," moedas"]})]}),n?e.jsx(qe,{size:16}):c?e.jsx(ve,{size:14,className:"opacity-60"}):null]}),e.jsx("p",{className:"text-xs leading-snug mt-2 opacity-90",children:s.desc}),!n&&e.jsx("button",{type:"button",disabled:!d,onClick:()=>{const p=an(s.id,s.cost,s.requires);p.ok?W.success(`${s.displayName} destravado!`,{description:"Atalho liberado em /play."}):p.reason==="not-enough-coins"?W.error("Moedas insuficientes."):p.reason==="requires-missing"&&W.error("Conclua os 3 capstones primeiro.")},className:"mt-2 w-full inline-flex items-center justify-center gap-1 border-2 border-ink bg-postit-cinnabar text-paper px-3 py-1.5 text-[11px] font-mono uppercase tracking-wider shadow-flat disabled:opacity-40 disabled:cursor-not-allowed hover:-translate-y-[1px] transition-transform",children:c?"trancado":d?`destravar · ${s.cost}`:"faltam moedas"}),n&&e.jsx("p",{className:"mt-2 text-[10px] font-mono uppercase tracking-wider opacity-90 border-t border-paper/30 pt-1",children:"⚠ runs com isso não entram no ranking"})]},s.id)})})]})}function Yr({onBack:t}){return e.jsx(ie,{title:"Ranking",kana:"ランキング · global",accent:"violet",onBack:t,children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx(Ga,{compact:!0}),e.jsx("p",{className:"mt-6 text-xs text-ink/60 text-center max-w-3xl mx-auto",children:"Melhor score por jogador. Submissões passam por anti-cheat — scores impossíveis são rejeitados."})]})})}const Kr="md.lastRun";function Xr({onBack:t,onReplay:a,onOpenPanel:s,run:n}){const[r,c]=l.useState(n??null);l.useEffect(()=>{if(n){c(n);return}try{const i=localStorage.getItem(Kr);i&&c(JSON.parse(i))}catch{}},[n]);const d=r?r.outcome==="victory"?{bg:"bg-postit-jade",label:"VITÓRIA",kana:"ショウリ",icon:e.jsx(Fe,{size:48})}:r.outcome==="endless"?{bg:"bg-postit-violet text-paper",label:`∞ LOOP ${r.loop??1}`,kana:"エンドレス",icon:e.jsx(Fe,{size:48})}:{bg:"bg-postit-cinnabar text-paper",label:"DERROTA",kana:"シボウ",icon:e.jsx(In,{size:48})}:{bg:"bg-paper-2",label:"—",kana:"—",icon:e.jsx(Fe,{size:48})};return e.jsx(ie,{title:"Resultado",kana:"リザルト · run",accent:"paper",onBack:t,children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[e.jsx("article",{className:`relative border-2 border-ink shadow-[8px_8px_0_0_rgba(11,11,14,0.6)] ${d.bg}`,children:e.jsxs("div",{className:"px-6 py-8 text-center",children:[e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.4em] opacity-60",children:d.kana}),e.jsx("div",{className:"my-3 flex justify-center",children:d.icon}),e.jsx("h2",{className:"font-display text-4xl sm:text-5xl font-black tracking-tight",children:d.label}),r?.mapName&&e.jsxs("p",{className:"mt-2 font-mono text-xs uppercase tracking-wider opacity-70",children:[r.mapName," · ",r.tier??"normal"]})]})}),r?e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsx(Ze,{label:"Tempo",value:r.time?Gr(r.time):"—",kana:"ジカン"}),e.jsx(Ze,{label:"Kills",value:String(r.kills??0),kana:"キル"}),e.jsx(Ze,{label:"Level",value:String(r.level??1),kana:"レベル"}),e.jsx(Ze,{label:"Moedas",value:`+${r.coins??0}`,kana:"コイン",highlight:!0})]}):e.jsx("div",{className:"border-2 border-ink bg-paper p-6 text-center shadow-flat",children:e.jsx("p",{className:"text-sm text-ink/60",children:"Sem run registrada ainda."})}),r&&(r.coins??0)>0&&e.jsxs("div",{className:"border-2 border-ink bg-postit-mustard p-3 shadow-flat flex items-center justify-center gap-2",children:[e.jsx(te,{size:18}),e.jsxs("span",{className:"font-display font-black text-lg",children:["+",r.coins]}),e.jsx("span",{className:"text-xs font-mono uppercase tracking-wider opacity-70",children:"→ carteira"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx("button",{type:"button",onClick:()=>s("maps"),className:"inline-flex items-center justify-center gap-2 border-2 border-ink bg-paper px-3 py-3 font-display font-black uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-sm",children:"mapas"}),e.jsxs("button",{type:"button",onClick:()=>s("store"),className:"inline-flex items-center justify-center gap-2 border-2 border-ink bg-postit-mustard px-3 py-3 font-display font-black uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-sm",children:[e.jsx(te,{size:14})," loja"]}),e.jsxs("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center gap-2 border-2 border-ink bg-postit-cinnabar text-paper px-3 py-3 font-display font-black uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-sm",children:[e.jsx(it,{size:14,fill:"currentColor"})," de novo"]})]}),e.jsxs("button",{type:"button",onClick:t,className:"w-full inline-flex items-center justify-center gap-2 border-2 border-ink bg-paper-2 px-3 py-2 font-mono text-[11px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(Wa,{size:12})," voltar pro menu"]}
16)]})})}function Ze({label:t,value:a,kana:s,highlight:n}){return e.jsxs("div",{className:`border-2 border-ink p-3 shadow-flat ${n?"bg-postit-mustard":"bg-paper"}`,children:[e.jsx("p",{className:"text-[9px] font-mono uppercase tracking-widest text-ink/50",children:s}),e.jsx("p",{className:"font-display text-2xl font-black tabular-nums leading-none mt-1",children:a}),e.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/60 mt-0.5",children:t})]})}function Gr(t){const a=Math.floor(t/60),s=Math.floor(t%60);return`${a}:${String(s).padStart(2,"0")}`}function Jr({onBack:t}){const a=_a(),s=ce(Ta),n=ce(Vs),[r,c]=l.useState(null),[d,i]=l.useState(""),[p,m]=l.useState(""),[g,x]=l.useState(null),[h,f]=l.useState(null),[k,w]=l.useState(!1),[u,N]=l.useState(!1),[j,I]=l.useState(!1),[S,b]=l.useState(null),y=l.useRef(null);l.useEffect(()=>{(async()=>{const{data:_}=await Q.auth.getSession();if(!_.session){b(!1),I(!0);return}b(!0),c(_.session.user.id),i(_.session.user.email??"");try{const P=await s();P&&(m(P.displayName),x(P.avatarUrl))}catch(P){console.error(P)}I(!0)})()},[s]);const C=async _=>{const P=_.target.files?.[0];if(!(!P||!r)){if(P.size>2*1024*1024){f("imagem precisa ser menor que 2MB");return}f(null),N(!0);try{const U=P.name.split(".").pop()?.toLowerCase()??"jpg",V=`${r}/avatar-${Date.now()}.${U}`,{error:Y}=await Q.storage.from("avatars").upload(V,P,{upsert:!0,contentType:P.type});if(Y)throw Y;const{data:X}=Q.storage.from("avatars").getPublicUrl(V);x(X.publicUrl)}catch(U){f(U instanceof Error?U.message:"erro upload")}finally{N(!1)}}},$=async _=>{_.preventDefault(),f(null),w(!0);try{const P=await n({data:{displayName:p,avatarUrl:g}});if(!P.ok){f(P.error);return}t()}catch(P){f(P instanceof Error?P.message:"erro")}finally{w(!1)}},A=async()=>{await Q.auth.signOut(),b(!1),m(""),x(null),i("")};return e.jsx(ie,{title:"Perfil",kana:"プロフィール · player",accent:"paper",onBack:t,children:e.jsx("div",{className:"max-w-md mx-auto",children:j?S===!1?e.jsxs("div",{className:"border-2 border-ink bg-paper p-6 text-center shadow-flat-lg space-y-4",children:[e.jsx(Wt,{size:48,className:"mx-auto text-ink/40"}),e.jsx("h3",{className:"font-display text-xl font-black",children:"Você está jogando como convidado"}),e.jsx("p",{className:"text-sm text-ink/70",children:"Faça login pra salvar score, foto e progresso na nuvem."}),e.jsxs("button",{type:"button",onClick:()=>a({to:"/login",search:{redirect:"/play"}}),className:"w-full inline-flex items-center justify-center gap-2 border-2 border-ink bg-postit-cinnabar text-paper px-4 py-3 font-display font-black uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(wn,{size:16})," fazer login"]})]}):e.jsxs("form",{onSubmit:$,className:"border-2 border-ink bg-paper-2 shadow-flat-lg p-6 space-y-4",children:[e.jsx("header",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"font-display text-lg font-black",children:"seu perfil"}),e.jsx("p",{className:"text-xs text-ink/60",children:d})]})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-20 h-20 border-2 border-ink bg-paper overflow-hidden flex items-center justify-center",children:g?e.jsx("img",{src:g,alt:"avatar",className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-3xl",children:"👤"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/webp",onChange:C,className:"hidden"}),e.jsxs("button",{type:"button",onClick:()=>y.current?.click(),disabled:u,className:"inline-flex items-center gap-1 border-2 border-ink bg-paper px-3 py-2 text-xs font-mono uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(fn,{size:12}),u?"enviando…":g?"trocar foto":"subir foto"]}),g&&e.jsx("button",{type:"button",onClick:()=>x(null),className:"block mt-2 text-xs text-ink/60 underline",children:"remover"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"displayName",className:"block text-xs font-mono uppercase tracking-wider text-ink/60 mb-1",children:"apelido (2-16 caracteres)"}),e.jsx("input",{id:"displayName",required:!0,minLength:2,maxLength:16,value:p,onChange:_=>m(_.target.value),placeholder:"MD-fan",className:"w-full border-2 border-ink bg-paper px-3 py-2 font-mono text-sm shadow-flat focus:outline-none focus:bg-paper-2"})]}),h&&e.jsx("p",{className:"text-sm text-ink-cinnabar font-bold",children:h}),e.jsxs("button",{type:"submit",disabled:k,className:"w-full inline-flex items-center justify-center gap-2 border-2 border-ink bg-postit-cinnabar text-paper px-4 py-3 font-display font-black uppercase tracking-wider shadow-flat disabled:opacity-50 hover:-translate-y-[1px] transition-transform",children:[e.jsx(bn,{size:16})," ",k?"salvando…":"salvar"]}),e.jsxs("button",{type:"button",onClick:A,className:"w-full inline-flex items-center justify-center gap-2 border-2 border-ink bg-paper px-4 py-2 text-xs font-mono uppercase tracking-wider text-ink-cinnabar shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(Sn,{size:12})," sair da conta"]})]}):e.jsx("div",{className:"text-center text-ink/60 py-12",children:"carregando…"})})})}const Qr=l.lazy(()=>ee(()=>import("./MapsSection-CWBwxSQs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),Zr=l.lazy(()=>ee(()=>import("./PersonagemSection-CBQwgWAb.js"),__vite__mapDeps([11,1,2,3,4,10]))),ei=l.lazy(()=>ee(()=>import("./WeaponsSection-2FSkwWS4.js"),__vite__mapDeps([12,1,4,13,3,10,14,15,16]))),ti=l.lazy(()=>ee(()=>import("./EnemiesSection-7eGjYkKF.js"),__vite__mapDeps([17,1,2,3,4,18,19,20]))),ai=l.lazy(()=>ee(()=>import("./BossesSection-DTNRIZkh.js"),__vite__mapDeps([21,1,2,3,4,20,19,22,23]))),si=l.lazy(()=>ee(()=>import("./DropsSection-B3hgvPTQ.js"),__vite__mapDeps([24,1,2,3,4,10,25,26,27,28,29,30,14,31,32,33,19,23,9,34]))),ni=l.lazy(()=>ee(()=>import("./FxSection-DBeNld7n.js"),__vite__mapDeps([35,1,2,3,4,10]))),ri=l.lazy(()=>ee(()=>import("./HudSection-DpgRiieg.js"),__vite__mapDeps([36,1,2,4,37]))),ii=l.lazy(()=>ee(()=>import("./LobbySection-BSbn1dVp.js"),__vite__mapDeps([38,1,2,4,37]))),oi={maps:Qr,player:Zr,weapons:ei,enemies:ti,bosses:ai,drops:si,fx:ni,hud:ri,meta:ii};function li({onBack:t}){const[a,s]=l.useState(null),n=a?oi[a]:null;return e.jsx(ie,{title:"Catálogo",kana:"ズカン · figurinhas",accent:"violet",onBack:t,contentPad:"none",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(hn,{active:a??"",onChange:s,children:n?e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"border-2 border-dashed border-ink/20 p-8 text-center text-xs font-mono uppercase tracking-widest text-ink/50 animate-pulse",children:"Carregando…"}),children:e.jsx(n,{})}):e.jsxs("div",{className:"border-2 border-ink bg-paper p-8 text-center",children:[e.jsx("p",{className:"font-display text-lg",children:"Escolhe uma categoria pra explorar."}),e.jsx("p",{className:"text-xs text-ink/60 mt-1",children:"Cada seção é renderizada em mini-arenas reais."})]})})})})}const Qa=Ys(),K={species:5,bosses:25,weapons:10,maps:15,marks:50},Re={species:{title:"Espécies",kana:"ヨウカイ",subtitle:"Yokai documentados em batalha."},bosses:{title:"Bosses",kana:"オオヌシ",subtitle:"Senhores derrotados em vitória."},weapons:{title:"Armas",kana:"ブキ",subtitle:"Pinceladas do arsenal."},maps:{title:"Mapas",kana:"チ",subtitle:"Trilhas percorridas."},marks:{title:"Marcos",kana:"メモリ",subtitle:"Conquistas guardadas."}},Za={"manifest-oni-borrao":"オニ","manifest-inu-sombra":"イヌ","manifest-karakasa-real":"カラカサ","manifest-tengu-asa-negra":"テング","manifest-nure-onna":"ヌレオンナ","manifest-rokurokubi-pedra":"ロクロクビ","manifest-mokumoku-folha":"モクモク","manifest-shikigami":"シキガミ","manifest-hi-no-tama":"ヒノタマ","manifest-hannya":"ハンニャ"},ci={hissen:{kana:"ヒセン",unlocked:"Shuriken de papel arremessado em leques rápidos."},obi:{kana:"オビ",unlocked:"Faixa que se desenrola feito chicote de tinta."},hanabi:{kana:"ハナビ",unlocked:"Fogos que explodem em pétalas de pólvora."},tako:{kana:"タコ",unlocked:"Tentáculos que agarram e drenam ki."},michi:{kana:"ミチ",unlocked:"Trilha de tinta que queima pelas costas."},ougi:{kana:"オウギ",unlocked:"Leque que corta o vento em meia-lua."}},di={"trilha-vermelha":"アカミチ","beco-de-lanternas":"チョウチン","templo-submerso":"シズミ","shoji-infinito":"ショウジ","jardim-de-pedra":"カレサンスイ","biblioteca-de-papel":"ショジョ","canyon-rachado":"ワレタニ","pico-nas-nuvens":"クモミネ","campo-em-chamas":"ヒノハラ","forja-vulcanica":"ヨウガン"};function pi(){return Qa.map(t=>({id:`species:${t.id}`,chapter:"species",title:t.name,kana:Za[t.id]??"ヨウカイ",loreLocked:"Algo se moveu na névoa.",loreUnlocked:t.desc,reward:K.species,refId:t.id}))}function mi(){return Qa.map(t=>({id:`boss:${t.id}`,chapter:"bosses",title:`Lorde ${t.name}`,kana:Za[t.id]??"オオヌシ",loreLocked:"Uma sombra maior dorme ao fim da trilha.",loreUnlocked:`Forma colossal de ${t.name}. ${t.desc}`,reward:K.bosses,refId:t.id}))}function xi(){return["hissen","obi","hanabi","tako","michi","ougi"].map(a=>{const s=$t[a],n=ci[a];return{id:`weapon:${a}`,chapter:"weapons",title:s?.name??a,kana:n?.kana??"ブキ",loreLocked:"Pincel ainda fechado no estojo.",loreUnlocked:n?.unlocked??s?.desc??"Arma do roster.",reward:K.weapons,refId:a}})}function ui(){return[...Ot].sort((t,a)=>
16t.trailOrder-a.trailOrder).map(t=>({id:`map:${t.id}`,chapter:"maps",title:t.displayName,kana:di[t.id]??"チ",loreLocked:"Trilha ainda fechada por nevoeiro.",loreUnlocked:Rt[t.id]??"Bioma desbloqueado.",reward:K.maps,refId:t.id}))}const es=[{id:"mark:first-blood",chapter:"marks",title:"Primeiro Risco",kana:"ハツ",loreLocked:"Toda história começa com um traço.",loreUnlocked:"Sobreviveu à primeira wave. O pincel respondeu.",reward:K.marks,check:t=>t.killCount>=1},{id:"mark:first-boss",chapter:"marks",title:"Tinta do Lorde",kana:"オオヌシ",loreLocked:"Algo enorme caminha no fim do mapa.",loreUnlocked:"Derrotou seu primeiro boss. A trilha se abriu.",reward:K.marks,check:t=>t.victory},{id:"mark:wave-15",chapter:"marks",title:"Quinze Riscos",kana:"ジュウゴ",loreLocked:"Quinze waves de pura insistência.",loreUnlocked:"Resistiu até a wave 15 em uma única run.",reward:K.marks,check:t=>t.wave>=15},{id:"mark:100-kills",chapter:"marks",title:"Cem Sombras",kana:"ヒャク",loreLocked:"Cem yokai aguardam no breu.",loreUnlocked:"Aniquilou 100 inimigos em uma única run.",reward:K.marks,check:t=>t.killCount>=100},{id:"mark:level-10",chapter:"marks",title:"Décimo Sumi",kana:"ジュウ",loreLocked:"O pincel cresce com o uso.",loreUnlocked:"Atingiu nível 10 em uma única run.",reward:K.marks,check:t=>t.level>=10},{id:"mark:endless-loop",chapter:"marks",title:"Roda Infinita",kana:"ムゲン",loreLocked:"Há quem caminhe além do fim.",loreUnlocked:"Completou um loop completo no modo Infinito.",reward:K.marks,check:t=>t.endlessLoop>=1},{id:"mark:hard-clear",chapter:"marks",title:"Tinta Difícil",kana:"カタ",loreLocked:"Há mapas que exigem o pulso firme.",loreUnlocked:"Limpou um mapa no tier Difícil.",reward:K.marks,check:t=>t.victory&&t.tier==="hard"},{id:"mark:all-weapons",chapter:"marks",title:"Arsenal Completo",kana:"ブキ",loreLocked:"Seis pinceladas no estojo.",loreUnlocked:"Destravou todas as 6 armas do roster.",reward:K.marks,check:t=>t.ownedWeaponCount>=6},{id:"mark:5-passives",chapter:"marks",title:"Caminho do Sumi",kana:"ミチ",loreLocked:"Cada passiva é um nó na árvore.",loreUnlocked:"Comprou ao menos 5 passivas na árvore.",reward:K.marks,check:t=>t.ownedPassiveCount>=5},{id:"mark:3-maps",chapter:"marks",title:"Trilha Tripla",kana:"サン",loreLocked:"A jornada não cabe num mapa só.",loreUnlocked:"Concluiu 3 mapas diferentes da trilha.",reward:K.marks,check:t=>t.mapsCleared>=3}],Ee=[...pi(),...mi(),...xi(),...ui(),...es.map(({check:t,...a})=>a)];Object.fromEntries(Ee.map(t=>[t.id,t]));function Ca(t){return Ee.filter(a=>a.chapter===t)}Ee.reduce((t,a)=>t+a.reward,0);function Ma(t){const a=Ot.find(n=>n.id===t);if(!a)return[];const s=[];for(const n of a.cardHeroFamilyIds??[]){const r=Ss[n];r?.baseManifestId&&s.push(`species:${r.baseManifestId}`)}return s}const ts="md.meta.codex.v1",Mt={seen:{},claimed:[]};function Ke(){if(typeof window>"u")return{...Mt};try{const t=window.localStorage.getItem(ts);if(!t)return{...Mt};const a=JSON.parse(t);return{seen:typeof a.seen=="object"&&a.seen?a.seen:{},claimed:Array.isArray(a.claimed)?a.claimed:[]}}catch{return{...Mt}}}function Ht(t){if(!(typeof window>"u"))try{window.localStorage.setItem(ts,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("md:codex:change"))}catch{}}function fi(){return Ke()}function bi(t){if(typeof window>"u")return()=>{};const a=()=>t(Ke());return window.addEventListener("md:codex:change",a),()=>window.removeEventListener("md:codex:change",a)}function hi(t){if(!t)return!1;const a=Ke();return a.seen[t]?!1:(a.seen={...a.seen,[t]:Date.now()},Ht(a),!0)}function gi(t){if(!t?.length)return;const a=Ke();let s=!1;const n={...a.seen};for(const r of t)!r||n[r]||(n[r]=Date.now(),s=!0);s&&(a.seen=n,Ht(a))}function ki(t,a){const s=Ke();return s.seen[t]?s.claimed.includes(t)?{ok:!1,reward:0}:(s.claimed=[...s.claimed,t],Ht(s),a>0&&za(a),{ok:!0,reward:a}):{ok:!1,reward:0}}typeof window<"u"&&window.addEventListener("md:codex:see",(t=>{const a=t.detail;Array.isArray(a)?gi(a):typeof a=="string"&&hi(a)}));function $a(t){typeof window>"u"||window.dispatchEvent(new CustomEvent("md:codex:see",{detail:t}))}const vi=["species","bosses","weapons","maps","marks"],ji={seen:{},claimed:[]};function yi({onBack:t}){const[a,s]=l.useState(ji),[n,r]=l.useState("species"),[c,d]=l.useState(null),[i,p]=l.useState(null);l.useEffect(()=>(s(fi()),bi(s)),[]);const m=l.useMemo(()=>{const x=Ee.length,h=Ee.filter(w=>a.seen[w.id]).length,f=Ee.filter(w=>a.seen[w.id]&&!a.claimed.includes(w.id)),k=f.reduce((w,u)=>w+u.reward,0);return{total:x,seen:h,pendingCount:f.length,pendingCoins:k}
16},[a]),g=x=>{ki(x.id,x.reward).ok&&(p(x.id),window.setTimeout(()=>p(null),900))};return e.jsx(ie,{title:"Mangá",kana:"マンガ · álbum",accent:"paper",onBack:t,headerRight:e.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest",children:[e.jsxs("span",{className:"border-2 border-ink bg-paper px-2 py-1 shadow-flat",children:[e.jsx(Lt,{size:11,className:"inline mr-1 -mt-[2px]"}),m.seen,"/",m.total]}),m.pendingCount>0&&e.jsxs("span",{className:"border-2 border-ink bg-postit-mustard text-ink px-2 py-1 shadow-flat animate-pulse",children:[e.jsx(te,{size:11,className:"inline mr-1 -mt-[2px]"}),"+",m.pendingCoins," pendentes"]})]}),children:e.jsxs("div",{className:"mx-auto max-w-[1100px]",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[220px_1fr] gap-4 md:gap-6",children:[e.jsxs("aside",{className:"relative border-2 border-ink bg-paper-2 p-3 shadow-flat",children:[e.jsx("div",{className:"absolute top-0 right-0 h-full w-2 bg-gradient-to-l from-ink/30 to-transparent pointer-events-none hidden md:block"}),e.jsx("h3",{className:"font-display text-lg font-black mb-2 leading-none",children:"Sumário"}),e.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-ink/50 mb-3",children:"もくじ"}),e.jsx("nav",{className:"flex md:flex-col gap-1 overflow-x-auto md:overflow-visible",children:vi.map(x=>{const h=Re[x],f=Ca(x),k=f.filter(N=>a.seen[N.id]).length,w=f.filter(N=>a.seen[N.id]&&!a.claimed.includes(N.id)).length,u=n===x;return e.jsxs("button",{type:"button",onClick:()=>{r(x),d(null)},className:ge("shrink-0 md:w-full text-left border-2 border-ink px-2.5 py-2 shadow-flat font-mono text-xs uppercase tracking-wider transition-transform hover:-translate-y-[1px]",u?"bg-ink text-paper":"bg-paper text-ink"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-display text-sm normal-case tracking-normal",children:h.title}),w>0&&e.jsx("span",{className:"bg-postit-mustard text-ink border border-ink rounded-full px-1.5 text-[9px] leading-none py-0.5",children:w})]}),e.jsxs("div",{className:ge("text-[9px] mt-0.5 opacity-70",u&&"opacity-90"),children:[h.kana," · ",k,"/",f.length]})]},x)})})]}),e.jsxs("section",{className:"relative border-2 border-ink bg-paper p-4 sm:p-5 shadow-flat min-h-[420px]",children:[e.jsx("div",{className:"flex items-end justify-between gap-3 mb-4 border-b-2 border-ink pb-2",children:e.jsxs("div",{children:[e.jsx("p",{className:"font-mono text-[9px] uppercase tracking-[0.3em] text-ink/50",children:Re[n].kana}),e.jsx("h3",{className:"font-display text-2xl font-black leading-none",children:Re[n].title}),e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ink/60 mt-1",children:Re[n].subtitle})]})}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:Ca(n).map(x=>{const h=!!a.seen[x.id],f=a.claimed.includes(x.id),k=h&&!f,w=i===x.id;return e.jsxs("button",{type:"button",onClick:()=>{h&&(k&&g(x),d(x))},disabled:!h,className:ge("relative group text-left border-2 border-ink shadow-flat aspect-[3/4] flex flex-col overflow-hidden transition-transform",h?"bg-paper-2 hover:-translate-y-[2px]":"bg-ink/95 cursor-not-allowed",w&&"animate-pulse ring-2 ring-postit-mustard"),children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-[0.08] pointer-events-none",style:{backgroundImage:"radial-gradient(#0b0b0e 1px, transparent 1.5px)",backgroundSize:"6px 6px"}}),e.jsx("div",{className:"relative flex-1 flex items-center justify-center",children:h?e.jsx("span",{className:"font-display text-[64px] leading-none font-black opacity-70 select-none",children:x.kana?.[0]??"?"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-paper/80",children:[e.jsx(ve,{size:28}),e.jsx("span",{className:"font-display text-2xl",children:"???"})]})}),e.jsxs("div",{className:ge("relative border-t-2 border-ink px-2 py-1.5",h?"bg-paper text-ink":"bg-paper text-ink/60"),children:[e.jsx("p",{className:"font-mono text-[8px] uppercase tracking-widest opacity-60 truncate",children:h?x.kana:"???"}),e.jsx("p",{className:"font-display text-xs font-black leading-tight truncate",children:h?x.title:"desconhecido"})]}),k&&e.jsxs("span",{className:"absolute top-1 right-1 flex items-center gap-1 bg-postit-mustard text-ink border-2 border-ink px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-widest shadow-flat animate-bounce",children:[e.jsx(ot,{size:9})," +",x.reward]}),f&&e.jsxs("span",{className:"absolute top-1 right-1 flex items-center gap-1 bg-ink text-paper border-2 border-ink px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-widest shadow-flat",children:[e.jsx(qe,{size:9})," lido"]}
16)]},x.id)})})]})]}),c&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/60 backdrop-blur-sm p-4 animate-fade-in",onClick:()=>d(null),children:e.jsxs("div",{className:"relative w-full max-w-md border-2 border-ink bg-paper p-5 shadow-flat animate-scale-in",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"border-b-2 border-ink pb-2 mb-3",children:[e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-ink/50",children:c.kana}),e.jsx("h3",{className:"font-display text-2xl font-black leading-none",children:c.title})]}),e.jsxs("div",{className:"flex items-center justify-center h-32 border-2 border-ink bg-paper-2 mb-3 relative overflow-hidden",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-[0.1]",style:{backgroundImage:"radial-gradient(#0b0b0e 1px, transparent 1.5px)",backgroundSize:"8px 8px"}}),e.jsx("span",{className:"font-display text-[96px] leading-none font-black opacity-80",children:c.kana?.[0]??"?"})]}),e.jsx("p",{className:"font-mono text-xs text-ink/80 leading-relaxed mb-3",children:a.seen[c.id]?c.loreUnlocked:c.loreLocked}),e.jsxs("div",{className:"flex items-center justify-between gap-2 border-t-2 border-ink pt-3",children:[e.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink/60",children:["capítulo · ",Re[c.chapter].title]}),a.claimed.includes(c.id)?e.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] uppercase tracking-widest text-ink/70",children:[e.jsx(qe,{size:11})," recolhido"]}):a.seen[c.id]?e.jsxs("button",{type:"button",onClick:()=>g(c),className:"flex items-center gap-1 border-2 border-ink bg-postit-mustard text-ink px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest shadow-flat hover:-translate-y-[1px] transition-transform",children:[e.jsx(te,{size:11})," recolher +",c.reward]}):e.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] uppercase tracking-widest text-ink/40",children:[e.jsx(ve,{size:11})," ainda desconhecido"]})]})]})})]})})}function je({variantId:t,fallback:a,size:s=32}){const n=t?ke(t):void 0;return n?e.jsx(tt,{v:n,size:s}):e.jsx("span",{"aria-hidden":!0,style:{fontSize:Math.round(s*.7),lineHeight:1,display:"inline-block"},children:a??"?"})}function Pe(t,a){if(!t)return[];const s=Math.max(1,Math.min(de,a)),n=t.statMult,r=i=>(Math.round(i*10)/10).toString(),c=i=>(Math.round(i)/1).toString(),d=i=>`${(i/1e3).toFixed(2)}s`;switch(t.behavior){case"hissen":{const i=qs(s);return[`Dano ${r(i.damage*n.dmg)} × ${i.multi}`,`Cadência ${d(i.cdMs*n.cd)}`,`Perfura ${i.pierce} · tinta ${Math.round(i.inkChance*100)}%`]}case"obi":{const i=Hs(s);return[`Dano ${r(i.damage*n.dmg)} por tick`,`Período ${d(i.periodMs*n.cd)}`,`Knockback ${c(i.knockback)} · bloqueia ${Math.round(i.blockChance*100)}%`]}case"hanabi":{const i=Ws(s);return[`Dano ${r(i.damageCenter*n.dmg)} (centro) / ${r(i.damageEdge*n.dmg)} (borda)`,`Cadência ${d(i.cdMs*n.cd)}`,`Raio ${c(i.radius*n.aoe)} · queima ${d(i.burnTtlMs)}`]}case"tako":{const i=Bs(s);return[`Dano ${r(i.damagePerTick*n.dmg)} a cada 83ms`,`Alcance ${c(i.range*n.range)} · cone ${i.coneDeg}°`,`Molha ${d(i.wetTtlMs)} · slow ${Math.round(i.slowPct*100)}%`]}case"michi":{const i=Fs(s);return[`DOT ${r(i.dotPerTick*n.dmg)} a cada 125ms`,`Largura ${c(i.width*n.aoe)} · dura ${d(i.ttlMs)}`,`Slow ${Math.round(i.slowPct*100)}% · tinta ${Math.round(i.inkChance*100)}%`]}case"ougi":{const i=Ds(s);return["Defesa pura (dano zero)",`Cadência ${d(i.cdMs*n.cd)} · raio ${c(i.radius*n.aoe)}`,`Knockback ${c(i.knockback)} · mata ${Math.round(i.killChance*100)}% projétil`]}}return[]}function Ia(t){const a=ke(t.variantId??t.id),s=t.fused?.statMult;if(!a){if(!t.fused)return[];const n={id:t.id,behavior:t.id,name:t.fused.name??t.id,icon:t.fused.icon??"?",element:t.fused.element??"neutral",statMult:s??{dmg:1,cd:1,range:1,aoe:1}};return Pe(n,t.level)}if(s){const n={...a,statMult:{dmg:a.statMult.dmg*s.dmg,cd:a.statMult.cd*s.cd,range:a.statMult.range*s.range,aoe:a.statMult.aoe*s.aoe},element:t.fused?.element??a.element};return Pe(n,t.level)}return Pe(a,t.level)}const Ea={fire:{label:"Fogo",tone:"text-paper",bg:"bg-postit-cinnabar"},water:{label:"Água",tone:"text-paper",bg:"bg-postit-cobalt"},ice:{label:"Gelo",tone:"text-ink",bg:"bg-postit-cobalt/40"},lightning:{label:"Raio",tone:"text-ink",bg:"bg-postit-mustard"},ink:{label:"Tinta",tone:"text-paper",bg:"bg-ink"},neutral:{label:"Neutro",tone:"text-ink",bg:"bg-paper-2"},poison:{label:"Veneno",tone:"text-paper",bg:"bg-postit-jade"},holy:{label:"Sacro",tone:"text-ink",bg:"bg-postit-mustard"},void:{label:"Vazio",tone:"text-paper",bg:"bg-postit-violet"},legend:{label:"Lenda",tone:"text-ink",bg:"bg-postit-mustard"}};function Ue(t){return Ea[t??"neutral"]??Ea.neutral}function vo(){const{roomId:t,character:a}=Cs.useSearch();l.useEffect(()=>{let o=!0;return(async()=>{const v=await ee(()=>import("./engine-BmfGk2c3.js").then(M=>M.x),__vite__mapDeps([25,26,27,1,28,29,30,14,31,32,33,19,23,9,34]));o&&v.setPreviewCharacter(a??null)})(),()=>{o=!1,ee(()=>import("./engine-BmfGk2c3.js").then(v=>v.x),__vite__mapDeps([25,26,27,1,28,29,30,14,31,32,33,19,23,9,34])).then(v=>v.setPreviewCharacter(null))}},[a]);const s=_a(),n=ce(Ta),r=ce(Tn),c=ce(Is),d=ce(Es),i=ce(Ps),[p,m]=l.useState(null),[g,x]=l.useState(!1),[h,f]=l.useState(!1),[k,w]=l.useState(0),[u,N]=l.useState({score:0,wave:1,lives:3,maxLives:3,level:1,xp:0,xpToNext:5,status:"running",durationMs:0,waveTimeLeftMs:25e3,waveTotalMs:25e3,killCount:0,levelUpChoices:[],weapons:[],combos:[],stats:As(),dashCdLeft:0,dashCdMax:5e3,movements:["s
16olo","solo","dupla","solo"],movementIdx:0,waveTheme:"oni-blot",shieldHp:0,shieldMax:0,shieldTier:0,artilleryMs:0,artilleryMaxMs:0,artilleryTier:0,killChain:0,killChainMs:0,killChainBest:0,boss:null,minimap:{arenaW:3600,arenaH:2700,px:1800,py:1350,dots:[]}}),[j,I]=l.useState(null),[S,b]=l.useState(null),[y,C]=l.useState(!1),[$,A]=l.useState(()=>pe());l.useEffect(()=>Ve(A),[]);const _=Pt($,"meta-training-arena"),P=Pt($,"meta-next-wave"),U=l.useRef(!1),[V,Y]=l.useState(!0),[X,O]=l.useState(null),ct=l.useRef(null),qt=l.useRef(null),Ut=l.useRef(null),as=l.useRef(null),dt=l.useRef(null),me=l.useRef(null),[ye,xe]=l.useState({state:"idle"}),[Vt,pt]=l.useState(!1),[ss,Yt]=l.useState(!1),[z,Kt]=l.useState(null),[we,Xt]=l.useState(null),[ns,Ne]=l.useState([]),[rs,Gt]=l.useState(null),[Jt,Qt]=l.useState(!1),oe=l.useRef(null),Zt=l.useRef(0),[L,is]=l.useState(()=>tr()),[ea,mt]=l.useState(!1),[os,ls]=l.useState(null),ta=l.useRef(new or({renderDelayMs:100,staleMs:3e3})),[cs,aa]=l.useState(null),[_e,xt]=Ms(),ut=l.useRef(null),sa=o=>{const v=["var(--ink-cobalt)","var(--ink-cinnabar)","var(--ink-jade)","var(--ink-mustard)","var(--ink-violet)"];let M=0;for(const E of o)M=M*31+E.charCodeAt(0)>>>0;return v[M%v.length]},G=l.useCallback(o=>{is(v=>{const M={...v,...o};return o.enabled!==void 0&&o.autoFire===void 0&&(M.autoFire=!!o.enabled),ar(M),M})},[]),na=l.useCallback(()=>{G({enabled:!L.enabled})},[L.enabled,G]),ds=l.useCallback((o,v)=>{Ut.current?.(o,v)},[]),ra=l.useRef(null),[Z,ps]=l.useState(!1);l.useEffect(()=>{const o=()=>ps(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o)},[]);const ft=l.useCallback(()=>{try{document.fullscreenElement?document.exitFullscreen?.().catch(()=>{}):ra.current?.requestFullscreen?.().catch(()=>{})}catch{}},[]),ue=pr(),[Ci,ms]=l.useState(typeof window<"u"?window.innerHeight>window.innerWidth:!1);l.useEffect(()=>{const o=()=>ms(window.innerHeight>window.innerWidth);return window.addEventListener("resize",o),window.addEventListener("orientationchange",o),()=>{window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o)}},[]),l.useEffect(()=>{if(typeof window>"u")return;const o=window.matchMedia?.("(pointer: coarse)")?.matches??!1,v=window.matchMedia?.("(hover: none)")?.matches??!1;(o&&v||ue)&&(!L.enabled||!L.autoFire)&&G({enabled:!0,autoFire:!0})},[ue]),l.useEffect(()=>{(async()=>{const{data:o}=await Q.auth.getSession();if(o.session)try{const v=await n();v&&m(v)}catch(v){console.error(v)}x(!0)})()},[n]),l.useEffect(()=>{const o=v=>{v.key==="Escape"&&!j&&u.status!=="levelup"&&f(M=>!M)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[j,u.status]);const[xs,bt]=l.useState(!1);l.useEffect(()=>{g&&On().then(o=>{o?Kt(o):bt(!0)})},[g]),l.useEffect(()=>{if(!t||!z){Xt(null),Ne([]),Gt(null);return}let o=!0;const v=()=>c({data:{roomId:t}}).then(E=>{o&&(Xt(E),E||s({to:"/play",search:{}}))});v();const M=Q.channel(`play-room-${t}`).on("postgres_changes",{event:"*",schema:"public",table:"rooms",filter:`id=eq.${t}`},v).on("postgres_changes",{event:"*",schema:"public",table:"room_members",filter:`room_id=eq.${t}`},v).subscribe();return()=>{o=!1,Q.removeChannel(M)}},[t,z,c,s]),l.useEffect(()=>{if(!t||!z||!we?.members.some(E=>E.memberId===z.id))return;let o=!1;const v=async()=>{try{const E=await d({data:{roomId:t,memberId:z.id}});!o&&E.ok&&!E.alive&&s({to:"/play",search:{}})}catch{}};v();const M=setInterval(v,8e3);return()=>{o=!0,clearInterval(M)}},[t,z,we,d,s]);const ht=l.useCallback(()=>{I(null),f(!1),xe({state:"idle"}),b(null),U.current=!1,Y(!0),w(o=>o+1)},[]),us=l.useCallback(o=>{b(o),C(!1),I(null),f(!1),xe({state:"idle"}),U.current=!0,Y(!1),w(v=>v+1),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})},[]),fs=l.useCallback(o=>{I(o);try{const v=o.activeMapTier,M=v==="medium"?1.5:v==="hard"?2.2:v==="endless"?Math.min(2.5,1+(o.endlessLoop??0)*.25):1,E=Math.floor(o.killCount*.5+o.score/100),F=o.victory?25:o.wave>=3?5:0,T=Math.max(F,Math.floor(E*(o.victory?1.5:1)*M)),H=ma(),R=Math.floor(T*H);if(R>0){za(R);const q=H>1?` (×${H.toFixed(2)} passiva)`:"",le=v&&v!=="normal"?` · tier ${v}`:"",fe=o.victory?"🏆 Vitória! ":o.endlessLoop?`♾ ${o.endlessLoop} loops · `:"";W.success(`${fe}+${R} moedas${q}${le}`,{description:"Use na Loja (lab) ou desbloqueie passivas."})}const B=o.activeMapId??(typeof window<"u"?localStorage.getItem("md.meta.activeMap"):null);let J=null;if(B&&(v==="endless"&&(o.endlessLoop??0)>=1?J="endless":o.victory?J=v??"normal":o.wave>=15&&!v&&(J="normal")),B&&J){const q=pe().mapProgress[B]??null;sn(B,J),q!==J&&W.success(`Mapa ${B}: ${J} concluído`,{description:J==="endless"?"Domínio absoluto.":"Próximo tier/bioma liberado."})}try{const q=B?la[B]:null,fe={outcome:o.victory?"victory":v==="endless"&&(o.endlessLoop??0)>0?"endless":"defeat",mapId:B??void 0,mapName:q?.displayName??void 0,tier:v??"normal",time:Math.floor(o.durationMs/1e3),kills:o.killC
16ount,level:o.level,coins:R,loop:o.endlessLoop??0,at:Date.now()};typeof window<"u"&&localStorage.setItem("md.lastRun",JSON.stringify(fe))}catch{}try{const q=[];if(B&&(q.push(...Ma(B)),q.push(`map:${B}`),o.victory)){const Te=la[B]?.bosses?.[0]?.familyId;if(Te){const Xe=Ba(Te);Xe?.baseManifestId&&q.push(`boss:${Xe.baseManifestId}`)}}const le=pe(),fe={victory:!!o.victory,wave:o.wave,killCount:o.killCount,level:o.level,endlessLoop:o.endlessLoop??0,tier:v,mapId:B,mapsCleared:Object.values(le.mapProgress??{}).filter(Boolean).length,ownedWeaponCount:(le.ownedWeaponIds??[]).length,ownedPassiveCount:(le.ownedPassiveIds??[]).length};for(const be of es)be.check(fe)&&q.push(be.id);q.length&&$a(q)}catch{}}catch(v){console.warn("[meta wiring] gameover hook failed",v)}if(U.current){W.message("Run não rankeada",{description:"Você usou treino livre ou pulo de wave."});return}!p||o.score<=0||(xe({state:"sending"}),r({data:{score:Math.floor(o.score),wave:Math.floor(o.wave),level:Math.floor(o.level),kills:Math.floor(o.killCount),durationMs:Math.floor(o.durationMs)}}).then(v=>{v.ok?xe({state:"ok",rank:v.rank}):xe({state:"error",error:v.error})}).catch(v=>{console.error(v),xe({state:"error",error:"rede"})}))},[r,p]),bs=o=>{ct.current?.(o)},gt=l.useRef(!1);l.useEffect(()=>{if(gt.current||u.level!==1||u.weapons.length!==0||!u.levelUpChoices||u.levelUpChoices.length===0)return;let o=null;try{o=localStorage.getItem("md.meta.starterWeapon")}catch{}if(!o)return;const v=u.levelUpChoices.findIndex(M=>(M.kind==="new"||M.kind==="upgrade")&&M.weaponId===o);v<0||(gt.current=!0,ct.current?.(v))},[u.level,u.weapons.length,u.levelUpChoices]),l.useEffect(()=>{gt.current=!1},[k]);const D=!!(t&&z&&we?.status==="playing"&&we.members.some(o=>o.memberId===z.id)),Le=!!(D&&we?.hostId===z?.id);l.useEffect(()=>{t&&z&&!D&&pt(!0)},[t,z,D]),l.useEffect(()=>{if(!D||!t||!z){oe.current?.close(),oe.current=null,aa(null);return}const o=ta.current,v=Dn(t,z.id,{onPose:M=>{o.push(M.memberId,{memberId:M.memberId,nick:M.nick,x:M.x,y:M.y,aimX:M.aimX,aimY:M.aimY,shooting:M.shooting,ts:M.ts,color:sa(M.memberId),chat:null}),Ne(E=>{const F=E.find(H=>H.memberId===M.memberId);return F&&F.nick===M.nick?E:[...E.filter(H=>H.memberId!==M.memberId),{...M,color:sa(M.memberId),chat:F?.chat??null}]})},onLeave:M=>{o.remove(M),Ne(E=>E.filter(F=>F.memberId!==M))},onArena:M=>{Le||Gt(M)},onStats:M=>aa(M)});return oe.current=v,()=>{v.close(),oe.current===v&&(oe.current=null)}},[D,t,z,Le]),l.useEffect(()=>{if(!D)return;let o=0;const v=()=>{const M=Date.now(),E=ta.current;E.prune(M);const F=E.sample(M);F.length===0?Ne(T=>T.length===0?T:[]):Ne(T=>{const H=new Map(T.map(R=>[R.memberId,R.chat??null]));return F.map(R=>({memberId:R.memberId,nick:R.nick,x:R.x,y:R.y,aimX:R.aimX,aimY:R.aimY,shooting:R.shooting,ts:R.ts,color:R.color,chat:H.get(R.memberId)??null}))}),o=requestAnimationFrame(v)};return o=requestAnimationFrame(v),()=>cancelAnimationFrame(o)},[D]);const hs=l.useCallback(o=>{!D||!z||oe.current?.sendPose({...o,nick:z.nick})},[D,z]),gs=l.useCallback(o=>{if(!Le)return;const v=performance.now();v-Zt.current<120||(Zt.current=v,oe.current?.sendArena(o))},[Le]),ks=l.useCallback((o,v)=>{if(z&&v.memberId===z.id){ls({text:v.text,ts:v.ts});return}Ne(M=>{const E=M.findIndex(T=>T.memberId===v.memberId);if(E<0)return M;const F=M.slice();return F[E]={...F[E],chat:{text:v.text,ts:v.ts}},F})},[z]),vs=l.useCallback(async()=>{!t||!z||(Qt(!0),await i({data:{roomId:t,memberId:z.id}}),oe.current?.close(),Qt(!1),s({to:"/play",search:{}}))},[t,z,i,s]),ae=u.status==="levelup";we?.members.length;const js=h||!g||!!j||ae||V||X!==null||Vt&&!D||!!t&&!D;return l.useEffect(()=>{D&&(I(null),f(!1),pt(!1),Y(!1),xe({state:"idle"}),w(o=>o+1))},[D]),l.useEffect(()=>{ut.current&&ir(ut.current,t?sr(t):null)},[t]),g?e.jsxs("div",{className:"min-h-screen bg-paper text-ink flex flex-col",children:[!Z&&e.jsx(_s,{compact:!0}),e.jsxs("div",{className:"flex-1 flex flex-col items-center px-2 sm:px-4 py-3",children:[xs&&!z&&e.jsx(Bn,{open:!0,onClose:()=>bt(!1),onConfirm:(o,v)=>{Kt({id:v,nick:o,isGuest:!0}),bt(!1)}}),e.jsx("div",{ref:ra,className:Z||ue?"fixed inset-0 z-50 bg-ink flex items-center justify-center overflow-hidden":"relative w-full max-w-6xl",style:Z||ue?void 0:{aspectRatio:"800/600"},children:e.jsxs("div",{ref:ut,className:Z||ue?"relative bg-paper w-full h-full flex items-center justify-center":"absolute inset-0",children:[e.jsx($s,{mode:"play",initialLoadout:S??void 0,paused:js,resetKey:k,onStateChange:N,onGameOver:fs,fxPrefs:_e,registerChooseHandler:o=>{ct.current=o},registerDashHandler:o=>{qt.current=o},registerMoveHandler:o=>{Ut.current=o},registerFireHandler:o=>{as.current=o},registerDebugHandlers:o=>{dt.current=o},registerZoomHandler:o=>{me.current=o},disableKeyboardMove:L.enabled,autoAim:L.autoFire,autoFire:L.autoFire,onSelfPose:hs,remotePlayers:D?ns:[],arenaSnapsh
16ot:Le?null:rs,onArenaSnapshot:gs,selfChatBubble:os}),V&&!D&&X===null&&e.jsx(Mr,{profile:p,isFullscreen:Z,onToggleFullscreen:ft,onStart:()=>{let o=null,v=null;try{o=Ra(),v=localStorage.getItem("md.meta.starterWeapon")}catch{}if(!o){O("maps");return}if(!v){O("loadout");return}try{$a([...Ma(o),`weapon:${v}`,`map:${o}`])}catch{}Y(!1)},onTraining:_?()=>C(!0):void 0,onOpenPanel:o=>O(o)}),X==="maps"&&e.jsx(_r,{onBack:()=>O(null),onOpenPanel:o=>O(o)}),X==="loadout"&&e.jsx(Tr,{onBack:()=>O(null),onOpenPanel:o=>O(o),onConfirm:()=>{O(null),I(null),Y(!1),w(o=>o+1)}}),X==="store"&&e.jsx(zr,{onBack:()=>O(null),onOpenPanel:o=>O(o)}),X==="passives"&&e.jsx(Ur,{onBack:()=>O(null),onOpenPanel:o=>O(o)}),X==="ranking"&&e.jsx(Yr,{onBack:()=>O(null)}),X==="result"&&e.jsx(Xr,{onBack:()=>O(null),onReplay:()=>{O(null),I(null),w(o=>o+1),Y(!1)},onOpenPanel:o=>O(o)}),X==="profile"&&e.jsx(Jr,{onBack:()=>O(null)}),X==="catalog"&&e.jsx(li,{onBack:()=>O(null)}),X==="manga"&&e.jsx(yi,{onBack:()=>O(null)}),(()=>{const o=Da(),v=o?Fa[o].coin:1,M=ma(),E=u.killCount*.5+u.score/100,F=Math.max(0,Math.floor(E*v*M)),T=Oa(),H=T?T.displayName.slice(0,14):void 0,R=o?o==="endless"?"∞":o==="hard"?"H":o==="medium"?"M":"N":void 0;return e.jsx(Yn,{wave:u.wave,killCount:u.killCount,score:u.score,bossWave:T?rn:void 0,coinsEst:F,tierLabel:R,mapLabel:H})})(),e.jsx(Hn,{lives:u.lives,maxLives:u.maxLives,shieldHp:u.shieldHp,shieldMax:u.shieldMax,shieldTier:u.shieldTier,level:u.level,xp:u.xp,xpToNext:u.xpToNext}),e.jsx(Xn,{ms:u.artilleryMs,maxMs:u.artilleryMaxMs,tier:u.artilleryTier}),e.jsx(Gn,{chain:u.killChain,msLeft:u.killChainMs,best:u.killChainBest}),e.jsx(Kn,{boss:u.boss}),!j&&e.jsx(Zn,{wave:u.wave,isLevelup:ae,lives:u.lives}),!ae&&(()=>{const o=ha(L),v=ue&&L.enabled,M=o.dashSide==="left"?"right":"left",E=v?M==="left"?{left:6,bottom:10,top:"auto",right:"auto"}:{right:6,bottom:10,top:"auto",left:"auto"}:{left:"50%",transform:"translateX(-50%)",bottom:10},F=v?"absolute z-10 pointer-events-none flex flex-col gap-1.5 items-center max-h-[60vh] overflow-hidden":"absolute z-10 pointer-events-none flex gap-1.5 flex-wrap justify-center max-w-[92%] items-center";return e.jsxs("div",{className:F,style:E,children:[v&&e.jsxs("div",{className:"pointer-events-auto flex flex-col gap-1 items-center mb-0.5",children:[e.jsx("button",{type:"button",onClick:()=>me.current?.zoomIn(),"aria-label":"zoom in",title:"zoom +",className:"w-10 h-8 border-2 border-ink bg-paper/90 backdrop-blur-sm shadow-flat font-display font-black text-base leading-none active:scale-95",children:"+"}),e.jsx("button",{type:"button",onClick:()=>me.current?.reset(),"aria-label":"zoom reset",title:"reset zoom",className:"w-10 h-6 border-2 border-ink bg-paper/90 backdrop-blur-sm shadow-flat font-mono text-[9px] uppercase tracking-wider active:scale-95",children:"1×"}),e.jsx("button",{type:"button",onClick:()=>me.current?.zoomOut(),"aria-label":"zoom out",title:"zoom −",className:"w-10 h-8 border-2 border-ink bg-paper/90 backdrop-blur-sm shadow-flat font-display font-black text-base leading-none active:scale-95",children:"−"})]}),e.jsx("button",{type:"button",onClick:()=>Yt(!0),title:"abrir inventário (armas, combos, stats)","aria-label":"inventário",className:"pointer-events-auto w-10 h-10 border-2 border-ink bg-postit-mustard text-ink shadow-flat font-display text-lg hover:-translate-y-[1px] transition-transform",children:"📜"}),u.weapons.map((T,H)=>{const R=Et[T.id],B=!!T.container,J=!!T.fused&&!B,q=We(T,R?.icon),le=He(T,R?.name),fe=T.level>=de,be=T.fused?.element??ke(T.variantId)?.element??"neutral",Te={fire:"var(--ink-cinnabar)",ice:"var(--ink-cobalt)",water:"var(--ink-cobalt)",lightning:"var(--ink-mustard)",poison:"var(--ink-jade)",ink:"var(--ink)",holy:"var(--ink-mustard)",void:"var(--ink-violet)",legend:"var(--ink-mustard)",neutral:"var(--ink-3)"},Xe=Te[be]??Te.neutral,ia=B?"border-postit-cinnabar bg-postit-cinnabar/15":J?"border-ink-cobalt bg-ink-cobalt/10":"border-ink bg-paper/95";if(B&&T.container){const Ae=T.container.members;return e.jsxs("div",{title:`Backpack ×${Ae.length} · todas ativas · Lv 5★`,className:`relative min-w-14 px-1.5 py-1 border-2 ${ia} shadow-flat text-center backdrop-blur-sm`,children:[e.jsxs("div",{className:"flex items-center justify-center gap-0.5 leading-none",children:[Ae.slice(0,3).map((oa,ys)=>e.jsx(je,{variantId:oa.variantId??oa.id,size:18},ys)),Ae.length>3&&e.jsxs("span",{className:"text-[9px] text-ink-3",children:["+",Ae.length-3]})]}),e.jsxs("div",{className:"font-display text-[10px] font-black leading-tight",children:["🎒×",Ae.length," 5★"]})]},H)}return e.jsxs("div",{title:`${le} · Lv ${T.level} · ${be}`,className:`relative min-w-14 px-2 py-1 border-2 ${ia} shadow-flat text-center backdrop-blur-sm`,children:[be!=="neutral"&&e.jsx("span",{"aria-hidden":!0,
16className:"absolute -top-1 -right-1 w-2.5 h-2.5 rounded-full border border-ink",style:{background:Xe}}),e.jsx("div",{className:"flex items-center justify-center leading-none",children:e.jsx(je,{variantId:T.variantId??T.id,fallback:q,size:22})}),e.jsx("div",{className:"font-display text-[10px] font-black leading-tight truncate max-w-20",children:`Lv ${T.level}${fe?"★":""}`})]},H)})]})})(),e.jsx(cr,{stats:cs,visible:!!D&&_e.netHud}),e.jsxs("div",{className:"absolute top-2 right-2 z-20 flex flex-col items-end gap-1",children:[P&&e.jsx("button",{type:"button",onClick:()=>{U.current=!0,dt.current?.skipWave(),W.message("Wave pulada",{description:"Run não conta no ranking."})},title:"pular pra próxima wave (desbloqueado na árvore) — tira a run do ranking",className:"hidden sm:inline-flex h-8 px-2 border-2 border-ink bg-paper hover:bg-paper-2 shadow-flat font-mono text-[10px] uppercase tracking-wide items-center",children:"⏭ wave"}),D&&e.jsx(lr,{prefs:_e,onChange:xt}),e.jsx($e,{onClick:ft,title:Z?"exit fullscreen":"fullscreen",label:"⛶",active:Z}),e.jsx($e,{onClick:()=>f(o=>!o),disabled:ae,title:h?"resume (esc)":"pause (esc)",label:h?"▶":"⏸"}),e.jsx($e,{onClick:()=>G({autoFire:!L.autoFire}),title:L.autoFire?"auto-fire: on":"auto-fire: off",label:"◎",active:L.autoFire}),e.jsxs("span",{className:"hidden sm:contents",children:[e.jsx($e,{onClick:ht,title:"restart",label:"↺"}),e.jsx($e,{onClick:na,title:"toggle analog stick",label:"🕹",active:L.enabled})]}),e.jsxs("div",{className:"relative",children:[e.jsx($e,{onClick:()=>mt(o=>!o),title:"menu / settings",label:"☰",active:ea}),ea&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-64 z-30 border-2 border-ink bg-paper shadow-flat-lg p-3 text-ink text-[11px] font-mono space-y-2 max-h-[80vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-display font-black text-sm",children:"menu"}),e.jsx("button",{type:"button",onClick:()=>mt(!1),className:"text-ink-3 hover:text-ink","aria-label":"close",children:"✕"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[da,D&&e.jsx("button",{type:"button",onClick:vs,disabled:Jt,className:"border-2 border-ink bg-postit-mustard text-ink px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform disabled:opacity-50",children:Jt?"ending…":"⛔ end battle"}),_?e.jsx("button",{type:"button",onClick:()=>{C(!0),mt(!1)},title:"Treino livre com tudo destravado — não conta no ranking",className:"border-2 border-ink bg-postit-mustard text-ink px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform",children:"🎯 treino livre"}):e.jsx("div",{title:"Compre 'Câmara de Treino Livre' na árvore de passivas (capstone)",className:"border-2 border-dashed border-ink/40 bg-paper/60 text-ink/50 px-2 py-1 font-mono text-[10px] uppercase tracking-wider text-center cursor-not-allowed",children:"🔒 treino livre"}),e.jsx(ca,{to:"/leaderboard",className:"border-2 border-ink bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-center",children:"🏆 ranking"}),e.jsxs(ca,{to:"/profile",search:{next:"/play"},className:"border-2 border-ink bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-center",children:["👤 ",p?.displayName??"profile"]}),e.jsx("a",{href:"/",className:"border-2 border-ink bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat hover:-translate-y-[1px] transition-transform text-center",children:"← site"})]}),P&&e.jsxs("div",{className:"sm:hidden border-t border-ink-3/30 pt-2 space-y-1",children:[e.jsx("div",{className:"font-display font-black text-sm",children:"debug"}),e.jsx("button",{type:"button",onClick:()=>{U.current=!0,dt.current?.skipWave(),W.message("Wave pulada",{description:"Run não conta no ranking."})},className:"w-full border-2 border-ink bg-paper px-2 py-1 font-mono text-[10px] uppercase tracking-wider shadow-flat text-left",children:"⏭ skip wave (não-rankeado)"})]}),e.jsxs("div",{className:"sm:hidden border-t border-ink-3/30 pt-2 grid grid-cols-3 gap-1",children:[e.jsx("button",{type:"button",onClick:ht,className:"border-2 border-ink bg-paper px-2 py-2 font-mono text-[10px] uppercase tracking-wider shadow-flat",children:"↺ restart"}),e.jsx("button",{type:"button",onClick:ft,className:`border-2 border-ink px-2 py-2 font-mono text-[10px] uppercase tracking-wider shadow-flat ${Z?"bg-postit-cobalt":"bg-paper"}`,children:"⛶ full"}),e.jsx("button",{type:"button",onClick:na,className:`border-2 border-ink px-2 py-2 font-mono text-[10px] uppercase tracking-wider shadow-flat ${L.enabled?"bg-postit-jade":"bg-paper"}`,children:"🕹 analog"})]}),e.jsxs("div",{className:"border-t border-ink-3/30 pt-2 space-y-2",children:[e.jsx("div",{className:"font-display font-black text-sm",children:"controls layout"}),e.jsx("div",{className:"grid grid-cols-3 gap-1",children:["default","em-pe","landscape"].map(o=>e.jsx("button",{type:"button",onClick:()=>G({layout:o}),className:`border-2 border-ink px-2 py-1.5 font-mono text-[10px] uppercase tracking-wider shadow-flat ${L.layout===o?"bg-ink text-paper":"bg-paper"}`,title:o==="default"?"analog center, dash side":o==="em-pe"?"phone upright — two hands":"phone landscape — spread",children:o==="default"?"default":o==="em-pe"?"upright":"landscape"},o))}),L.layout==="default"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"dash horizontal"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>G({dashSide:"left"}),className:`border-2 border-ink px-2 py-0.5 text-[10px] uppercase ${L.dashSide==="left"?"bg-ink text-paper":"bg-paper"}`,children:"left"}),e.jsx("button",{type:"button",onClick:()=>G({dashSide:"right"}),className:`border-2 border-ink px-2 py-0.5 text-[10px] uppercase ${L.dashSide==="right"?"bg-ink text-paper":"bg-paper"}`,children:"right"})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"dash vertical"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>G({dashVSide:"top"}),className:`border-2 border-ink px-2 py-0.5 text-[10px] uppercase ${L.dashVSide==="top"?"bg-ink text-paper":"bg-paper"}`,children:"top"}),e.jsx("button",{type:"button",onClick:()=>G({dashVSide:"bottom"}),className:`border-2 border-ink px-2 py-0.5 text-[10px] uppercase ${L.dashVSide==="bottom"?"bg-ink text-paper":"bg-paper"}`,children:"bottom"})]})]})]}),e.jsxs("p",{className:"text-[10px] text-ink-3 leading-snug",children:["on mobile, with analog on, aim and fire are ",e.jsx("b",{children:"automatic"})," on the closest enemy. you just move."]}),e.jsxs("label",{className:"hidden sm:flex items-center justify-between gap-2",children:[e.jsx("span",{children:L.enabled?"auto aim+fire":"auto-fire (mouse aim)"}),e.jsx("input",{type:"checkbox",checked:L.autoFire,onChange:o=>G({autoFire:o.target.checked})})]}),e.jsxs("label",{className:"block",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"size"}),e.jsxs("span",{children:[L.size,"px"]})]}),e.jsx("input",{type:"range",min:80,max:200,value:L.size,onChange:o=>G({size:Number(o.target.value)}),className:"w-full"})]}),e.jsxs("label",{className:"block",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"opacity"}),e.jsxs("span",{children:[Math.round(L.opacity*100),"%"]})]}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(L.opacity*100),onChange:o=>G({opacity:Number(o.target.value)/100}),className:"w-full"})]}),e.jsxs("label",{className:"block",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"height (raise stick)"}),e.jsxs("span",{children:[L.offsetY,"px"]})]}),e.jsx("input",{type:"range",min:0,max:300,step:2,value:L.offsetY,onChange:o=>G({offsetY:Number(o.target.value)}),className:"w-full"})]})]}),e.jsxs("div",{className:"border-t border-ink-3/30 pt-2 space-y-1",children:[e.jsx("div",{className:"font-display font-black text-sm",children:"damage numbers (Sumi)"}),e.jsx("div",{className:"grid grid-cols-3 gap-1",children:["stack","dps","off"].map(o=>e.jsx("button",{type:"button",onClick:()=>xt({damageMode:o}),className:`border-2 border-ink px-2 py-1.5 font-mono text-[10px] uppercase tracking-wider shadow-flat ${_e.damageMode===o?"bg-ink text-paper":"bg-paper"}
16`,title:o==="stack"?"Sumi Strike — each hit is a rising number":o==="dps"?"Sumi DPS — one number per enemy, damage/second":"hide",children:o==="stack"?"stack":o==="dps"?"dps":"off"},o))}),e.jsxs("p",{className:"text-[10px] text-ink-3 leading-snug",children:[e.jsx("b",{children:"DPS"})," (default) shows one number per enemy, summing damage per second.",e.jsx("b",{children:" Stack"})," stacks each individual hit."]})]}),e.jsx("div",{className:"border-t border-ink-3/30 pt-2 space-y-1",children:e.jsxs("label",{className:"flex items-center justify-between gap-2 cursor-pointer",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-display font-black text-sm",children:"simplified scene"}),e.jsx("p",{className:"text-[10px] text-ink-3 leading-snug",children:"disables rain, embers, god rays and wipe — keeps walls and palette. helps perf."})]}),e.jsx("input",{type:"checkbox",checked:_e.simpleScene,onChange:o=>xt({simpleScene:o.target.checked}),className:"h-4 w-4 accent-ink"})]})})]})]})]}),e.jsx("div",{className:"absolute top-12 right-2 sm:top-14 sm:right-3 z-10 pointer-events-none opacity-55 hover:opacity-90 transition-opacity font-mono text-[10px] uppercase tracking-wider text-ink",children:e.jsx(Ls,{compact:!0})}),e.jsxs("div",{className:`absolute right-2 top-1/2 -translate-y-1/2 z-20 flex-col gap-1 select-none ${ue?"hidden":"flex"}`,children:[e.jsx("button",{type:"button",onClick:()=>me.current?.zoomIn(),"aria-label":"zoom in",title:"zoom +",className:"w-9 h-9 border-2 border-ink bg-paper/85 backdrop-blur-sm shadow-flat font-display font-black text-lg leading-none hover:bg-paper active:scale-95",children:"+"}),e.jsx("button",{type:"button",onClick:()=>me.current?.reset(),"aria-label":"zoom reset",title:"reset",className:"w-9 h-7 border-2 border-ink bg-paper/85 backdrop-blur-sm shadow-flat font-mono text-[9px] uppercase tracking-wider hover:bg-paper active:scale-95",children:"1×"}),e.jsx("button",{type:"button",onClick:()=>me.current?.zoomOut(),"aria-label":"zoom out",title:"zoom −",className:"w-9 h-9 border-2 border-ink bg-paper/85 backdrop-blur-sm shadow-flat font-display font-black text-lg leading-none hover:bg-paper active:scale-95",children:"−"})]}),(()=>{const o=ha(L),v=u.dashCdLeft<=0,M=v?1:1-u.dashCdLeft/u.dashCdMax,E=zs().kit.dashAbility,F=E==="blink"?"瞬":E==="rollIframe"?"回":E==="none"?"—":"≫",T=E==="blink"?"Blink (Shift)":E==="rollIframe"?"Roll (Shift)":E==="none"?"Sem dash":"Dash (Shift)",H=E==="rollIframe"?"bg-jade text-paper":E==="none"?"bg-paper/20 text-ink/40 border-ink/40":"bg-cobalt text-paper",R=E==="rollIframe"?"bg-jade":"bg-cobalt",B=o.dashVSide==="top"?"top":"bottom",J=o.dashVSide==="top"?Math.max(56,o.bottomOffset):o.bottomOffset,q=o.dashSide==="left"?{left:o.edgeOffset,[B]:J}:{right:o.edgeOffset,[B]:J};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>qt.current?.(),disabled:!v||!!j||ae||E==="none","aria-label":T,style:q,className:`absolute z-20 w-16 h-16 sm:w-16 sm:h-16 border-2 border-ink font-display font-black flex items-center justify-center select-none transition-all touch-none ${v&&E!=="none"?`${H} shadow-flat hover:scale-105 active:scale-95`:"bg-paper/20 text-ink/40 border-ink/40 backdrop-blur-sm cursor-not-allowed"}`,title:T,children:[e.jsx("span",{className:"text-2xl",children:F}),!v&&E!=="none"&&e.jsx("span",{className:`absolute inset-x-0 bottom-0 h-1 ${R} origin-left`,style:{transform:`scaleX(${M})`}}),e.jsx("span",{className:"absolute -top-2 -right-2 text-[10px] bg-paper border border-ink px-1 leading-none py-0.5",children:E==="none"?"—":v?"GO":`${(u.dashCdLeft/1e3).toFixed(1)}s`})]}),L.enabled&&!j&&!ae&&!h&&e.jsx(Wn,{size:L.size,opacity:L.opacity,pos:o.analogPos,offsetX:o.edgeOffset,offsetY:o.bottomOffset+L.offsetY,onVector:ds})]})})(),e.jsx(Ts,{open:Vt,onClose:()=>pt(!1),initialRoomId:t??null}),e.jsx(Si,{open:ss,onClose:()=>Yt(!1),weapons:u.weapons,combos:u.combos,stats:u.stats,level:u.level,killCount:u.killCount}),z&&D&&t&&e.jsx(Ln,{identity:z,channels:[{key:`room:${t}`,label:"room",tone:"cinnabar"}
16,{key:"global",label:"global",tone:"cobalt"}],position:"bottom-left",onAnyMessage:ks,enableHotkey:!ae&&!j}),t&&!D&&!j&&e.jsx("div",{className:"absolute inset-0 z-30 flex items-center justify-center bg-paper/90 backdrop-blur-sm p-4",children:e.jsxs("div",{className:"max-w-sm border-4 border-ink bg-paper-2 p-5 text-center shadow-flat-lg",children:[e.jsx(he,{text:"SYNC",tone:"mustard",rotate:-4,size:"md"}),e.jsx("p",{className:"mt-3 font-mono text-xs uppercase tracking-wider text-ink-3",children:"entering the room arena…"}),e.jsx("div",{className:"mt-4 flex justify-center gap-2",children:e.jsx(st,{variant:"outline",onClick:()=>s({to:"/play",search:{}}),children:"leave room"})})]})}),h&&!j&&!ae&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-paper/80 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx(he,{text:"PAUSE",tone:"cobalt",rotate:-4,size:"lg"}),e.jsx("p",{className:"mt-4 text-sm text-ink-3",children:"press ESC or ▶ to resume"})]})}),ae&&!j&&!V&&(()=>{const o=u.level===1&&u.weapons.length===0;return e.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-paper/95 backdrop-blur-sm p-3 sm:p-4 pt-24 sm:pt-4 animate-fade-in overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl w-full my-auto",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsx(he,{text:o?"ESCOLHE!":`LV ${u.level}!`,tone:o?"cinnabar":"mustard",rotate:-3,size:"lg"}),e.jsx("p",{className:"mt-2 text-sm text-ink-3 font-mono uppercase tracking-wider",children:o?"pick your first weapon":"pick a card"})]}),e.jsx("div",{className:`grid gap-3 ${u.levelUpChoices.length>=9||u.levelUpChoices.length>=6?"grid-cols-2 sm:grid-cols-3 lg:grid-cols-3":"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"}`,children:u.levelUpChoices.map((v,M)=>e.jsx(wi,{choice:v,currentWeapons:u.weapons,onPick:()=>bs(M)},M))})]})})})(),j&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-paper/90 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center max-w-sm border-2 border-ink bg-paper p-6 shadow-flat-lg",children:[j.victory?e.jsxs(e.Fragment,{children:[e.jsx(he,{text:"VITÓRIA!",tone:"mustard",rotate:-4,size:"lg"}),e.jsxs("p",{className:"mt-2 text-xs uppercase tracking-widest text-ink-3",children:["Mapa concluído",j.activeMapId?` · ${j.activeMapId}`:"",j.activeMapTier&&j.activeMapTier!=="normal"?` · tier ${j.activeMapTier}`:""]})]}):j.activeMapTier==="endless"&&(j.endlessLoop??0)>0?e.jsxs(e.Fragment,{children:[e.jsx(he,{text:"∞ LOOP!",tone:"violet",rotate:-5,size:"lg"}),e.jsxs("p",{className:"mt-2 text-xs uppercase tracking-widest text-ink-3",children:[j.endlessLoop," ",j.endlessLoop===1?"ciclo":"ciclos"," de boss · ",j.activeMapId]})]}):e.jsx(he,{text:"GAME OVER",tone:"cinnabar",rotate:-6,size:"lg"}),e.jsxs("div",{className:"mt-6 space-y-1 font-display",children:[e.jsxs("p",{className:"text-3xl font-black",children:[j.score," pts"]}),e.jsxs("p",{className:"text-sm text-ink-3",children:["Lv ",j.level," · wave ",j.wave," · ",j.killCount," kills ·"," ",Math.floor(j.durationMs/1e3),"s"]})]}),e.jsxs("div",{className:"mt-4 min-h-[44px]",children:[ye.state==="sending"&&e.jsx("p",{className:"text-xs text-ink-3 animate-pulse",children:"submitting to ranking…"}),ye.state==="ok"&&e.jsxs("p",{className:"text-sm font-display",children:["🏆 ",e.jsxs("b",{children:["#",ye.rank]})," on global ranking"]}),ye.state==="error"&&e.jsxs("p",{className:"text-xs text-ink-cinnabar",children:["couldn't submit: ",ye.error]}),ye.state==="idle"&&j.score===0&&e.jsx("p",{className:"text-xs text-ink-3",children:"score to enter the ranking"})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 justify-center",children:[e.jsx(st,{onClick:ht,className:"bg-ink text-paper border-2 border-ink shadow-flat font-bold",children:"play again"}),e.jsx("button",{type:"button",onClick:()=>O("result"),className:"inline-flex items-center justify-center px-4 py-2 border-2 border-ink shadow-flat font-bold text-sm bg-postit-mustard text-ink hover:-translate-y-[1px] transition-transform",children:"📊 resultado"}),e.jsx("button",{type:"button",onClick:()=>{I(null),Y(!0)},className:"inline-flex items-center justify-center px-4 py-2 border-2 border-ink shadow-flat font-bold text-sm bg-paper hover:bg-paper-2",children:"🏠 menu"}),e.jsx("button",{type:"button",onClick:()=>O("ranking"),className:"inline-flex items-center justify-center px-4 py-2 border-2 border-ink shadow-flat font-bold text-sm bg-paper hover:bg-paper-2",children:"🏆 ranking"})]})]})}),e.jsx(dr,{open:y,onClose:()=>C(!1),initial:S??void 0,onConfirm:us})]})}),!Z&&da,e.jsxs("details",{className:"w-full max-w-5xl mt-6 border-2 border-ink bg-paper-2 shadow-flat",children:[e.jsx("summary",{className:"cursor-pointer font-display font-bold p-3",children:"how to play"}),e.jsxs("div",{className:"px-4 pb-4 text-sm space-y-2 text-ink-2",children:[e.jsxs("p",{children:["• ",e.jsx("b",{children:"Move:"})," WASD or arrows. MD walks in 8 directions."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Aim:"})," the mouse points the shot direction."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Shoot:"}
16)," mouse click, hold for burst — or spacebar."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Hordes:"})," yokai come from all 4 sides. Each hit costs 1 life."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Drops:"})," ◉ blue = XP, ❤ rare = heal, 🦊 golden = clears screen."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Level up:"})," XP fills → pick 1 of 3 cards (weapon, fuse or skill). Stacks."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"Dash:"})," Shift (or Q, or button ≫). 5s cooldown, short invuln."]}),e.jsxs("p",{children:["• ",e.jsx("b",{children:"ESC:"})," pauses."]})]})]}),!Z&&e.jsx("div",{className:"w-full mt-8",children:e.jsx(Ga,{compact:!0})})]})]}):e.jsx("div",{className:"min-h-screen bg-paper flex items-center justify-center text-ink-3",children:"loading…"})}function $e({onClick:t,label:a,title:s,disabled:n,active:r}){return e.jsx("button",{type:"button",onClick:t,disabled:n,title:s,"aria-label":s,className:`w-10 h-10 sm:w-8 sm:h-8 border-2 border-ink shadow-flat font-mono text-base sm:text-sm flex items-center justify-center transition-all hover:-translate-y-[1px] disabled:opacity-40 disabled:cursor-not-allowed disabled:translate-y-0 ${r?"bg-cobalt text-paper":"bg-paper text-ink"}`,children:a})}function rt({element:t}){const a=Ue(t);return!t||t==="neutral"?null:e.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider border border-ink px-1.5 py-0.5 ${a.bg} ${a.tone}`,children:a.label})}function Oe({label:t,bg:a}){return e.jsx("div",{className:`absolute -top-2 left-2 px-2 py-0.5 border-2 border-ink shadow-flat font-display font-black text-[9px] uppercase tracking-widest ${a}`,children:t})}function Be({items:t,dense:a=!1}){return t.length?e.jsx("ul",{className:`font-mono ${a?"text-[9px]":"text-[10px]"} text-ink leading-tight space-y-0.5`,children:t.map((s,n)=>e.jsx("li",{className:"truncate",children:s},n))}):null}function wi({choice:t,currentWeapons:a,onPick:s}){if(t.kind==="new"){const n=ke(t.weaponId),r=Ue(n?.element);return e.jsxs("button",{onClick:()=>s(),className:"relative border-2 border-ink bg-paper hover:bg-paper-2 shadow-flat hover:shadow-flat-lg p-3 pt-4 text-left transition-all hover-scale flex flex-col gap-2 min-h-[200px]",children:[e.jsx(Oe,{label:"New weapon",bg:"bg-postit-jade text-ink"}),e.jsx("div",{className:"absolute -top-2 right-2 z-10",children:e.jsx(rt,{element:n?.element})}),e.jsx("div",{className:"flex items-start gap-1",children:e.jsx("div",{className:`w-14 h-14 border-2 border-ink flex items-center justify-center ${r.bg}`,children:e.jsx(je,{variantId:t.weaponId,fallback:n?.icon,size:44})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-display font-bold text-base leading-tight tracking-tight",children:n?.name??t.weaponId}),e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3",children:n?et[n.behavior]??n.behavior:""})]}),e.jsx("div",{className:"text-[11px] text-ink-2 leading-snug",children:n?.desc}),n&&e.jsxs("div",{className:"text-[10px] text-ink-cobalt leading-snug border-l-2 border-ink-cobalt/40 pl-2 flex-1",children:["👁 ",nt(n)]}),n?.tradeoff&&e.jsxs("div",{className:"text-[10px] italic text-ink-3 leading-snug",children:["⚖ ",n.tradeoff]}),e.jsxs("div",{className:"pt-2 border-t-2 border-dashed border-ink/30",children:[e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3 mb-1",children:"level 1 stats"}),e.jsx(Be,{items:Pe(n,1)})]})]})}if(t.kind==="upgrade"){const n=ke(t.weaponId),r=Pe(n,t.toLevel-1),c=Pe(n,t.toLevel),d=Ue(n?.element);return e.jsxs("button",{onClick:()=>s(),className:"relative border-2 border-ink bg-paper hover:bg-paper-2 shadow-flat hover:shadow-flat-lg p-3 pt-4 text-left transition-all hover-scale flex flex-col gap-2 min-h-[200px]",children:[e.jsx(Oe,{label:"Evolution",bg:"bg-postit-cobalt text-paper"}),e.jsx("div",{className:"absolute -top-2 right-2 z-10",children:e.jsx(rt,{element:n?.element})}),e.jsx("div",{className:"flex items-start gap-1",children:e.jsx("div",{className:`w-14 h-14 border-2 border-ink flex items-center justify-center ${d.bg}`,children:e.jsx(je,{variantId:t.weaponId,fallback:n?.icon,size:44})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-display font-bold text-base leading-tight tracking-tight",children:n?.name??t.weaponId}),e.jsxs("div",{className:"font-mono text-[10px] text-ink-3",children:["Lv ",t.toLevel-1," → ",e.jsxs("span",{className:"text-ink font-black",children:["Lv ",t.toLevel]})," / ",de]})]}),n&&e.jsxs("div",{className:"text-[10px] text-ink-cobalt leading-snug border-l-2 border-ink-cobalt/40 pl-2",children:["👁 ",nt(n)]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t-2 border-dashed border-ink/30 flex-1",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3 mb-1",children:"before"}),e.jsx(Be,{items:r,dense:!0})]}),e.jsxs("div",{className:"border-l-2 border-dashed border-ink/30 pl-2",children:[e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-postit-cinnabar mb-1",children:"after"}),e.jsx(Be,{items:c,dense:!0})]})]}),(t.toLevel===3||t.toLevel===5)&&kt[t.weaponId]&&(()=>{const i=t.toLevel===5?kt[t.weaponId].l5:kt[t.weaponId].l3;return e.jsxs("div",{className:"mt-1 border-2 border-postit-mustard bg-postit-mustard/30 p-2",children:[e.jsxs("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3",children:["unlock · Lv ",t.toLevel]}),e.jsxs("div",{className:"font-display font-black text-[12px] leading-tight",children:["★ ",i.name]}),e.jsx("div",{className:"text-[10px] text-ink-2 leading-snug",children:i.desc})]})})()]})}if(t.kind==="combo"){const n=La[t.comboId];return e.jsxs("button",{onClick:()=>s(),className:"relative border-2 border-ink bg-postit-mustard/30 hover:bg-postit-mustard/50 shadow-flat hover:shadow-flat-lg p-3 pt-4 text-left transition-all hover-scale flex flex-col gap-2 min-h-[200px] ring-2 ring-postit-mustard ring-offset-2 ring-offset-paper",children:[e.jsx(Oe,{label:"Combo",bg:"bg-postit-mustard text-ink"}),e.jsx("div",{className:"flex items-start justify-between gap-1",children:e.jsx("div",{className:"w-14 h-14 border-2 border-ink bg-paper flex items-center justify-center text-3xl",children:n.icon})}),e.jsx("div",{className:"font-display font-bold text-base leading-tight tracking-tight",children:n.name}),e.jsx("div",{className:"text-[11px] text-ink-2 leading-snug flex-1",children:n.desc}),e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3 pt-2 border-t-2 border-dashed border-ink/30",children:"passive — always on"})]})}return t.kind==="fuse"?e.jsx(Ni,{choice:t,currentWeapons:a,onPick:s}):e.jsxs("button",{onClick:()=>s(),className:"relative border-2 border-ink bg-postit-jade/30 hover:bg-postit-jade/50 shadow-flat hover:shadow-flat-lg p-3 pt-4 text-left transition-all hover-scale flex flex-col gap-2 min-h-[200px]",children:[e.jsx(Oe,{label:"Life",bg:"bg-postit-cinnabar text-paper"}),e.jsx("div",{className:"w-14 h-14 border-2 border-ink bg-paper flex items-center justify-center text-3xl",children:"❤"}),e.jsx("div",{className:"font-display font-bold text-base leading-tight tracking-tight",children:"Extra heart"}),e.jsx("div",{className:"text-[11px] text-ink-2 leading-snug flex-1",children:"+1 to max life cap and +1 current life. Does not fully heal."}),e.jsx("div",{className:"font-mono text-[10px] text-ink pt-2 border-t-2 border-dashed border-ink/30",children:"maxHp +1 · vidas +1"})]})}function Ni({choice:t,currentWeapons:a,onPick:s}){const n=a.find(i=>(i.variantId??i.id)===t.baseId),r=a.find(i=>(i.variantId??i.id)===t.temperoId),c=i=>i?i.container?i.container.members.map(p=>({id:p.id,variantId:p.variantId,icon:We({id:p.id,variantId:p.variantId,state:p.state},void 0),name:He({id:p.id,variantId:p.variantId,state:p.state},void 0)})):[{id:i.id,variantId:i.variantId,icon:We(i,void 0),name:He(i,void 0)}]:[],d=[...c(n),...c(r)];return e.jsxs("div",{className:"relative border-2 border-ink bg-postit-cinnabar/15 shadow-flat p-3 pt-4 flex flex-col gap-2 min-h-[280px] ring-2 ring-postit-cinnabar ring-offset-2 ring-offset-paper sm:col-span-2 lg:col-span-1",children:[e.jsx(Oe,{label:"⚡ Fusion",bg:"bg-postit-cinnabar text-paper"}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3 mb-1",children:"stash both weapons in one backpack slot"})}),e.jsxs("div",{className:"border-2 border-postit-cinnabar bg-paper p-3 flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("div",{className:"w-12 h-12 border-2 border-ink bg-paper flex items-center justify-center text-2xl shrink-0 relative",children:["🎒",e.jsxs("span",{className:"absolute -bottom-1 -right-1 px-1 text-[9px] font-black bg-ink text-paper border border-ink leading-none",children:["×",d.length]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-display font-black text-sm leading-tight",children:["Backpack ×",d.length]}),e.jsx("div",{className:"font-mono text-[9px] uppercase text-postit-cinnabar",children:"all weapons fire together"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:d.map((i,p)=>e.jsxs("span",{className:"flex items-center gap-0.5",children:[p>0&&e.jsx("span",{className:"text-ink-3 text-[10px]",children:"+"}),e.jsx("span",{title:i.name,className:"w-8 h-8 border-2 border-ink bg-paper flex items-center justify-center",children:e.jsx(je,{variantId:i.variantId??i.id,fallback:i.icon,size:24})})]},p))}),e.jsx("div",{className:"font-mono text-[9px] text-ink-3 mt-auto pt-2 leading-snug",children:"each keeps its look, stats and damage · locks at Lv 5★ · frees 1 slot"})]}),e.jsx("button",{type:"button",onClick:()=>s(),className:"mt-auto border-2 border-ink bg-postit-cinnabar hover:bg-postit-cinnabar/80 text-paper shadow-flat hover:shadow-flat-lg font-display font-black text-xs py-2 uppercase tracking-wider transition-all",children:"Stash in backpack 🎒"})]})}function Si({open:t,onClose:a,weapons:s,combos:n,stats:r,level:c,killCount:d}){return t?e.jsx("div",{className:"absolute inset-0 z-30 bg-ink/80 backdrop-blur-sm flex items-center justify-center p-3 animate-fade-in",onClick:a,children:e.jsxs("div",{className:"relative max-w-3xl w-full max-h-[90vh] overflow-y-auto bg-paper border-2 border-ink shadow-flat-lg p-4 sm:p-6",onClick:i=>i.stopPropagation(),children:[e.jsx("button",{onClick:a,className:"absolute top-2 right-2 w-8 h-8 border-2 border-ink bg-paper hover:bg-paper-2 font-mono text-sm","aria-label":"close",children:"✕"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"font-display font-black text-2xl",children:"📜 Inventory"}),(()=>{const i=s.reduce((m,g)=>m+(g.container?g.container.members.length:1),0),p=s.filter(m=>!!m.container).length;return e.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-wider text-ink-3",children:["Lv ",c," · ",d," kills · ",i," active weapon",i===1?"":"s",p>0?` · 🎒 ${p} backpack${p===1?"":"s"}`:""," · ",n.length," combo",n.length===1?"":"s"]})})()]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"font-display font-black text-sm mb-2 uppercase tracking-wider",children:"Equipped weapons"}),s.length===0?e.jsx("div",{className:"text-[11px] text-ink-3 italic",children:"no weapons yet"}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:s.map((i,p)=>{if(i.container){const N=i.container.members;return e.jsxs("div",{className:"border-2 border-postit-cinnabar bg-postit-cinnabar/10 p-2.5 sm:col-span-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("div",{className:"w-12 h-12 border-2 border-ink bg-paper flex items-center justify-center text-2xl shrink-0 relative",children:["🎒",e.jsxs("span",{className:"absolute -bottom-1 -right-1 px-1 text-[9px] font-black bg-ink text-paper border border-ink leading-none",children:["×",N.length]})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"font-display font-black text-sm leading-tight",children:["Backpack ×",N.length]}),e.jsx("div",{className:"font-mono text-[9px] uppercase tracking-wider text-postit-cinnabar",children:"all weapons fire in parallel · Lv 5★ · 1 slot"})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1.5",children:N.map((j,I)=>{const S={id:j.id,variantId:j.variantId,level:de,state:j.state,fused:j.fused},b=Et[j.id],y=He(S,b?.name),C=We(S,b?.icon),$=j.fused?.element??ke(j.variantId)?.element??"neutral",A=Ue($),_=
16Ia(S);return e.jsxs("div",{className:"border-2 border-ink bg-paper p-1.5 flex gap-1.5",children:[e.jsx("div",{className:`w-9 h-9 border-2 border-ink flex items-center justify-center shrink-0 ${A.bg}`,children:e.jsx(je,{variantId:j.variantId??j.id,fallback:C,size:28})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-1",children:[e.jsx("div",{className:"font-display font-black text-[11px] leading-tight truncate",children:y}),e.jsx(rt,{element:$})]}),e.jsxs("div",{className:"font-mono text-[8px] uppercase tracking-wider text-ink-3",children:["Lv 5★ · ",j.id]}),_.length>0&&e.jsx("div",{className:"mt-1 pt-1 border-t border-ink/15",children:e.jsx(Be,{items:_,dense:!0})})]})]},I)})})]},p)}const m=ke(i.variantId??i.id),g=Et[i.id],x=He(i,g?.name),h=We(i,g?.icon),f=i.fused?.element??m?.element??"neutral",k=i.level>=de,w=Ue(f),u=Ia(i);return e.jsxs("div",{className:"border-2 border-ink p-2.5 flex flex-col gap-2 bg-paper",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:`w-12 h-12 border-2 border-ink flex items-center justify-center shrink-0 ${w.bg}`,children:e.jsx(je,{variantId:i.variantId??i.id,fallback:h,size:40})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-1",children:[e.jsx("div",{className:"font-display font-black text-sm leading-tight truncate",children:x}),e.jsx(rt,{element:f})]}),e.jsxs("div",{className:"font-mono text-[9px] uppercase tracking-wider text-ink-3",children:["Lv ",i.level,k?" ★ — ready to stash":""," · ",i.id]})]})]}),m?.desc&&e.jsx("div",{className:"text-[10px] text-ink-2 leading-snug",children:m.desc}),m&&e.jsxs("div",{className:"text-[10px] text-ink-cobalt leading-snug border-l-2 border-ink-cobalt/40 pl-2",children:["👁 ",nt(m)]}),m?.tradeoff&&e.jsxs("div",{className:"text-[10px] italic text-ink-3 leading-snug",children:["⚖ ",m.tradeoff]}),e.jsx("div",{className:"pt-1.5 border-t border-ink/15",children:e.jsx(Be,{items:u,dense:!0})})]},p)})})]}),n.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"font-display font-black text-sm mb-2 uppercase tracking-wider",children:"Active combos"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:n.map(i=>{const p=La[i];return p?e.jsxs("div",{className:"border-2 border-ink bg-postit-mustard/20 p-2 flex gap-2",children:[e.jsx("div",{className:"w-10 h-10 border-2 border-ink bg-paper flex items-center justify-center text-xl shrink-0",children:p.icon}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-display font-black text-[12px] leading-tight",children:p.name}),e.jsx("div",{className:"text-[10px] text-ink-2 leading-snug",children:p.desc})]})]},i):null})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-display font-black text-sm mb-2 uppercase tracking-wider",children:"Hero stats"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-1.5 font-mono text-[10px]",children:[e.jsx(ne,{label:"Max lives",value:String(r.maxHp)}),e.jsx(ne,{label:"Speed",value:String(Math.round(r.speed))}),e.jsx(ne,{label:"Base cooldown",value:`${r.fireCooldownMs}ms`}),e.jsx(ne,{label:"Proj. damage",value:r.projDmg.toFixed(1)}),e.jsx(ne,{label:"Proj. speed",value:String(Math.round(r.projSpeed))}),e.jsx(ne,{label:"Proj. pierce",value:String(r.projPierce)}),e.jsx(ne,{label:"Proj. count",value:String(r.projCount)}),e.jsx(ne,{label:"Pickup r.",value:String(Math.round(r.pickupRadius))}),e.jsx(ne,{label:"Heal/kill",value:`${Math.round(r.healOnKillChance*100)}%`})]})]})]})}):null}function ne({label:t,value:a}){return e.jsxs("div",{className:"border-2 border-ink bg-paper px-2 py-1 flex flex-col",children:[e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-ink-3",children:t}),e.jsx("div",{className:"font-display font-black text-[13px]",children:a})]})}export{vo as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.