1"use strict";(globalThis.webpackChunkfrontend||=[]).push([[1618],{32687(e,t,a){var s=a(36012),r=a(49198),n=a(94183),l=a(85582);const i="Rastyle Republik",o="https://www.rastyle.co.ke".replace(/\/+$/,""),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(!e)return t;try{return new URL(e,`${o}/`).toString()}catch{return t}};let d=null,m=!1;const x=e=>{let{title:t,description:a,image:o,url:x,canonicalPath:g,canonical:p,type:u="website",noindex:h=!1,jsonLd:b,event:f,creator:y,imageAlt:j,imageWidth:w=1200,imageHeight:v=630,locale:N}=e;const[k,_]=(0,r.useState)(d);(0,r.useEffect)(()=>{m||(async()=>{if(m)return d;try{const e=await n.A.get("https://rastyle.co.ke/api/og-meta/public");e.data&&e.data.og_title&&(d=e.data)}catch{}return m=!0,d})().then(e=>{e&&_(e)})},[]);const A=/Rastyle\s+Kenya/i.test((null===k||void 0===k?void 0:k.og_site_name)||"")?i:(null===k||void 0===k?void 0:k.og_site_name)||i,S=((e,t)=>{const a=String(e||"").trim().replace(/Rastyle\s+Kenya/gi,i);return a?a.toLowerCase().includes(t.toLowerCase())?a:`${a} | ${t}`:t})(t||(null===k||void 0===k?void 0:k.og_title),A),z=a||(null===k||void 0===k?void 0:k.og_description)||"The global reggae community. Music, events, culture. One love, one platform.",C=c(o||(null===k||void 0===k?void 0:k.og_cover)||(null===k||void 0===k?void 0:k.og_logo)||"/og-image.jpg"),R=c(p||g||x||"/"),$=j||(null===k||void 0===k?void 0:k.og_image_alt)||`${S} social preview`,T=N||(null===k||void 0===k?void 0:k.og_locale)||"en_KE",P=(null===k||void 0===k?void 0:k.twitter_card)||"summary_large_image";let E=b||null;var B,M,q,D,K;(!E&&f&&(E={"@context":"https://schema.org","@type":"MusicEvent",name:f.name,startDate:f.date,endDate:f.end_date,location:{"@type":"Place",name:f.venue,address:f.venue_address||f.city},description:f.description,image:f.image,offers:f.price?{"@type":"Offer",price:f.price,priceCurrency:f.currency||"KES",availability:"https://schema.org/InStock",url:R}:void 0,organizer:f.organizer?{"@type":"Organization",name:f.organizer}:void 0}),!E&&y)&&(E={"@context":"https://schema.org","@type":"MusicGroup",name:y.display_name,description:y.bio,image:y.profile_image,url:R,genre:"Reggae",sameAs:[(null===(B=y.socials)||void 0===B?void 0:B.instagram)&&`https://instagram.com/${y.socials.instagram}`,(null===(M=y.socials)||void 0===M?void 0:M.twitter)&&`https://twitter.com/${y.socials.twitter}`,null===(q=y.socials)||void 0===q?void 0:q.youtube_channel,(null===(D=y.socials)||void 0===D?void 0:D.spotify_artist_id)&&`https://open.spotify.com/artist/${y.socials.spotify_artist_id}`].filter(Boolean)});return K=E,(0,r.useEffect)(()=>{if(!K)return;const e="rastyle-jsonld";let t=document.getElementById(e);return t||(t=document.createElement("script"),t.id=e,t.type="application/ld+json",document.head.appendChild(t)),t.textContent=JSON.stringify(K),()=>{const t=document.getElementById(e);t&&t.remove()}},[K]),(e=>{let{description:t,image:a,imageAlt:s,imageHeight:n,imageWidth:l,locale:i,noindex:o,siteName:c,title:d,twitterCard:m,twitterSite:x,type:g,url:p}=e;(0,r.useEffect)(()=>{const e=[{tag:"link",selector:'link[rel="canonical"]',attributes:{rel:"canonical",href:p}},{tag:"meta",selector:'meta[name="description"]',attributes:{name:"description",content:t}},{tag:"meta",selector:'meta[property="og:type"]',attributes:{property:"og:type",content:g}},{tag:"meta",selector:'meta[property="og:title"]',attributes:{property:"og:title",content:d}},{tag:"meta",selector:'meta[property="og:description"]',attributes:{property:"og:description",content:t}},{tag:"meta",selector:'meta[property="og:image"]',attributes:{property:"og:image",content:a}},{tag:"meta",selector:'meta[property="og:image:alt"]',attributes:{property:"og:image:alt",content:s}},{tag:"meta",selector:'meta[property="og:image:width"]',attributes:{property:"og:image:width",content:String(l)}},{tag:"meta",selector:'meta[property="og:image:height"]',attributes:{property:"og:image:height",content:String(n)}},{tag:"meta",selector:'meta[property="og:locale"]',attributes:{property:"og:locale",content:i}},{tag:"meta",selector:'meta[property="og:url"]',attributes:{property:"og:url",content:p}},{tag:"meta",selector:'meta[property="og:site_name"]',attributes:{property:"og:site_name",content:c}},{tag:"meta",selector:'meta[name="twitter:card"]',attributes:{name:"twitter:card",content:m}},{tag:"meta",selector:'meta[name="twitter:title"]',attributes:{name:"twitter:title",content:d}},{tag:"meta",selector:'meta[name="twitter:description"]',attributes:{name:"twitter:description",content:t}},{tag:"meta",selector:'meta[name="twitter:image"]',attributes:{name:"twitter:image",content:a}},{tag:"meta",selector:'meta[name="twitter:image:alt"]',attributes:{name:"twitter:image:alt",content:s}},...x?[{tag:"meta",selector:'meta[name="twitter:site"]',attributes:{name:"twitter:site",content:x}}]:[],...o?[{tag:"meta",selector:'meta[name="robots"]',attributes:{name:"robots",content:"noindex,nofollow"}}]:[]].map(e=>{let{tag:t,selector:a,attributes:s}=e,r=document.head.querySelector(a);const n=!r;r||(r=document.createElement(t),document.head.appendChild(r));const l=Object.fromEntries(Object.keys(s).map(e=>[e,r.getAttribute(e)]));
1return Object.entries(s).forEach(e=>{let[t,a]=e;r.setAttribute(t,a)}),{attributes:s,created:n,element:r,previous:l}});return()=>{e.forEach(e=>{let{attributes:t,created:a,element:s,previous:r}=e;a?s.remove():Object.keys(t).forEach(e=>{const t=r[e];null===t?s.removeAttribute(e):s.setAttribute(e,t)})})}},[t,a,s,n,l,i,o,c,d,m,x,g,p])})({description:z,image:C,imageAlt:$,imageHeight:(null===k||void 0===k?void 0:k.og_image_height)||v,imageWidth:(null===k||void 0===k?void 0:k.og_image_width)||w,locale:T,noindex:h,siteName:A,title:S,twitterCard:P,twitterSite:null===k||void 0===k?void 0:k.twitter_site,type:u,url:R}),(0,l.jsx)(s.mg,{children:(0,l.jsx)("title",{children:S})})};a.d(t,["A",0,x])},51618(e,t,a){a.r(t),a.d(t,{GamingLeaderboard:()=>se,default:()=>ie});var s=a(49198),r=a(98379),n=a(58625),l=a(96531),i=a(94522),o=a(22647),c=a(77068),d=a(13751),m=a(19933),x=a(26661),g=a(26738),p=a(13728),u=a(49406),h=a(10218),b=a(54321),f=a(65048),y=a(76304),j=a(72456),w=a(17989),v=a(46266),N=a(19639),k=a(84866),_=a(64759),A=a(44900),S=a(94183),z=a(43535),C=a(99187),R=a(32687),$=a(49228),T=a.n($),P=a(66703),E=a(21447),B=a(85582);const M=e=>{let{open:t,onClose:a,userName:r="Selector",currentStreak:n=0,longestStreak:l=0,plays:i=0,badgeCount:o=0,totalBadges:c=9}=e;
1const d=(0,s.useRef)(null),[m,x]=(0,s.useState)(!1);if(!t)return null;const g=async()=>d.current?await T()(d.current,{backgroundColor:"#0a0a0a",scale:2,useCORS:!0,logging:!1}):null;return(0,B.jsx)("div",{className:"fixed inset-0 z-[200] bg-black/80 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto",onClick:a,"data-testid":"streak-share-modal",children:(0,B.jsxs)("div",{className:"bg-zinc-950 border border-white/10 rounded-2xl w-full max-w-md my-8",onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/10",children:[(0,B.jsxs)("h3",{className:"font-heading font-extrabold text-lg uppercase tracking-tight flex items-center gap-2",children:[(0,B.jsx)(_.A,{className:"w-5 h-5 text-rastyle-orange"})," Share Your Streak"]}),(0,B.jsx)("button",{onClick:a,className:"w-8 h-8 rounded-full bg-white/5 hover:bg-white/10 flex items-center justify-center","data-testid":"streak-share-close",children:(0,B.jsx)(P.A,{className:"w-4 h-4"})})]}),(0,B.jsxs)("div",{className:"p-5",children:[(0,B.jsxs)("div",{ref:d,className:"relative w-full aspect-square rounded-2xl overflow-hidden",style:{background:"radial-gradient(circle at top right, rgba(255,116,0,0.35), transparent 55%), radial-gradient(circle at bottom left, rgba(255,107,53,0.25), transparent 50%), #0a0a0a"},"data-testid":"streak-share-card",children:[(0,B.jsxs)("div",{className:"absolute top-0 inset-x-0 px-6 pt-6 flex items-center justify-between",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)("div",{className:"w-9 h-9 rounded-lg bg-gradient-to-br from-rastyle-orange to-red-600 flex items-center justify-center",children:(0,B.jsx)("span",{className:"font-heading font-black text-white text-sm leading-none",children:"RR"})}),(0,B.jsxs)("div",{className:"leading-tight",children:[(0,B.jsx)("p",{className:"font-heading font-extrabold text-white text-sm uppercase tracking-tight",children:"Rastyle Kenya"}),(0,B.jsx)("p",{className:"text-[10px] text-zinc-400 uppercase tracking-wider font-mono",children:"Gaming Room"})]})]}),(0,B.jsx)("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:"rastyle.co.ke"})]}),(0,B.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center px-6 text-center",children:[(0,B.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,B.jsx)(p.A,{className:"w-12 h-12 text-rastyle-orange drop-shadow-[0_0_20px_rgba(255,116,0,0.6)]"}),(0,B.jsxs)("div",{className:"text-left",children:[(0,B.jsx)("p",{className:"font-heading font-black text-7xl text-white leading-none",children:n}),(0,B.jsx)("p",{className:"font-mono text-xs uppercase tracking-widest text-rastyle-orange mt-1",children:"day streak"})]})]}),(0,B.jsx)("p",{className:"font-heading font-extrabold text-2xl text-white uppercase tracking-tight mt-4",children:r}),(0,B.jsx)("p",{className:"text-zinc-400 text-xs mt-1 max-w-[80%]",children:n>=7?"Proper selector status. Sound system tested. \ud83c\uddf0\ud83c\uddea":n>=3?"On fire \u2014 climbing the Nairobi leaderboard.":"Just getting started \u2014 selector in the making."})]}),(0,B.jsx)("div",{className:"absolute bottom-0 inset-x-0 px-6 pb-6",children:(0,B.jsxs)("div",{className:"grid grid-cols-3 gap-2 bg-black/50 backdrop-blur-sm rounded-xl border border-white/10 p-3",children:[(0,B.jsxs)("div",{className:"text-center border-r border-white/10",children:[(0,B.jsx)("p",{className:"font-mono font-extrabold text-white text-lg leading-none",children:l}),(0,B.jsx)("p",{className:"text-[9px] uppercase tracking-wider text-zinc-500 mt-0.5",children:"Best Streak"})]}),(0,B.jsxs)("div",{className:"text-center border-r border-white/10",children:[(0,B.jsx)("p",{className:"font-mono font-extrabold text-rastyle-orange text-lg leading-none",children:i}),(0,B.jsx)("p",{className:"text-[9px] uppercase tracking-wider text-zinc-500 mt-0.5",children:"Total Plays"})]}),(0,B.jsxs)("div",{className:"text-center",children:[(0,B.jsxs)("p",{className:"font-mono font-extrabold text-fomo-amber text-lg leading-none",children:[o,(0,B.jsxs)("span",{className:"text-zinc-600 text-sm",children:["/",c]})]}),(0,B.jsx)("p",{className:"text-[9px] uppercase tracking-wider text-zinc-500 mt-0.5",children:"Badges"})]})]})})]}),(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-5",children:[(0,B.jsxs)("button",{onClick:async()=>{x(!0);try{const e=await g();if(!e)return;const t=document.createElement("a");t.download=`rastyle-streak-${n}
1days.png`,t.href=e.toDataURL("image/png"),t.click(),z.oR.success("Streak card downloaded!")}catch(e){z.oR.error("Could not generate card. Try again.")}finally{x(!1)}},disabled:m,className:"h-12 bg-white/5 border border-white/10 hover:border-rastyle-orange/50 hover:bg-white/10 rounded-full text-sm font-bold uppercase tracking-wide flex items-center justify-center gap-2 transition-all disabled:opacity-50","data-testid":"streak-share-download-btn",children:[(0,B.jsx)(E.A,{className:"w-4 h-4"})," Download"]}),(0,B.jsxs)("button",{onClick:async()=>{x(!0);try{const e=await g();if(!e)return;const t=await new Promise(t=>e.toBlob(t,"image/png"));if(!t)throw new Error("Blob failed");const a=new File([t],`rastyle-streak-${n}days.png`,{type:"image/png"}),s={title:`${n}-day streak on Rastyle Kenya`,text:`\ud83d\udd25 ${n}-day Gaming Room streak on Rastyle Kenya. Catch me in the leaderboard. rastyle.co.ke`,files:[a]};if(navigator.canShare&&navigator.canShare(s))await navigator.share(s);else{const t=document.createElement("a");t.download=`rastyle-streak-${n}days.png`,t.href=e.toDataURL("image/png"),t.click(),z.oR.info("Share not supported \u2014 saved to downloads instead.")}}catch(e){"AbortError"!==(null===e||void 0===e?void 0:e.name)&&z.oR.error("Could not share. Try Download instead.")}finally{x(!1)}},disabled:m,className:"h-12 bg-rastyle-orange text-black font-bold uppercase tracking-wide rounded-full flex items-center justify-center gap-2 hover:bg-orange-400 transition-colors disabled:opacity-50","data-testid":"streak-share-share-btn",children:[(0,B.jsx)(_.A,{className:"w-4 h-4"})," Share"]})]}),(0,B.jsxs)("p",{className:"text-center text-[11px] text-zinc-500 mt-3",children:[(0,B.jsx)(f.A,{className:"w-3 h-3 inline mr-1 text-rastyle-orange"}),"Card includes Rastyle branding so friends can find the Gaming Room."]})]})]})})};var q=a(81232),D=a(99245),K=a(57140),I=a(16502),O=a(99520);const G=60/110,V=60,F=1800,L=["D","F","J","K"],W=["from-rastyle-orange to-red-600","from-fomo-amber to-rastyle-orange","from-euphoria-pink to-rastyle-orange","from-fomo-amber to-euphoria-pink"];class H{constructor(){this.ctx=null,this.muted=!1}ensure(){if(!this.ctx)try{this.ctx=new(window.AudioContext||window.webkitAudioContext)}catch{}return this.ctx}kick(e){const t=this.ensure();if(!t||this.muted)return;const a=t.createOscillator(),s=t.createGain();a.frequency.setValueAtTime(120,e),a.frequency.exponentialRampToValueAtTime(40,e+.18),s.gain.setValueAtTime(.6,e),s.gain.exponentialRampToValueAtTime(.01,e+.25),a.connect(s).connect(t.destination),a.start(e),a.stop(e+.28)}snare(e){const t=this.ensure();if(!t||this.muted)return;const a=t.createBuffer(1,.18*t.sampleRate,t.sampleRate),s=a.getChannelData(0);for(let l=0;l<s.length;l++)s[l]=(2*Math.random()-1)*(1-l/s.length);const r=t.createBufferSource(),n=t.createGain();n.gain.setValueAtTime(.35,e),n.gain.exponentialRampToValueAtTime(.01,e+.18),r.buffer=a,r.connect(n).connect(t.destination),r.start(e),r.stop(e+.18)}hat(e){const t=this.ensure();if(!t||this.muted)return;const a=t.createBuffer(1,.05*t.sampleRate,t.sampleRate),s=a.getChannelData(0);for(let i=0;i<s.length;i++)s[i]=.6*(2*Math.random()-1);const r=t.createBufferSource(),n=t.createBiquadFilter();n.type="highpass",n.frequency.value=7e3;const l=t.createGain();l.gain.setValueAtTime(.18,e),l.gain.exponentialRampToValueAtTime(.001,e+.05),r.buffer=a,r.connect(n).connect(l).connect(t.destination),r.start(e),r.stop(e+.05)}click(e){const t=this.ensure();if(!t||this.muted)return;const a=t.createOscillator(),s=t.createGain();a.frequency.setValueAtTime(1200,e),s.gain.setValueAtTime(.18,e),s.gain.exponentialRampToValueAtTime(.001,e+.05),a.connect(s).connect(t.destination),a.start(e),a.stop(e+.06)}hit(e){const t=this.ensure();if(!t)return;const a=t.currentTime;0===e?this.kick(a):2===e?this.snare(a):this.hat(a)}}const J=e=>`rastyle_reflex_ghost_${e||"anon"}`,U=e=>{try{const t=localStorage.getItem(J(e));if(!t)return null;const a=JSON.parse(t);return a&&Array.isArray(a.hits)?a:null}catch{return null}},Y=e=>{let{onClose:t,userId:a}=e;
1const[r,l]=(0,s.useState)("intro"),[i,o]=(0,s.useState)(V),[d,u]=(0,s.useState)(0),[h,b]=(0,s.useState)(0),[f,y]=(0,s.useState)(0),[j,w]=(0,s.useState)({perfect:0,good:0,miss:0}),[v,N]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),[A,C]=(0,s.useState)(!1),[R,$]=(0,s.useState)(null),[T,P]=(0,s.useState)(()=>U(a)),E=(0,s.useRef)([]),[,M]=(0,s.useState)(0),Y=(0,s.useRef)(null),Q=(0,s.useRef)([]),Z=(0,s.useRef)(0),X=(0,s.useRef)(new H),ee=(0,s.useRef)(null),te=(0,s.useRef)([]),ae=()=>{l("intro"),o(V),u(0),b(0),y(0),w({perfect:0,good:0,miss:0}),$(null),E.current=[],Z.current=0,te.current=[],X.current.muted=v,X.current.ensure(),Q.current=(e=>{const t=[],a=Math.floor(e/(G/2));for(let s=4;s<a;s++){const e=s*(G/2)*1e3;s%2===0?t.push({t:e,lane:0}):s%4===1&&t.push({t:e,lane:2}),s%3===0&&t.push({t:e,lane:1+s%2*2})}return t})(V),Y.current=performance.now(),l("playing")},se=(0,s.useCallback)(async(e,t,s)=>{C(!0);try{const e=U(a);if(!e||t>(e.score||0)){const e={score:t,hits:te.current.slice(),saved_at:(new Date).toISOString()};((e,t)=>{try{localStorage.setItem(J(e),JSON.stringify(t))}catch{}})(a,e),P(e)}}catch{}try{const a=await S.A.post("https://rastyle.co.ke/api/games/reflex/submit",{score:t,perfect_count:e.perfect,good_count:e.good,miss_count:e.miss,max_combo:s,duration_ms:6e4},{withCredentials:!0});$(a.data),a.data.is_personal_best&&z.oR.success(`\ud83d\udd25 New personal best \u2014 ${t} pts`)}catch(r){$({score:t,perfect_count:e.perfect,good_count:e.good,miss_count:e.miss,max_combo:s,is_personal_best:!1,saved:!1})}finally{C(!1),l("gameover")}},[a]);(0,s.useEffect)(()=>{if("playing"!==r)return;let e;const t=()=>{const a=performance.now()-Y.current;for(;Z.current<Q.current.length;){const e=Q.current[Z.current];if(!(e.t-F<=a))break;E.current.push({id:`${Z.current}-${e.lane}`,lane:e.lane,t:e.t}),Z.current+=1}const s=[];let r=0;for(const e of E.current)e.t<a-180?r+=1:s.push(e);E.current=s,r&&(w(e=>({...e,miss:e.miss+r})),b(0),_("miss"));const n=Math.max(0,Math.ceil(V-a/1e3));o(e=>e===n?e:n),M(e=>e+1),a>=6e4?w(e=>(y(t=>(u(a=>(se(e,a,t),a)),t)),e)):(e=requestAnimationFrame(t),ee.current=e)};return e=requestAnimationFrame(t),ee.current=e,()=>cancelAnimationFrame(e)},[r,se]),(0,s.useEffect)(()=>{if(!k)return;const e=setTimeout(()=>_(null),380);return()=>clearTimeout(e)},[k]);const re=(0,s.useCallback)(e=>{if("playing"!==r)return;const t=performance.now()-Y.current;let a=-1,s=1/0;if(E.current.forEach((r,n)=>{if(r.lane!==e)return;const l=Math.abs(r.t-t);l<s&&l<=180&&(s=l,a=n)}),a<0)return b(0),void _("miss");const n=E.current[a],l=(e=>{const t=Math.abs(e);return t<=90?"perfect":t<=180?"good":"miss"})(n.t-t);E.current.splice(a,1),X.current.hit(e),"perfect"!==l&&"good"!==l||te.current.push({t:n.t,lane:e,verdict:l}),"perfect"===l?(u(e=>e+30),w(e=>({...e,perfect:e.perfect+1})),b(e=>{const t=e+1;return y(e=>t>e?t:e),t}),_("perfect")):"good"===l?(u(e=>e+15),w(e=>({...e,good:e.good+1})),b(e=>{const t=e+1;return y(e=>t>e?t:e),t}),_("good")):(w(e=>({...e,miss:e.miss+1})),b(0),_("miss"))},[r]);return(0,s.useEffect)(()=>{if("playing"!==r)return;const e=e=>{if(e.repeat)return;const t=e.key.toUpperCase(),a=L.indexOf(t);a>=0&&(e.preventDefault(),re(a))," "===t&&(e.preventDefault(),re(0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,re]),(0,s.useEffect)(()=>()=>{ee.current&&cancelAnimationFrame(ee.current),X.current.ctx&&X.current.ctx.close().catch(()=>{})},[]),"intro"===r?(0,B.jsxs)("div",{className:"bg-zinc-900 border border-white/10 rounded-2xl p-6 sm:p-8 text-center","data-testid":"reflex-intro",children:[(0,B.jsx)("div",{className:"mx-auto w-16 h-16 rounded-2xl bg-gradient-to-br from-red-500 to-pink-600 flex items-center justify-center mb-4",children:(0,B.jsx)(c.A,{className:"w-8 h-8 text-white"})}),(0,B.jsx)("h2",{className:"font-heading font-extrabold text-3xl uppercase tracking-tight mb-1",children:"Bashment Reflex"}),(0,B.jsx)("p",{className:"text-zinc-400 text-sm sm:text-base mb-6 max-w-md mx-auto",children:"Tap each note as it hits the line. Perfect timing scores big. 60 seconds to shell di place."}),(0,B.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3 max-w-md mx-auto mb-6 text-left text-xs",children:[(0,B.jsxs)("div",{className:"bg-white/5 border border-rastyle-orange/30 rounded-xl p-3",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-rastyle-orange text-lg",children:"+30"}),(0,B.jsx)("p",{className:"text-zinc-400",children:"Perfect (\xb190ms)"})]}),(0,B.jsxs)("div",{className:"bg-white/5 border border-fomo-amber/30 rounded-xl p-3",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-fomo-amber text-lg",children:"+15"}),(0,B.jsx)("p",{className:"text-zinc-400",children:"Good (\xb1180ms)"})]}),(0,B.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-xl p-3",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-zinc-500 text-lg",children:"0"}),(0,B.jsx)("p",{className:"text-zinc-400",children:"Miss \xb7 combo reset"})]})]}),(0,B.jsxs)("div",{className:"text-xs text-zinc-500 mb-6",children:["Keyboard: ",(0,B.jsx)("span",{className:"font-mono text-rastyle-orange",children:"D F J K"})," \xb7 or just tap the lanes on mobile"]}),T&&(0,B.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 mb-4 bg-fomo-amber/15 border border-fomo-amber/40 text-fomo-amber font-mono text-[11px] uppercase tracking-wider rounded-full","data-testid":"reflex-ghost-indicator",children:[(0,B.jsx)(p.A,{className:"w-3.5 h-3.5"})," Personal Best \xb7 ",T.score," pts \u2014 beat your ghost"]}),(0,B.jsx)("div",{children:(0,B.jsxs)("button",{onClick:ae,className:"px-6 py-3 bg-rastyle-orange text-black font-bold uppercase tracking-wide rounded-full inline-flex items-center gap-2 hover:bg-orange-400 transition-colors","data-testid":"reflex-start-btn",children:[(0,B.jsx)(D.A,{className:"w-4 h-4"})," Start Round"]})})]}):"gameover"===r&&R?(0,B.jsx)("div",{className:"bg-gradient-to-br from-red-500 via-rastyle-orange to-fomo-amber p-1 rounded-2xl","data-testid":"reflex-gameover",children:(0,B.jsxs)("div",{className:"bg-black rounded-2xl p-8 text-center",children:[(0,B.jsx)(x.A,{className:"w-16 h-16 mx-auto mb-3 "+(R.is_personal_best?"text-fomo-amber":"text-rastyle-orange")}),(0,B.jsx)("h2",{className:"font-heading font-extrabold text-3xl uppercase tracking-tight mb-1",children:R.is_personal_best?"Personal Best!":"Round Complete"}),(0,B.jsx)("p",{className:"text-zinc-400 text-sm mb-6",children:R.saved?"Score saved to leaderboard.":"Sign in to save your scores to the leaderboard."}),(0,B.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 max-w-md mx-auto mb-6",children:[(0,B.jsxs)("div",{className:"p-3 bg-white/5 border border-white/10 rounded-xl",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-rastyle-orange text-2xl",children:R.score}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Score"})]}),(0,B.jsxs)("div",{className:"p-3 bg-white/5 border border-rastyle-orange/20 rounded-xl",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-rastyle-orange text-2xl",children:R.perfect_count}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Perfect"})]}),(0,B.jsxs)("div",{className:"p-3 bg-white/5 border border-fomo-amber/20 rounded-xl",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-fomo-amber text-2xl",children:R.good_count}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Good"})]}),(0,B.jsxs)("div",{className:"p-3 bg-white/5 border border-white/10 rounded-xl",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-euphoria-pink text-2xl",children:R.max_combo}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Max Combo"})]})]}),(0,B.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,B.jsxs)("button",{onClick:ae,className:"px-6 py-3 bg-rastyle-orange text-black font-bold uppercase tracking-wide rounded-full inline-flex items-center justify-center gap-2 hover:bg-orange-400 transition-colors","data-testid":"reflex-play-again",children:[(0,B.jsx)(g.A,{className:"w-4 h-4"})," Play Again"]}),(0,B.jsx)("button",{onClick:t,className:"px-6 py-3 border border-white/20 text-white font-medium rounded-full hover:border-rastyle-orange transition-colors",children:"Back to Room"})]})]})}):(0,B.jsxs)("div",{className:"bg-zinc-950 border border-white/10 rounded-2xl overflow-hidden","data-testid":"reflex-playing",children:[(0,B.jsxs)("div",{className:"px-4 py-3 bg-black border-b border-white/10 flex items-center justify-between gap-3 flex-wrap",children:[(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)("span",{className:"text-[11px] font-mono uppercase tracking-wider text-zinc-500",children:"Time"}),(0,B.jsxs)("span",{className:"font-mono font-bold text-2xl text-rastyle-orange",children:[i,"s"]})]}),(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)("span",{className:"text-[11px] font-mono uppercase tracking-wider text-zinc-500",children:"Score"}),(0,B.jsx)("span",{className:"font-mono font-bold text-2xl",children:d}),h>=5&&(0,B.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono uppercase tracking-wider text-fomo-amber px-2 py-0.5 bg-fomo-amber/15 border border-fomo-amber/40 rounded-full",children:[(0,B.jsx)(p.A,{className:"w-3.5 h-3.5"})," \xd7",h]}),T&&(0,B.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono uppercase tracking-wider px-2 py-0.5 rounded-full "+(d>=T.score?"bg-mpesa-green/15 border border-mpesa-green/40 text-mpesa-green":"bg-white/5 border border-white/10 text-zinc-400"),"data-testid":"reflex-pb-indicator",children:["PB ",T.score," \xb7 ",d>=T.score?"AHEAD":"\u2212"+(T.score-d)]})]}),(0,B.jsx)("button",{onClick:()=>{N(e=>(X.current.muted=!e,!e))},className:"w-9 h-9 rounded-full bg-white/5 hover:bg-white/10 flex items-center justify-center","aria-label":"Toggle sound","data-testid":"reflex-mute-toggle",children:v?(0,B.jsx)(K.A,{className:"w-4 h-4"}):(0,B.jsx)(I.A,{className:"w-4 h-4"})})]}),(0,B.jsxs)("div",{className:"relative w-full h-[420px] sm:h-[480px] bg-gradient-to-b from-zinc-950 via-zinc-900 to-black overflow-hidden select-none",children:[(0,B.jsx)("div",{className:"absolute inset-0 grid grid-cols-4",children:L.map((e,t)=>(0,B.jsxs)("button",{type:"button",onPointerDown:e=>{e.preventDefault(),re(t)},className:"relative border-r border-white/5 last:border-r-0 active:bg-white/[0.04]","data-testid":`reflex-lane-${t}`,"aria-label":`Lane ${e}`,children:[(0,B.jsx)(q.N,{children:E.current.filter(e=>e.lane===t).map(e=>{const a=performance.now()-Y.current,s=1-(e.t-a)/F,r=Math.max(0,Math.min(100,100*s));return(0,B.jsx)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:`absolute left-1/2 -translate-x-1/2 w-[70%] h-12 rounded-xl bg-gradient-to-br ${W[t]} shadow-[0_0_15px_rgba(255,116,0,0.4)]`,style:{top:`${r}%`,transition:"top 16ms linear"}},e.id)})}),(null===T||void 0===T?void 0:T.hits)&&T.hits.filter(e=>e.lane===t).map((e,a)=>{const s=performance.now()-Y.current;if(Math.abs(e.t-s)>F)return null;const r=1-(e.t-s)/F,n=Math.max(0,Math.min(100,100*r));return(0,B.jsx)("div",{"aria-hidden":"true",className:"absolute left-1/2 -translate-x-1/2 w-[55%] h-10 rounded-xl border-2 border-dashed border-white/15",style:{top:`${n}%`,transition:"top 16ms linear"},"data-testid":`reflex-ghost-${t}-${a}`},`ghost-${t}-${a}`)}),(0,B.jsx)("div",{className:"absolute bottom-2 inset-x-0 text-center font-mono font-bold text-xs text-zinc-500",children:e})]},e))}),(0,B.jsx)("div",{className:"absolute left-0 right-0 h-[3px] bg-gradient-to-r from-transparent via-rastyle-orange to-transparent shadow-[0_0_15px_rgba(255,116,0,0.6)]",style:{top:"85%"}}),(0,B.jsx)(q.N,{children:k&&(0,B.jsx)(n.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0},className:"absolute inset-x-0 top-[55%] -translate-y-1/2 text-center pointer-events-none",children:(0,B.jsx)("span",{className:"font-heading font-black text-5xl uppercase tracking-tighter drop-shadow "+("perfect"===k?"text-rastyle-orange":"good"===k?"text-fomo-amber":"text-zinc-500"),children:k})},k+Math.random())})]}),(0,B.jsxs)("div",{className:"px-4 py-2 bg-black border-t border-white/10 flex items-center justify-between text-xs text-zinc-500",children:[(0,B.jsx)("span",{className:"font-mono",children:"D \xb7 F \xb7 J \xb7 K"}),(0,B.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,B.jsx)(O.A,{className:"w-3.5 h-3.5"})," ",110," BPM \xb7 Perfect \xb1",90,"ms"]})]}),A&&(0,B.jsxs)("div",{className:"px-4 py-2 bg-rastyle-orange/10 border-t border-rastyle-orange/30 text-xs text-rastyle-orange flex items-center gap-2 justify-center",children:[(0,B.jsx)(m.A,{className:"w-3.5 h-3.5 animate-spin"})," Saving score..."]})]})},Q="https://rastyle.co.ke",Z={Brain:l.A,Disc3:i.A,Type:o.A,Zap:c.A,Gamepad2:d.A},X=[{id:"all",label:"All Games"},{id:"reggae_trivia",label:"Trivia"},{id:"slang_puzzle",label:"Slang"},{id:"bashment_reflex",label:"Reflex"}],ee=e=>{let{onClose:t,userId:a}=e;const[r,i]=(0,s.useState)("intro"),[o,d]=(0,s.useState)(!1),[f,y]=(0,s.useState)(null),[j,w]=(0,s.useState)(null),[v,N]=(0,s.useState)(0),[k,_]=(0,s.useState)(10),[A,C]=(0,s.useState)(0),[R,$]=(0,s.useState)(null),[T,P]=(0,s.useState)(null),[E,M]=(0,s.useState)(null),[q,D]=(0,s.use
1State)(null),[K,I]=(0,s.useState)(null),O=async()=>{d(!0),I(null);try{const e=await S.A.post(`${Q}/api/games/trivia/start`,{num_questions:10,difficulty:q},{withCredentials:!0});y({id:e.data.session_id}),w(e.data.question),_(e.data.total_questions),N(0),C(0),i("playing"),$(null),P(null)}catch(s){var e,t,a;const r=429===(null===(e=s.response)||void 0===e?void 0:e.status)?"Whoa selector \u2014 too many requests. Take a breath and try again in a few seconds.":(null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Failed to start game. Please try again.";I(r),z.oR.error(r)}finally{d(!1)}},G=()=>{i("intro"),y(null),w(null),P(null),$(null),M(null),C(0)};if("intro"===r)return(0,B.jsx)("div",{className:"bg-gradient-to-br from-rastyle-orange to-red-600 p-1 rounded-lg","data-testid":"trivia-intro",children:(0,B.jsxs)("div",{className:"bg-black rounded-lg p-8 sm:p-12 text-center",children:[(0,B.jsx)(l.A,{className:"w-16 h-16 text-rastyle-orange mx-auto mb-4"}),(0,B.jsx)("h2",{className:"font-heading font-extrabold text-3xl sm:text-4xl uppercase tracking-tight mb-3",children:"Reggae Trivia"}),(0,B.jsx)("p",{className:"text-zinc-400 mb-6 max-w-md mx-auto",children:"10 questions on reggae legends, dancehall culture, Kenya's scene, and sound system history. Test your knowledge \u2014 climb the leaderboard."}),(0,B.jsxs)("div",{className:"mb-6",children:[(0,B.jsx)("p",{className:"text-xs uppercase tracking-wider text-zinc-500 mb-3",children:"Choose Difficulty"}),(0,B.jsx)("div",{className:"flex flex-wrap justify-center gap-2",children:[{id:null,label:"Mixed",emoji:"\ud83c\udfaf"},{id:"easy",label:"Easy",emoji:"\ud83d\udfe2"},{id:"medium",label:"Medium",emoji:"\ud83d\udfe1"},{id:"hard",label:"Hard",emoji:"\ud83d\udd34"}].map(e=>(0,B.jsxs)("button",{onClick:()=>D(e.id),className:"px-4 py-2 text-sm font-medium border transition-all "+(q===e.id?"bg-rastyle-orange text-black border-rastyle-orange":"border-white/20 text-white hover:border-rastyle-orange/60"),children:[e.emoji," ",e.label]},String(e.id)))})]}),(0,B.jsxs)("button",{onClick:O,disabled:o,className:"px-8 py-3.5 bg-rastyle-orange text-black font-heading font-bold uppercase tracking-wide hover:bg-orange-400 transition-all flex items-center justify-center gap-2 mx-auto disabled:opacity-50","data-testid":"start-trivia-btn",children:[o?(0,B.jsx)(m.A,{className:"w-5 h-5 animate-spin"}):(0,B.jsx)(c.A,{className:"w-5 h-5"}),K?"Try Again":"Start Game"]}),K&&(0,B.jsx)("div",{className:"mt-5 mx-auto max-w-md text-sm text-red-300 bg-red-500/10 border border-red-500/30 px-4 py-3 rounded","data-testid":"trivia-start-error",children:K})]})});if("gameover"===r&&E){const e=E.correct===E.total,s=E.percent>=70;return(0,B.jsx)("div",{className:"bg-gradient-to-br from-yellow-500 via-rastyle-orange to-red-600 p-1 rounded-lg","data-testid":"trivia-gameover",children:(0,B.jsxs)("div",{className:"bg-black rounded-lg p-8 sm:p-12 text-center",children:[(0,B.jsx)(x.A,{className:"w-20 h-20 mx-auto mb-4 "+(e?"text-yellow-400":s?"text-rastyle-orange":"text-zinc-400")}),(0,B.jsx)("h2",{className:"font-heading font-extrabold text-4xl uppercase tracking-tight mb-2",children:e?"Legend!":s?"Strong Vibes!":"Keep Practicing"}),(0,B.jsx)("p",{className:"text-zinc-400 mb-6",children:e?"A perfect score \u2014 true selector knowledge.":s?"Solid reggae IQ \u2014 close to perfect.":"Try again to level up."}),(0,B.jsx)(le,{userId:a}),(0,B.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-6 max-w-md mx-auto",children:[(0,B.jsxs)("div",{className:"p-4 bg-white/5 border border-white/10",children:[(0,B.jsx)("p",{className:"text-3xl font-bold text-rastyle-orange",children:E.final_score}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Score"})]}),(0,B.jsxs)("div",{className:"p-4 bg-white/5 border border-white/10",children:[(0,B.jsxs)("p",{className:"text-3xl font-bold text-green-400",children:[E.correct,"/",E.total]}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Correct"})]}),(0,B.jsxs)("div",{className:"p-4 bg-white/5 border border-white/10",children:[(0,B.jsxs)("p",{className:"text-3xl font-bold text-yellow-400",children:[E.percent,"%"]}),(0,B.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-zinc-500 mt-1",children:"Accuracy"})]})]}),(0,B.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,B.jsxs)("button",{onClick:G,className:"px-6 py-3 bg-rastyle-orange text-black font-bold uppercase tracking-wide hover:bg-orange-400 transition-all flex items-center justify-center gap-2","data-testid":"play-again-btn",children:[(0,B.jsx)(g.A,{className:"w-4 h-4"})," Play Again"]}),(0,B.jsxs)("button",{onClick:t,className:"px-6 py-3 border border-white/20 text-white font-medium hover:border-rastyle-orange transition-all flex items-center justify-center gap-2",children:[(0,B.jsx)(x.A,{className:"w-4 h-4"})," View Leaderboard"]})]})]})})}if(!j)return null;const V="result"===r&&T;return(0,B.jsxs)("div",{className:"bg-zinc-900 border border-white/10 rounded-lg overflow-hidden","data-testid":"trivia-playing",children:[(0,B.jsxs)("div",{className:"px-5 py-4 bg-black border-b border-white/10 flex items-center justify-between",children:[(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)(l.A,{className:"w-5 h-5 text-rastyle-orange"}),(0,B.jsxs)("span",{className:"font-mono text-xs uppercase tracking-wider text-zinc-400",children:["Question ",v+1," / ",k]})]}),(0,B.jsxs)("div",{className:"flex items-center gap-2 text-rastyle-orange font-bold",children:[(0,B.jsx)(p.A,{className:"w-4 h-4"}),(0,B.jsxs)("span",{"data-testid":"score-display",children:[A," pts"]})]})]}),(0,B.jsx)("div",{className:"h-1 bg-zinc-800",children:(0,B.jsx)("div",{className:"h-full bg-gradient-to-r from-rastyle-orange to-yellow-400 transition-all duration-500",style:{width:(v+(V?1:0))/k*100+"%"}})}),(0,B.jsxs)("div",{className:"p-6 sm:p-8",children:[(0,B.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,B.jsx)("span",{className:"text-[10px] px-2 py-0.5 uppercase tracking-wider font-mono "+("easy"===j.difficulty?"bg-green-500/15 text-green-400":"medium"===j.difficulty?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400"),children:j.difficulty}),(0,B.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:j.category})]}),(0,B.jsx)("h3",{className:"font-heading text-xl sm:text-2xl font-bold mb-6 leading-snug","data-testid":"trivia-question",children:j.question}),(0,B.jsx)("div",{className:"space-y-3",children:j.options.map((e,t)=>{let a="bg-white/5 border-white/10 hover:border-rastyle-orange/50 hover:bg-white/10",s=null;return V?t===T.correct_answer_index?(a="bg-green-500/15 border-green-500 text-green-300",s=(0,B.jsx)(u.A,{className:"w-5 h-5 text-green-400"})):t!==R||T.correct?a="bg-white/5 border-white/10 opacity-50":(a="bg-red-500/15 border-red-500 text-red-300",s=(0,B.jsx)(h.A,{className:"w-5 h-5 text-red-400"})):R===t&&(a="bg-rastyle-orange/20 border-rastyle-orange"),(0,B.jsxs)("button",{onClick:()=>(async e=>{if(null===R){$(e),d(!0);try{const t=await S.A.post(`${Q}/api/games/trivia/answer`,{session_id:f.id,question_id:j.id,answer_index:e},{withCredentials:!0});P(t.data),C(t.data.score),i("result"),t.data.is_final&&M({correct:t.data.correct_count,total:t.data.total_questions,percent:t.data.percent,final_score:t.data.final_score})}catch(s){var t,a;z.oR.error((null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Failed to submit answer"),$(null)}finally{d(!1)}}})(t),disabled:null!==R,className:`w-full text-left p-4 border-2 transition-all flex items-center gap-3 font-medium ${a} disabled:cursor-default`,"data-testid":`trivia-option-${t}`,children:[(0,B.jsx)("span",{className:"w-7 h-7 flex items-center justify-center font-mono text-sm border "+(V&&t===T.correct_answer_index?"border-green-500 text-green-400":V&&t===R?"border-red-500 text-red-400":"border-white/20 text-zinc-400"),children:["A","B","C","D"][t]}),(0,B.jsx)("span",{className:"flex-1",children:e}),s]},t)})}),V&&(0,B.jsxs)(n.P.div,{initial:{opacity:0,y:12}
1,animate:{opacity:1,y:0},className:"mt-6 p-4 rounded-md "+(T.correct?"bg-green-500/10 border border-green-500/30":"bg-red-500/10 border border-red-500/30"),children:[(0,B.jsxs)("div",{className:"flex items-start gap-3",children:[T.correct?(0,B.jsx)(u.A,{className:"w-6 h-6 text-green-400 flex-shrink-0 mt-0.5"}):(0,B.jsx)(h.A,{className:"w-6 h-6 text-red-400 flex-shrink-0 mt-0.5"}),(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("p",{className:"font-bold text-lg",children:T.correct?`Correct! +${T.points_earned} pts`:"Wrong!"}),T.fact&&(0,B.jsxs)("p",{className:"text-sm text-zinc-300 mt-1",children:["\ud83d\udca1 ",T.fact]})]})]}),(0,B.jsxs)("button",{onClick:()=>{null!==T&&void 0!==T&&T.is_final?i("gameover"):(w(T.next_question),N(T.current_index),$(null),P(null),i("playing"))},className:"mt-4 w-full sm:w-auto px-6 py-2.5 bg-rastyle-orange text-black font-bold uppercase tracking-wide text-sm hover:bg-orange-400 transition-all flex items-center justify-center gap-2 ml-auto","data-testid":"next-question-btn",children:[T.is_final?"See Results":"Next Question",(0,B.jsx)(b.A,{className:"w-4 h-4"})]})]})]})]})},te={patwa:{label:"Patwa \ud83c\uddef\ud83c\uddf2",color:"text-fomo-amber"},sheng:{label:"Sheng \ud83c\uddf0\ud83c\uddea",color:"text-rastyle-orange"},dancehall:{label:"Dancehall",color:"text-euphoria-pink"},reggae_ke:{label:"Reggae KE \ud83c\uddf0\ud83c\uddea",color:"text-mpesa-green"}},ae=e=>{let{onClose:t,userId:a}=e;const[r,l]=(0,s.useState)("intro"),[i,c]=(0,s.useState)(null),[d,p]=(0,s.use
1State)(null),[b,y]=(0,s.useState)(10),[j,w]=(0,s.useState)(0),[v,N]=(0,s.useState)(0),[k,_]=(0,s.useState)(0),[A,C]=(0,s.useState)(null),[R,$]=(0,s.useState)(null),[T,P]=(0,s.useState)(!1),[E,M]=(0,s.useState)(null),q=async()=>{P(!0),M(null);try{const e=await S.A.post(`${Q}/api/games/slang/start`,{num_puzzles:10},{withCredentials:!0});c({id:e.data.session_id}),p(e.data.puzzle),y(e.data.total_puzzles),w(0),N(0),_(0),l("playing"),C(null),$(null)}catch(s){var e,t,a;const r=429===(null===(e=s.response)||void 0===e?void 0:e.status)?"Whoa selector \u2014 too many requests. Take a breath and try again.":(null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Failed to start puzzle.";M(r),z.oR.error(r)}finally{P(!1)}};if("intro"===r)return(0,B.jsxs)("div",{className:"bg-surface border border-white/5 rounded-2xl p-8 text-center","data-testid":"slang-intro",children:[(0,B.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-fomo-amber/15 border border-fomo-amber/30 rounded-2xl mb-4",children:(0,B.jsx)(o.A,{className:"w-7 h-7 text-fomo-amber"})}),(0,B.jsx)("h2",{className:"font-heading font-black text-3xl uppercase tracking-tighter leading-none mb-2",children:"Slang Puzzle"}),(0,B.jsx)("p",{className:"text-zinc-400 text-sm mb-2 max-w-md mx-auto",children:"25 fill-in-the-blank puzzles. Patwa, Sheng, Dancehall slang, Kenya reggae heritage."}),(0,B.jsx)("p",{className:"text-zinc-500 text-xs mb-6",children:"10 random puzzles \xb7 12 points per correct"}),(0,B.jsxs)("button",{onClick:q,disabled:T,className:"px-8 h-12 bg-fomo-amber text-black font-heading font-bold uppercase tracking-wide rounded-full hover:brightness-110 active:scale-[0.98] transition-all flex items-center justify-center gap-2 mx-auto disabled:opacity-50","data-testid":"start-slang-btn",children:[T?(0,B.jsx)(m.A,{className:"w-5 h-5 animate-spin"}):(0,B.jsx)(f.A,{className:"w-5 h-5"}),E?"Try Again":"Start Puzzle"]}),E&&(0,B.jsx)("div",{className:"mt-5 mx-auto max-w-md text-sm text-red-300 bg-red-500/10 border border-red-500/30 px-4 py-3 rounded-xl","data-testid":"slang-start-error",children:E})]});if(("playing"===r||"feedback"===r)&&d){const e=te[d.lang]||{label:d.lang,color:"text-zinc-400"},t=j/b*100;return(0,B.jsxs)("div",{className:"bg-surface border border-white/5 rounded-2xl p-6 sm:p-8","data-testid":"slang-game",children:[(0,B.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,B.jsxs)("span",{className:"overline",children:["Puzzle ",j+1,"/",b]}),(0,B.jsxs)("span",{className:"font-mono font-bold text-fomo-amber",children:[v," pts"]})]}),(0,B.jsx)("div",{className:"h-1.5 bg-white/5 rounded-full mb-6 overflow-hidden",children:(0,B.jsx)(n.P.div,{className:"h-full bg-gradient-to-r from-fomo-amber to-rastyle-orange",initial:{width:0},animate:{width:`${t+("feedback"===r?100/b:0)}%`},transition:{duration:.4}})}),(0,B.jsx)("span",{className:`overline ${e.color} mb-2 block`,children:e.label}),(0,B.jsx)("h3",{className:"font-heading font-extrabold text-2xl sm:text-3xl uppercase tracking-tight leading-snug mb-6","data-testid":"slang-prompt",children:d.prompt}),(0,B.jsx)("div",{className:"space-y-2.5",children:d.options.map((e,t)=>{const a=A===t,s=R&&R.correct_answer_index===t,n="feedback"===r;let o="border-white/10 hover:border-fomo-amber/40";return n&&s?o="border-mpesa-green bg-mpesa-green/10 text-mpesa-green":n&&a&&!s?o="border-euphoria-pink bg-euphoria-pink/10 text-euphoria-pink":a&&(o="border-fomo-amber"),(0,B.jsxs)("button",{onClick:()=>(async e=>{if(null===A&&d){C(e);try{const t=await S.A.post(`${Q}/api/games/slang/answer`,{session_id:i.id,puzzle_id:d.id,answer_index:e});$(t.data),N(t.data.total_score),_(t.data.correct_count),l("feedback"),setTimeout(()=>{t.data.is_complete?l("gameover"):t.data.next_puzzle&&(p(t.data.next_puzzle),w(t.data.current_index),C(null),$(null),l("playing"))},2400)}catch(s){var t,a;z.oR.error((null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Could not submit"),C(null)}}})(t),disabled:null!==A,className:`w-full text-left h-14 px-5 rounded-xl border transition-all flex items-center justify-between gap-3 disabled:cursor-default ${o}`,"data-testid":`slang-option-${t}`,children:[(0,B.jsx)("span",{className:"font-medium text-base",children:e}),n&&s&&(0,B.jsx)(u.A,{className:"w-5 h-5 text-mpesa-green shrink-0"}),n&&a&&!s&&(0,B.jsx)(h.A,{className:"w-5 h-5 text-euphoria-pink shrink-0"})]},t)})}),"feedback"===r&&R&&(0,B.jsxs)(n.P.div,{initial:{opacity:0,y:8}
1,animate:{opacity:1,y:0},className:"mt-5 p-4 bg-white/[0.03] border border-white/10 rounded-xl","data-testid":"slang-fact",children:[R.translation&&(0,B.jsxs)("p",{className:"text-sm text-zinc-300",children:[(0,B.jsx)("span",{className:"text-fomo-amber font-medium",children:"Translation:"})," ",R.translation]}),R.fact&&(0,B.jsx)("p",{className:"text-xs text-zinc-500 mt-1.5",children:R.fact})]})]})}if("gameover"===r){const e=b?Math.round(k/b*100):0;return(0,B.jsxs)("div",{className:"bg-surface border border-fomo-amber/30 rounded-2xl p-8 text-center","data-testid":"slang-gameover",children:[(0,B.jsx)(x.A,{className:"w-14 h-14 text-fomo-amber mx-auto mb-4"}),(0,B.jsx)("h2",{className:"font-heading font-black text-3xl uppercase tracking-tighter leading-none mb-1",children:"Slang Master?"}),(0,B.jsx)("p",{className:"text-zinc-500 text-sm mb-6",children:"Here's your score for this round"}),(0,B.jsx)(le,{userId:a}),(0,B.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[(0,B.jsxs)("div",{className:"bg-white/5 rounded-xl p-4",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-3xl text-fomo-amber",children:v}),(0,B.jsx)("p",{className:"overline mt-1",children:"Points"})]}),(0,B.jsxs)("div",{className:"bg-white/5 rounded-xl p-4",children:[(0,B.jsxs)("p",{className:"font-mono font-bold text-3xl text-rastyle-orange",children:[k,(0,B.jsxs)("span",{className:"text-zinc-500 text-xl",children:["/",b]})]}),(0,B.jsx)("p",{className:"overline mt-1",children:"Correct"})]}),(0,B.jsxs)("div",{className:"bg-white/5 rounded-xl p-4",children:[(0,B.jsxs)("p",{className:"font-mono font-bold text-3xl text-euphoria-pink",children:[e,"%"]}),(0,B.jsx)("p",{className:"overline mt-1",children:"Accuracy"})]})]}),(0,B.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,B.jsxs)("button",{onClick:q,className:"flex-1 h-12 bg-fomo-amber text-black font-bold uppercase tracking-wide rounded-full flex items-center justify-center gap-2 active:scale-95 transition-transform","data-testid":"slang-play-again",children:[(0,B.jsx)(g.A,{className:"w-4 h-4"})," Play Again"]}),(0,B.jsx)("button",{onClick:t,className:"flex-1 h-12 border border-white/15 text-zinc-400 uppercase tracking-wide text-sm rounded-full hover:text-white","data-testid":"slang-back-to-room",children:"Back to Room"})]})]})}return null},se=e=>{let{refreshKey:t=0}=e;const[a,r]=(0,s.useState)([]),[n,l]=(0,s.useState)("weekly"),[i,o]=(0,s.useState)("all"),[c,d]=(0,s.useState)(!0);(0,s.useEffect)(()=>{d(!0),S.A.get(`${Q}/api/games/leaderboard`,{params:{game:i,window:n,limit:25}}).then(e=>r(e.data.entries||[])).catch(()=>r([])).finally(()=>d(!1))},[i,n,t]);const g=e=>1===e?(0,B.jsx)(y.A,{className:"w-5 h-5 text-yellow-400"}):2===e?(0,B.jsx)(j.A,{className:"w-5 h-5 text-gray-300"}):3===e?(0,B.jsx)(j.A,{className:"w-5 h-5 text-amber-600"}):(0,B.jsxs)("span",{className:"text-zinc-500 font-mono text-sm",children:["#",e]});return(0,B.jsxs)("div",{id:"leaderboard",className:"scroll-mt-24 bg-surface border border-white/5 rounded-2xl","data-testid":"leaderboard",children:[(0,B.jsxs)("div",{className:"px-5 py-4 border-b border-white/5 flex items-center justify-between gap-3 flex-wrap",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(x.A,{className:"w-5 h-5 text-fomo-amber"}),(0,B.jsx)("h3",{className:"font-heading font-extrabold text-lg uppercase tracking-tight",children:"Top Selectors"})]}),(0,B.jsxs)("div",{className:"flex bg-black/40 rounded-full p-1",children:[(0,B.jsx)("button",{onClick:()=>l("weekly"),className:"px-4 py-1.5 text-xs font-bold uppercase tracking-wide rounded-full transition-all "+("weekly"===n?"bg-rastyle-orange text-black":"text-zinc-400 hover:text-white"),children:"This Week"}),(0,B.jsx)("button",{onClick:()=>l("all_time"),className:"px-4 py-1.5 text-xs font-bold uppercase tracking-wide rounded-full transition-all "+("all_time"===n?"bg-rastyle-orange text-black":"text-zinc-400 hover:text-white"),children:"All Time"})]})]}),(0,B.jsx)("div",{className:"flex gap-1 overflow-x-auto border-b border-white/5 px-3 py-2 scrollbar-hide","aria-label":"Choose game leaderboard",children:X.map(e=>(0,B.jsx)("button",{type:"button",onClick:()=>o(e.id),className:"shrink-0 rounded-full px-3 py-1.5 text-[10px] font-bold uppercase tracking-wide "+(i===e.id?"bg-fomo-amber text-black":"text-zinc-500 hover:text-white"),"aria-pressed":i===e.id,children:e.label},e.id))}),(0,B.jsx)("div",{className:"p-3 max-h-96 overflow-y-auto",children:c?(0,B.jsx)("div",{className:"py-12 text-center",children:(0,B.jsx)(m.A,{className:"w-6 h-6 animate-spin text-rastyle-orange mx-auto"})}):0===a.length?(0,B.jsxs)("div",{className:"py-12 text-center text-zinc-500 text-sm",children:[(0,B.jsx)(x.A,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),(0,B.jsx)("p",{children:"Be the first to claim the top spot!"})]}):(0,B.jsx)("ul",{className:"space-y-1.5",children:a.map((e,t)=>{const a=t+1,s=a<=3;return(0,B.jsxs)("li",{className:"flex items-center gap-3 p-3 rounded-xl "+(s?"bg-gradient-to-r from-fomo-amber/10 to-transparent border-l-2 border-fomo-amber":"bg-white/[0.03]"),"data-testid":`leaderboard-row-${t}`,children:[(0,B.jsx)("div",{className:"w-8 flex items-center justify-center font-mono",children:g(a)}),(0,B.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,B.jsx)("p",{className:"font-medium text-sm truncate",children:e.user_name}),(0,B.jsxs)("p",{className:"overline",children:[e.plays," ",1===e.plays?"play":"plays","all"===i?` \u2022 ${e.games_played} games`:` \u2022 ${e.best_correct||0} correct`]})]}),(0,B.jsxs)("div",{className:"text-right",children:[(0,B.jsx)("p",{className:"font-mono font-bold text-rastyle-orange text-lg leading-none",children:"all"===i?e.championship_points:e.best_score}),(0,B.jsx)("p",{className:"overline mt-0.5",children:"all"===i?"champ pts":"score"})]})]},e.user_id||t)})})})]})},re={Sparkles:f.A,Layers:w.A,Flame:p.A,TrendingUp:v.A,Crown:y.A,Type:o.A,BookOpen:N.A,Trophy:x.A,Medal:j.A,Award:k.A},ne=e=>{let{userId:t,refreshKey:a=0}
1=e;const[n,l]=(0,s.useState)(null),[i,o]=(0,s.useState)(!0),[c,d]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{t?(o(!0),S.A.get(`${Q}/api/games/profile`,{params:{user_id:t}}).then(e=>l(e.data)).catch(()=>l(null)).finally(()=>o(!1))):o(!1)},[t,a]),i)return(0,B.jsx)("div",{className:"bg-surface border border-white/5 rounded-2xl p-6 mb-6 flex items-center justify-center","data-testid":"selector-profile-loading",children:(0,B.jsx)(m.A,{className:"w-5 h-5 animate-spin text-rastyle-orange"})});if(!t||null!==n&&void 0!==n&&n.anonymous)return(0,B.jsx)("div",{className:"bg-gradient-to-r from-rastyle-orange/10 via-fomo-amber/5 to-transparent border border-rastyle-orange/30 rounded-2xl p-5 sm:p-6 mb-6","data-testid":"selector-profile-anon",children:(0,B.jsxs)("div",{className:"flex items-start gap-4",children:[(0,B.jsx)("div",{className:"w-12 h-12 rounded-xl bg-rastyle-orange/20 border border-rastyle-orange/40 flex items-center justify-center flex-shrink-0",children:(0,B.jsx)(p.A,{className:"w-6 h-6 text-rastyle-orange"})}),(0,B.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,B.jsx)("h3",{className:"font-heading font-extrabold text-lg sm:text-xl uppercase tracking-tight mb-1",children:"Sign up to build your streak"}),(0,B.jsx)("p",{className:"text-zinc-400 text-sm",children:"Earn selector badges, climb the weekly Top 10, and rack up daily streaks. Play anonymously now \u2014 but real progress needs a Rastyle account."})]}),(0,B.jsxs)(r.N_,{to:"/login",className:"hidden sm:inline-flex items-center gap-1.5 px-4 py-2 bg-rastyle-orange text-black font-bold uppercase tracking-wide text-sm rounded-full hover:bg-orange-400 transition-colors flex-shrink-0","data-testid":"selector-profile-signup-link",children:["Sign In ",(0,B.jsx)(b.A,{className:"w-4 h-4"})]})]})});if(!n)return null;const g=new Set((n.badges||[]).map(e=>e.id)),u=n.all_badges||n.badges||[],h=n.best_scores||{},f={reggae_trivia:"Reggae Trivia",slang_puzzle:"Slang Puzzle"};return(0,B.jsxs)("div",{className:"bg-surface border border-white/5 rounded-2xl overflow-hidden mb-6","data-testid":"selector-profile",children:[(0,B.jsxs)("div",{className:"px-5 sm:px-6 py-4 border-b border-white/5 bg-gradient-to-r from-rastyle-orange/10 to-transparent flex items-center justify-between gap-3 flex-wrap",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(k.A,{className:"w-5 h-5 text-rastyle-orange"}),(0,B.jsx)("h3",{className:"font-heading font-extrabold text-lg uppercase tracking-tight",children:"Your Selector Profile"})]}),(0,B.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[n.in_weekly_top_10&&(0,B.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-fomo-amber/15 border border-fomo-amber/40 text-fomo-amber font-mono text-[11px] uppercase tracking-wider rounded-full","data-testid":"selector-profile-top10-pill",children:[(0,B.jsx)(x.A,{className:"w-3.5 h-3.5"})," Top 10 this week"]}),n.current_streak>0&&(0,B.jsxs)("button",{onClick:()=>d(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-rastyle-orange text-black font-mono text-[11px] font-bold uppercase tracking-wider rounded-full hover:bg-orange-400 transition-colors","data-testid":"selector-profile-share-btn",children:[(0,B.jsx)(_.A,{className:"w-3.5 h-3.5"})," Share Streak"]})]})]}),(0,B.jsxs)("div",{className:"p-5 sm:p-6 space-y-6",children:[(0,B.jsxs)("div",{className:"grid grid-cols-3 gap-3","data-testid":"selector-profile-stats",children:[(0,B.jsxs)("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl p-4 text-center",children:[(0,B.jsxs)("div",{className:"flex items-center justify-center gap-1 mb-1",children:[(0,B.jsx)(p.A,{className:"w-5 h-5 "+(n.current_streak>0?"text-rastyle-orange":"text-zinc-600")}),(0,B.jsx)("p",{className:"font-mono font-extrabold text-2xl sm:text-3xl leading-none",children:n.current_streak})]}),(0,B.jsx)("p",{className:"overline mt-1",children:"Day Streak"})]}),(0,B.jsxs)("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl p-4 text-center",children:[(0,B.jsx)("p",{className:"font-mono font-extrabold text-2xl sm:text-3xl text-fomo-amber leading-none",children:n.longest_streak}),(0,B.jsx)("p",{className:"overline mt-1",children:"Best Streak"})]}),(0,B.jsxs)("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl p-4 text-center",children:[(0,B.jsx)("p",{className:"font-mono font-extrabold text-2xl sm:text-3xl text-rastyle-orange leading-none",children:n.plays}),(0,B.jsx)("p",{className:"overline mt-1",children:"Total Plays"})]})]}),Object.keys(h).length>0&&(0,B.jsxs)("div",{"data-testid":"selector-profile-bests",children:[(0,B.jsx)("p",{className:"overline mb-2",children:"Best Scores"}),(0,B.jsx)("div",{className:"grid sm:grid-cols-2 gap-2",children:Object.entries(h).map(e=>
1{let[t,a]=e;return(0,B.jsxs)("div",{className:"flex items-center justify-between bg-white/[0.03] border border-white/5 rounded-xl px-4 py-3","data-testid":`selector-profile-best-${t}`,children:[(0,B.jsxs)("div",{className:"min-w-0",children:[(0,B.jsx)("p",{className:"font-medium text-sm truncate",children:f[t]||t}),(0,B.jsxs)("p",{className:"overline",children:[a.best_correct,"/",a.total_questions," correct"]})]}),(0,B.jsx)("p",{className:"font-mono font-bold text-rastyle-orange text-lg",children:a.best_score})]},t)})})]}),u.length>0&&(0,B.jsxs)("div",{"data-testid":"selector-profile-badges",children:[(0,B.jsxs)("div",{className:"flex items-baseline justify-between mb-2",children:[(0,B.jsx)("p",{className:"overline",children:"Badges"}),(0,B.jsxs)("p",{className:"overline text-zinc-500",children:[g.size,"/",u.length," unlocked"]})]}),(0,B.jsx)("div",{className:"grid grid-cols-4 sm:grid-cols-5 lg:grid-cols-9 gap-2",children:u.map(e=>{const t=g.has(e.id),a=re[e.icon]||x.A;return(0,B.jsx)("div",{title:`${e.name} \u2014 ${e.tagline}`,className:"relative aspect-square rounded-xl p-1 flex items-center justify-center transition-all "+(t?`bg-gradient-to-br ${e.color}`:"bg-white/[0.02] border border-white/5"),"data-testid":`badge-${e.id}${t?"-earned":"-locked"}`,children:(0,B.jsx)("div",{className:"w-full h-full rounded-lg flex items-center justify-center "+(t?"bg-black/30 backdrop-blur-sm":""),children:t?(0,B.jsx)(a,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white drop-shadow"}):(0,B.jsx)(A.A,{className:"w-4 h-4 text-zinc-600"})})},e.id)})})]})]}),(0,B.jsx)(M,{open:c,onClose:()=>d(!1),userName:n.user_name||"Selector",currentStreak:n.current_streak||0,longestStreak:n.longest_streak||0,plays:n.plays||0,badgeCount:g.size,totalBadges:u.length})]})},le=e=>{let{userId:t}=e;const[a,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&!t.startsWith("anon-")&&S.A.get(`${Q}/api/games/profile`,{params:{user_id:t}}).then(e=>{var t,a;return r(null!==(t=null===(a=e.data)||void 0===a?void 0:a.current_streak)&&void 0!==t?t:0)}).catch(()=>{})},[t]),null===a||a<=0?null:(0,B.jsxs)("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-rastyle-orange/15 border border-rastyle-orange/40 text-rastyle-orange font-mono text-xs uppercase tracking-wider mb-4","data-testid":"post-game-streak-chip",children:[(0,B.jsx)(p.A,{className:"w-4 h-4"}),"You're on a ",a,"-day streak \u2014 keep it going!"]})},ie=()=>{const{user:e}
1=(0,C.As)(),[t,a]=(0,s.useState)([]),[r,n]=(0,s.useState)(null),[l,i]=(0,s.useState)(0);(0,s.useEffect)(()=>{S.A.get(`${Q}/api/games`).then(e=>a(e.data||[])).catch(()=>{})},[]);const o=()=>{n(null),i(e=>e+1)};return(0,B.jsxs)("div",{className:"min-h-screen bg-background pt-20 pb-16",children:[(0,B.jsx)(R.A,{title:"Gaming Room \u2014 Rastyle Republik",description:"Play reggae trivia, dancehall slang and sound-system challenges. Build streaks and compete across the Rastyle Republik gaming leaderboards.",url:"/gaming"}),(0,B.jsxs)("div",{className:"relative overflow-hidden border-b border-white/10",children:[(0,B.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-rastyle-orange/10 via-black to-red-900/10"}),(0,B.jsx)("div",{className:"absolute top-0 left-1/4 right-1/4 h-px bg-gradient-to-r from-transparent via-rastyle-orange/40 to-transparent"}),(0,B.jsxs)("div",{className:"relative max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 py-12 sm:py-16",children:[(0,B.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,B.jsxs)("span",{className:"inline-flex items-center gap-2 px-2.5 py-1 bg-rastyle-orange/15 border border-rastyle-orange/40 text-rastyle-orange font-mono text-[11px] uppercase tracking-wider",children:[(0,B.jsx)(d.A,{className:"w-3.5 h-3.5"})," Rastyle Club OS\u2122"]}),(0,B.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wider text-zinc-500",children:"Gaming Room"})]}),(0,B.jsxs)("h1",{className:"font-heading font-extrabold text-4xl sm:text-5xl lg:text-6xl uppercase tracking-tight mb-3",children:["Play. Score.",(0,B.jsx)("span",{className:"text-rastyle-orange",children:" Shell di place."})]}),(0,B.jsx)("p",{className:"text-zinc-400 max-w-2xl",children:"Reggae trivia, dancehall slang puzzles & sound-system challenges. Climb the leaderboard. Earn badges. Bragging rights, guaranteed."}),(0,B.jsxs)("a",{href:"#leaderboard",className:"mt-6 inline-flex items-center gap-2 rounded-full border border-fomo-amber/40 bg-fomo-amber/10 px-5 py-2.5 text-sm font-bold text-fomo-amber hover:bg-fomo-amber hover:text-black",children:[(0,B.jsx)(x.A,{className:"h-4 w-4"})," View live leaderboard"]})]})]}),(0,B.jsx)("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 mt-10",children:"reggae_trivia"===r||"slang_puzzle"===r||"reflex_tap"===r?(0,B.jsxs)("div",{className:"grid lg:grid-cols-3 gap-6 lg:gap-8",children:[(0,B.jsxs)("div",{className:"lg:col-span-2",children:[(0,B.jsx)("button",{onClick:o,className:"mb-4 text-sm text-zinc-400 hover:text-rastyle-orange flex items-center gap-1.5",children:"\u2190 Back to Gaming Room"}),"reggae_trivia"===r&&(0,B.jsx)(ee,{onClose:o,userId:null===e||void 0===e?void 0:e.user_id}),"slang_puzzle"===r&&(0,B.jsx)(ae,{onClose:o,userId:null===e||void 0===e?void 0:e.user_id}),"reflex_tap"===r&&(0,B.jsx)(Y,{onClose:o,userId:null===e||void 0===e?void 0:e.user_id})]}),(0,B.jsx)("div",{children:(0,B.jsx)(se,{refreshKey:l})})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ne,{userId:null===e||void 0===e?void 0:e.user_id,refreshKey:l}),(0,B.jsxs)("div",{className:"grid lg:grid-cols-3 gap-6 lg:gap-8",children:[(0,B.jsxs)("div",{className:"lg:col-span-2",children:[(0,B.jsxs)("h2",{className:"font-heading font-bold text-xl uppercase tracking-tight mb-4 flex items-center gap-2",children:[(0,B.jsx)(f.A,{className:"w-5 h-5 text-rastyle-orange"})," Choose Your Game"]}),(0,B.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:t.map(e=>{const t=Z[e.icon]||d.A,a="live"===e.status;return(0,B.jsxs)("button",{onClick:()=>a&&n(e.id),disabled:!a,className:"text-left p-5 rounded-lg border transition-all group relative overflow-hidden "+(a?"bg-zinc-900 border-white/10 hover:border-rastyle-orange/60 hover:-translate-y-1 cursor-pointer":"bg-zinc-900/50 border-white/5 cursor-not-allowed opacity-60"),"data-testid":`game-card-${e.id}`,children:[(0,B.jsx)("div",{className:`absolute -top-12 -right-12 w-32 h-32 bg-gradient-to-br ${e.color} opacity-20 rounded-full blur-2xl`}),(0,B.jsxs)("div",{className:"relative",children:[(0,B.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,B.jsx)("div",{className:`w-12 h-12 rounded-lg bg-gradient-to-br ${e.color} flex items-center justify-center`,children:(0,B.jsx)(t,{className:"w-6 h-6 text-white"})}),a?(0,B.jsx)("span",{className:"text-[10px] px-2 py-0.5 bg-green-500/15 text-green-400 font-mono uppercase tracking-wider border border-green-500/30",children:"\u25cf Live"}):(0,B.jsx)("span",{className:"text-[10px] px-2 py-0.5 bg-zinc-700/40 text-zinc-400 font-mono uppercase tracking-wider",children:"Soon"})]}),(0,B.jsx)("h3",{className:"font-heading font-bold text-xl mb-1 group-hover:text-rastyle-orange transition-colors",children:e.name}),(0,B.jsx)("p",{className:"text-sm text-zinc-400 mb-3",children:e.tagline}),(0,B.jsx)("p",{className:"text-xs text-zinc-500 line-clamp-2",children:e.description}),a&&(0,B.jsxs)("div",{className:"mt-4 flex items-center gap-1.5 text-rastyle-orange text-sm font-medium group-hover:gap-2 transition-all",children:["Play now ",(0,B.jsx)(b.A,{className:"w-4 h-4"})]})]})]},e.id)})}),(0,B.jsx)("div",{className:"mt-6 p-5 rounded-lg bg-gradient-to-r from-rastyle-orange/10 to-red-900/10 border border-rastyle-orange/30",children:(0,B.jsxs)("div",{className:"flex items-start gap-4",children:[(0,B.jsx)(x.A,{className:"w-10 h-10 text-yellow-400 flex-shrink-0"}),(0,B.jsxs)("div",{children:[(0,B.jsx)("h3",{className:"font-bold text-lg mb-1",children:"Weekly Champion gets bragging rights"}),(0,B.jsx)("p",{className:"text-sm text-zinc-400",children:"Score reset every Monday at 00:00 EAT. Highest weekly score wins the Rastyle Champion badge. Coming soon: real-world rewards from Kenyan venues \u2014 free drinks, VIP upgrades, merch discounts."})]})]})})]}),(0,B.jsx)("div",{className:"order-first lg:order-last",children:(0,B.jsx)(se,{refreshKey:l})})]})]})})]})}}}]); 2//# sourceMappingURL=1618.964c5b5a.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.