@mblinkov/whats-missing 20.0.56 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblinkov/whats-missing",
3
- "version": "20.0.56",
3
+ "version": "21.0.0",
4
4
  "description": "A memory game component for React - Guess what's missing from a collection of images",
5
5
  "main": "dist/whats-missing.cjs.js",
6
6
  "module": "dist/whats-missing.es.js",
@@ -1,6 +0,0 @@
1
- export default function AdaptiveGameShell({ gameCubeSize, screenHeight, screenWidth, seed, }: {
2
- gameCubeSize?: number;
3
- screenHeight?: number;
4
- screenWidth?: number;
5
- seed?: number;
6
- }): import("react/jsx-runtime").JSX.Element;
package/dist/Game.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export default function Game({ gameCubeSize, screenHeight, screenWidth, seed, }: {
2
- gameCubeSize?: number;
3
- screenHeight?: number;
4
- screenWidth?: number;
5
- seed?: number;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export { Game };
@@ -1,2 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- export declare const styles: Record<string, CSSProperties>;
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { default as Game } from './AdaptiveGameShell';
2
- export { default as AdaptiveGameShell } from './AdaptiveGameShell';
3
- export { default as RawGame } from './Game';
4
- export { themes } from './themes';
5
- export type { Theme } from './themes';
package/dist/themes.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export type Theme = "animals" | "food" | "toys" | "clothes" | "transport" | "nature" | "home" | "school";
2
- export type ImageItem = {
3
- src: string;
4
- name: string;
5
- aliases?: string[];
6
- };
7
- export declare const themes: Record<Theme, ImageItem[]>;
@@ -1,32 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("react"),oi=`
2
- @keyframes spin {
3
- from { transform: rotate(0deg); }
4
- to { transform: rotate(360deg); }
5
- }
6
- `;if(typeof document<"u"&&!document.getElementById("spin-keyframes")){const d=document.createElement("style");d.id="spin-keyframes",d.innerHTML=oi,document.head.appendChild(d)}const wi={animation:"spin 1.4s linear infinite"},o={gmCenterScreen:{position:"relative",zIndex:1,minHeight:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"#1f2937",padding:"24px 16px",boxSizing:"border-box",transform:"translateY(20px)"},gmHeadline1:{fontWeight:700,fontSize:"clamp(28px, 4vw, 40px)",lineHeight:"110%"},gmHeadline3:{fontWeight:600,fontSize:"18px",lineHeight:"130%"},gmBodyM:{fontWeight:400,fontSize:"16px",lineHeight:"140%"},gmBodyS:{fontWeight:400,fontSize:"14px",lineHeight:"140%",color:"#6b7280"},gmButton:{fontFamily:'"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',fontWeight:600,fontSize:"16px",padding:"10px 16px",borderRadius:"12px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"0 6px 18px rgba(236, 76, 68, .18)",transition:"transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"},gmButtonActive:{background:"#333",color:"#fff"},gmGameLayout:{position:"relative",width:"100%",maxWidth:"none",minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",color:"#1f2937",padding:"16px 8px",margin:"0 auto"},gmGrid:{width:"100%",maxWidth:"none",margin:"0 auto",display:"grid",gridTemplateColumns:"repeat(3, 210px)",gridAutoRows:"210px",gap:"20px",justifyContent:"center"},gmInput:{padding:"6px 10px",borderRadius:"6px",border:"1px solid #ccc",fontSize:"16px",fontFamily:'"Geist", system-ui',width:"160px"},gmTable:{marginTop:"20px",marginBottom:"32px",borderCollapse:"collapse",width:"100%",maxWidth:"520px",tableLayout:"fixed",textAlign:"center"},gmTableCell:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},gmLogoFixed:{position:"absolute",top:"28px",left:"16px",width:"120px",zIndex:10,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"clamp(28px, 5vw, 40px)",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},gmHourglass:{fontSize:"42px",...wi}},di=window.origin+"/cloud/speakid/games/whatsmissing/",M=(d,a)=>d.map(([g,s,...p])=>({src:`${di}${a}/${s.replace(/\s/g,"%20")}.png`,name:s,aliases:p?.length?p:void 0})),ri=[["apple","apple"],["banana","banana"],["bread","bread"],["burger","burger"],["cake","cake"],["carrot","carrot"],["cheese","cheese"],["chicken","chicken"],["chocolate","chocolate"],["corn","corn"],["donut","donut"],["fish","fish"],["fries","fries"],["grapes","grapes"],["ice_cream","ice cream"],["milk","milk"],["orange","orange"],["pear","pear"],["pizza","pizza"],["rice","rice"],["sandwich","sandwich"],["soup","soup"],["strawberry","strawberry"],["tomato","tomato"],["watermelon","watermelon"]],hi=[["bear","bear"],["cat","cat"],["crocodile","crocodile","alligator"],["dolphin","dolphin"],["elephant","elephant"],["fox","fox"],["giraffe","giraffe"],["horse","horse"],["kangaroo","kangaroo"],["lion","lion"],["monkey","monkey"],["owl","owl"],["panda","panda"],["penguin","penguin"],["squirrel","squirrel"],["tiger","tiger"],["tortoise","tortoise","turtle"],["wolf","wolf"],["zebra","zebra"]],si=[["ball","ball"],["balloon","balloon"],["blocks","blocks"],["car","car"],["doll","doll"],["drum","drum"],["guitar","guitar"],["jump_rope","jump rope"],["kite","kite"],["paints","paints"],["plane","plane"],["puzzle","puzzle"],["rocket","rocket"],["scooter","scooter"],["skateboard","skateboard"],["slide","slide"],["teddy_bear","teddy bear"],["yo-yo","yo-yo"],["crayons","crayons"]],ai=[["t-shirt","T-shirt"],["dress","dress"],["hat","hat"],["shoes","shoes"],["socks","socks"],["coat","coat"],["skirt","skirt"],["trousers","trousers"],["jacket","jacket"],["scarf","scarf"],["gloves","gloves"],["shorts","shorts"],["cap","cap"],["boots","boots"],["pyjamas","pyjamas"]],gi=[["car","car"],["bus","bus"],["bike","bike"],["train","train"],["plane","plane"],["boat","boat"],["ship","ship"],["helicopter","helicopter"],["lorry","lorry","truck"],["taxi","taxi"],["rocket","rocket"],["van","van"],["motorbike","motorbike"],["tram","tram"],["submarine","submarine"]],pi=[["sun","sun"],["cloud","cloud"],["rain","rain"],["tree","tree"],["flower","flower"],["grass","grass"],["star","star"],["moon","moon"],["mountain","mountain"],["river","river"],["rainbow","rainbow"],["snowman","snowman"],["snow","snow"],["butterfly","butterfly"],["bird","bird"]],li=[["bed","bed"],["table","table"],["chair","chair"],["door","door"],["window","window"],["lamp","lamp"],["sofa","sofa"],["clock","clock"],["key","key"],["phone","phone"],["tv","TV"],["cup","cup"],["plate","plate"],["mirror","mirror"],["book","book"]],ci=[["book","book"],["pen","pen"],["pencil","pencil"],["bag","bag"],["ruler","ruler"],["rubber","rubber","eraser"],["desk","desk"],["board","board"],["crayon","crayon"],["glue","glue"],["scissors","scissors"],["notebook","notebook"],["pencil_case","pencil case"],["paintbrush","paintbrush"],["backpack","backpack"]],F={food:M(ri,"food"),animals:M(hi,"animals"),toys:M(si,"toys"),clothes:M(ai,"clothes"),transport:M(gi,"transport"),nature:M(pi,"nature"),home:M(li,"home"),school:M(ci,"school")},xi=["animals","food","toys","clothes","transport","nature","home","school"],Hi={animals:"🐶 Animals",food:"🍎 Food",toys:"🧸 Toys",clothes:"👕 Clothes",transport:"🚗 Transport",nature:"🌳 Nature",home:"🏠 Home",school:"📚 School"},Wi=()=>{const d=document.createElement("style");d.id="whats-missing-reset",d.textContent=`
7
- #whats-missing-root, #whats-missing-root * {
8
- box-sizing: border-box;
9
- font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
10
- }
11
- #whats-missing-root img {
12
- max-width: 100%;
13
- height: auto;
14
- display: block;
15
- user-select: none;
16
- }
17
- html, body {
18
- margin: 0 !important;
19
- padding: 0 !important;
20
- width: 100% !important;
21
- height: 100% !important;
22
- overflow: hidden !important;
23
- zoom: 1 !important; /* ✅ защита от подзума */
24
- }
25
- #root {
26
- margin: 0 !important;
27
- padding: 0 !important;
28
- width: 100% !important;
29
- height: 100% !important;
30
- overflow: hidden !important;
31
- }
32
- `;const a=document.getElementById("whats-missing-reset");a&&a.remove(),document.head.appendChild(d)};class mi{constructor(a){this.seed=a}next(){return this.seed=(this.seed*1664525+1013904223)%Math.pow(2,32),this.seed/Math.pow(2,32)}nextInt(a){return Math.floor(this.next()*a)}}const ui=(d,a)=>{const g=Array.from({length:d.length+1},()=>Array(a.length+1).fill(0));for(let s=0;s<=d.length;s++)g[s][0]=s;for(let s=0;s<=a.length;s++)g[0][s]=s;for(let s=1;s<=d.length;s++)for(let p=1;p<=a.length;p++)g[s][p]=d[s-1]===a[p-1]?g[s-1][p-1]:Math.min(g[s-1][p-1],g[s][p-1],g[s-1][p])+1;return g[d.length][a.length]},fi=d=>new Promise(a=>{const g=new Image;g.onload=()=>a(g),g.onerror=()=>a(g),g.src=d}),gn=async(d,a)=>{const g=new Map,s=d.map(async p=>{const j=await fi(p);g.set(p,j)});return await Promise.allSettled(s),g};function In({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const p=t.useRef(null);t.useEffect(()=>(Wi(),()=>{document.documentElement.style.overflow="",document.body.style.overflow="";const e=document.getElementById("whats-missing-reset");e&&e.remove(),I.current&&I.current.abort()}),[]);const[j,$]=t.useState(null),[b,A]=t.useState([]),[D,Pn]=t.useState(4),[pn,Q]=t.useState(1),[L,ln]=t.useState(!1),[_,cn]=t.useState(1),[T,zn]=t.useState(null),[v,O]=t.useState("ready"),[xn,Hn]=t.useState(10),[X,nn]=t.useState(10),[en,Wn]=t.useState(20),[Rn,tn]=t.useState(0),[U,on]=t.useState(!1),[Y,mn]=t.useState(""),[C,wn]=t.useState(!1),[dn,un]=t.useState(!1),[fn,G]=t.useState(null),[Mn,rn]=t.useState([]),[Ln,yn]=t.useState([]),[n,Cn]=t.useState(!1),[Bn,V]=t.useState(1),[bn,q]=t.useState(null),[k,En]=t.useState(!1),[l,An]=t.useState(!1),[c,Dn]=t.useState(!1),[x,Gn]=t.useState(!1),[H,Fn]=t.useState(!1),[W,$n]=t.useState(!1),[m,_n]=t.useState(!1),[u,On]=t.useState(!1),[f,Un]=t.useState(!1),[P,Yn]=t.useState(!1),hn=t.useRef(new Set),N=t.useRef(new Map),I=t.useRef(null),B=t.useRef(null);t.useEffect(()=>{s!==void 0?B.current=new mi(s):B.current=null},[s]);const Vn=()=>B.current?B.current.next():Math.random(),Sn=e=>B.current?B.current.nextInt(e):Math.floor(Math.random()*e);t.useEffect(()=>{const e=()=>{const w=g??window.innerWidth,r=a??window.innerHeight,h=w<768||w===926&&r===428||w===932&&r===430,y=r<700,z=w/r>1.8,S=w===768&&r===1024,vn=w===1024&&r===768,Z=w===820&&r===1180,R=w===1180&&r===820,E=w===540&&r===720,Qn=w===720&&r===540,Xn=w===1024&&r===1366,ni=w===1366&&r===1024,ii=w>=1200&&r>=600&&!h;if(En(ii),An(S),Dn(vn),Gn(Z),Fn(R),$n(E),_n(Qn),On(Xn),Un(ni),Yn(z),Cn(h),h)q(d&&d>=320?d:null),V(1);else if(y)q(d&&d>=400?d:null),V(1);else if(z){const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(.85)}else{const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[g,a,d]);const sn=e=>[...e].sort(()=>Vn()-.5).slice(0,6),qn=e=>{I.current&&I.current.abort(),I.current=new AbortController;const r=F[e].map(h=>h.src);gn(r,I.current.signal).then(h=>{r.forEach(y=>{hn.current.add(y),h.has(y)&&N.current.set(y,h.get(y))})}).catch(()=>{})},jn=()=>{if(!j)return;const e=sn(F[j]);A(e),ln(!0),on(!1),cn(1),tn(0),rn([]),yn([]);const w=e.map(r=>r.src);gn(w,I.current?.signal).then(r=>{w.forEach(h=>{hn.current.add(h),r.has(h)&&N.current.set(h,r.get(h))})}).catch(()=>{}),kn(e,[],!0)},kn=(e=b,w=Ln,r=!1)=>{const h=sn(e.length?e:F[j]);let y=Sn(h.length),z=h[y].name,S=0;for(;w.includes(z)&&S<20;)y=Sn(h.length),z=h[y].name,S++;if(A(h),zn(y),yn([...w,z]),wn(!1),mn(""),Wn(20),G(null),j&&!r){const Z=sn(F[j].filter(R=>!w.includes(R.name))).map(R=>R.src);gn(Z,I.current?.signal).then(R=>{Z.forEach(E=>{hn.current.add(E),R.has(E)&&N.current.set(E,R.get(E))})}).catch(()=>{})}r?(O("ready"),Hn(10),nn(10)):(O("memorize"),nn(10))};t.useEffect(()=>{if(!(!L||U||C)){if(v==="ready")if(xn<=0)O("memorize");else{const e=setTimeout(()=>Hn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="memorize")if(X<=0)O("guess");else{const e=setTimeout(()=>nn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="guess"){if(en<=0){wn(!0),G("wrong");const w=b[T].name,r=b[T].aliases,h=[w,...r||[]].join(", ");rn(y=>[...y,{round:_,answer:Y,correct:h,result:"wrong"}]);return}const e=setTimeout(()=>Wn(w=>w-1),1e3);return()=>clearTimeout(e)}}},[v,xn,X,en,L,U,C,b,T,_,Y]);const Nn=()=>{if(T===null||dn)return;const e=b[T].name,w=b[T].aliases,r=Y.toLowerCase().trim();let h="wrong";const y=[e,...w||[]].map(S=>S.toLowerCase()),z=[e,...w||[]].join(", ");y.includes(r)?(tn(S=>S+1),G("correct"),h="correct"):y.some(S=>ui(r,S)===1)?(tn(S=>S+.5),G("almost"),h="almost"):(G("wrong"),h="wrong"),rn(S=>[...S,{round:_,answer:r,correct:z,result:h}]),un(!0),setTimeout(()=>{un(!1),wn(!0)},600)},Zn=()=>_<D?(cn(e=>e+1),kn()):on(!0),Kn=()=>{I.current&&I.current.abort(),ln(!1),on(!1),$(null),Q(2)},Jn=t.useMemo(()=>i.jsx("div",{style:{...o.gmLogoFixed,position:"absolute",top:28,left:16,zIndex:30},children:i.jsxs("picture",{children:[i.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),i.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:o.gmLogoImg,loading:"lazy"})]})}),[]);return i.jsxs("div",{ref:p,style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",transition:"background 0.3s ease",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:[Jn,i.jsx("div",{style:{width:n?"100%":bn||d||1e3,height:n?"100%":bn||d||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:0,background:"transparent",boxShadow:"none",margin:"0 auto",position:"relative",transform:`scale(${Bn})`},children:i.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:i.jsxs("div",{id:"whats-missing-root",style:{position:"relative",width:"100%",height:"100%"},children:[!j&&!L&&pn===1&&i.jsxs("div",{style:{...o.gmCenterScreen,transform:"none"},children:[i.jsx("h1",{style:o.gmHeadline1,children:"WHAT'S MISSING?"}),i.jsxs("div",{style:{marginTop:24},children:[i.jsx("p",{style:o.gmBodyS,children:"Choose number of rounds:"}),i.jsx("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:8},children:[3,4,5].map(e=>i.jsx("button",{style:{...o.gmButton,...D===e?o.gmButtonActive:{},padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"14px 28px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"13px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"48px":"64px"},onClick:()=>Pn(e),children:e},e))})]}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"10px 20px":"14px 30px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"15px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"132px":"160px"},onClick:()=>Q(2),children:"Play"})]}),!j&&!L&&pn===2&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("p",{style:o.gmBodyM,children:"Select a theme:"}),i.jsxs("p",{style:o.gmBodyS,children:["Rounds: ",D]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:n?"repeat(2, 1fr)":"repeat(4, 1fr)",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px":"12px",maxWidth:n?280:420,margin:"0 auto"},children:xi.map(e=>i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"10px 16px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"14px"},onClick:()=>{$(e),qn(e)},children:Hi[e]},e))}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:()=>Q(1),children:"Back"})]}),j&&!L&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsxs("h1",{style:o.gmHeadline1,children:["Theme selected: ",j]}),i.jsxs("p",{style:o.gmBodyM,children:["Rounds: ",D]}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:jn,children:"▶ Start game"})]}),U&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("h1",{style:{...o.gmHeadline1,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline1.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline1.marginBottom},children:"Results"}),i.jsxs("h2",{style:{...o.gmHeadline3,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline3.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline3.marginBottom},children:["Your score: ",Rn," / ",D]}),i.jsx("p",{style:{...o.gmBodyM,color:"#10b981",marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"12px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmBodyM.marginBottom},children:"Yahoo! You did it! 🍬✨"}),i.jsxs("table",{style:{...o.gmTable,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"20px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"4px":"32px"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Round"}),i.jsx("th",{children:"Your Answer"}),i.jsx("th",{children:"Correct"}),i.jsx("th",{children:"Result"})]})}),i.jsx("tbody",{children:Mn.map((e,w)=>i.jsxs("tr",{children:[i.jsx("td",{style:o.gmTableCell,children:e.round}),i.jsx("td",{style:o.gmTableCell,children:e.answer||"—"}),i.jsx("td",{style:o.gmTableCell,children:e.correct}),i.jsx("td",{style:o.gmTableCell,children:e.result==="correct"?"✔ Correct":e.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},w))})]}),i.jsxs("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"2px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k?"12px":"24px"},children:[i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:jn,children:"🔁 Play again"}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:Kn,children:"⬅️ Choose theme"})]})]}),L&&!U&&i.jsxs("div",{style:o.gmGameLayout,children:[i.jsxs("div",{style:{minHeight:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"45px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"50px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"60px":"160px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"15px":"40px"},children:[v==="ready"&&i.jsxs(i.Fragment,{children:[i.jsx("h1",{style:{...o.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),i.jsx("div",{style:o.gmHourglass,children:"⏳"})]}),v==="memorize"&&i.jsxs("p",{style:{...o.gmBodyM,color:"#10b981"},children:["MEMORIZE (",X,")"]}),v==="guess"&&!C&&i.jsxs("p",{style:o.gmBodyM,children:["⏳ Time left: ",en,"s"]})]}),v!=="ready"&&i.jsx("div",{style:{...o.gmGrid,...P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?{width:"100%"}:{},gridTemplateColumns:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667?"repeat(3, 1fr)":n?"repeat(2, 1fr)":window.innerHeight<700?"repeat(3, 1fr)":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"repeat(3, 130px)":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"repeat(3, 150px)":"repeat(3, 210px)",gridAutoRows:n&&window.innerWidth>window.innerHeight?"120px":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"100px":n?"150px":window.innerHeight<700?"140px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"240px":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"130px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"150px":"210px",gap:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"12px":n||window.innerHeight<700?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"24px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"12px":"20px",justifyItems:"center",maxWidth:n&&window.innerWidth>window.innerHeight?"90%":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"95%":"100%",padding:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"20px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"10px":"16px"},children:b.map((e,w)=>{const r=T===w&&v==="guess"&&!C;return i.jsx("div",{style:{width:"100%",height:"100%",borderRadius:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px":"12px",overflow:"hidden",backgroundColor:"#ffffff",boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 1px 4px rgba(0,0,0,0.1)":"0 4px 12px rgba(0,0,0,0.15)",transition:"all 0.3s ease",cursor:"pointer",...fn==="correct"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #10b981":"0 0 20px #10b981",transform:"scale(1.03)"}:{},...fn==="wrong"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #ef4444":"0 0 20px #ef4444",transform:"scale(1.03)"}:{}},children:!r&&(()=>{const h=N.current.get(e.src),y=h?.complete&&h.src?h.src:e.src;return i.jsx("img",{src:y,alt:e.name,fetchPriority:"high",loading:"eager",decoding:"async",style:{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center"}},`${e.src}-${h?.complete?"loaded":"pending"}`)})()},w)})}),i.jsxs("div",{style:{marginTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"1px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"4px":"16px",height:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"40px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"50px":"80px"},children:[v==="guess"&&!C&&i.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",minWidth:0,gap:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"3px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"6px":"12px",width:"100%",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"270px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"400px":"300px"},children:i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",placeholder:"Type the missing word",value:Y,onChange:e=>mn(e.target.value),style:{...o.gmInput,flex:"1 1 0",minWidth:0,width:"auto",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"170px":(window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700,"250px"),padding:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"5px 6px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 12px":"12px 16px",boxSizing:"border-box",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428?"10px":window.innerWidth===896&&window.innerHeight===414?"11px":window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"}}),i.jsx("button",{style:{...o.gmButton,marginLeft:0,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px",minWidth:n&&window.innerWidth<=375&&window.innerHeight<=667?"45px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"55px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"80px":"100px",flexShrink:0},onClick:Nn,disabled:dn,children:dn?"...":"Check"})]})}),C&&i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"},onClick:Zn,children:"Next round"})]})]})]})})})]})}const K=1280,J=720;function yi(d,a){const g=Math.min(d,a);return d<=768?Math.max(280,d-20):Math.max(400,Math.min(1200,g-40))}function Tn({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const[p,j]=t.useState(()=>({width:typeof window<"u"?window.innerWidth:K,height:typeof window<"u"?window.innerHeight:J}));t.useEffect(()=>{const b=()=>{j({width:window.innerWidth,height:window.innerHeight})};b(),window.addEventListener("resize",b),window.addEventListener("orientationchange",b);const A=new ResizeObserver(b);return A.observe(document.documentElement),()=>{window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),A.disconnect()}},[]);const $=t.useMemo(()=>Math.min(p.width/K,p.height/J),[p.width,p.height]);return i.jsx("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:i.jsx("div",{style:{position:"absolute",left:"50%",top:"50%",width:`${K}px`,height:`${J}px`,transform:`translate(-50%, -50%) scale(${$})`,transformOrigin:"center center"},children:i.jsx("div",{style:{width:`${K}px`,height:`${J}px`,position:"relative",overflow:"hidden"},children:i.jsx(In,{gameCubeSize:d??yi(p.width,p.height),screenWidth:g??p.width,screenHeight:a??p.height,seed:s})})})})}exports.AdaptiveGameShell=Tn;exports.Game=Tn;exports.RawGame=In;exports.themes=F;
@@ -1,1068 +0,0 @@
1
- import { jsx as t, jsxs as l, Fragment as Mn } from "react/jsx-runtime";
2
- import { useRef as F, useEffect as _, useState as r, useMemo as Rn } from "react";
3
- const ri = `
4
- @keyframes spin {
5
- from { transform: rotate(0deg); }
6
- to { transform: rotate(360deg); }
7
- }
8
- `;
9
- if (typeof document < "u" && !document.getElementById("spin-keyframes")) {
10
- const w = document.createElement("style");
11
- w.id = "spin-keyframes", w.innerHTML = ri, document.head.appendChild(w);
12
- }
13
- const hi = {
14
- animation: "spin 1.4s linear infinite"
15
- }, e = {
16
- gmCenterScreen: {
17
- position: "relative",
18
- zIndex: 1,
19
- // use percent so the component fits inside the centered square container
20
- // (100vh caused overflow on tablets because it measured the viewport, not the container)
21
- minHeight: "100%",
22
- width: "100%",
23
- display: "flex",
24
- flexDirection: "column",
25
- justifyContent: "center",
26
- alignItems: "center",
27
- textAlign: "center",
28
- color: "#1f2937",
29
- padding: "24px 16px",
30
- boxSizing: "border-box",
31
- transform: "translateY(20px)"
32
- // чуть вниз, чтобы компенсировать логотип
33
- },
34
- gmHeadline1: {
35
- fontWeight: 700,
36
- fontSize: "clamp(28px, 4vw, 40px)",
37
- lineHeight: "110%"
38
- },
39
- gmHeadline3: {
40
- fontWeight: 600,
41
- fontSize: "18px",
42
- lineHeight: "130%"
43
- },
44
- gmBodyM: {
45
- fontWeight: 400,
46
- fontSize: "16px",
47
- lineHeight: "140%"
48
- },
49
- gmBodyS: {
50
- fontWeight: 400,
51
- fontSize: "14px",
52
- lineHeight: "140%",
53
- color: "#6b7280"
54
- },
55
- gmButton: {
56
- fontFamily: '"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',
57
- fontWeight: 600,
58
- fontSize: "16px",
59
- padding: "10px 16px",
60
- borderRadius: "12px",
61
- border: "1px solid #e5e7eb",
62
- background: "#ec4c44",
63
- color: "#ffffff",
64
- cursor: "pointer",
65
- boxShadow: "0 6px 18px rgba(236, 76, 68, .18)",
66
- transition: "transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"
67
- },
68
- gmButtonActive: {
69
- background: "#333",
70
- color: "#fff"
71
- },
72
- gmGameLayout: {
73
- position: "relative",
74
- width: "100%",
75
- // allow the layout to expand within the square container for tablets/laptops
76
- maxWidth: "none",
77
- // should fill the parent square, not the full viewport
78
- minHeight: "100%",
79
- display: "flex",
80
- flexDirection: "column",
81
- alignItems: "center",
82
- justifyContent: "center",
83
- textAlign: "center",
84
- color: "#1f2937",
85
- padding: "16px 8px",
86
- margin: "0 auto"
87
- },
88
- gmGrid: {
89
- width: "100%",
90
- // let the grid use all available space; sizing is controlled in Game.tsx
91
- maxWidth: "none",
92
- margin: "0 auto",
93
- display: "grid",
94
- // defaults; overridden responsively in Game.tsx
95
- gridTemplateColumns: "repeat(3, 210px)",
96
- gridAutoRows: "210px",
97
- gap: "20px",
98
- justifyContent: "center"
99
- },
100
- gmInput: {
101
- padding: "6px 10px",
102
- borderRadius: "6px",
103
- border: "1px solid #ccc",
104
- fontSize: "16px",
105
- fontFamily: '"Geist", system-ui',
106
- width: "160px"
107
- },
108
- gmTable: {
109
- marginTop: "20px",
110
- marginBottom: "32px",
111
- borderCollapse: "collapse",
112
- width: "100%",
113
- maxWidth: "520px",
114
- tableLayout: "fixed",
115
- textAlign: "center"
116
- },
117
- gmTableCell: {
118
- padding: "8px 12px",
119
- borderBottom: "1px solid #e5e7eb",
120
- whiteSpace: "nowrap",
121
- overflow: "hidden",
122
- textOverflow: "ellipsis"
123
- },
124
- // ✅ Обновлено только для качества логотипа
125
- gmLogoFixed: {
126
- position: "absolute",
127
- top: "28px",
128
- left: "16px",
129
- width: "120px",
130
- zIndex: 10,
131
- pointerEvents: "none",
132
- background: "transparent",
133
- transform: "none",
134
- willChange: "auto"
135
- },
136
- gmLogoImg: {
137
- height: "clamp(28px, 5vw, 40px)",
138
- width: "auto",
139
- background: "transparent",
140
- objectFit: "contain",
141
- imageRendering: "auto",
142
- transform: "translateZ(0)",
143
- backfaceVisibility: "hidden",
144
- WebkitFontSmoothing: "antialiased"
145
- },
146
- gmHourglass: {
147
- fontSize: "42px",
148
- ...hi
149
- }
150
- }, si = window.origin + "/cloud/speakid/games/whatsmissing/", C = (w, a) => w.map(([g, s, ...p]) => ({
151
- src: `${si}${a}/${s.replace(/\s/g, "%20")}.png`,
152
- name: s,
153
- aliases: p?.length ? p : void 0
154
- })), ai = [
155
- ["apple", "apple"],
156
- ["banana", "banana"],
157
- ["bread", "bread"],
158
- ["burger", "burger"],
159
- ["cake", "cake"],
160
- ["carrot", "carrot"],
161
- ["cheese", "cheese"],
162
- ["chicken", "chicken"],
163
- ["chocolate", "chocolate"],
164
- ["corn", "corn"],
165
- ["donut", "donut"],
166
- ["fish", "fish"],
167
- ["fries", "fries"],
168
- ["grapes", "grapes"],
169
- ["ice_cream", "ice cream"],
170
- ["milk", "milk"],
171
- ["orange", "orange"],
172
- ["pear", "pear"],
173
- ["pizza", "pizza"],
174
- ["rice", "rice"],
175
- ["sandwich", "sandwich"],
176
- ["soup", "soup"],
177
- ["strawberry", "strawberry"],
178
- ["tomato", "tomato"],
179
- ["watermelon", "watermelon"]
180
- ], gi = [
181
- ["bear", "bear"],
182
- ["cat", "cat"],
183
- ["crocodile", "crocodile", "alligator"],
184
- ["dolphin", "dolphin"],
185
- ["elephant", "elephant"],
186
- ["fox", "fox"],
187
- ["giraffe", "giraffe"],
188
- ["horse", "horse"],
189
- ["kangaroo", "kangaroo"],
190
- ["lion", "lion"],
191
- ["monkey", "monkey"],
192
- ["owl", "owl"],
193
- ["panda", "panda"],
194
- ["penguin", "penguin"],
195
- ["squirrel", "squirrel"],
196
- ["tiger", "tiger"],
197
- ["tortoise", "tortoise", "turtle"],
198
- ["wolf", "wolf"],
199
- ["zebra", "zebra"]
200
- ], pi = [
201
- ["ball", "ball"],
202
- ["balloon", "balloon"],
203
- ["blocks", "blocks"],
204
- ["car", "car"],
205
- ["doll", "doll"],
206
- ["drum", "drum"],
207
- ["guitar", "guitar"],
208
- ["jump_rope", "jump rope"],
209
- ["kite", "kite"],
210
- ["paints", "paints"],
211
- ["plane", "plane"],
212
- ["puzzle", "puzzle"],
213
- ["rocket", "rocket"],
214
- ["scooter", "scooter"],
215
- ["skateboard", "skateboard"],
216
- ["slide", "slide"],
217
- ["teddy_bear", "teddy bear"],
218
- ["yo-yo", "yo-yo"],
219
- ["crayons", "crayons"]
220
- ], li = [
221
- ["t-shirt", "T-shirt"],
222
- ["dress", "dress"],
223
- ["hat", "hat"],
224
- ["shoes", "shoes"],
225
- ["socks", "socks"],
226
- ["coat", "coat"],
227
- ["skirt", "skirt"],
228
- ["trousers", "trousers"],
229
- ["jacket", "jacket"],
230
- ["scarf", "scarf"],
231
- ["gloves", "gloves"],
232
- ["shorts", "shorts"],
233
- ["cap", "cap"],
234
- ["boots", "boots"],
235
- ["pyjamas", "pyjamas"]
236
- ], ci = [
237
- ["car", "car"],
238
- ["bus", "bus"],
239
- ["bike", "bike"],
240
- ["train", "train"],
241
- ["plane", "plane"],
242
- ["boat", "boat"],
243
- ["ship", "ship"],
244
- ["helicopter", "helicopter"],
245
- ["lorry", "lorry", "truck"],
246
- ["taxi", "taxi"],
247
- ["rocket", "rocket"],
248
- ["van", "van"],
249
- ["motorbike", "motorbike"],
250
- ["tram", "tram"],
251
- ["submarine", "submarine"]
252
- ], xi = [
253
- ["sun", "sun"],
254
- ["cloud", "cloud"],
255
- ["rain", "rain"],
256
- ["tree", "tree"],
257
- ["flower", "flower"],
258
- ["grass", "grass"],
259
- ["star", "star"],
260
- ["moon", "moon"],
261
- ["mountain", "mountain"],
262
- ["river", "river"],
263
- ["rainbow", "rainbow"],
264
- ["snowman", "snowman"],
265
- ["snow", "snow"],
266
- ["butterfly", "butterfly"],
267
- ["bird", "bird"]
268
- ], Hi = [
269
- ["bed", "bed"],
270
- ["table", "table"],
271
- ["chair", "chair"],
272
- ["door", "door"],
273
- ["window", "window"],
274
- ["lamp", "lamp"],
275
- ["sofa", "sofa"],
276
- ["clock", "clock"],
277
- ["key", "key"],
278
- ["phone", "phone"],
279
- ["tv", "TV"],
280
- ["cup", "cup"],
281
- ["plate", "plate"],
282
- ["mirror", "mirror"],
283
- ["book", "book"]
284
- ], Wi = [
285
- ["book", "book"],
286
- ["pen", "pen"],
287
- ["pencil", "pencil"],
288
- ["bag", "bag"],
289
- ["ruler", "ruler"],
290
- ["rubber", "rubber", "eraser"],
291
- ["desk", "desk"],
292
- ["board", "board"],
293
- ["crayon", "crayon"],
294
- ["glue", "glue"],
295
- ["scissors", "scissors"],
296
- ["notebook", "notebook"],
297
- ["pencil_case", "pencil case"],
298
- ["paintbrush", "paintbrush"],
299
- ["backpack", "backpack"]
300
- ], Q = {
301
- food: C(ai, "food"),
302
- animals: C(gi, "animals"),
303
- toys: C(pi, "toys"),
304
- clothes: C(li, "clothes"),
305
- transport: C(ci, "transport"),
306
- nature: C(xi, "nature"),
307
- home: C(Hi, "home"),
308
- school: C(Wi, "school")
309
- }, mi = [
310
- "animals",
311
- "food",
312
- "toys",
313
- "clothes",
314
- "transport",
315
- "nature",
316
- "home",
317
- "school"
318
- ], ui = {
319
- animals: "🐶 Animals",
320
- food: "🍎 Food",
321
- toys: "🧸 Toys",
322
- clothes: "👕 Clothes",
323
- transport: "🚗 Transport",
324
- nature: "🌳 Nature",
325
- home: "🏠 Home",
326
- school: "📚 School"
327
- }, fi = () => {
328
- const w = document.createElement("style");
329
- w.id = "whats-missing-reset", w.textContent = `
330
- #whats-missing-root, #whats-missing-root * {
331
- box-sizing: border-box;
332
- font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
333
- }
334
- #whats-missing-root img {
335
- max-width: 100%;
336
- height: auto;
337
- display: block;
338
- user-select: none;
339
- }
340
- html, body {
341
- margin: 0 !important;
342
- padding: 0 !important;
343
- width: 100% !important;
344
- height: 100% !important;
345
- overflow: hidden !important;
346
- zoom: 1 !important; /* ✅ защита от подзума */
347
- }
348
- #root {
349
- margin: 0 !important;
350
- padding: 0 !important;
351
- width: 100% !important;
352
- height: 100% !important;
353
- overflow: hidden !important;
354
- }
355
- `;
356
- const a = document.getElementById("whats-missing-reset");
357
- a && a.remove(), document.head.appendChild(w);
358
- };
359
- class yi {
360
- constructor(a) {
361
- this.seed = a;
362
- }
363
- // Linear Congruential Generator (LCG)
364
- // Используем параметры из Numerical Recipes
365
- next() {
366
- return this.seed = (this.seed * 1664525 + 1013904223) % Math.pow(2, 32), this.seed / Math.pow(2, 32);
367
- }
368
- // Генерирует случайное число от 0 до max (не включая max)
369
- nextInt(a) {
370
- return Math.floor(this.next() * a);
371
- }
372
- }
373
- const bi = (w, a) => {
374
- const g = Array.from({ length: w.length + 1 }, () => Array(a.length + 1).fill(0));
375
- for (let s = 0; s <= w.length; s++) g[s][0] = s;
376
- for (let s = 0; s <= a.length; s++) g[0][s] = s;
377
- for (let s = 1; s <= w.length; s++)
378
- for (let p = 1; p <= a.length; p++)
379
- g[s][p] = w[s - 1] === a[p - 1] ? g[s - 1][p - 1] : Math.min(g[s - 1][p - 1], g[s][p - 1], g[s - 1][p]) + 1;
380
- return g[w.length][a.length];
381
- }, ki = (w) => new Promise((a) => {
382
- const g = new Image();
383
- g.onload = () => a(g), g.onerror = () => a(g), g.src = w;
384
- }), cn = async (w, a) => {
385
- const g = /* @__PURE__ */ new Map(), s = w.map(async (p) => {
386
- const S = await ki(p);
387
- g.set(p, S);
388
- });
389
- return await Promise.allSettled(s), g;
390
- };
391
- function vi({
392
- gameCubeSize: w,
393
- screenHeight: a,
394
- screenWidth: g,
395
- seed: s
396
- }) {
397
- const p = F(null);
398
- _(() => (fi(), () => {
399
- document.documentElement.style.overflow = "", document.body.style.overflow = "";
400
- const i = document.getElementById("whats-missing-reset");
401
- i && i.remove(), P.current && P.current.abort();
402
- }), []);
403
- const [S, U] = r(null), [k, D] = r([]), [G, Ln] = r(4), [xn, en] = r(1), [B, Hn] = r(!1), [Y, Wn] = r(1), [z, Cn] = r(null), [T, O] = r("ready"), [mn, un] = r(10), [tn, on] = r(10), [wn, fn] = r(20), [Bn, dn] = r(0), [V, rn] = r(!1), [N, yn] = r(""), [A, hn] = r(!1), [sn, bn] = r(!1), [kn, $] = r(null), [An, an] = r([]), [En, vn] = r([]), [n, jn] = r(!1), [Dn, Z] = r(1), [Sn, q] = r(null), [I, Gn] = r(!1), [c, $n] = r(!1), [x, Fn] = r(!1), [H, _n] = r(!1), [W, Un] = r(!1), [m, Yn] = r(!1), [u, On] = r(!1), [f, Vn] = r(!1), [y, Nn] = r(!1), [M, Zn] = r(!1), gn = F(/* @__PURE__ */ new Set()), K = F(/* @__PURE__ */ new Map()), P = F(null), E = F(null);
404
- _(() => {
405
- s !== void 0 ? E.current = new yi(s) : E.current = null;
406
- }, [s]);
407
- const qn = () => E.current ? E.current.next() : Math.random(), In = (i) => E.current ? E.current.nextInt(i) : Math.floor(Math.random() * i);
408
- _(() => {
409
- const i = () => {
410
- const o = g ?? window.innerWidth, d = a ?? window.innerHeight, h = o < 768 || o === 926 && d === 428 || o === 932 && d === 430, b = d < 700, R = o / d > 1.8, v = o === 768 && d === 1024, zn = o === 1024 && d === 768, J = o === 820 && d === 1180, L = o === 1180 && d === 820, j = o === 540 && d === 720, ii = o === 720 && d === 540, ei = o === 1024 && d === 1366, ti = o === 1366 && d === 1024, oi = o >= 1200 && d >= 600 && !h;
411
- if (Gn(oi), $n(v), Fn(zn), _n(J), Un(L), Yn(j), On(ii), Vn(ei), Nn(ti), Zn(R), jn(h), h)
412
- q(w && w >= 320 ? w : null), Z(1);
413
- else if (b)
414
- q(w && w >= 400 ? w : null), Z(1);
415
- else if (R) {
416
- const ln = w ? Math.max(400, Math.min(1200, w)) : Math.min(1e3, Math.min(o, d) * 0.9);
417
- q(ln), Z(0.85);
418
- } else {
419
- const ln = w ? Math.max(400, Math.min(1200, w)) : Math.min(1e3, Math.min(o, d) * 0.9);
420
- q(ln), Z(1);
421
- }
422
- };
423
- return i(), window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
424
- }, [g, a, w]);
425
- const pn = (i) => [...i].sort(() => qn() - 0.5).slice(0, 6), Kn = (i) => {
426
- P.current && P.current.abort(), P.current = new AbortController();
427
- const d = Q[i].map((h) => h.src);
428
- cn(d, P.current.signal).then((h) => {
429
- d.forEach((b) => {
430
- gn.current.add(b), h.has(b) && K.current.set(b, h.get(b));
431
- });
432
- }).catch(() => {
433
- });
434
- }, Tn = () => {
435
- if (!S) return;
436
- const i = pn(Q[S]);
437
- D(i), Hn(!0), rn(!1), Wn(1), dn(0), an([]), vn([]);
438
- const o = i.map((d) => d.src);
439
- cn(o, P.current?.signal).then((d) => {
440
- o.forEach((h) => {
441
- gn.current.add(h), d.has(h) && K.current.set(h, d.get(h));
442
- });
443
- }).catch(() => {
444
- }), Pn(i, [], !0);
445
- }, Pn = (i = k, o = En, d = !1) => {
446
- const h = pn(i.length ? i : Q[S]);
447
- let b = In(h.length), R = h[b].name, v = 0;
448
- for (; o.includes(R) && v < 20; )
449
- b = In(h.length), R = h[b].name, v++;
450
- if (D(h), Cn(b), vn([...o, R]), hn(!1), yn(""), fn(20), $(null), S && !d) {
451
- const J = pn(Q[S].filter((L) => !o.includes(L.name))).map((L) => L.src);
452
- cn(J, P.current?.signal).then((L) => {
453
- J.forEach((j) => {
454
- gn.current.add(j), L.has(j) && K.current.set(j, L.get(j));
455
- });
456
- }).catch(() => {
457
- });
458
- }
459
- d ? (O("ready"), un(10), on(10)) : (O("memorize"), on(10));
460
- };
461
- _(() => {
462
- if (!(!B || V || A)) {
463
- if (T === "ready")
464
- if (mn <= 0) O("memorize");
465
- else {
466
- const i = setTimeout(() => un((o) => o - 1), 1e3);
467
- return () => clearTimeout(i);
468
- }
469
- if (T === "memorize")
470
- if (tn <= 0) O("guess");
471
- else {
472
- const i = setTimeout(() => on((o) => o - 1), 1e3);
473
- return () => clearTimeout(i);
474
- }
475
- if (T === "guess") {
476
- if (wn <= 0) {
477
- hn(!0), $("wrong");
478
- const o = k[z].name, d = k[z].aliases, h = [o, ...d || []].join(", ");
479
- an((b) => [
480
- ...b,
481
- { round: Y, answer: N, correct: h, result: "wrong" }
482
- ]);
483
- return;
484
- }
485
- const i = setTimeout(() => fn((o) => o - 1), 1e3);
486
- return () => clearTimeout(i);
487
- }
488
- }
489
- }, [
490
- T,
491
- mn,
492
- tn,
493
- wn,
494
- B,
495
- V,
496
- A,
497
- k,
498
- z,
499
- Y,
500
- N
501
- ]);
502
- const Jn = () => {
503
- if (z === null || sn) return;
504
- const i = k[z].name, o = k[z].aliases, d = N.toLowerCase().trim();
505
- let h = "wrong";
506
- const b = [i, ...o || []].map((v) => v.toLowerCase()), R = [i, ...o || []].join(", ");
507
- b.includes(d) ? (dn((v) => v + 1), $("correct"), h = "correct") : b.some((v) => bi(d, v) === 1) ? (dn((v) => v + 0.5), $("almost"), h = "almost") : ($("wrong"), h = "wrong"), an((v) => [
508
- ...v,
509
- { round: Y, answer: d, correct: R, result: h }
510
- ]), bn(!0), setTimeout(() => {
511
- bn(!1), hn(!0);
512
- }, 600);
513
- }, Qn = () => Y < G ? (Wn((i) => i + 1), Pn()) : rn(!0), Xn = () => {
514
- P.current && P.current.abort(), Hn(!1), rn(!1), U(null), en(2);
515
- }, ni = Rn(() => (
516
- // ensure logo is positioned inside the square container
517
- /* @__PURE__ */ t("div", { style: { ...e.gmLogoFixed, position: "absolute", top: 28, left: 16, zIndex: 30 }, children: /* @__PURE__ */ l("picture", { children: [
518
- /* @__PURE__ */ t(
519
- "source",
520
- {
521
- srcSet: window.origin + "/cloud/speakid/games/whatsmissing/logo.svg",
522
- type: "image/svg+xml"
523
- }
524
- ),
525
- /* @__PURE__ */ t(
526
- "img",
527
- {
528
- src: window.origin + "/cloud/speakid/games/whatsmissing/logo.png",
529
- alt: "SPEAKID Logo",
530
- style: e.gmLogoImg,
531
- loading: "lazy"
532
- }
533
- )
534
- ] }) })
535
- ), []);
536
- return /* @__PURE__ */ l(
537
- "div",
538
- {
539
- ref: p,
540
- style: {
541
- width: "100%",
542
- height: "100%",
543
- display: "flex",
544
- justifyContent: "center",
545
- alignItems: "center",
546
- background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
547
- transition: "background 0.3s ease",
548
- overflow: "hidden",
549
- position: "absolute",
550
- top: 0,
551
- left: 0,
552
- right: 0,
553
- bottom: 0
554
- },
555
- children: [
556
- ni,
557
- /* @__PURE__ */ t(
558
- "div",
559
- {
560
- style: {
561
- width: n ? "100%" : Sn || w || 1e3,
562
- height: n ? "100%" : Sn || w || 1e3,
563
- display: "flex",
564
- justifyContent: "center",
565
- alignItems: "center",
566
- overflow: "hidden",
567
- borderRadius: 0,
568
- background: "transparent",
569
- boxShadow: "none",
570
- margin: "0 auto",
571
- position: "relative",
572
- // needed so absolute logo is inside the square
573
- transform: `scale(${Dn})`
574
- // ✅ Применяем масштаб для широких экранов
575
- },
576
- children: /* @__PURE__ */ t(
577
- "div",
578
- {
579
- style: {
580
- transform: "translateZ(0)",
581
- width: "100%",
582
- height: "100%",
583
- display: "flex",
584
- justifyContent: "center",
585
- alignItems: "center"
586
- },
587
- children: /* @__PURE__ */ l("div", { id: "whats-missing-root", style: { position: "relative", width: "100%", height: "100%" }, children: [
588
- !S && !B && xn === 1 && /* @__PURE__ */ l("div", { style: { ...e.gmCenterScreen, transform: "none" }, children: [
589
- /* @__PURE__ */ t("h1", { style: e.gmHeadline1, children: "WHAT'S MISSING?" }),
590
- /* @__PURE__ */ l("div", { style: { marginTop: 24 }, children: [
591
- /* @__PURE__ */ t("p", { style: e.gmBodyS, children: "Choose number of rounds:" }),
592
- /* @__PURE__ */ t(
593
- "div",
594
- {
595
- style: {
596
- display: "flex",
597
- gap: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
598
- marginTop: 8
599
- },
600
- children: [3, 4, 5].map((i) => /* @__PURE__ */ t(
601
- "button",
602
- {
603
- style: {
604
- ...e.gmButton,
605
- ...G === i ? e.gmButtonActive : {},
606
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "8px 12px" : "14px 28px",
607
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "13px" : "18px",
608
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "48px" : "64px"
609
- },
610
- onClick: () => Ln(i),
611
- children: i
612
- },
613
- i
614
- ))
615
- }
616
- )
617
- ] }),
618
- /* @__PURE__ */ t(
619
- "button",
620
- {
621
- style: {
622
- ...e.gmButton,
623
- marginTop: 24,
624
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "10px 20px" : "14px 30px",
625
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "15px" : "18px",
626
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "132px" : "160px"
627
- },
628
- onClick: () => en(2),
629
- children: "Play"
630
- }
631
- )
632
- ] }),
633
- !S && !B && xn === 2 && /* @__PURE__ */ l("div", { style: e.gmCenterScreen, children: [
634
- /* @__PURE__ */ t("p", { style: e.gmBodyM, children: "Select a theme:" }),
635
- /* @__PURE__ */ l("p", { style: e.gmBodyS, children: [
636
- "Rounds: ",
637
- G
638
- ] }),
639
- /* @__PURE__ */ t(
640
- "div",
641
- {
642
- style: {
643
- display: "grid",
644
- gridTemplateColumns: n ? "repeat(2, 1fr)" : "repeat(4, 1fr)",
645
- gap: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "8px" : "12px",
646
- maxWidth: n ? 280 : 420,
647
- margin: "0 auto"
648
- },
649
- children: mi.map((i) => /* @__PURE__ */ t(
650
- "button",
651
- {
652
- style: {
653
- ...e.gmButton,
654
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "8px 12px" : "10px 16px",
655
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "12px" : "14px"
656
- },
657
- onClick: () => {
658
- U(i), Kn(i);
659
- },
660
- children: ui[i]
661
- },
662
- i
663
- ))
664
- }
665
- ),
666
- /* @__PURE__ */ t(
667
- "button",
668
- {
669
- style: {
670
- ...e.gmButton,
671
- marginTop: 24,
672
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "8px 16px" : "12px 24px",
673
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px",
674
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "120px" : "auto"
675
- },
676
- onClick: () => en(1),
677
- children: "Back"
678
- }
679
- )
680
- ] }),
681
- S && !B && /* @__PURE__ */ l("div", { style: e.gmCenterScreen, children: [
682
- /* @__PURE__ */ l("h1", { style: e.gmHeadline1, children: [
683
- "Theme selected: ",
684
- S
685
- ] }),
686
- /* @__PURE__ */ l("p", { style: e.gmBodyM, children: [
687
- "Rounds: ",
688
- G
689
- ] }),
690
- /* @__PURE__ */ t(
691
- "button",
692
- {
693
- style: {
694
- ...e.gmButton,
695
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "8px 16px" : "12px 24px",
696
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px",
697
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "120px" : "auto"
698
- },
699
- onClick: Tn,
700
- children: "▶ Start game"
701
- }
702
- )
703
- ] }),
704
- V && /* @__PURE__ */ l("div", { style: e.gmCenterScreen, children: [
705
- /* @__PURE__ */ t(
706
- "h1",
707
- {
708
- style: {
709
- ...e.gmHeadline1,
710
- marginTop: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "0px" : e.gmHeadline1.marginTop,
711
- marginBottom: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "2px" : e.gmHeadline1.marginBottom
712
- },
713
- children: "Results"
714
- }
715
- ),
716
- /* @__PURE__ */ l(
717
- "h2",
718
- {
719
- style: {
720
- ...e.gmHeadline3,
721
- marginTop: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "0px" : e.gmHeadline3.marginTop,
722
- marginBottom: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "2px" : e.gmHeadline3.marginBottom
723
- },
724
- children: [
725
- "Your score: ",
726
- Bn,
727
- " / ",
728
- G
729
- ]
730
- }
731
- ),
732
- /* @__PURE__ */ t(
733
- "p",
734
- {
735
- style: {
736
- ...e.gmBodyM,
737
- color: "#10b981",
738
- marginTop: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "0px" : "12px",
739
- marginBottom: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "2px" : e.gmBodyM.marginBottom
740
- },
741
- children: "Yahoo! You did it! 🍬✨"
742
- }
743
- ),
744
- /* @__PURE__ */ l(
745
- "table",
746
- {
747
- style: {
748
- ...e.gmTable,
749
- marginTop: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "0px" : "20px",
750
- marginBottom: n && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || c || x || H || W || m || u || f || y ? "4px" : "32px"
751
- },
752
- children: [
753
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { children: [
754
- /* @__PURE__ */ t("th", { children: "Round" }),
755
- /* @__PURE__ */ t("th", { children: "Your Answer" }),
756
- /* @__PURE__ */ t("th", { children: "Correct" }),
757
- /* @__PURE__ */ t("th", { children: "Result" })
758
- ] }) }),
759
- /* @__PURE__ */ t("tbody", { children: An.map((i, o) => /* @__PURE__ */ l("tr", { children: [
760
- /* @__PURE__ */ t("td", { style: e.gmTableCell, children: i.round }),
761
- /* @__PURE__ */ t("td", { style: e.gmTableCell, children: i.answer || "—" }),
762
- /* @__PURE__ */ t("td", { style: e.gmTableCell, children: i.correct }),
763
- /* @__PURE__ */ t("td", { style: e.gmTableCell, children: i.result === "correct" ? "✔ Correct" : i.result === "almost" ? "◐ Almost (0.5)" : "✘ Wrong" })
764
- ] }, o)) })
765
- ]
766
- }
767
- ),
768
- /* @__PURE__ */ l(
769
- "div",
770
- {
771
- style: {
772
- display: "flex",
773
- gap: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
774
- marginTop: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I ? "12px" : "24px"
775
- },
776
- children: [
777
- /* @__PURE__ */ t(
778
- "button",
779
- {
780
- style: {
781
- ...e.gmButton,
782
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px 10px" : "12px 24px",
783
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "12px" : "16px",
784
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "80px" : "auto"
785
- },
786
- onClick: Tn,
787
- children: "🔁 Play again"
788
- }
789
- ),
790
- /* @__PURE__ */ t(
791
- "button",
792
- {
793
- style: {
794
- ...e.gmButton,
795
- padding: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px 10px" : "12px 24px",
796
- fontSize: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "12px" : "16px",
797
- minWidth: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "80px" : "auto"
798
- },
799
- onClick: Xn,
800
- children: "⬅️ Choose theme"
801
- }
802
- )
803
- ]
804
- }
805
- )
806
- ] }),
807
- B && !V && /* @__PURE__ */ l("div", { style: e.gmGameLayout, children: [
808
- /* @__PURE__ */ l(
809
- "div",
810
- {
811
- style: {
812
- minHeight: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "45px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "50px" : n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "60px" : "160px",
813
- display: "flex",
814
- flexDirection: "column",
815
- justifyContent: "center",
816
- alignItems: "center",
817
- paddingTop: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "8px" : n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "15px" : "40px"
818
- },
819
- children: [
820
- T === "ready" && /* @__PURE__ */ l(Mn, { children: [
821
- /* @__PURE__ */ t("h1", { style: { ...e.gmHeadline1, color: "#ec4c44" }, children: "GET READY" }),
822
- /* @__PURE__ */ t("div", { style: e.gmHourglass, children: "⏳" })
823
- ] }),
824
- T === "memorize" && /* @__PURE__ */ l("p", { style: { ...e.gmBodyM, color: "#10b981" }, children: [
825
- "MEMORIZE (",
826
- tn,
827
- ")"
828
- ] }),
829
- T === "guess" && !A && /* @__PURE__ */ l("p", { style: e.gmBodyM, children: [
830
- "⏳ Time left: ",
831
- wn,
832
- "s"
833
- ] })
834
- ]
835
- }
836
- ),
837
- T !== "ready" && /* @__PURE__ */ t(
838
- "div",
839
- {
840
- style: {
841
- ...e.gmGrid,
842
- ...M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? { width: "100%" } : {},
843
- // ✅ Широкие экраны: полная ширина грида
844
- gridTemplateColumns: n && window.innerWidth > window.innerHeight || n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "repeat(3, 1fr)" : n ? "repeat(2, 1fr)" : window.innerHeight < 700 ? "repeat(3, 1fr)" : typeof window < "u" && window.innerWidth === 1280 && window.innerHeight === 720 ? "repeat(3, 130px)" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "repeat(3, 150px)" : "repeat(3, 210px)",
845
- // desktop: 3 колонки фиксированного размера
846
- gridAutoRows: n && window.innerWidth > window.innerHeight ? "120px" : n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "100px" : n ? "150px" : window.innerHeight < 700 ? "140px" : typeof window < "u" && window.devicePixelRatio >= 1.25 && window.devicePixelRatio <= 1.5 ? "240px" : typeof window < "u" && window.innerWidth === 1280 && window.innerHeight === 720 ? "130px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "150px" : "210px",
847
- // desktop: стандартная высота
848
- gap: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "12px" : n || window.innerHeight < 700 ? "8px" : typeof window < "u" && window.devicePixelRatio >= 1.25 && window.devicePixelRatio <= 1.5 ? "24px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "12px" : "20px",
849
- justifyItems: "center",
850
- maxWidth: n && window.innerWidth > window.innerHeight ? "90%" : n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "95%" : "100%",
851
- padding: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "8px" : typeof window < "u" && window.devicePixelRatio >= 1.25 && window.devicePixelRatio <= 1.5 ? "20px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 ? "10px" : "16px"
852
- },
853
- children: k.map((i, o) => {
854
- const d = z === o && T === "guess" && !A;
855
- return /* @__PURE__ */ t(
856
- "div",
857
- {
858
- style: {
859
- width: "100%",
860
- height: "100%",
861
- borderRadius: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "6px" : "12px",
862
- overflow: "hidden",
863
- backgroundColor: "#ffffff",
864
- boxShadow: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "0 1px 4px rgba(0,0,0,0.1)" : "0 4px 12px rgba(0,0,0,0.15)",
865
- transition: "all 0.3s ease",
866
- cursor: "pointer",
867
- ...kn === "correct" && z === o ? {
868
- boxShadow: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "0 0 15px #10b981" : "0 0 20px #10b981",
869
- transform: "scale(1.03)"
870
- } : {},
871
- ...kn === "wrong" && z === o ? {
872
- boxShadow: n && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "0 0 15px #ef4444" : "0 0 20px #ef4444",
873
- transform: "scale(1.03)"
874
- } : {}
875
- },
876
- children: !d && (() => {
877
- const h = K.current.get(i.src), b = h?.complete && h.src ? h.src : i.src;
878
- return /* @__PURE__ */ t(
879
- "img",
880
- {
881
- src: b,
882
- alt: i.name,
883
- fetchPriority: "high",
884
- loading: "eager",
885
- decoding: "async",
886
- style: {
887
- width: "100%",
888
- height: "100%",
889
- objectFit: "contain",
890
- objectPosition: "center"
891
- }
892
- },
893
- `${i.src}-${h?.complete ? "loaded" : "pending"}`
894
- );
895
- })()
896
- },
897
- o
898
- );
899
- })
900
- }
901
- ),
902
- /* @__PURE__ */ l(
903
- "div",
904
- {
905
- style: {
906
- marginTop: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "1px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "4px" : "16px",
907
- height: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "40px" : M || typeof window < "u" && window.innerWidth / window.innerHeight > 1.8 || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "50px" : "80px"
908
- },
909
- children: [
910
- T === "guess" && !A && /* @__PURE__ */ t(
911
- "div",
912
- {
913
- style: {
914
- display: "flex",
915
- flexDirection: "row",
916
- flexWrap: "nowrap",
917
- alignItems: "center",
918
- justifyContent: "center",
919
- minWidth: 0,
920
- gap: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "3px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y ? "8px" : n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "6px" : "12px",
921
- width: "100%",
922
- maxWidth: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "270px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "400px" : "300px"
923
- },
924
- children: /* @__PURE__ */ l(Mn, { children: [
925
- /* @__PURE__ */ t(
926
- "input",
927
- {
928
- type: "text",
929
- placeholder: "Type the missing word",
930
- value: N,
931
- onChange: (i) => yn(i.target.value),
932
- style: {
933
- ...e.gmInput,
934
- flex: "1 1 0",
935
- minWidth: 0,
936
- width: "auto",
937
- maxWidth: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "170px" : (window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700, "250px"),
938
- padding: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "5px 6px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "10px 12px" : "12px 16px",
939
- boxSizing: "border-box",
940
- fontSize: n && window.innerWidth <= 375 && window.innerHeight <= 667 || n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 ? "10px" : window.innerWidth === 896 && window.innerHeight === 414 ? "11px" : window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "10px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "14px" : "16px"
941
- }
942
- }
943
- ),
944
- /* @__PURE__ */ t(
945
- "button",
946
- {
947
- style: {
948
- ...e.gmButton,
949
- marginLeft: 0,
950
- padding: n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "5px 8px" : n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "6px 10px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "10px 16px" : "12px 24px",
951
- fontSize: n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "10px" : n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "11px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "14px" : "16px",
952
- minWidth: n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "45px" : n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "55px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "80px" : "100px",
953
- flexShrink: 0
954
- },
955
- onClick: Jn,
956
- disabled: sn,
957
- children: sn ? "..." : "Check"
958
- }
959
- )
960
- ] })
961
- }
962
- ),
963
- A && /* @__PURE__ */ t(
964
- "button",
965
- {
966
- style: {
967
- ...e.gmButton,
968
- padding: n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "5px 8px" : n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "6px 10px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "10px 16px" : "12px 24px",
969
- fontSize: n && window.innerWidth <= 375 && window.innerHeight <= 667 ? "10px" : n && window.innerWidth > window.innerHeight && window.innerHeight <= 428 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 ? "11px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || I || c || x || H || W || m || u || f || y || n && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "14px" : "16px"
970
- },
971
- onClick: Qn,
972
- children: "Next round"
973
- }
974
- )
975
- ]
976
- }
977
- )
978
- ] })
979
- ] })
980
- }
981
- )
982
- }
983
- )
984
- ]
985
- }
986
- );
987
- }
988
- const X = 1280, nn = 720;
989
- function Si(w, a) {
990
- const g = Math.min(w, a);
991
- return w <= 768 ? Math.max(280, w - 20) : Math.max(400, Math.min(1200, g - 40));
992
- }
993
- function Pi({
994
- gameCubeSize: w,
995
- screenHeight: a,
996
- screenWidth: g,
997
- seed: s
998
- }) {
999
- const [p, S] = r(() => ({
1000
- width: typeof window < "u" ? window.innerWidth : X,
1001
- height: typeof window < "u" ? window.innerHeight : nn
1002
- }));
1003
- _(() => {
1004
- const k = () => {
1005
- S({
1006
- width: window.innerWidth,
1007
- height: window.innerHeight
1008
- });
1009
- };
1010
- k(), window.addEventListener("resize", k), window.addEventListener("orientationchange", k);
1011
- const D = new ResizeObserver(k);
1012
- return D.observe(document.documentElement), () => {
1013
- window.removeEventListener("resize", k), window.removeEventListener("orientationchange", k), D.disconnect();
1014
- };
1015
- }, []);
1016
- const U = Rn(() => Math.min(p.width / X, p.height / nn), [p.width, p.height]);
1017
- return /* @__PURE__ */ t(
1018
- "div",
1019
- {
1020
- style: {
1021
- position: "relative",
1022
- width: "100%",
1023
- height: "100%",
1024
- overflow: "hidden"
1025
- },
1026
- children: /* @__PURE__ */ t(
1027
- "div",
1028
- {
1029
- style: {
1030
- position: "absolute",
1031
- left: "50%",
1032
- top: "50%",
1033
- width: `${X}px`,
1034
- height: `${nn}px`,
1035
- transform: `translate(-50%, -50%) scale(${U})`,
1036
- transformOrigin: "center center"
1037
- },
1038
- children: /* @__PURE__ */ t(
1039
- "div",
1040
- {
1041
- style: {
1042
- width: `${X}px`,
1043
- height: `${nn}px`,
1044
- position: "relative",
1045
- overflow: "hidden"
1046
- },
1047
- children: /* @__PURE__ */ t(
1048
- vi,
1049
- {
1050
- gameCubeSize: w ?? Si(p.width, p.height),
1051
- screenWidth: g ?? p.width,
1052
- screenHeight: a ?? p.height,
1053
- seed: s
1054
- }
1055
- )
1056
- }
1057
- )
1058
- }
1059
- )
1060
- }
1061
- );
1062
- }
1063
- export {
1064
- Pi as AdaptiveGameShell,
1065
- Pi as Game,
1066
- vi as RawGame,
1067
- Q as themes
1068
- };