(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17661,e=>{"use strict";var t=e.i(50266),s=e.i(15149),a=e.i(46146),l=e.i(72143),r=e.i(96498),n=e.i(12598),i=e.i(8519),o=e.i(73261),c=e.i(68604),d=e.i(77634),x=e.i(75262),m=e.i(49897),u=e.i(23883);let h={original:{name:"Classic",emoji:"🎯",color:"#7c3aed",bg:"from-purple-600 to-purple-800"},world:{name:"World",emoji:"🌍",color:"#059669",bg:"from-emerald-600 to-emerald-800"},special:{name:"Special",emoji:"⚡",color:"#ea580c",bg:"from-orange-500 to-orange-700"},sports:{name:"Sports",emoji:"⚽",color:"#16a34a",bg:"from-green-600 to-green-800"}};function p({onClose:e,initialView:l}){let[r,n]=(0,a.useState)(l??"create"),[o,c]=(0,a.useState)("original"),[p,b]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,w]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[v,k]=(0,a.useState)(null),[S,C]=(0,a.useState)(!1),[_,T]=(0,a.useState)([]),[P,E]=(0,a.useState)(null),[I,M]=(0,a.useState)(null),L=(0,i.useSupabaseAuthStore)(e=>e.user);(0,i.useSupabaseAuthStore)(e=>e.hasSportsAccess),(0,a.useEffect)(()=>{if("my"!==r)return;let e=R();if(!L?.id&&0===e.length)return;$();let t=setInterval(()=>{$()},15e3);return()=>clearInterval(t)},[r,L?.id]);let R=()=>{try{return JSON.parse(localStorage.getItem("geohunter_completed_challenges")||"[]").map(e=>e.code).filter(e=>e?.length===6)}catch{return[]}},A=async()=>{if(L?.id){g(!0),w(null);try{let e=await fetch("/api/challenge/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:L.id,base_mode:o})});if(!e.ok){let t=await e.json();w(t.error||"Failed to create challenge");return}let t=await e.json();k(t.code),N(t.share_url)}catch(e){w("Failed to create challenge. Please try again.")}finally{g(!1)}}},O=async()=>{p&&6===p.length?await U(p):w("Please enter a valid 6-character code")},$=async()=>{try{let e=new URLSearchParams;L?.id&&e.set("user_id",L.id);let t=R();if(t.length>0&&e.set("extra_codes",t.join(",")),!e.toString())return;let s=await fetch(`/api/challenge/my-challenges?${e}`);if(s.ok){let e=await s.json();T(e.challenges||[])}}catch(e){console.error("Failed to load challenges:",e)}},F=async e=>{if(L?.id)try{(await fetch(`/api/challenge/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:L.id})})).ok&&T(_.filter(t=>t.code!==e))}catch(e){console.error("Failed to delete challenge:",e)}},U=async e=>{g(!0),w(null);try{let t=await (0,d.fetchChallengeForPlay)(e,L?.id);if("error"in t)return void w(t.error);if("awaitingAccept"in t)return void w("Waiting for your friend to accept this duel.");if(t.alreadyPlayed){E(e),n("my");return}M({code:t.code,payload:t.payload,creatorUsername:t.creatorUsername,baseMode:t.baseMode})}finally{g(!1)}},D=async e=>{try{await navigator.clipboard.writeText(e),C(!0),setTimeout(()=>C(!1),2e3)}catch(e){}};return(0,t.jsxs)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:e,children:[(0,t.jsxs)("div",{className:"bg-slate-900 rounded-2xl max-w-md md:max-w-lg w-full max-h-[90vh] overflow-y-auto border border-slate-700/50 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"relative bg-gradient-to-r from-rose-600 via-orange-500 to-amber-500 p-5 rounded-t-2xl",children:[(0,t.jsx)("button",{onClick:e,className:"absolute top-3 right-3 w-8 h-8 rounded-full bg-black/20 hover:bg-black/40 text-white flex items-center justify-center transition text-lg",children:"×"}),(0,t.jsx)("div",{className:"text-3xl mb-1",children:"⚔️"}),(0,t.jsx)("h2",{className:"text-xl font-black text-white",children:"Challenge a Friend"}),(0,t.jsx)("p",{className:"text-white/80 text-sm",children:"Same countries. Same categories. Who scores lower?"})]}),(0,t.jsx)("div",{className:"flex gap-1.5 p-3 bg-slate-800/50",children:[{key:"create",icon:"⚔️",label:"Create"},{key:"enter",icon:"🎮",label:"Join"},{key:"duels",icon:"🥊",label:"Duels"},{key:"my",icon:"📋",label:"History"}].map(e=>(0,t.jsxs)("button",{onClick:()=>{n(e.key),w(null)},className:`flex-1 py-2 px-3 rounded-xl font-semibold text-sm transition flex items-center justify-center gap-1.5 ${r===e.key?"bg-white/15 text-white shadow-inner":"text-slate-400 hover:text-slate-200 hover:bg-white/5"}`,children:[(0,t.jsx)("span",{children:e.icon}),(0,t.jsx)("span",{children:e.label})]},e.key))}),(0,t.jsxs)("div",{className:"p-4",children:["create"===r&&(0,t.jsx)("div",{children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-slate-400 text-sm mb-3",children:"Pick a mode for the challenge:"}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mb-4",children:Object.keys(h).map(e=>{let s=h[e];return(0,t.jsxs)("button",{onClick:()=>c(e),disabled:!1,className:`relative p-3 rounded-xl text-left transition-all ${o===e?"ring-2 ring-white/60 scale-[1.02] shadow-lg":"hover:scale-[1.01] hover:brightness-110"}`,style:{background:`linear-gradient(135deg, ${s.color}cc, ${s.color}99)`},children:[(0,t.jsx)("div",{className:"text-2xl mb-1",children:s.emoji}),(0,t.jsx)("div",{className:"text-white font-bold text-sm",children:s.name}),!1,o===e&&(0,t.jsx)("div",{className:"absolute top-2 right-2 w-5 h-5 rounded-full bg-white text-green-600 flex items-center justify-center text-xs font-bold",children:"✓"})]},e)})}),y&&(0,t.jsx)("p",{className:"text-red-400 text-sm mb-3 bg-red-400/10 rounded-lg p-2",children:y}),(0,t.jsx)("button",{onClick:A,disabled:f,className:"w-full py-3 rounded-xl font-bold text-base transition-all bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 disabled:opacity-50 text-white shadow-lg shadow-orange-500/25",children:f?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}),"Creating..."]}):"🔥 Create Challenge"}),j&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-green-500/10 border border-green-500/30 rounded-xl",children:[(0,t.jsxs)("p",{className:"text-green-400 font-bold mb-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-6 h-6 rounded-full bg-green-500 text-white flex items-center justify-center text-xs",children:"✓"}),"Challenge Created!"]}),(0,t.jsx)("p",{className:"text-slate-400 text-xs mb-2",children:"Share this link with your friend:"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:j,readOnly:!0,className:"flex-1 px-3 py-2 bg-slate-800 border border-slate-600 rounded-lg text-slate-300 text-xs font-mono"}),(0,t.jsx)("button",{onClick:()=>D(j),className:`px-4 py-2 rounded-lg font-semibold text-sm transition-all ${S?"bg-green-600 text-white":"bg-blue-600 hover:bg-blue-500 text-white"}`,children:S?"✓":"Copy"})]}),v&&(0,t.jsx)("button",{onClick:()=>U(v),disabled:f,className:"w-full mt-3 py-2.5 rounded-lg font-semibold text-sm transition-all bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white",children:f?"Loading...":"🎮 Play This Challenge"})]})]}):(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"text-4xl mb-3",children:"🔒"}),(0,t.jsx)("h3",{className:"text-white font-bold text-lg mb-2",children:"Sign In Required"}),(0,t.jsx)("p",{className:"text-slate-400 text-sm mb-4",children:"Sign in to create challenges and invite friends."}),(0,t.jsx)("button",{onClick:e,className:"px-6 py-2.5 bg-slate-700 hover:bg-slate-600 text-white font-semibold rounded-xl transition",children:"Close"})]})}),"enter"===r&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-slate-400 text-sm mb-3",children:"Got a challenge code? Enter it below:"}),(0,t.jsxs)("div",{className:"relative mb-4",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>b(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),placeholder:"ABC123",maxLength:6,className:"w-full px-4 py-4 bg-slate-800 border-2 border-slate-600 focus:border-rose-500 rounded-xl text-white text-2xl text-center font-mono tracking-[0.3em] transition-colors outline-none"}),(0,t.jsx)("div",{className:"flex justify-center gap-1.5 mt-2",children:Array.from({length:6}).map((e,s)=>(0,t.jsx)("div",{className:`w-2 h-2 rounded-full transition-all ${s<p.length?"bg-rose-500 scale-110":"bg-slate-700"}`},s))})]}),y&&(0,t.jsx)("p",{className:"text-red-400 text-sm mb-3 bg-red-400/10 rounded-lg p-2",children:y}),(0,t.jsx)("button",{onClick:O,disabled:f||6!==p.length,className:"w-full py-3 rounded-xl font-bold text-base transition-all bg-gradient-to-r from-rose-600 to-pink-600 hover:from-rose-500 hover:to-pink-500 disabled:opacity-40 text-white shadow-lg shadow-rose-500/25",children:f?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}),"Loading..."]}):"🎮 Join Challenge"})]}),"duels"===r&&(L?(0,t.jsx)("div",{className:"-m-4",children:(0,t.jsx)(u.default,{onNewDuel:()=>n("create")})}):(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"text-4xl mb-3",children:"🔒"}),(0,t.jsx)("h3",{className:"text-white font-bold text-lg mb-2",children:"Sign In Required"}),(0,t.jsx)("p",{className:"text-slate-400 text-sm mb-4",children:"Sign in to see and send duels."}),(0,t.jsx)("button",{onClick:e,className:"px-6 py-2.5 bg-slate-700 hover:bg-slate-600 text-white font-semibold rounded-xl transition",children:"Close"})]})),"my"===r&&(0,t.jsx)("div",{children:P?(0,t.jsx)(x.default,{challengeCode:P,onBack:()=>E(null)}):0===_.length?(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"text-4xl mb-2",children:"📋"}),(0,t.jsx)("p",{className:"text-slate-500",children:"No active challenges yet"}),(0,t.jsx)("p",{className:"text-slate-600 text-xs mt-1",children:L?"Create one to get started!":"Join a challenge to see it here!"})]}):(0,t.jsx)("div",{className:"space-y-2",children:_.map(e=>{let s,a=h[e.base_mode]||h.original,l=`${window.location.origin}/challenge/${e.code}`,r=e.participants||[];return(0,t.jsxs)("div",{className:"bg-slate-800 rounded-xl p-3 border-l-4 transition-all hover:bg-slate-750",style:{borderLeftColor:a.color},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"text-lg",children:a.emoji}),(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-white font-mono font-bold text-sm tracking-wider",children:e.code}),(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-md text-white/80",style:{backgroundColor:`${a.color}66`},children:a.name})]})})]}),e.is_creator&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>D(l),className:"w-8 h-8 rounded-lg bg-slate-700 hover:bg-slate-600 text-slate-400 hover:text-white flex items-center justify-center transition text-sm",title:"Copy link",children:"📋"}),(0,t.jsx)("button",{onClick:()=>F(e.code),className:"w-8 h-8 rounded-lg bg-slate-700 hover:bg-red-600/50 text-slate-400 hover:text-red-300 flex items-center justify-center transition text-sm",title:"Delete",children:"🗑️"})]})]}),(0,t.jsx)("div",{className:"mt-2 ml-8",children:0===r.length?(0,t.jsxs)("p",{className:"text-slate-500 text-xs flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),"Waiting for players..."]}):(0,t.jsxs)("div",{className:"space-y-1",children:[r.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"w-4 text-center",children:0===s&&r.length>1?"🏆":""}),(0,t.jsx)("span",{className:`truncate max-w-[120px] ${0===s&&r.length>1?"text-amber-400 font-semibold":"text-slate-300"}`,children:e.username}),(0,t.jsx)("span",{className:`font-mono font-bold ${0===s&&r.length>1?"text-green-400":"text-slate-400"}`,children:e.score})]},e.user_id)),1===r.length&&(0,t.jsx)("p",{className:"text-slate-500 text-xs italic",children:"Waiting for opponent..."})]})}),(0,t.jsxs)("div",{className:"mt-2 ml-8 flex gap-3",children:[(s=L?.id||localStorage.getItem("geohunter_anon_id"))&&r.some(e=>e.user_id===s)?null:(0,t.jsx)("button",{onClick:()=>U(e.code),className:"text-xs text-blue-400 hover:text-blue-300 font-semibold transition",children:"Play →"}),r.length>=1&&(0,t.jsx)("button",{onClick:()=>E(e.code),className:"text-xs text-rose-400 hover:text-rose-300 font-semibold transition",children:"View Results →"})]})]},e.code)})})})]})]}),I&&(0,t.jsx)(m.default,{code:I.code,creatorUsername:I.creatorUsername,modeName:h[I.baseMode]?.name||"Classic",modeEmoji:h[I.baseMode]?.emoji||"🎯",modeColor:h[I.baseMode]?.color||"#7c3aed",isSignedIn:!!L,onConfirm:t=>{I&&(t&&s.useGameStore.getState().setChallengeNickname(t),s.useGameStore.getState().startChallengeGame(I.code,I.payload),M(null),e())},onCancel:()=>M(null)})]})}e.i(24856);var b=e.i(13335),f=e.i(41),g=e.i(18738);function y({visible:e,onClose:s,targetFriendId:l,targetFriendUsername:n,onSent:o}){let c=(0,r.useRouter)(),d=(0,i.useSupabaseAuthStore)(e=>e.user),x=(0,i.useSupabaseAuthStore)(e=>e.hasProAccess),[m,u]=(0,a.useState)("duel-easy"),[h,p]=(0,a.useState)(!1),[y,w]=(0,a.useState)(null),[j,N]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),[S,C]=(0,a.useState)(null),_=x(),T=(0,f.computeProgression)(d?.stats||{}).level;(0,a.useEffect)(()=>{e&&(u("duel-easy"),w(null),N(!1),k(!1),p(!1),C(null))},[e,l]),(0,a.useEffect)(()=>{if(!v)return;let e=setTimeout(()=>{o?.(m),s()},1200);return()=>clearTimeout(e)},[v]);let P=async()=>{if(d?.id&&!h){p(!0),w(null),N(!1);try{let e=await fetch("/api/social/challenge-friend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({challenger_id:d.id,friend_id:l,base_mode:m})}),t=await e.json().catch(()=>({}));if(429===e.status){N(!0),(0,g.trackPaywall)("duel_limit_reached");return}if(!e.ok)return void w(t.error||"Failed to send duel");k(!0)}catch{w("Failed to send duel. Please try again.")}finally{p(!1)}}},E=()=>{(0,g.trackPaywall)("duel_difficulty"),s(),c.push("/subscriptions")},I=()=>{h||s()};return e?(0,t.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-[60] p-4",onClick:I,children:(0,t.jsx)("div",{className:"bg-slate-900 rounded-2xl max-w-md w-full max-h-[90vh] overflow-y-auto border border-slate-700/50 shadow-2xl p-5",onClick:e=>e.stopPropagation(),children:v?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 py-8",children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-full bg-green-500 flex items-center justify-center text-2xl",children:"✓"}),(0,t.jsxs)("p",{className:"text-green-400 font-bold text-center",children:["Duel sent to @",n,"!"]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:"text-xl font-black text-white text-center mb-0.5",children:"Send a Duel"}),(0,t.jsxs)("p",{className:"text-indigo-300 font-semibold text-sm text-center mb-5",children:["@",n]}),(0,t.jsx)("p",{className:"text-slate-400 text-xs font-extrabold uppercase tracking-wide mb-2",children:"Pick a difficulty"}),(0,t.jsx)("div",{className:"flex flex-col gap-2.5 mb-4",children:b.DUEL_DIFFICULTIES.map(e=>{let s=(0,b.canCreateDifficulty)(e,T,_),a=m===e.baseMode,l=null===e.band.max?`Par ${e.band.min}+`:`Par ${e.band.min}–${e.band.max}`;return(0,t.jsxs)("button",{onClick:()=>(e=>{let t=b.DUEL_DIFFICULTIES.find(t=>t.id===e);if(t){if(!(0,b.canCreateDifficulty)(t,T,_))return void C(`${t.name} unlocks at level ${t.unlockLevel}. Reach it or go Pro.`);C(null),u(t.baseMode)}})(e.id),className:`flex items-center gap-3 rounded-xl px-4 py-3 text-left transition-all ${a?"ring-2":"border"} ${s?"":"opacity-60 border-dashed"}`,style:{backgroundColor:a?e.color:"rgba(255,255,255,0.07)",borderColor:a?e.color:"rgba(255,255,255,0.14)",...a?{boxShadow:`0 0 0 2px ${e.color}`}:{}},children:[(0,t.jsx)("span",{className:"text-2xl",children:s?e.emoji:"🔒"}),(0,t.jsxs)("span",{className:"flex-1",children:[(0,t.jsx)("span",{className:`block font-extrabold text-[15px] ${a?"text-white":"text-slate-200"}`,children:e.name}),(0,t.jsx)("span",{className:`block text-[11px] font-semibold ${a?"text-white/80":"text-white/45"}`,children:l})]}),!s&&(0,t.jsx)("span",{className:"text-[11px] font-extrabold text-white/70 bg-black/25 px-2 py-1 rounded-lg",children:`Lvl ${e.unlockLevel}`})]},e.id)})}),S&&(0,t.jsxs)("button",{onClick:E,className:"w-full mb-3 p-3 bg-indigo-500/10 rounded-xl text-center",children:[(0,t.jsx)("span",{className:"block text-indigo-200 text-[13px] font-semibold",children:S}),(0,t.jsx)("span",{className:"block text-indigo-300 text-[13px] font-extrabold mt-1.5",children:"Unlock with GeoHunter+ →"})]}),y&&(0,t.jsx)("p",{className:"text-red-400 text-sm mb-3 bg-red-400/10 rounded-lg p-2",children:y}),j&&(0,t.jsxs)("div",{className:"mb-4 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl text-center",children:[(0,t.jsx)("p",{className:"text-amber-300 font-bold text-sm mb-1",children:"Duel limit reached"}),(0,t.jsx)("p",{className:"text-slate-400 text-xs mb-3",children:"Upgrade to Pro to run up to 5 duels at once."}),(0,t.jsx)("button",{onClick:E,className:"w-full py-2.5 rounded-lg font-bold text-sm text-white bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 transition",children:"Upgrade to Pro"})]}),(0,t.jsx)("button",{onClick:P,disabled:h||!d?.id,className:"w-full py-3 rounded-xl font-bold text-base transition-all bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white shadow-lg shadow-rose-500/25",children:h?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}),"Sending..."]}):"⚔️ Send Duel"}),(0,t.jsx)("button",{onClick:I,className:"w-full mt-2 py-2 text-slate-500 hover:text-slate-300 text-sm font-semibold transition",children:"Cancel"})]})})}):null}var w=e.i(24550),j=e.i(98355);function N({onShowLeaderboard:e}){let{startDailyGame:l,loadDailyChallenge:r,dailyChallenge:n,dailyChallengeCompleted:o,dailyAttempt:c}=(0,s.useGameStore)(),{isAuthenticated:d,user:x,getTodaysDailyScore:m,hasAttemptedDailyToday:u}=(0,i.useSupabaseAuthStore)(),h="geohunter_daily_tutorial_shown",[p,b]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!0),[y,N]=(0,a.useState)(!1),[v,k]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),[_,T]=(0,a.useState)(null),[P,E]=(0,a.useState)({hours:0,minutes:0,seconds:0}),[I,M]=(0,a.useState)(!1),[L,R]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!0;return(async()=>{N(!1),T(null),M(!0),R(null);try{if(await r(),!e)return;if(d){try{let t=await u();e&&g(t)}catch{e&&g(!1)}try{let t=await m();e&&C(t)}catch{e&&C(null)}e&&k(w.DailyGameManager.getTodaysAttempt())}else e&&(g(w.DailyGameManager.hasAttemptedToday()),k(w.DailyGameManager.getTodaysAttempt()),C(null))}catch(t){if(e){let e=t instanceof Error?t.message:"Failed to load challenge";T(e),R(e),g(!1)}}finally{e&&(N(!0),M(!1))}})(),()=>{e=!1}},[r,d,m,u]),(0,a.useEffect)(()=>{o&&(c?k(c):k(w.DailyGameManager.getTodaysAttempt()),d?(u().then(e=>g(e)).catch(()=>g(!0)),m().then(e=>C(e)).catch(()=>C(null))):g(!0))},[o,c,d,u,m]),(0,a.useEffect)(()=>{let e=()=>{E(w.DailyGameManager.getTimeUntilNext())};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[]);let A=(0,a.useMemo)(()=>{if(!y||o)return!0;if(d)return null!=S||f;let e=w.DailyGameManager.getTodaysAttempt();return!!e?.completed},[y,o,f,d,S]),O=S??v?.score??null;(0,a.useMemo)(()=>{if(!n)return null;let e=c??v??w.DailyGameManager.getTodaysAttempt();return e&&e.completed?w.DailyGameManager.evaluateDailyRun(n,e):null},[n,c,v]);let $=y&&!!n,F=p?(0,t.jsx)("div",{className:"fixed inset-0 bg-black/75 flex items-center justify-center z-50 p-5",children:(0,t.jsxs)("div",{className:"bg-white rounded-2xl p-6 w-full max-w-sm",children:[(0,t.jsx)("h2",{className:"text-xl font-black text-indigo-950 text-center",children:"📅 Daily Challenge"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center mt-1 mb-4",children:"Here's how it works"}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-3.5 mb-3 border border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)("span",{className:"text-lg",children:"🎯"}),(0,t.jsx)("span",{className:"text-sm font-bold text-gray-900",children:"Match the target score"})]}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mb-2.5",children:["Pick a category for each country. Your rank in it adds to your score. The target is the ",(0,t.jsx)("span",{className:"font-bold text-gray-700",children:"perfect score"}),": what you'd get making every optimal pick. Match it to win!"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,t.jsxs)("div",{className:"bg-emerald-50 border border-emerald-400 rounded-lg p-2 text-center min-w-[60px]",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 font-semibold",children:"Target"}),(0,t.jsx)("div",{className:"text-xl font-black text-emerald-600",children:"80"})]}),(0,t.jsx)("span",{className:"text-xs text-gray-500 font-bold",children:"= perfect"}),(0,t.jsxs)("div",{className:"bg-white border-2 border-emerald-500 rounded-lg p-2 text-center min-w-[60px]",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 font-semibold",children:"You got"}),(0,t.jsx)("div",{className:"text-xl font-black text-gray-900",children:"80"})]}),(0,t.jsx)("span",{className:"text-sm font-bold text-emerald-500",children:"✅ Win!"})]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-3.5 mb-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)("span",{className:"text-lg",children:"⏭️"}),(0,t.jsx)("span",{className:"text-sm font-bold text-gray-900",children:"One skip (not optional)"})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-2.5",children:"You must use one skip per challenge, use it on the country that doesnt fit into any of the categories."}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative bg-blue-50 border border-blue-200 rounded-xl p-3 flex flex-col items-center",children:[(0,t.jsx)("span",{className:"text-3xl",children:"🇦🇷"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-blue-800 mt-1",children:"ARGENTINA"}),(0,t.jsxs)("div",{className:"absolute -bottom-1.5 -right-1.5 w-11 h-11 bg-white border-2 border-gray-300 rounded-xl flex flex-col items-center justify-center",children:[(0,t.jsx)("span",{className:"text-sm leading-none",children:"⏭️"}),(0,t.jsx)("span",{className:"text-[8px] font-bold text-gray-700",children:"SKIP"}),(0,t.jsx)("div",{className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-yellow-400 border-2 border-yellow-500 rounded-full flex items-center justify-center text-[10px] font-black",children:"1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 italic flex-1",children:"← tap before you pick a category"})]})]}),(0,t.jsx)("button",{onClick:()=>{b(!1),d||alert("You're playing as a guest. Sign in to save your daily score!"),l()},className:"w-full bg-indigo-600 text-white font-black text-base rounded-xl py-3.5 hover:bg-indigo-700 transition-colors",children:"Let's Play 🎯"}),(0,t.jsx)("button",{onClick:()=>b(!1),className:"w-full text-gray-500 font-medium text-sm py-3 mt-1 hover:text-gray-700 transition-colors",children:"Not ready yet, go back"})]})}):null;if(_&&!n&&y)return(0,t.jsx)("div",{className:"flex-1 min-w-0 rounded-2xl bg-gradient-to-br from-red-600 via-red-700 to-rose-700 p-4 text-white shadow-lg",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-2xl",children:"⚠️"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-bold",children:"Daily unavailable"}),(0,t.jsx)("p",{className:"text-xs text-white/80",children:"Try refreshing."})]})]})});let U=A&&null!==O?(0,t.jsxs)("span",{className:"text-xs font-bold text-white",children:["→ ",O]}):A||n?.targetScore==null?d&&(x?.stats.dailyStreak??0)>=1&&(0,j.isStreakActive)(x?.stats.lastDailyPlay)?(0,t.jsxs)("span",{className:"text-xs font-bold text-orange-300",children:["🔥 ",x.stats.dailyStreak]}):null:(0,t.jsxs)("span",{className:"text-xs font-bold text-white/70",children:["→ ",n.targetScore]});return(0,t.jsxs)(t.Fragment,{children:[F,(0,t.jsx)("button",{onClick:A?void 0:()=>{if($&&!A){if(!localStorage.getItem(h)){localStorage.setItem(h,"true"),b(!0);return}d||alert("You're playing as a guest. Sign in to save your daily score!"),l()}},disabled:I||!$,className:`w-full rounded-2xl bg-gradient-to-br from-blue-700 via-blue-800 to-indigo-800 dark:bg-none dark:bg-[#15295c] dark:border dark:border-white/20 text-white shadow-md transition-all ${!A&&$&&!I?"hover:shadow-lg hover:scale-[1.01] active:scale-[0.99] cursor-pointer":"cursor-default"}`,children:(0,t.jsxs)("div",{className:"p-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-xl bg-white/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("span",{className:"text-base",children:"🕐"})}),(0,t.jsx)("div",{className:"flex-1 text-left min-w-0",children:(0,t.jsx)("p",{className:"text-sm font-black leading-tight truncate",children:"Daily"})}),I||!$?(0,t.jsx)("div",{className:"bg-white/15 rounded-lg px-2 py-1.5 border border-white/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("div",{className:"w-3 h-3 border-2 border-white/40 border-t-white rounded-full animate-spin"})}):A?(0,t.jsx)("div",{className:"bg-white/10 rounded-lg px-2 py-1.5 border border-white/20 flex-shrink-0",children:(0,t.jsxs)("p",{className:"text-[10px] font-bold tabular-nums text-white/90 leading-tight",children:[String(P.hours).padStart(2,"0"),":",String(P.minutes).padStart(2,"0"),":",String(P.seconds).padStart(2,"0")]})}):(0,t.jsx)("div",{className:"bg-white/25 rounded-lg px-2.5 py-1.5 border border-white/40 flex-shrink-0",children:(0,t.jsx)("p",{className:"text-[11px] font-bold whitespace-nowrap",children:"▷"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-blue-200",children:n?.date?new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}):new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})}),U]})]})})]})}var v=e.i(2008),k=e.i(88093),S=e.i(86922),C=e.i(7340),_=e.i(84945),T=e.i(19860);function P({show:e,onComplete:s,message:l="Loading Geo Hunter..."}){let[r,n]=(0,a.useState)(0);return((0,a.useEffect)(()=>{if(!e)return void n(0);let t=setTimeout(()=>{console.log("[LoadingOverlay] Failsafe triggered - forcing completion"),n(100),setTimeout(()=>{s?.()},300)},8e3),a=setInterval(()=>{n(e=>e>=85?e:e+12*Math.random()+4)},100);return()=>{clearInterval(a),clearTimeout(t)}},[e,s]),e)?(0,t.jsxs)("div",{className:`jsx-1e86eed7acd4314a loading-overlay ${r>=100?"fade-out":""}`,children:[(0,t.jsxs)("div",{className:"jsx-1e86eed7acd4314a loading-content",children:[(0,t.jsxs)("div",{className:"jsx-1e86eed7acd4314a loading-logo-container",children:[(0,t.jsx)(C.default,{src:"/geohunter-logo.png",alt:"Geo Hunter",width:120,height:120,className:"loading-logo",priority:!0}),(0,t.jsx)("div",{className:"jsx-1e86eed7acd4314a loading-logo-glow"})]}),(0,t.jsx)("div",{className:"jsx-1e86eed7acd4314a loading-spinner"}),(0,t.jsx)("div",{className:"jsx-1e86eed7acd4314a loading-text",children:l}),(0,t.jsx)("div",{className:"jsx-1e86eed7acd4314a loading-progress",children:(0,t.jsx)("div",{style:{width:`${r}%`},className:"jsx-1e86eed7acd4314a loading-bar"})})]}),(0,t.jsx)(T.default,{id:"1e86eed7acd4314a",children:".loading-overlay.jsx-1e86eed7acd4314a{z-index:1000;pointer-events:auto;transition:opacity .5s,visibility .5s}.loading-overlay.fade-out.jsx-1e86eed7acd4314a{opacity:0;visibility:hidden;pointer-events:none}.loading-content.jsx-1e86eed7acd4314a{text-align:center;color:#fff;animation:2s ease-in-out infinite loadingPulse}.loading-logo-container.jsx-1e86eed7acd4314a{margin-bottom:20px;display:inline-block;position:relative}.loading-logo.jsx-1e86eed7acd4314a{border-radius:50%;animation:3s ease-in-out infinite logoFloat,4s ease-in-out 1s infinite joyfulWiggle}.loading-logo-glow.jsx-1e86eed7acd4314a{background:radial-gradient(circle,#ffffff4d 0%,#0000 70%);border-radius:50%;animation:2s ease-in-out infinite alternate glowPulse;position:absolute;inset:-10px}.loading-spinner.jsx-1e86eed7acd4314a{border:4px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:50px;height:50px;margin:0 auto 20px;animation:1s linear infinite spin}.loading-text.jsx-1e86eed7acd4314a{text-shadow:0 2px 4px #0000004d;margin-bottom:20px;font-size:1.2rem;font-weight:600}.loading-progress.jsx-1e86eed7acd4314a{background:#ffffff4d;border-radius:3px;width:200px;height:6px;margin:0 auto;overflow:hidden}.loading-bar.jsx-1e86eed7acd4314a{background:linear-gradient(90deg,gold,#ffed4e);border-radius:3px;height:100%;transition:width .3s;box-shadow:0 0 10px #ffd70099}@keyframes loadingPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.9;transform:scale(1.02)}}@keyframes logoFloat{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes glowPulse{0%{opacity:.5}to{opacity:.8}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"})]}):null}var E=e.i(37684),I=e.i(73019),M=e.i(26500),L=e.i(69923),R=e.i(59490);let A=(0,R.default)("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var O=e.i(6159),$=e.i(60049);let F=(0,R.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),U=(0,R.default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var D=e.i(24779),G=e.i(53596);let H=(0,R.default)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),z=(0,R.default)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),W=(0,R.default)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),B=(0,R.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),V=(0,R.default)("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);var Y=e.i(81323);let J=(0,R.default)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",key:"nb9nel"}]]),q=(0,R.default)("Map",[["polygon",{points:"3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21",key:"ok2ie8"}],["line",{x1:"9",x2:"9",y1:"3",y2:"18",key:"w34qz5"}],["line",{x1:"15",x2:"15",y1:"6",y2:"21",key:"volv9a"}]]);var K=e.i(6904),Z=e.i(98160);"u">typeof window&&window.document&&window.document.createElement;var X=e.i(89483),Q=globalThis?.document?a.useLayoutEffect:()=>{};a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var ee=a[" useInsertionEffect ".trim().toString()]||Q;Symbol("RADIX:SYNC_STATE"),e.i(37265);var et=Symbol("radix.slottable");function es(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===et}var ea=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{var l,r;let n,i,o,c=(r=l=`Primitive.${s}`,(n=a.forwardRef((e,t)=>{let{children:s,...l}=e;if(a.isValidElement(s)){var r;let e,n,i=(r=s,(n=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.ref:(n=(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.props.ref:r.props.ref||r.ref),o=function(e,t){let s={...t};for(let a in t){let l=e[a],r=t[a];/^on[A-Z]/.test(a)?l&&r?s[a]=(...e)=>{let t=r(...e);return l(...e),t}:l&&(s[a]=l):"style"===a?s[a]={...l,...r}:"className"===a&&(s[a]=[l,r].filter(Boolean).join(" "))}return{...e,...s}}(l,s.props);return s.type!==a.Fragment&&(o.ref=t?(0,X.composeRefs)(t,i):i),a.cloneElement(s,o)}return a.Children.count(s)>1?a.Children.only(null):null})).displayName=`${r}.SlotClone`,i=n,(o=a.forwardRef((e,s)=>{let{children:l,...r}=e,n=a.Children.toArray(l),o=n.find(es);if(o){let e=o.props.children,l=n.map(t=>t!==o?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(i,{...r,ref:s,children:a.isValidElement(e)?a.cloneElement(e,void 0,l):null})}return(0,t.jsx)(i,{...r,ref:s,children:l})})).displayName=`${l}.Slot`,o),d=a.forwardRef((e,a)=>{let{asChild:l,...r}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(l?c:s,{...r,ref:a})});return d.displayName=`Primitive.${s}`,{...e,[s]:d}},{}),el="Switch",[er,en]=function(e,s=[]){let l=[],r=()=>{let t=l.map(e=>a.createContext(e));return function(s){let l=s?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[function(s,r){let n=a.createContext(r),i=l.length;l=[...l,r];let o=s=>{let{scope:l,children:r,...o}=s,c=l?.[e]?.[i]||n,d=a.useMemo(()=>o,Object.values(o));return(0,t.jsx)(c.Provider,{value:d,children:r})};return o.displayName=s+"Provider",[o,function(t,l){let o=l?.[e]?.[i]||n,c=a.useContext(o);if(c)return c;if(void 0!==r)return r;throw Error(`\`${t}\` must be used within \`${s}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let s=()=>{let s=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let l=s.reduce((t,{useScope:s,scopeName:a})=>{let l=s(e)[`__scope${a}`];return{...t,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return s.scopeName=t.scopeName,s}(r,...s)]}(el),[ei,eo]=er(el),ec=a.forwardRef((e,s)=>{let{__scopeSwitch:l,name:r,checked:n,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:x,form:m,...u}=e,[h,p]=a.useState(null),b=(0,X.useComposedRefs)(s,e=>p(e)),f=a.useRef(!1),g=!h||m||!!h.closest("form"),[y,w]=function({prop:e,defaultProp:t,onChange:s=()=>{},caller:l}){let[r,n,i]=function({defaultProp:e,onChange:t}){let[s,l]=a.useState(e),r=a.useRef(s),n=a.useRef(t);return ee(()=>{n.current=t},[t]),a.useEffect(()=>{r.current!==s&&(n.current?.(s),r.current=s)},[s,r]),[s,l,n]}({defaultProp:t,onChange:s}),o=void 0!==e,c=o?e:r;{let t=a.useRef(void 0!==e);a.useEffect(()=>{let e=t.current;if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${l} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=o},[o,l])}return[c,a.useCallback(t=>{if(o){let s="function"==typeof t?t(e):t;s!==e&&i.current?.(s)}else n(t)},[o,e,n,i])]}({prop:n,defaultProp:i??!1,onChange:x,caller:el});return(0,t.jsxs)(ei,{scope:l,checked:y,disabled:c,children:[(0,t.jsx)(ea.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":eu(y),"data-disabled":c?"":void 0,disabled:c,value:d,...u,ref:b,onClick:function(e,t,{checkForDefaultPrevented:s=!0}={}){return function(a){if(e?.(a),!1===s||!a.defaultPrevented)return t?.(a)}}(e.onClick,e=>{w(e=>!e),g&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})}),g&&(0,t.jsx)(em,{control:h,bubbles:!f.current,name:r,value:d,checked:y,required:o,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});ec.displayName=el;var ed="SwitchThumb",ex=a.forwardRef((e,s)=>{let{__scopeSwitch:a,...l}=e,r=eo(ed,a);return(0,t.jsx)(ea.span,{"data-state":eu(r.checked),"data-disabled":r.disabled?"":void 0,...l,ref:s})});ex.displayName=ed;var em=a.forwardRef(({__scopeSwitch:e,control:s,checked:l,bubbles:r=!0,...n},i)=>{let o,c=a.useRef(null),d=(0,X.useComposedRefs)(c,i),x=(o=a.useRef({value:l,previous:l}),a.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])),m=function(e){let[t,s]=a.useState(void 0);return Q(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let a,l;if(!Array.isArray(t)||!t.length)return;let r=t[0];if("borderBoxSize"in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,l=t.blockSize}else a=e.offsetWidth,l=e.offsetHeight;s({width:a,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),t}(s);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==l&&t){let s=new Event("click",{bubbles:r});t.call(e,l),e.dispatchEvent(s)}},[x,l,r]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...n,tabIndex:-1,ref:d,style:{...n.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function eu(e){return e?"checked":"unchecked"}em.displayName="SwitchBubbleInput";var eh=e.i(52236);function ep({className:e,...s}){return(0,t.jsx)(ec,{"data-slot":"switch",className:(0,eh.cn)("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-white/30 bg-white/20 transition-all outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-yellow-300 data-[state=checked]:bg-emerald-400 data-[state=checked]:border-emerald-300 data-[state=unchecked]:bg-white/25 dark:data-[state=unchecked]:bg-white/10 disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:(0,t.jsx)(ex,{"data-slot":"switch-thumb",className:(0,eh.cn)("pointer-events-none block h-4 w-4 translate-x-0 rounded-full bg-white shadow transition-transform data-[state=checked]:translate-x-4")})})}var eb=e.i(4412),ef=e.i(65299),eg=e.i(61584),ey=e.i(11240);function ew(){let e,d,x,m,u,h,b,w,T,R,X=(0,r.useRouter)(),{startGame:Q,startPracticeGame:ee,startTutorialGame:et,startMiniHunter:es,startMiniHunter2:ea,startReverseGame:el,startCustomGame:er,updateSettings:en,gamesPlayed:ei,bestEasyScoresByMode:eo}=(0,s.useGameStore)(),{user:ec,isAuthenticated:ed,initializeAuth:ex,bestScores:em,getBestDailyRankingBadge:eu,statsSyncError:eh,logout:ew,hasUSAAccess:ej,hasCanadaAccess:eN,hasEuropeAccess:ev,hasSportsAccess:ek,hasProAccess:eS,hasExplorerAccess:eC,hasEmpiresAccess:e_,refreshPremiumStatus:eT,followingCount:eP,pendingRequestsCount:eE,fetchPendingRequestsCount:eI,markFootyTrialUsed:eM,profileStatus:eL}=(0,i.useSupabaseAuthStore)(),eR=(0,g.useAnalytics)(),eA=(0,M.useTranslation)(),[eO,e$]=(0,a.useState)(!1),[eF,eU]=(0,a.useState)(!1),[eD,eG]=(0,a.useState)(!1),[eH,ez]=(0,a.useState)(!1),[eW,eB]=(0,a.useState)(0),[eV,eY]=(0,a.useState)(null),[eJ,eq]=(0,a.useState)(!1),[eK,eZ]=(0,a.useState)("canada"),[eX,eQ]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(""),[e2,e5]=(0,a.useState)("original"),[e9,e3]=(0,a.useState)(!1),[e4,e6]=(0,a.useState)(!1),[e8,e7]=(0,a.useState)(!1),[te,tt]=(0,a.useState)("create"),[ts,ta]=(0,a.useState)(null),[tl,tr]=(0,a.useState)(!1),[tn,ti]=(0,a.useState)([]),[to,tc]=(0,a.useState)(!1),[td,tx]=(0,a.useState)(void 0),[tm,tu]=(0,a.useState)(null),[th,tp]=(0,a.useState)(!1),[tb]=(0,a.useState)({empires_mode:!0,world_cup_mode:!0,footy_clubs_mode:!0}),[tf,tg]=(0,a.useState)([]),[ty,tw]=(0,a.useState)(null),[tj,tN]=(0,a.useState)({}),[tv,tk]=(0,a.useState)(!1),[tS,tC]=(0,a.useState)(!1),[t_,tT]=(0,a.useState)(!1),[tP,tE]=(0,a.useState)(!1),[tI,tM]=(0,a.useState)(!1),[tL,tR]=(0,a.useState)(!1),[tA,tO]=(0,a.useState)(!1),[t$,tF]=(0,a.useState)("tournament"),tU=(0,a.useRef)(null),[tD,tG]=(0,a.useState)(!0);(0,a.useEffect)(()=>{try{tG("1"===localStorage.getItem("geohunter:seen-reverse"))}catch{}},[]),(0,a.useEffect)(()=>{try{let e=localStorage.getItem("geohunter:last-expanded-mode");e&&e5(e)}catch{}},[]);let[tH,tz]=(0,a.useState)([]),[tW,tB]=(0,a.useState)(()=>{try{return JSON.parse(localStorage.getItem("@geohunter_dismissed_announcements")??"[]")}catch{return[]}});(0,a.useEffect)(()=>{ez(!0);{let e=localStorage.getItem("geohunter-games-played");eB(e?Number.parseInt(e):0),tp((()=>{try{let e=localStorage.getItem("geohunter_weekly_played_today");if(!e)return!1;let t=JSON.parse(e);return t.date===(0,j.getEasternDateString)()&&!0===t.played}catch{return!1}})())}n.DailyBadgeFinalizer.initialize(),(async()=>{try{await ex(),ed&&await eu()}catch(e){console.warn("Auth init failed:",e)}})(),en(o.CookieStorage.getPreferences());try{(0,k.isFirstTimeUser)()&&(eG(!0),(0,k.markFirstTimeUserStarted)())}catch{}},[ex,en,ed,eu]),(0,a.useEffect)(()=>{if(!ed||!ec?.id)return;let e=new URLSearchParams(window.location.search).get("add");e&&e!==ec.id&&(tx("add"),tu(e),tc(!0),window.history.replaceState({},"","/"))},[ed,ec?.id]),(0,a.useEffect)(()=>{fetch("/api/announcements").then(e=>e.json()).then(e=>{Array.isArray(e)&&tz(e)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!ed||!ec?.id)return void ti([]);let e=async()=>{try{let e=(()=>{try{return JSON.parse(localStorage.getItem("geohunter_completed_challenges")||"[]").map(e=>e.code).filter(e=>e?.length===6)}catch{return[]}})(),t=new URLSearchParams({user_id:ec.id});e.forEach(e=>t.append("codes",e));let s=await fetch(`/api/challenge/my?${t}`);if(s.ok){let e=await s.json();ti(Array.isArray(e)?e.slice(0,4):[])}}catch{}};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[ed,ec?.id]),(0,a.useEffect)(()=>{let e=async()=>{let e=new URLSearchParams(window.location.search);("success"===e.get("purchase")||e.get("session_id")||document.referrer.includes("purchase/success"))&&ed&&(console.log("[MainMenu] Detected return from purchase, refreshing premium status..."),setTimeout(async()=>{await eT(),console.log("[MainMenu] Premium status refreshed after purchase")},2e3),(e.has("purchase")||e.has("session_id"))&&window.history.replaceState({},document.title,window.location.pathname))};eH&&ed&&e()},[eH,ed,eT]);let tV=async e=>{console.log("Starting game:",e),eR.game.start(e),(0,g.trackEvent)("mode_selected",{mode:e}),eQ(!0),e1(`Loading ${{original:"GeoHunter Classic",world:"GeoHunter World",special:"GeoHunter Special",voyage:"GeoHunter Voyage",atlas:"GeoHunter Atlas"}[e]}...`);try{await Q(e)}catch{eQ(!1)}},tY=async()=>{eR.game.start("original"),eG(!1),eQ(!0),e1("Starting Easy Mode...");try{await ee()}catch{eQ(!1)}},tJ=(0,a.useCallback)(e=>{eR.game.leaderboard("view",e),eY(e)},[eR]),tq=(0,a.useCallback)(()=>tJ("daily"),[tJ]),tK=(()=>{if(!eH)return 999;if(ed&&ec)return eh?999:em.original<999?em.original:999;let e=o.CookieStorage.getHighScore("original");if(e<999)return e;let t=localStorage.getItem("geohunter-best-score-original");return t?Number.parseInt(t):999})(),tZ=(()=>{if(!eH)return 999;if(ed&&ec)return eh?999:em.world<999?em.world:999;let e=o.CookieStorage.getHighScore("world");if(e<999)return e;let t=localStorage.getItem("geohunter-best-score-world");return t?Number.parseInt(t):999})(),tX=(()=>{if(!eH)return 999;if(ed&&ec)return eh?999:em.special<999?em.special:999;let e=o.CookieStorage.getHighScore("special");if(e<999)return e;let t=localStorage.getItem("geohunter-best-score-special");return t?Number.parseInt(t):999})(),tQ=(()=>{if(!eH)return 999;if(ed&&ec)return eh?999:em.voyage&&em.voyage<999?em.voyage:999;let e=o.CookieStorage.getHighScore("voyage");if(e<999)return e;let t=localStorage.getItem("geohunter-best-score-voyage");return t?Number.parseInt(t):999})(),t0=(()=>{if(!eH)return 999;if(ed&&ec)return eh?999:em.atlas&&em.atlas<999?em.atlas:999;let e=o.CookieStorage.getHighScore("atlas");if(e<999)return e;let t=localStorage.getItem("geohunter-best-score-atlas");return t?Number.parseInt(t):999})(),t1=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;if(em.usa&&em.usa<999)return em.usa}return 999})(),t2=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;let e=em.canada;if("number"==typeof e&&e<999)return e}return 999})(),t5=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;let e=em.europe;if("number"==typeof e&&e<999)return e}return 999})(),t9=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;if(em.sports&&em.sports<999)return em.sports}return 999})(),t3=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;if(em.empires&&em.empires<999)return em.empires}return 999})(),t4=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;if(em.footyClubs&&em.footyClubs<999)return em.footyClubs}return 999})();(0,a.useEffect)(()=>{if(!tb.world_cup_mode||!eH)return void tg([]);let e=!1;return(0,ey.getWorldCupEntries)(100).then(t=>{if(e)return;let s={};for(let e of t){if(!e.pickedNation||!e.pickedNationEmoji)continue;let t=e.pickedNation.toLowerCase(),a=s[t];(!a||e.score<a.best)&&(s[t]={emoji:e.pickedNationEmoji,best:e.score})}tg(Object.values(s).sort((e,t)=>e.best-t.best).slice(0,3))}),()=>{e=!0}},[tb.world_cup_mode,eH]),(0,a.useEffect)(()=>{if(!eH)return;let e=ec?.nationsCupPick;if(!e||!ed||!eg.supabase)return void tw(null);let t=!1;return eg.supabase.from("countries").select("name, emoji").eq("id",e.toLowerCase()).maybeSingle().then(({data:e})=>{!t&&e&&tw({emoji:e.emoji??"🏳️",name:e.name})}),()=>{t=!0}},[ec?.nationsCupPick,ed,eH]),(0,a.useEffect)(()=>{eH&&tN((0,ey.loadNationsCupRoundBest)())},[eH]);let t6=(()=>{if(!eH)return 999;if(ed&&ec){if(eh)return 999;if(em.worldCup&&em.worldCup<999)return em.worldCup}return 999})(),t8=eH&&ed&&eS(),t7=!eH||"pending"===eL,se=eH&&!t7&&!t8&&th,st=eH&&ej(),ss=eH&&eN(),sa=eH&&ev(),sl=eH&&e_(),sr=eH&&eS(),sn=async()=>{if(ss){eR.game.start("canada"),eQ(!0),e1("Loading Canada Mode...");try{await Q("canada")}catch{eQ(!1)}}else(0,g.trackPaywall)("home_expansions",{mode:"canada"}),eZ("canada"),eq(!0)},si=async()=>{if(sa){eR.game.start("europe"),eQ(!0),e1("Loading Europe Mode...");try{await Q("europe")}catch{eQ(!1)}}else"true"===localStorage.getItem("geohunter:europe_trial_used")?((0,g.trackPaywall)("home_expansions",{mode:"europe"}),eZ("europe"),eq(!0)):tC(!0)},so=async()=>{tC(!1),localStorage.setItem("geohunter:europe_trial_used","true"),eR.game.start("europe"),eQ(!0),e1("Loading Europe Mode...");try{await Q("europe")}catch{eQ(!1)}},sc=async()=>{eR.game.start("sports"),eQ(!0),e1("Loading Sports Mode...");try{await Q("sports")}catch{eQ(!1)}},sd=async()=>{if(sl){eR.game.start("empires"),eQ(!0),e1("Loading Ancient Empires...");try{await Q("empires")}catch{eQ(!1)}}else"true"===localStorage.getItem("geohunter:empires_trial_used")?((0,g.trackPaywall)("home_expansions",{mode:"empires"}),eZ("empires"),eq(!0)):tk(!0)},sx=async()=>{tk(!1),localStorage.setItem("geohunter:empires_trial_used","true"),eR.game.start("empires"),eQ(!0),e1("Loading Ancient Empires...");try{await Q("empires")}catch{eQ(!1)}},sm=async()=>{if(sr){eR.game.start("footy-clubs"),eQ(!0),e1("Loading Footy Clubs...");try{await Q("footy-clubs")}catch{eQ(!1)}}else(ec?ec.footyTrialUsed:"true"===localStorage.getItem("geohunter:footy_clubs_trial_used"))?((0,g.trackPaywall)("home_expansions",{mode:"footy-clubs"}),eZ("footy-clubs"),eq(!0)):tT(!0)},su=async()=>{tT(!1),eM(),eR.game.start("footy-clubs"),eQ(!0),e1("Loading Footy Clubs...");try{await Q("footy-clubs")}catch{eQ(!1)}},sh=async()=>{if(console.log("[DEBUG] USA mode clicked:",{userHasUSAAccess:st,isAuthenticated:ed,user:ec?{id:ec.id,email:ec.email,ownedProducts:ec.ownedProducts}:null}),st){eR.game.start("usa"),eQ(!0),e1("Loading USA States...");try{await Q("usa")}catch{eQ(!1)}}else(0,g.trackPaywall)("home_expansions",{mode:"usa"}),eZ("usa"),eq(!0)},sp=e=>e<9?"👑":e<50?"⭐":e<100?"🏆":e<200?"🔥":"🎯",sb={original:"classic",world:"world",special:"special",voyage:"voyage",atlas:"atlas",usa:"usa",canada:"canada",europe:"europe",sports:"sports",empires:"empires"},sf=(e,t)=>{if(t>=999)return"rgba(255,255,255,0.35)";let s=f.TRACKS.find(t=>t.id===sb[e]);if(!s)return"rgba(255,255,255,0.5)";let a=(0,f.evaluateTrack)(s,{[s.statKey]:t});return a.earnedTier?f.TIER_COLORS[a.earnedTier]:"rgba(255,255,255,0.5)"},sg=(e,s="w-5 h-5 text-white")=>{switch(e){case"original":return(0,t.jsx)(Y.Target,{className:s});case"world":return(0,t.jsx)(J,{className:s});case"special":return(0,t.jsx)(z,{className:s});case"voyage":return(0,t.jsx)(q,{className:s});case"atlas":return(0,t.jsx)(H,{className:s});default:return null}},sy=[{id:"original",color:"#9333ea",label:eA.modes.classic,categories:["👥","⚽","🏝️","🚨","🗺️","💰","⛽","☕"],score:tK},{id:"world",color:"#10b981",label:eA.modes.world,categories:["👥","⚽","🏝️","🏛️","🌲","🏀","🏭","🍽️"],score:tZ},{id:"special",color:"#f97316",label:eA.modes.special,categories:["🪖","🛂","🏝️","📊","🌿","🏔️","🏉","🌊"],score:tX},{id:"voyage",color:"#06b6d4",label:"Voyage",categories:["🌡️","🦞","🚴","🧍‍♂️","🍼","🛢️","🏦","🌪️"],score:tQ},{id:"atlas",color:"#dc2626",label:"Atlas",categories:["🏙️","🏅","🌧️","🏢","🍔","👴","🐌","🗣️"],score:t0}],sw=["voyage","atlas"],sj=[tK,tZ,tX].filter(e=>e<350).length,sN=(e,t)=>!sw.includes(e)||t<999||sj>=2;return(0,t.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-purple-600 via-purple-700 to-indigo-800 dark:bg-gradient-to-b dark:from-[#1a2f5c] dark:via-[#13234a] dark:to-[#0a1430] text-white relative",children:[(0,t.jsxs)("div",{className:"absolute inset-0 opacity-10 pointer-events-none",children:[(0,t.jsx)("div",{className:"absolute top-20 left-16 w-40 h-40 bg-yellow-400/30 dark:bg-[#5aa6ff]/40 rounded-full blur-3xl animate-pulse"}),(0,t.jsx)("div",{className:"absolute bottom-40 right-20 w-32 h-32 bg-pink-400/25 dark:bg-[#3f86f0]/25 rounded-full blur-2xl animate-pulse",style:{animationDelay:"1s"}})]}),(0,t.jsxs)("div",{className:"relative z-20",children:[(0,t.jsxs)("div",{className:"max-w-2xl mx-auto px-3 sm:px-5 pt-3 pb-0",children:[(0,t.jsxs)("div",{className:"relative flex items-center justify-center mb-2 pt-1",children:[(0,t.jsxs)("div",{className:"absolute left-0 top-2 flex flex-col items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>ed?X.push("/subscriptions"):e$(!0),className:"w-12 h-12 rounded-2xl flex items-center justify-center transition-all hover:scale-105 active:scale-95",style:{backgroundColor:"rgba(217, 119, 6, 0.25)",border:"1px solid rgba(251, 191, 36, 0.4)"},title:"Upgrade to GeoHunter+","aria-label":"Upgrade",children:(0,t.jsx)("span",{className:"text-2xl",style:{color:"#FFD700"},children:"👑"})}),ed&&ec&&(d=(e=(0,f.computeProgression)(ec.stats)).level>=50?f.TIER_COLORS.diamond:"#6366f1",(0,t.jsx)("button",{onClick:()=>X.push("/account"),className:"transition-transform hover:scale-105 active:scale-95",title:"View your progress",children:(0,t.jsx)(S.LevelBadge,{level:e.level,fraction:e.fraction,size:40,color:d,hideLabel:!0})}))]}),(0,t.jsxs)("div",{className:"relative w-20 h-20 sm:w-28 sm:h-28",children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"hidden dark:block absolute inset-0 -m-5 rounded-full blur-xl pointer-events-none animate-pulse",style:{background:"radial-gradient(circle, rgba(90,166,255,0.55) 0%, rgba(63,134,240,0.22) 50%, transparent 72%)"}}),(0,t.jsx)(C.default,{src:"/geohunter-logo.png",alt:"GeoHunter",fill:!0,className:"object-contain drop-shadow-2xl relative",priority:!0})]}),(0,t.jsxs)("button",{onClick:()=>e3(e=>!e),className:"absolute right-0 top-2 w-12 h-12 rounded-2xl bg-white/15 backdrop-blur-sm border border-white/20 hover:bg-white/25 transition-all flex items-center justify-center","aria-label":"Menu",children:[(0,t.jsx)(W,{className:"w-6 h-6 text-white"}),ed&&eE>0&&(0,t.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 rounded-full bg-red-500 text-white text-[10px] font-bold flex items-center justify-center",children:eE})]})]}),e9&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>e3(!1)}),(0,t.jsxs)("div",{className:"fixed top-14 right-4 z-50 bg-purple-950/95 dark:bg-[#0d1a38]/95 backdrop-blur-md border border-white/20 dark:border-white/15 rounded-2xl shadow-2xl overflow-hidden min-w-[190px]",children:[ed&&ec&&(0,t.jsxs)("button",{onClick:()=>{window.location.href="/account",e3(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/10 transition-colors border-b border-white/10",children:[(0,t.jsx)($.User,{className:"w-4 h-4 text-white/70"}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsx)("div",{className:"text-xs font-bold text-white",children:ec.username}),(0,t.jsx)("div",{className:"text-[10px] text-white/50",children:"View Profile"})]})]}),(0,t.jsxs)("button",{onClick:()=>{eU(!0),e3(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/10 transition-colors",children:[(0,t.jsx)(A,{className:"w-4 h-4 text-white/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-white",children:"How To Play"})]}),(0,t.jsxs)("button",{onClick:()=>{e6(!0),e3(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/10 transition-colors",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-white/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-white",children:"Settings"})]}),ed&&(0,t.jsxs)("button",{onClick:()=>{tc(!0),e3(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/10 transition-colors",children:[(0,t.jsx)(G.Users,{className:"w-4 h-4 text-white/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-white",children:"Friends"}),eE>0&&(0,t.jsx)("span",{className:"ml-auto min-w-[18px] h-[18px] px-1.5 rounded-full bg-red-500 text-white text-[10px] font-bold flex items-center justify-center",children:eE})]}),ed&&(0,t.jsxs)("button",{onClick:()=>{ew(),e3(!1)},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/10 transition-colors border-t border-white/10",children:[(0,t.jsx)(F,{className:"w-4 h-4 text-red-300"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-red-300",children:"Log Out"})]})]})]})]}),!eS()&&!eC()&&(0,t.jsx)("div",{className:"flex justify-center pb-2 px-5",children:(0,t.jsx)("div",{className:"bg-white/10 rounded-lg overflow-hidden min-h-[50px]",children:(0,t.jsx)(E.LargeBannerAd,{},"menu-top-banner")})})]}),(0,t.jsxs)("div",{className:"relative z-10 max-w-2xl mx-auto px-3 sm:px-5 pb-28 pt-2",children:[(0,t.jsxs)("div",{className:"rounded-2xl bg-white/[0.06] dark:bg-black/15 border border-white/10 dark:border-white/15 px-3 py-2.5 mb-3",children:[(0,t.jsx)("h2",{className:"text-[12px] font-black text-white uppercase tracking-[1.5px] mb-2",children:"Challenges"}),(0,t.jsxs)("div",{className:"flex gap-2 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)(N,{onShowLeaderboard:tq})}),(0,t.jsx)("button",{onClick:()=>{t8||t7?X.push("/weekly-pro"):th?X.push("/subscriptions"):window.confirm("Play this week's challenge! You get 1 free play per day.\n\nClick OK to play, or Cancel to learn about GeoHunter+.")?(tp(!0),X.push("/weekly-pro?freePlay=true")):X.push("/subscriptions")},className:"flex-1 min-w-0 rounded-2xl text-white shadow-md transition-all hover:shadow-lg hover:scale-[1.01] active:scale-[0.99]",style:{backgroundColor:se?"rgba(160, 101, 47, 0.7)":"#A0652F"},children:(0,t.jsxs)("div",{className:"p-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-xl bg-white/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)("span",{className:"text-base",children:se?"🔒":"📅"})}),(0,t.jsx)("div",{className:"flex-1 text-left min-w-0",children:(0,t.jsx)("p",{className:"text-sm font-black leading-tight truncate",children:"Weekly"})}),(0,t.jsx)("div",{className:`rounded-lg px-2 py-1.5 border flex-shrink-0 ${se?"bg-white/10 border-white/20":"bg-white/25 border-white/40"}`,children:(0,t.jsx)("p",{className:"text-[10px] font-bold whitespace-nowrap",children:se?"VIEW ▷":"▷"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-xs text-amber-200",children:["Week ",eH?(0,ef.getWeeklyProDisplayNumber)():""]}),eH&&(()=>{let e=999;try{let t=`geohunter-weekly-best-${(0,ef.getCurrentWeekIdentifier)()}`;e=parseInt(localStorage.getItem(t)||"999",10)}catch{}return e<999?(0,t.jsxs)("span",{className:"text-xs font-bold text-white",children:["→ ",e]}):null})()]})]})})]})]}),(0,t.jsxs)("div",{className:"rounded-2xl bg-white/[0.06] dark:bg-black/15 border border-white/10 dark:border-white/15 px-3 py-2.5 mt-3 mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"text-[12px] font-black text-white uppercase tracking-[1.5px]",children:"Your Modes"}),(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-white/80",children:"Easy"}),(0,t.jsx)(ep,{checked:tl,onCheckedChange:e=>tr(!!e),"aria-label":"Toggle easy mode"})]})]}),(0,t.jsxs)("div",{children:[(x=tI?sy:sy.filter(e=>sN(e.id,e.score)),m=!tI&&sy.some(e=>!sN(e.id,e.score)),(0,t.jsxs)("div",{className:"flex gap-2 mb-2",children:[x.map(e=>{let s,a=e2===e.id,l=!sN(e.id,e.score),r=e.score<999?sp(e.score):null;return(0,t.jsxs)("button",{onClick:()=>(e=>{e5(e);try{localStorage.setItem("geohunter:last-expanded-mode",e)}catch{}})(e.id),className:"flex-1 flex flex-col items-center py-2 px-0.5 rounded-2xl transition-all duration-200",style:{backgroundColor:a?e.color:"rgba(255,255,255,0.1)",border:a?"2px solid rgba(255,255,255,0.55)":"2px solid transparent",transform:a?"scale(1.06)":"scale(1)"},children:[(0,t.jsxs)("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl flex items-center justify-center mb-1 relative",style:{backgroundColor:a?"rgba(255,255,255,0.22)":e.color,opacity:l?.7:1},children:[sg(e.id,"w-5 h-5 text-white"),l&&(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] rounded-md flex items-center justify-center",style:{backgroundColor:"#1f2937"},children:(0,t.jsx)("span",{className:"text-[8px]",children:"🔒"})})]}),l?(0,t.jsx)("span",{className:"text-[10px] text-white/40 leading-none",children:"Locked"}):tl?(s=eo?.[e.id]??999)<999?(0,t.jsxs)("span",{className:"text-[10px] font-black text-white leading-none",children:["🏋️",s]}):(0,t.jsx)("span",{className:"text-[10px] text-white/40 leading-none",children:"Easy"}):r?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-black text-white leading-none",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:sf(e.id,e.score)}}),e.score]}):(0,t.jsx)("span",{className:"text-[10px] text-white/40 leading-none",children:"—"})]},e.id)}),m&&(0,t.jsxs)("button",{onClick:()=>tM(!0),className:"flex-1 flex flex-col items-center py-2 px-0.5 rounded-2xl transition-all duration-200",style:{backgroundColor:"rgba(255,255,255,0.1)",border:"2px dashed rgba(255,255,255,0.3)"},title:"More modes",children:[(0,t.jsx)("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl flex items-center justify-center mb-1",style:{backgroundColor:"rgba(255,255,255,0.12)"},children:(0,t.jsx)("span",{className:"text-white text-lg font-black leading-none",children:"+"})}),(0,t.jsx)("span",{className:"text-[10px] text-white/40 leading-none",children:"More"})]})]})),e2&&(()=>{let e,s=sy.find(e=>e.id===e2);if(!s)return null;sp(s.score);let a=!sN(s.id,s.score),l={original:"classic",world:"world",special:"special",voyage:"voyage",atlas:"atlas"},r=f.TRACKS.find(e=>e.id===l[s.id]),n=s.score<999,i=r?(0,f.evaluateTrack)(r,{[r.statKey]:s.score}):null,o=i?.earnedTier??null,c=i?.nextTier??null,d=i?.fraction??0,x=o?f.TIER_COLORS[o]:"rgba(255,255,255,0.5)",m=c?f.TIER_COLORS[c]:f.TIER_COLORS.diamond,u=c?Math.max(6,Math.min(100,Math.round(100*d))):100;return(0,t.jsxs)("div",{className:"rounded-2xl p-2.5 border border-white/20 dark:!bg-[#0a142a]/90 dark:border-white/15",style:{backgroundColor:s.color},children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 border-2 border-white/30",style:{backgroundColor:"rgba(255,255,255,0.15)"},children:sg(s.id,"w-4 h-4 text-white")}),(0,t.jsx)("span",{className:"font-black text-white text-sm flex-1 leading-tight min-w-0 truncate",children:s.label}),tl?(e=eo?.[s.id]??999)<999?(0,t.jsxs)("span",{className:"text-xs font-bold text-white",children:["🏋️ ",e]}):(0,t.jsx)("span",{className:"text-xs font-bold text-white/70",children:"80 flags"}):s.score<999?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs font-bold text-white",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:x}}),s.score]}):null,(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),eY(s.id)},className:"w-7 h-7 rounded-xl flex items-center justify-center transition-all hover:opacity-90 active:scale-95 flex-shrink-0",style:{backgroundColor:"#d97706"},title:"Leaderboard",children:(0,t.jsx)(V,{className:"w-3.5 h-3.5 text-white"})}),(0,t.jsx)("button",{disabled:a,onClick:async()=>{if(!a)if(tl){eQ(!0),e1(`Loading Easy ${s.label}...`);try{await ee(s.id)}catch{eQ(!1)}}else tV(s.id)},className:"px-3 py-1.5 rounded-xl text-sm font-black text-white transition-all hover:opacity-90 active:scale-95 flex-shrink-0 disabled:opacity-60",style:{backgroundColor:a?"#475569":"#16a34a"},children:a?"🔒":tl?"EASY ▶":"PLAY ▶"})]}),a&&(0,t.jsxs)("div",{className:"mb-2 rounded-xl bg-black/25 border border-white/15 px-2.5 py-1.5",children:[(0,t.jsxs)("p",{className:"text-[10px] font-bold text-white/90 leading-snug",children:["🔒 Score under ",350," in any 2 of Classic, World & Special to unlock ",s.label," for free."]}),(0,t.jsxs)("p",{className:"text-[10px] text-white/55 leading-none mt-1",children:["Progress: ",Math.min(sj,2)," / 2"]})]}),!tl&&n&&r?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-0.5",children:[(0,t.jsx)("span",{className:"text-[11px] font-black leading-none whitespace-nowrap",style:{color:c?x:f.TIER_COLORS.diamond},children:c?o?`${({bronze:"🥉",silver:"🥈",gold:"🥇",diamond:"💎"})[o]} ${o.charAt(0).toUpperCase()+o.slice(1)}`:"Beginner":"💎 Mastered"}),(0,t.jsxs)("div",{className:"relative flex-1 h-2.5",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-black/30 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${u}%`,backgroundColor:c?x:f.TIER_COLORS.diamond}})}),(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-1 h-3.5 rounded-sm bg-white/90",style:{left:`${u}%`}}),c&&(0,t.jsx)("div",{className:"absolute top-1/2 right-0 -translate-y-1/2 w-2.5 h-2.5 rounded-full border border-white/40",style:{backgroundColor:m}})]})]}):tl?null:(0,t.jsx)("p",{className:"text-[11px] text-white/70 font-medium px-0.5",children:"Play to earn your first tier and start ranking"})]})})()]})]}),tb.world_cup_mode&&(u=tb.footy_clubs_mode&&t4>=999,h=ey.TOURNAMENT_STAGES.find(e=>e.key===(0,ey.getActiveStageKey)())?.label??"",(0,t.jsxs)("div",{ref:tU,className:"mt-3 mb-1 rounded-2xl overflow-hidden bg-white/8 dark:bg-black/15 border border-white/10 dark:border-white/15",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/10 bg-white/5 dark:bg-white/[0.04]",children:[(0,t.jsx)("button",{onClick:()=>tF("tournament"),children:(0,t.jsx)("span",{className:`text-[12px] font-black uppercase tracking-[1.4px] transition-colors ${"tournament"===t$?"text-white/85":"text-white/35"}`,children:"⚽ Tournament"})}),(0,t.jsxs)("button",{onClick:()=>tF("sports"),className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:`text-[12px] font-black uppercase tracking-[1.4px] transition-colors ${"sports"===t$?"text-white/85":"text-white/35"}`,children:"Sports"}),u&&(0,t.jsx)("span",{className:"text-[9px] font-black px-1.5 py-0.5 rounded-full bg-red-500 text-white leading-none animate-pulse",children:"NEW"}),(0,t.jsx)(D.ChevronRight,{className:`w-4 h-4 ${"sports"===t$?"text-[#fbbf24]":"text-white/35"}`})]})]}),"tournament"===t$?(0,t.jsx)("div",{className:"p-2",children:(0,t.jsxs)("button",{onClick:()=>X.push("/nations-cup"),className:"w-full flex items-center gap-3 px-4 py-3 rounded-xl transition-opacity hover:opacity-90 active:opacity-80",style:{backgroundColor:"#0d1626",border:"1px solid rgba(255,255,255,0.07)",borderLeft:"3px solid #7dd3fc"},children:[(0,t.jsxs)("div",{className:"w-10 h-10 rounded-full flex flex-col items-center justify-center flex-shrink-0 border-2",style:{backgroundColor:"#0c1f4a",borderColor:"#7dd3fc"},children:[(0,t.jsx)("span",{className:"text-base leading-4",children:"👑"}),(0,t.jsx)("span",{className:"text-sm leading-3 -mt-0.5",children:"⚽"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsxs)("p",{className:"text-sm font-black tracking-wider truncate",style:{color:"#7dd3fc"},children:["NATIONS CUP",h?(0,t.jsx)("span",{className:"font-bold",style:{color:"rgba(125,211,252,0.7)"},children:"  ·  "+h.toUpperCase()}):null]}),(0,t.jsx)("p",{className:"text-[11px] font-medium mt-0.5",style:{color:"#bfdbfe"},children:"See the global standings →"})]}),ty&&(b=(0,ey.currentNationsCupBest)(t6,tj),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[(0,t.jsx)("span",{className:"text-xl leading-none",children:ty.emoji}),b<999&&(0,t.jsx)("span",{className:"text-sm font-black",style:{color:"#7dd3fc"},children:b})]}))]})}):(0,t.jsx)("div",{className:"flex justify-center gap-10 p-3",children:[{id:"sports",emoji:"🏆",label:"Sports",color:"#166534",access:!0,score:t9,handler:sc,glow:!1,isNew:!1},...tb.footy_clubs_mode?[{id:"footy-clubs",emoji:"⚽",label:"Footy Clubs",color:"#d4a017",access:sr,score:t4,handler:sm,glow:!0,isNew:u}]:[]].map(e=>(0,t.jsxs)("button",{onClick:e.handler,className:"flex flex-col items-center gap-1 py-1 w-20 transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsxs)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl relative",style:{backgroundColor:e.color,...e.glow?{boxShadow:"0 0 8px rgba(251,191,36,0.95)",border:"1.5px solid #fde68a"}:{}},children:[e.emoji,e.isNew&&(0,t.jsx)("span",{className:"absolute -top-1.5 -right-1.5 text-[8px] font-black px-1 py-0.5 rounded-full bg-red-500 text-white leading-none",children:"NEW"}),!e.access&&!e.isNew&&(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 w-[18px] h-[18px] rounded-md flex items-center justify-center",style:{backgroundColor:"#1f2937"},children:(0,t.jsx)("span",{className:"text-[8px]",children:"🔒"})})]}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:e.label}),e.access&&e.score<999?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[9px] font-extrabold text-white/65 leading-none",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:sf(e.id,e.score)}}),e.score]}):null]},e.id))})]})),(0,t.jsxs)("div",{className:"mt-3 mb-2 rounded-2xl bg-white/[0.06] dark:bg-black/15 border border-white/10 dark:border-white/15 overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>tR(e=>!e),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/5 dark:hover:bg-white/5 transition-colors",children:[(0,t.jsx)("span",{className:"text-sm font-black text-white flex-1 text-left",children:"World Expansions"}),(0,t.jsx)("span",{className:"text-[10px] font-black bg-yellow-500 text-yellow-900 px-1.5 py-0.5 rounded",children:"PRO"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-base",children:"🇺🇸"}),(0,t.jsx)("span",{className:"text-base",children:"🇪🇺"}),(0,t.jsx)("span",{className:"text-base",children:"🏛️"})]}),(0,t.jsx)(U,{className:`w-4 h-4 text-white/60 transition-transform ${tL?"rotate-180":""}`})]}),tL&&(0,t.jsxs)("div",{className:"border-t border-white/[0.08] px-3 pt-3",children:[!eS()&&(0,t.jsxs)("button",{onClick:()=>{(0,g.trackPaywallCta)("home_plus_banner"),ed?X.push("/subscriptions"):e$(!0)},className:"w-full flex items-center gap-2.5 rounded-xl px-[11px] py-[9px] mb-2.5 text-left hover:opacity-90 transition-opacity",style:{backgroundColor:"rgba(99,102,241,0.12)",border:"1px solid rgba(99,102,241,0.45)"},children:[(0,t.jsx)("span",{className:"text-lg flex-shrink-0",children:"👑"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-black text-white leading-tight",children:"Unlock GeoHunter+"}),(0,t.jsx)("div",{className:"text-[11px] leading-tight mt-0.5",style:{color:"#a5b4fc"},children:"All modes · no ads · perfect solutions"})]}),(0,t.jsx)(D.ChevronRight,{className:"w-[18px] h-[18px] flex-shrink-0",style:{color:"rgba(255,255,255,0.45)"}})]}),!eS()&&(0,t.jsx)("span",{className:"block text-[10px] font-extrabold tracking-wide mb-2",style:{color:"rgba(255,255,255,0.4)",letterSpacing:.6},children:"OR UNLOCK"}),(0,t.jsx)("div",{className:`grid gap-2 pb-3 justify-items-center ${tb.empires_mode?"grid-cols-4":"grid-cols-3"}`,children:[{id:"usa",emoji:"🇺🇸",label:"USA",color:"#1e3a8a",access:st,score:t1,price:"$4.99",featured:!0,handler:sh},{id:"canada",emoji:"🍁",label:"Canada",color:"#b91c1c",access:ss,score:t2,price:"$1.99",featured:!1,handler:sn},{id:"europe",emoji:"🇪🇺",label:"Europe",color:"#1d4ed8",access:sa,score:t5,price:"$3.99",featured:!1,handler:si},...tb.empires_mode?[{id:"empires",emoji:"🏛️",label:"Empires",color:"#92400e",access:sl,score:t3,price:"PRO",featured:!1,handler:sd}]:[]].map(e=>{let s=e.featured&&!e.access;return(0,t.jsxs)("button",{onClick:e.handler,className:"flex flex-col items-center gap-1 py-1 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsxs)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl relative",style:{backgroundColor:e.color,...s?{boxShadow:"0 0 10px rgba(245,158,11,0.65)"}:{}},children:[e.emoji,s?(0,t.jsx)("span",{className:"absolute -bottom-1 -right-1 text-[7px] font-black px-1 py-0.5 rounded leading-none",style:{backgroundColor:"#f59e0b",color:"#1f2937"},children:"HOT"}):e.access?null:(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 w-[18px] h-[18px] rounded-md flex items-center justify-center",style:{backgroundColor:"#1f2937"},children:(0,t.jsx)("span",{className:"text-[8px]",children:"🔒"})})]}),(0,t.jsx)("span",{className:`text-[10px] leading-none ${s?"font-black text-[#fbbf24]":"font-bold text-white/85"}`,children:e.label}),e.access&&e.score<999?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[9px] font-extrabold text-white/65 leading-none",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:sf(e.id,e.score)}}),e.score]}):e.access?null:(0,t.jsx)("span",{className:"text-[9px] text-yellow-400 font-bold leading-none",children:e.price})]},e.id)})})]})]}),(0,t.jsxs)("div",{className:"mt-3 mb-2 rounded-2xl bg-white/[0.06] dark:bg-black/15 border border-white/10 dark:border-white/15 overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>tO(e=>!e),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-white/5 dark:hover:bg-white/5 transition-colors",children:[(0,t.jsx)("span",{className:"text-sm font-black text-white flex-1 text-left",children:"Minigames"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-base",children:"⚡"}),(0,t.jsx)("span",{className:"text-base",children:"🌊"}),(0,t.jsx)("span",{className:"text-base",children:"🔄"})]}),(0,t.jsx)(U,{className:`w-4 h-4 text-white/60 transition-transform ${tA?"rotate-180":""}`})]}),tA&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-1 gap-y-3 px-3 pb-3 justify-items-center border-t border-white/[0.08]",children:(w=eH?parseInt(localStorage.getItem("geohunter-best-score-mini-hunter")||"999"):999,T=eH?parseInt(localStorage.getItem("geohunter-best-score-mini-hunter2")||"999"):999,R=eH?parseInt(localStorage.getItem("geohunter-best-score-reverse")||"999"):999,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>es(),className:"flex flex-col items-center gap-1 pt-3 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsx)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl",style:{backgroundColor:"#f59e0b"},children:"⚡"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"MiniHunter"}),w<999?(0,t.jsxs)("span",{className:"text-[9px] font-extrabold text-white/65 leading-none",children:["⭐",w]}):(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:"Quick Play"})]}),(0,t.jsxs)("button",{onClick:()=>ea(),className:"flex flex-col items-center gap-1 pt-3 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsx)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl",style:{backgroundColor:"#14b8a6"},children:"🌊"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"MiniHunter2"}),T<999?(0,t.jsxs)("span",{className:"text-[9px] font-extrabold text-white/65 leading-none",children:["⭐",T]}):(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:"World + Voyage"})]}),(0,t.jsxs)("button",{onClick:()=>{tG(!0);try{localStorage.setItem("geohunter:seen-reverse","1")}catch{}el()},className:"flex flex-col items-center gap-1 pt-3 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsxs)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl relative",style:{backgroundColor:"#6366f1"},children:["🔄",!tD&&(0,t.jsx)("span",{className:"absolute -top-1.5 -right-1.5 text-[8px] font-black px-1 py-0.5 rounded-full bg-red-500 text-white leading-none",children:"NEW"})]}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"Reverse"}),R<999?(0,t.jsxs)("span",{className:"text-[9px] font-extrabold text-white/65 leading-none",children:["⭐",R]}):(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:"Guess by Cat"})]}),(0,t.jsxs)("button",{onClick:()=>ee(),className:"flex flex-col items-center gap-1 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsx)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl",style:{backgroundColor:"#7c3aed"},children:"🟢"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"Classic Easy"}),(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:"Beginner"})]}),(0,t.jsxs)("button",{onClick:()=>{eS()||eC()?er():"true"===localStorage.getItem("geohunter:custom_trial_used")?X.push("/weekly-pro"):tE(!0)},className:"flex flex-col items-center gap-1 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsxs)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl relative",style:{backgroundColor:"#db2777"},children:["🎨",!eS()&&!eC()&&(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 w-[18px] h-[18px] rounded-md flex items-center justify-center",style:{backgroundColor:"#1f2937"},children:(0,t.jsx)("span",{className:"text-[8px]",children:"🔒"})})]}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"Custom"}),(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:eS()||eC()?"Pick cats":"Try Free"})]}),(0,t.jsxs)("button",{onClick:()=>et(),className:"flex flex-col items-center gap-1 w-full transition-all hover:scale-[1.04] active:scale-[0.97]",children:[(0,t.jsx)("div",{className:"w-[46px] h-[46px] rounded-[13px] flex items-center justify-center text-2xl",style:{backgroundColor:"#10b981"},children:"🎯"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-white/85 leading-none",children:"Tutorial"}),(0,t.jsx)("span",{className:"text-[9px] text-white/50 leading-none",children:"Learn to play"})]})]}))})]}),ed&&tn.length>0&&(0,t.jsxs)("div",{className:"mt-2 mb-3 rounded-xl border border-white/15 overflow-hidden",style:{backgroundColor:"rgba(255,255,255,0.06)"},children:[(0,t.jsx)("div",{className:"px-3 pt-2.5 pb-1 text-[10px] font-bold text-white/40 uppercase tracking-widest",children:"Active Challenges"}),tn.map(e=>{let s=e.participants||[],a=ec?.id,l=a?s.find(e=>e.user_id===a):null,r=s.find(e=>e.user_id!==a),n=l?.score!=null&&r?.score!=null;return(0,t.jsxs)("button",{onClick:()=>{tt("my"),e7(!0)},className:"w-full flex items-center gap-3 px-3 py-2 border-t border-white/10 hover:bg-white/5 transition-colors text-left",children:[(0,t.jsx)("span",{className:"text-base",children:"🌍"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-white/90 truncate",children:r?.username?`@${r.username}`:"Waiting..."}),(0,t.jsx)("div",{className:"text-[10px] text-white/40",children:{original:"Classic",world:"World",special:"Special",sports:"Sports","weekly-pro":"Weekly"}[e.base_mode]||e.base_mode})]}),n&&(0,t.jsxs)("div",{className:"text-[10px] font-bold text-white/70",children:[l.score," vs ",r.score]})]},e.code)})]}),tH.filter(e=>!tW.includes(e.id)).map(e=>{let s="error"===e.type?"#ef4444":"warning"===e.type?"#eab308":"#3b82f6",a="error"===e.type?"rgba(239,68,68,0.12)":"warning"===e.type?"rgba(234,179,8,0.12)":"rgba(59,130,246,0.12)";return(0,t.jsxs)("div",{style:{borderLeft:`3px solid ${s}`,background:a,borderRadius:8,padding:"10px 14px",marginBottom:10,position:"relative"},children:[(0,t.jsx)("button",{onClick:()=>{let t=[...tW,e.id];tB(t);try{localStorage.setItem("@geohunter_dismissed_announcements",JSON.stringify(t))}catch{}},style:{position:"absolute",top:6,right:8,background:"none",border:"none",cursor:"pointer",color:"rgba(255,255,255,0.5)",fontSize:14,lineHeight:1},"aria-label":"Dismiss",children:"✕"}),(0,t.jsx)("p",{style:{margin:0,fontSize:13,color:"rgba(255,255,255,0.85)",paddingRight:20},children:e.message}),e.link_url&&e.link_text&&(0,t.jsxs)("a",{href:e.link_url,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:6,fontSize:12,color:s,fontWeight:600},children:[e.link_text," →"]})]},e.id)}),tb.footy_clubs_mode&&t4>=500&&(0,t.jsxs)("button",{onClick:()=>{tF("sports"),setTimeout(()=>{tU.current?.scrollIntoView({behavior:"smooth",block:"start"})},120)},className:"w-full flex items-center justify-center gap-2 rounded-xl px-3 py-2 mb-3 transition-transform hover:scale-[1.01] active:scale-[0.99]",style:{backgroundColor:"#160828",border:"1px solid rgba(255,215,0,0.35)"},children:[(0,t.jsx)("span",{className:"text-base leading-none",children:"⚽"}),(0,t.jsx)("span",{className:"text-xs font-black text-white",children:"Footy Clubs"}),(0,t.jsx)("span",{className:"text-[9px] font-black tracking-wider px-1.5 py-0.5 rounded",style:{color:"#FFD700",backgroundColor:"rgba(255,215,0,0.12)"},children:"TRY IT FREE"}),(0,t.jsx)(D.ChevronRight,{className:"w-3.5 h-3.5",style:{color:"#FFD700"}})]}),(0,t.jsxs)("div",{className:"flex justify-center gap-3 mb-4 flex-wrap",children:[(0,t.jsxs)("a",{href:"https://apps.apple.com/gb/app/geohunter/id6755425765",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-black text-white px-5 py-2.5 rounded-xl font-semibold text-sm transition-all hover:scale-105 active:scale-95 border border-white/20 hover:bg-gray-900",children:[(0,t.jsx)("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,t.jsx)("span",{children:"App Store"})]}),(0,t.jsxs)("a",{href:"https://play.google.com/store/apps/details?id=com.geohuntergame.mobile",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-black text-white px-5 py-2.5 rounded-xl font-semibold text-sm transition-all hover:scale-105 active:scale-95 border border-white/20 hover:bg-gray-900",children:[(0,t.jsx)("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z"})}),(0,t.jsx)("span",{children:"Google Play"})]})]}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(_.SocialLinks,{})}),(0,t.jsxs)("footer",{className:"text-center",children:[(0,t.jsxs)("div",{className:"flex justify-center flex-wrap gap-2 text-purple-200 dark:text-white/50 text-xs uppercase tracking-wider",children:[(0,t.jsx)(l.default,{href:"/about",className:"hover:text-white transition-colors",children:"About"}),(0,t.jsx)("span",{className:"text-white/40",children:"•"}),(0,t.jsx)(l.default,{href:"/contact",className:"hover:text-white transition-colors",children:"Contact"}),(0,t.jsx)("span",{className:"text-white/40",children:"•"}),(0,t.jsx)(l.default,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"}),(0,t.jsx)("span",{className:"text-white/40",children:"•"}),(0,t.jsx)(l.default,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})]}),(0,t.jsx)("p",{className:"text-xs text-white/50 mt-2",children:"geohuntergame.com"}),(0,t.jsx)("p",{className:"text-[10px] text-white/40 mt-1",children:"v2.5.0"})]})]}),(0,t.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-30 bg-purple-950/95 dark:bg-[#080c20]/95 backdrop-blur-md border-t border-white/10 dark:border-t-[#fbbf24]/20",children:(0,t.jsxs)("div",{className:"max-w-2xl mx-auto flex items-stretch justify-around px-2 py-2 pb-[max(env(safe-area-inset-bottom),0.5rem)]",children:[(0,t.jsxs)("button",{className:"flex flex-col items-center justify-center gap-0.5 flex-1 py-1.5 rounded-lg transition-colors","aria-label":"Home",children:[(0,t.jsx)(K.Home,{className:"w-5 h-5 text-yellow-400 dark:text-[#fbbf24]"}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-yellow-400 dark:text-[#fbbf24]",children:"Home"})]}),(0,t.jsxs)("button",{onClick:()=>X.push("/leaderboard"),className:"flex flex-col items-center justify-center gap-0.5 flex-1 py-1.5 rounded-lg hover:bg-white/5 transition-colors","aria-label":"Leaderboards",children:[(0,t.jsx)(O.Trophy,{className:"w-5 h-5 text-white/70 dark:text-white/45"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-white/70 dark:text-white/45",children:"Leaderboards"})]}),(0,t.jsxs)("button",{onClick:()=>ed?tc(!0):e$(!0),className:"flex flex-col items-center justify-center gap-0.5 flex-1 py-1.5 rounded-lg hover:bg-white/5 transition-colors","aria-label":"Friends",children:[(0,t.jsx)(G.Users,{className:"w-5 h-5 text-white/70 dark:text-white/45"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-white/70 dark:text-white/45",children:"Friends"})]}),(0,t.jsxs)("button",{onClick:()=>ed?X.push("/account"):e$(!0),className:"flex flex-col items-center justify-center gap-0.5 flex-1 py-1.5 rounded-lg hover:bg-white/5 transition-colors","aria-label":"Profile",children:[(0,t.jsx)($.User,{className:"w-5 h-5 text-white/70 dark:text-white/45"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-white/70 dark:text-white/45",children:"Profile"})]})]})}),(0,t.jsx)(c.AuthModal,{isOpen:eO,onClose:()=>e$(!1)}),(0,t.jsx)(Z.SettingsOverlay,{isOpen:e4,onClose:()=>e6(!1)}),eF&&(0,t.jsx)(v.OnboardingModal,{mode:"refresh",onClose:()=>eU(!1),onPlayEasyMode:()=>{eU(!1),ee()}}),e8&&(0,t.jsx)(p,{onClose:()=>e7(!1),initialView:te}),(0,t.jsx)(eb.FriendsModal,{isOpen:to,onClose:()=>{tc(!1),tx(void 0),tu(null),eI()},onChallengeFriend:(e,t)=>{tc(!1),tx(void 0),tu(null),ta({id:e,username:t})},initialTab:td,initialUserId:tm}),ts&&(0,t.jsx)(y,{visible:!!ts,targetFriendId:ts.id,targetFriendUsername:ts.username,onClose:()=>ta(null)}),eD&&(0,t.jsx)(v.OnboardingModal,{mode:"onboarding",onPlayEasyMode:tY,onPlayedBefore:()=>{eG(!1)},onClose:()=>eG(!1)}),eV&&(0,t.jsx)(I.SimpleLeaderboard,{isOpen:!0,initialTab:eV,onClose:()=>eY(null)}),tv&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-[#1c1a2e] border border-amber-500/30 rounded-2xl p-6 max-w-sm w-full shadow-2xl",children:[(0,t.jsxs)("div",{className:"text-center mb-4",children:[(0,t.jsx)("div",{className:"text-6xl mb-3",children:"🏛️"}),(0,t.jsx)("h2",{className:"text-xl font-black text-white mb-2",children:"Try Ancient Empires — Free!"}),(0,t.jsx)("p",{className:"text-sm text-white/70",children:"Play one game to experience 40 empires across 8 categories. Your trial score will be blurred — subscribe to unlock."})]}),(0,t.jsxs)("div",{className:"space-y-2 mt-5",children:[(0,t.jsx)("button",{onClick:sx,className:"w-full py-3 rounded-xl bg-gradient-to-r from-amber-600 to-amber-800 text-white font-black text-sm hover:from-amber-700 hover:to-amber-900 transition-all",children:"🏛️ Try Now — Free"}),(0,t.jsx)("button",{onClick:()=>{tk(!1),(0,g.trackPaywall)("home_expansions",{mode:"empires"}),eZ("empires"),eq(!0)},className:"w-full py-3 rounded-xl bg-white/10 text-white/80 font-bold text-sm hover:bg-white/20 transition-all",children:"Buy GeoHunter+"}),(0,t.jsx)("button",{onClick:()=>tk(!1),className:"w-full py-2 text-white/40 text-xs hover:text-white/60 transition-all",children:"Maybe later"})]})]})}),tS&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-[#0c1a3a] border border-blue-500/30 rounded-2xl p-6 max-w-sm w-full shadow-2xl",children:[(0,t.jsxs)("div",{className:"text-center mb-4",children:[(0,t.jsx)("div",{className:"text-6xl mb-3",children:"🇪🇺"}),(0,t.jsx)("h2",{className:"text-xl font-black text-white mb-2",children:"Try Europe — Free!"}),(0,t.jsx)("p",{className:"text-sm text-white/70",children:"Play one game across European countries and 8 categories. Your trial score will be blurred — subscribe to unlock."})]}),(0,t.jsxs)("div",{className:"space-y-2 mt-5",children:[(0,t.jsx)("button",{onClick:so,className:"w-full py-3 rounded-xl bg-gradient-to-r from-blue-600 to-blue-800 text-white font-black text-sm hover:from-blue-700 hover:to-blue-900 transition-all",children:"🇪🇺 Try Now — Free"}),(0,t.jsx)("button",{onClick:()=>{tC(!1),(0,g.trackPaywall)("home_expansions",{mode:"europe"}),eZ("europe"),eq(!0)},className:"w-full py-3 rounded-xl bg-white/10 text-white/80 font-bold text-sm hover:bg-white/20 transition-all",children:"Buy GeoHunter+"}),(0,t.jsx)("button",{onClick:()=>tC(!1),className:"w-full py-2 text-white/40 text-xs hover:text-white/60 transition-all",children:"Maybe later"})]})]})}),t_&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-[#0d1b3e] border border-yellow-500/30 rounded-2xl p-6 max-w-sm w-full shadow-2xl",children:[(0,t.jsxs)("div",{className:"text-center mb-4",children:[(0,t.jsx)("div",{className:"text-6xl mb-3",children:"⚽"}),(0,t.jsx)("h2",{className:"text-xl font-black text-white mb-2",children:"Try Footy Clubs free — one game on us!"}),(0,t.jsx)("p",{className:"text-sm text-white/70",children:"Rank 100 legendary football clubs across 8 categories. Subscribe to GeoHunter+ for unlimited games."})]}),(0,t.jsxs)("div",{className:"space-y-2 mt-5",children:[(0,t.jsx)("button",{onClick:su,className:"w-full py-3 rounded-xl bg-gradient-to-r from-yellow-500 to-yellow-700 text-[#0d1b3e] font-black text-sm hover:from-yellow-400 hover:to-yellow-600 transition-all",children:"⚽ Try Now — Free"}),(0,t.jsx)("button",{onClick:()=>{tT(!1),(0,g.trackPaywall)("home_expansions",{mode:"footy-clubs"}),eZ("footy-clubs"),eq(!0)},className:"w-full py-3 rounded-xl bg-white/10 text-white/80 font-bold text-sm hover:bg-white/20 transition-all",children:"Buy GeoHunter+"}),(0,t.jsx)("button",{onClick:()=>tT(!1),className:"w-full py-2 text-white/40 text-xs hover:text-white/60 transition-all",children:"Maybe later"})]})]})}),tP&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-[#1c1a2e] border border-pink-500/30 rounded-2xl p-6 max-w-sm w-full shadow-2xl",children:[(0,t.jsxs)("div",{className:"text-center mb-4",children:[(0,t.jsx)("div",{className:"text-6xl mb-3",children:"🎨"}),(0,t.jsx)("h2",{className:"text-xl font-black text-white mb-2",children:"Try Custom Mode — Free!"}),(0,t.jsx)("p",{className:"text-sm text-white/70",children:"Pick exactly 8 categories from across all game modes and play your own mashup. One free game — subscribe to unlock unlimited."})]}),(0,t.jsxs)("div",{className:"space-y-2 mt-5",children:[(0,t.jsx)("button",{onClick:()=>{tE(!1),localStorage.setItem("geohunter:custom_trial_used","true"),er()},className:"w-full py-3 rounded-xl bg-gradient-to-r from-pink-600 to-pink-800 text-white font-black text-sm hover:from-pink-700 hover:to-pink-900 transition-all",children:"🎨 Try Now — Free"}),(0,t.jsx)("button",{onClick:()=>{tE(!1),X.push("/weekly-pro")},className:"w-full py-3 rounded-xl bg-white/10 text-white/80 font-bold text-sm hover:bg-white/20 transition-all",children:"Get GeoHunter Pro"}),(0,t.jsx)("button",{onClick:()=>tE(!1),className:"w-full py-2 text-white/40 text-xs hover:text-white/60 transition-all",children:"Maybe later"})]})]})}),(0,t.jsx)(L.PremiumModePaywall,{isOpen:eJ,mode:eK,onClose:()=>eq(!1),onPurchaseSuccess:async()=>{await eT(),eq(!1),eR.game.start(eK),eQ(!0),e1(`Loading ${{usa:"USA States",canada:"Canada",europe:"Europe",empires:"Ancient Empires","footy-clubs":"Footy Clubs"}[eK]??eK} Mode...`);try{await Q(eK)}catch{eQ(!1)}}}),(0,t.jsx)(P,{show:eX,message:e0})]})}var ej=e.i(38643),eN=e.i(70977),ev=e.i(91699),ek=e.i(29978),eS=e.i(50288),eC=e.i(95849),e_=e.i(66691);let eT=(0,R.default)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function eP({onComplete:e}){let{startGame:l,isTutorialMode:r,selections:n,gameMode:i,currentCountryIndex:o,goToMenu:c}=(0,s.useGameStore)(),[d,x]=(0,a.useState)(!1),m=(0,a.useRef)(0),u=Math.min(o,eS.TUTORIAL_STEPS.length-1),h=eS.TUTORIAL_STEPS[u],p=(0,eC.getCategoriesForGameMode)("original").find(e=>e.id===h?.targetCategory);return((0,a.useEffect)(()=>{if(n.length>m.current&&n.length<=eS.TUTORIAL_STEPS.length){x(!0);let e=setTimeout(()=>x(!1),1500);return m.current=n.length,()=>clearTimeout(e)}m.current=n.length},[n.length]),(0,a.useEffect)(()=>{x(!1)},[o]),"finished"===i&&r)?(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4 pointer-events-auto",children:(0,t.jsxs)(ev.motion.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},className:"bg-gradient-to-br from-purple-600 via-purple-700 to-indigo-800 rounded-3xl border-2 border-white/30 p-8 max-w-md w-full text-center",children:[(0,t.jsx)("div",{className:"text-6xl mb-4 animate-bounce",children:"🏆"}),(0,t.jsx)("h2",{className:"text-3xl font-black text-white mb-2",children:"Tutorial Complete!"}),(0,t.jsx)("p",{className:"text-white/80 mb-6",children:"Great job! You understand how GeoHunter works. Now let's play a real game!"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(e_.Button,{onClick:()=>{l("original"),e?.()},className:"w-full bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700 text-white font-bold py-3 rounded-xl flex items-center justify-center gap-2",children:[(0,t.jsx)(z,{className:"w-5 h-5"}),(0,t.jsx)("span",{children:"Play Real Game - Classic Mode"}),(0,t.jsx)(eT,{className:"w-5 h-5"})]}),(0,t.jsx)(e_.Button,{onClick:()=>{c(),e?.()},variant:"ghost",className:"w-full text-white border border-white/30 hover:bg-white/10",children:"Back to Menu"})]})]})}):"playing"===i&&r&&h&&!(o>=eS.TUTORIAL_STEPS.length)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek.AnimatePresence,{children:!d&&(0,t.jsx)(ev.motion.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:50},className:"fixed top-20 right-4 z-40 max-w-xs pointer-events-auto",children:(0,t.jsxs)(ev.motion.div,{initial:{scale:.9},animate:{scale:1},exit:{scale:.9},className:"bg-gradient-to-br from-purple-600 via-purple-700 to-indigo-800 rounded-2xl border-2 border-white/30 p-4 shadow-2xl",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"text-xl",children:eS.TUTORIAL_COUNTRIES[u].emoji}),(0,t.jsxs)("div",{className:"text-xs font-bold text-white/70 bg-white/10 px-2 py-1 rounded-full",children:[u+1,"/3"]})]})}),(0,t.jsx)("p",{className:"text-white text-sm font-bold mb-3",children:h.explanation}),p&&(0,t.jsxs)("div",{className:"bg-gradient-to-r from-yellow-400/20 to-orange-400/20 border border-yellow-400/50 rounded-lg p-2 relative",children:[(0,t.jsx)("div",{className:"absolute -left-3 top-1/2 -translate-y-1/2 text-2xl",children:"👉"}),(0,t.jsxs)("div",{className:"text-lg font-black text-white flex items-center gap-2",children:[(0,t.jsx)("span",{children:p.icon}),(0,t.jsx)("span",{children:p.name})]})]})]})},`overlay-${o}`)}),(0,t.jsx)(ek.AnimatePresence,{children:d&&(0,t.jsx)(ev.motion.div,{initial:{opacity:0,scale:.8,x:100},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.8,x:100},className:"fixed top-20 right-4 z-40 pointer-events-none",children:(0,t.jsx)(ev.motion.div,{initial:{rotate:-5},animate:{rotate:0},transition:{type:"spring",bounce:.5},className:"bg-gradient-to-br from-green-500 via-emerald-500 to-teal-600 rounded-2xl border-2 border-yellow-300 shadow-2xl shadow-yellow-500/50 px-6 py-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-3xl",children:"✅"}),(0,t.jsxs)("div",{className:"text-white font-black text-lg",children:[n.length,"/",eS.TUTORIAL_STEPS.length," Complete"]})]})})},"celebration")})]}):null}function eE(){let e=(0,s.useGameStore)(e=>e.gameMode),a=(0,s.useGameStore)(e=>e.isTutorialMode);switch(e){case"menu":default:return(0,t.jsx)(ew,{});case"playing":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ej.GameScreen,{}),a&&(0,t.jsx)(eP,{onComplete:()=>window.location.href="/"})]});case"finished":if(a)return(0,t.jsx)(eP,{onComplete:()=>window.location.href="/"});return(0,t.jsx)(eN.FinalScore,{})}}e.s(["default",()=>eE],17661)}]);