{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "2048-game",
  "title": "2048 Game",
  "description": "A fully playable 2048, arrow-key and swipe controls, spring-animated tile merges, score and best-score tracking, and win/game-over overlays.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/2048-game/2048-game.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nconst SIZE = 4;\n\nexport type Game2048Theme = \"classic\" | \"neon\" | \"gold\" | \"night\";\nexport type Game2048Trigger = \"manual\" | \"delay\" | \"scroll\";\nexport type Game2048WidgetPosition = \"bottom-right\" | \"bottom-left\";\ntype MoveDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\ninterface ThemeConfig {\n  title: string;\n  subtitle: string;\n  buttonText: string;\n  triggerText: string;\n  glow: string;\n  background: string;\n  lightBackground: string;\n}\n\nconst THEMES: Record<Game2048Theme, ThemeConfig> = {\n  classic: {\n    title: \"2048\",\n    subtitle: \"Slide tiles. Reach 2048.\",\n    buttonText: \"New Game\",\n    triggerText: \"Play 2048\",\n    glow: \"rgba(255,255,255,0.16)\",\n    background: \"linear-gradient(160deg, #07080b 0%, #101319 100%)\",\n    lightBackground: \"linear-gradient(160deg, #f4f6fa 0%, #dfe6f0 100%)\",\n  },\n  neon: {\n    title: \"Merge Lab\",\n    subtitle: \"Keep the board alive\",\n    buttonText: \"Reset Board\",\n    triggerText: \"Open 2048\",\n    glow: \"rgba(129,140,248,0.22)\",\n    background: \"linear-gradient(160deg, #06050c 0%, #100a1c 100%)\",\n    lightBackground: \"linear-gradient(160deg, #eef2ff 0%, #e0e7ff 100%)\",\n  },\n  gold: {\n    title: \"High Score\",\n    subtitle: \"Beat your best run\",\n    buttonText: \"New Run\",\n    triggerText: \"Play a Round\",\n    glow: \"rgba(251,191,36,0.20)\",\n    background: \"linear-gradient(160deg, #0c0904 0%, #1a1206 100%)\",\n    lightBackground: \"linear-gradient(160deg, #fff7ed 0%, #fde8cf 100%)\",\n  },\n  night: {\n    title: \"Quiet Board\",\n    subtitle: \"Arrows or swipe to move\",\n    buttonText: \"New Game\",\n    triggerText: \"Start 2048\",\n    glow: \"rgba(45,212,191,0.20)\",\n    background: \"linear-gradient(160deg, #04080a 0%, #081619 100%)\",\n    lightBackground: \"linear-gradient(160deg, #ecfeff 0%, #cffafe 100%)\",\n  },\n};\n\nconst TILE_DARK: Record<number, string> = {\n  2: \"rgba(255,255,255,0.08)\",\n  4: \"rgba(255,255,255,0.12)\",\n  8: \"rgba(255,255,255,0.18)\",\n  16: \"rgba(255,255,255,0.24)\",\n  32: \"rgba(255,255,255,0.32)\",\n  64: \"rgba(255,255,255,0.40)\",\n  128: \"rgba(255,255,255,0.52)\",\n  256: \"rgba(255,255,255,0.64)\",\n  512: \"rgba(255,255,255,0.74)\",\n  1024: \"rgba(255,255,255,0.86)\",\n  2048: \"#ffffff\",\n  4096: \"#ffffff\",\n  8192: \"#ffffff\",\n};\n\nconst TILE_LIGHT: Record<number, string> = {\n  2: \"rgba(23,26,33,0.06)\",\n  4: \"rgba(23,26,33,0.10)\",\n  8: \"rgba(23,26,33,0.16)\",\n  16: \"rgba(23,26,33,0.22)\",\n  32: \"rgba(23,26,33,0.30)\",\n  64: \"rgba(23,26,33,0.38)\",\n  128: \"rgba(23,26,33,0.50)\",\n  256: \"rgba(23,26,33,0.62)\",\n  512: \"rgba(23,26,33,0.74)\",\n  1024: \"#171a21\",\n  2048: \"#171a21\",\n  4096: \"#171a21\",\n  8192: \"#171a21\",\n};\n\nfunction GiftGridIcon() {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n      <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" fill=\"#fffceb\" />\n      <rect x=\"13\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" fill=\"#ffc93c\" />\n      <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" fill=\"#ffc93c\" />\n      <rect x=\"13\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" fill=\"#fffceb\" />\n    </svg>\n  );\n}\n\nfunction addRandomTile(b: number[]) {\n  const empty: number[] = [];\n  b.forEach((v, i) => v === 0 && empty.push(i));\n  if (empty.length === 0) return b;\n  const idx = empty[Math.floor(Math.random() * empty.length)];\n  b[idx] = Math.random() < 0.9 ? 2 : 4;\n  return b;\n}\n\nfunction slide(row: number[]) {\n  let arr = row.filter((v) => v !== 0);\n  let scoreAdd = 0;\n  for (let i = 0; i < arr.length - 1; i++) {\n    if (arr[i] === arr[i + 1]) {\n      arr[i] *= 2;\n      scoreAdd += arr[i];\n      arr[i + 1] = 0;\n    }\n  }\n  arr = arr.filter((v) => v !== 0);\n  while (arr.length < SIZE) arr.push(0);\n  return { row: arr, scoreAdd };\n}\n\nfunction isGameOver(b: number[]) {\n  if (b.includes(0)) return false;\n  for (let r = 0; r < SIZE; r++) {\n    for (let c = 0; c < SIZE; c++) {\n      const v = b[r * SIZE + c];\n      if (c < SIZE - 1 && v === b[r * SIZE + c + 1]) return false;\n      if (r < SIZE - 1 && v === b[(r + 1) * SIZE + c]) return false;\n    }\n  }\n  return true;\n}\n\nexport interface Game2048Props extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  theme?: Game2048Theme;\n  lightMode?: boolean;\n  accentColor?: string;\n  asPopup?: boolean;\n  trigger?: Game2048Trigger;\n  delaySeconds?: number;\n  widgetPosition?: Game2048WidgetPosition;\n  widgetIcon?: string;\n  storageKey?: string;\n}\n\nexport function Game2048({\n  theme = \"classic\",\n  lightMode = false,\n  accentColor = \"#ffffff\",\n  asPopup = false,\n  trigger = \"manual\",\n  delaySeconds = 4,\n  widgetPosition = \"bottom-right\",\n  widgetIcon,\n  storageKey = \"\",\n  className,\n  style,\n  ...props\n}: Game2048Props) {\n  const uid = React.useId();\n  const rootRef = React.useRef<HTMLDivElement>(null);\n  const gameRootRef = React.useRef<HTMLDivElement>(null);\n  const widgetTriggerRef = React.useRef<HTMLButtonElement>(null);\n  const delayTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const wasPopupOpenRef = React.useRef(false);\n  const touchStart = React.useRef({ x: 0, y: 0 });\n\n  const suffix = storageKey.trim() ? `-${storageKey.trim()}` : \"\";\n  const bestKey = `2048-best${suffix}`;\n\n  const [board, setBoard] = React.useState<number[]>([]);\n  const [score, setScore] = React.useState(0);\n  const [best, setBest] = React.useState(() => {\n    if (typeof window === \"undefined\") return 0;\n    try {\n      const saved = localStorage.getItem(bestKey);\n      return saved ? parseInt(saved, 10) : 0;\n    } catch {\n      return 0;\n    }\n  });\n  const [status, setStatus] = React.useState<\"playing\" | \"won\" | \"lost\">(\"playing\");\n  const [won, setWon] = React.useState(false);\n  const [popupOpen, setPopupOpen] = React.useState(!asPopup);\n  const [scrollTriggered, setScrollTriggered] = React.useState(false);\n  const [prevAsPopup, setPrevAsPopup] = React.useState(asPopup);\n  const [focused, setFocused] = React.useState(false);\n\n  if (asPopup !== prevAsPopup) {\n    setPrevAsPopup(asPopup);\n    setPopupOpen(!asPopup);\n  }\n\n  const activeTheme = THEMES[theme];\n  const widgetOnRight = widgetPosition !== \"bottom-left\";\n  const widgetGlowStrong = activeTheme.glow.replace(/,\\s*[\\d.]+\\)$/, \", 0.85)\");\n  const resolvedAccent = accentColor || \"#ffffff\";\n\n  const mode = lightMode\n    ? {\n        ink: \"#171a21\",\n        inkFaint: \"rgba(23,26,33,0.4)\",\n        divider: \"rgba(23,26,33,0.18)\",\n        surface: \"rgba(255,255,255,0.65)\",\n        surfaceBorder: \"rgba(23,26,33,0.1)\",\n        cardBorder: \"rgba(23,26,33,0.08)\",\n        overlayBg: \"rgba(255,255,255,0.86)\",\n        modalBg: \"rgba(255,255,255,0.75)\",\n        modalBorder: \"rgba(23,26,33,0.12)\",\n        chromeBg: \"#ffffff\",\n        chromeBorder: \"rgba(23,26,33,0.1)\",\n        boardBg: \"rgba(23,26,33,0.06)\",\n        cellBg: \"rgba(23,26,33,0.06)\",\n        tileInkHigh: \"#ffffff\",\n        tileInkLow: \"#171a21\",\n        focusRing: \"0 0 0 2px rgba(23,26,33,0.35)\",\n      }\n    : {\n        ink: \"#ffffff\",\n        inkFaint: \"rgba(255,255,255,0.4)\",\n        divider: \"rgba(255,255,255,0.3)\",\n        surface: \"rgba(255,255,255,0.06)\",\n        surfaceBorder: \"rgba(255,255,255,0.12)\",\n        cardBorder: \"rgba(255,255,255,0.08)\",\n        overlayBg: \"rgba(4,4,6,0.86)\",\n        modalBg: \"rgba(255,255,255,0.06)\",\n        modalBorder: \"rgba(255,255,255,0.16)\",\n        chromeBg: \"rgba(10,10,15,0.92)\",\n        chromeBorder: \"rgba(255,255,255,0.16)\",\n        boardBg: \"rgba(255,255,255,0.04)\",\n        cellBg: \"rgba(255,255,255,0.05)\",\n        tileInkHigh: \"#0a0a0f\",\n        tileInkLow: \"#ffffff\",\n        focusRing: \"0 0 0 2px rgba(255,255,255,0.45)\",\n      };\n\n  const tilePalette = lightMode ? TILE_LIGHT : TILE_DARK;\n\n  const init = React.useCallback(() => {\n    const empty = Array(SIZE * SIZE).fill(0);\n    addRandomTile(empty);\n    addRandomTile(empty);\n    setBoard(empty);\n    setScore(0);\n    setStatus(\"playing\");\n    setWon(false);\n  }, []);\n\n  React.useEffect(() => {\n    init();\n  }, [init]);\n\n  React.useEffect(() => () => clearTimeout(delayTimerRef.current), []);\n\n  React.useEffect(() => {\n    if (!asPopup || trigger !== \"delay\") return;\n    clearTimeout(delayTimerRef.current);\n    delayTimerRef.current = setTimeout(() => setPopupOpen(true), delaySeconds * 1000);\n    return () => clearTimeout(delayTimerRef.current);\n  }, [asPopup, trigger, delaySeconds]);\n\n  React.useEffect(() => {\n    if (!asPopup || trigger !== \"scroll\" || !rootRef.current) return;\n    const el = rootRef.current;\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && !scrollTriggered) {\n          setScrollTriggered(true);\n          setPopupOpen(true);\n        }\n      },\n      { threshold: 0.4 },\n    );\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, [asPopup, trigger, scrollTriggered]);\n\n  React.useEffect(() => {\n    if (!asPopup) return;\n    if (popupOpen) gameRootRef.current?.focus();\n    else if (wasPopupOpenRef.current) widgetTriggerRef.current?.focus();\n    wasPopupOpenRef.current = popupOpen;\n  }, [asPopup, popupOpen]);\n\n  const move = React.useCallback(\n    (direction: MoveDirection) => {\n      setBoard((prevBoard) => {\n        if (status === \"lost\" || prevBoard.length === 0) return prevBoard;\n        const newBoard = [...prevBoard];\n        let moved = false;\n        let scoreAdd = 0;\n\n        const get = (r: number, c: number) => newBoard[r * SIZE + c];\n        const set = (r: number, c: number, v: number) => (newBoard[r * SIZE + c] = v);\n\n        if (direction === \"left\" || direction === \"right\") {\n          for (let r = 0; r < SIZE; r++) {\n            const row: number[] = [];\n            for (let c = 0; c < SIZE; c++) row.push(get(r, c));\n            if (direction === \"right\") row.reverse();\n            const result = slide(row);\n            if (direction === \"right\") result.row.reverse();\n            for (let c = 0; c < SIZE; c++) {\n              if (get(r, c) !== result.row[c]) moved = true;\n              set(r, c, result.row[c]);\n            }\n            scoreAdd += result.scoreAdd;\n          }\n        } else {\n          for (let c = 0; c < SIZE; c++) {\n            const col: number[] = [];\n            for (let r = 0; r < SIZE; r++) col.push(get(r, c));\n            if (direction === \"down\") col.reverse();\n            const result = slide(col);\n            if (direction === \"down\") result.row.reverse();\n            for (let r = 0; r < SIZE; r++) {\n              if (get(r, c) !== result.row[r]) moved = true;\n              set(r, c, result.row[r]);\n            }\n            scoreAdd += result.scoreAdd;\n          }\n        }\n\n        if (!moved) return prevBoard;\n\n        addRandomTile(newBoard);\n        setScore((s) => {\n          const next = s + scoreAdd;\n          setBest((b) => {\n            const nextBest = next > b ? next : b;\n            if (nextBest > b) {\n              try {\n                localStorage.setItem(bestKey, nextBest.toString());\n              } catch {\n                /* ignore */\n              }\n            }\n            return nextBest;\n          });\n          return next;\n        });\n        if (!won && newBoard.includes(2048)) {\n          setWon(true);\n          setStatus(\"won\");\n        }\n        if (isGameOver(newBoard)) setStatus(\"lost\");\n        return newBoard;\n      });\n    },\n    [status, won, bestKey],\n  );\n\n  const onCardKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    if (e.key === \"Escape\" && asPopup) {\n      setPopupOpen(false);\n      return;\n    }\n    const map: Record<string, MoveDirection> = {\n      ArrowUp: \"up\",\n      ArrowDown: \"down\",\n      ArrowLeft: \"left\",\n      ArrowRight: \"right\",\n      w: \"up\",\n      W: \"up\",\n      s: \"down\",\n      S: \"down\",\n      a: \"left\",\n      A: \"left\",\n      d: \"right\",\n      D: \"right\",\n    };\n    const dir = map[e.key];\n    if (!dir) return;\n    e.preventDefault();\n    move(dir);\n  };\n\n  const handlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n    touchStart.current = { x: e.clientX, y: e.clientY };\n    e.currentTarget.setPointerCapture?.(e.pointerId);\n  };\n\n  const handlePointerUp = (e: React.PointerEvent<HTMLDivElement>) => {\n    const deltaX = e.clientX - touchStart.current.x;\n    const deltaY = e.clientY - touchStart.current.y;\n    if (Math.abs(deltaX) < 30 && Math.abs(deltaY) < 30) return;\n    if (Math.abs(deltaX) > Math.abs(deltaY)) move(deltaX > 0 ? \"right\" : \"left\");\n    else move(deltaY > 0 ? \"down\" : \"up\");\n  };\n\n  const gameCard = (\n    <div\n      ref={gameRootRef}\n      tabIndex={0}\n      role=\"application\"\n      aria-label={`${activeTheme.title} number puzzle`}\n      onKeyDown={onCardKeyDown}\n      onPointerDown={() => gameRootRef.current?.focus()}\n      onFocus={() => setFocused(true)}\n      onBlur={() => setFocused(false)}\n      className=\"relative box-border flex w-full touch-none flex-col items-center overflow-hidden rounded-[22px] px-6.5 py-8 font-sans outline-none select-none\"\n      style={{\n        background: lightMode ? activeTheme.lightBackground : activeTheme.background,\n        border: `1px solid ${mode.cardBorder}`,\n        boxShadow: focused ? mode.focusRing : \"none\",\n        ...(asPopup ? { maxHeight: \"calc(100vh - 48px)\", overflowY: \"auto\" } : {}),\n      }}\n    >\n      <header className=\"mb-4.5 w-full text-center\">\n        <h2 id={`${uid}-title`} className=\"m-0 font-serif text-[25px] font-normal tracking-[-0.02em]\" style={{ color: mode.ink }}>\n          {activeTheme.title}\n        </h2>\n        <div className=\"mx-auto my-3 h-px w-8\" style={{ background: mode.divider }} />\n        <p className=\"m-0 text-[10px] font-semibold tracking-[0.18em] uppercase\" style={{ color: mode.inkFaint }}>\n          {activeTheme.subtitle}\n        </p>\n      </header>\n\n      <div className=\"mb-4 flex w-full max-w-[340px] gap-2.5\" aria-live=\"polite\">\n        {[\n          { label: \"Score\", value: score },\n          { label: \"Best\", value: best },\n        ].map((item) => (\n          <div key={item.label} className=\"flex-1 rounded-[14px] px-3 py-2.5 text-center backdrop-blur-[8px]\" style={{ background: mode.surface, border: `1px solid ${mode.surfaceBorder}` }}>\n            <div className=\"text-[10px] font-bold tracking-[0.2em] uppercase\" style={{ color: mode.inkFaint }}>\n              {item.label}\n            </div>\n            <div className=\"font-serif text-[28px] font-normal\" style={{ color: mode.ink }}>\n              {item.value}\n            </div>\n          </div>\n        ))}\n      </div>\n\n      <motion.button\n        type=\"button\"\n        onClick={init}\n        whileHover={{ scale: 1.03 }}\n        whileTap={{ scale: 0.97 }}\n        className=\"mb-4.5 rounded-full border-none px-7.5 py-3.5 text-xs font-bold tracking-[0.1em] text-[#0a0a0f] uppercase\"\n        style={{ background: resolvedAccent }}\n      >\n        {activeTheme.buttonText}\n      </motion.button>\n\n      <div\n        className=\"relative grid w-full max-w-[340px] touch-none grid-cols-4 grid-rows-4 gap-2 rounded-[14px] p-2.5\"\n        style={{ aspectRatio: \"1 / 1\", background: mode.boardBg, border: `1px solid ${mode.surfaceBorder}` }}\n        onPointerDown={handlePointerDown}\n        onPointerUp={handlePointerUp}\n      >\n        {Array.from({ length: SIZE * SIZE }).map((_, i) => (\n          <div key={`bg-${i}`} className=\"rounded-[10px]\" style={{ background: mode.cellBg }} />\n        ))}\n\n        <AnimatePresence>\n          {board.map((value, i) => {\n            if (value === 0) return null;\n            const row = Math.floor(i / SIZE);\n            const col = i % SIZE;\n            const high = value >= 128;\n            return (\n              <motion.div\n                key={`${i}-${value}`}\n                className=\"z-10 flex items-center justify-center rounded-[10px] font-bold\"\n                style={{\n                  backgroundColor: tilePalette[value] || resolvedAccent,\n                  color: high ? mode.tileInkHigh : mode.tileInkLow,\n                  fontSize: value >= 1000 ? 22 : value >= 100 ? 26 : 30,\n                  gridRow: row + 1,\n                  gridColumn: col + 1,\n                }}\n                initial={{ scale: 0.7 }}\n                animate={{ scale: 1 }}\n                exit={{ scale: 0 }}\n                transition={{ type: \"spring\", stiffness: 300, damping: 20 }}\n                layout\n              >\n                {value}\n              </motion.div>\n            );\n          })}\n        </AnimatePresence>\n      </div>\n\n      <AnimatePresence>\n        {(status === \"won\" || status === \"lost\") && (\n          <motion.div\n            className=\"absolute inset-0 z-50 flex items-center justify-center rounded-[22px] p-4 backdrop-blur-[6px]\"\n            style={{ background: mode.overlayBg }}\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n          >\n            <motion.div\n              initial={{ scale: 0.96, y: 12 }}\n              animate={{ scale: 1, y: 0 }}\n              className=\"w-full max-w-[260px] rounded-[18px] px-6 py-7 text-center backdrop-blur-[20px]\"\n              style={{ background: mode.modalBg, border: `1px solid ${mode.modalBorder}` }}\n            >\n              <h3 className=\"m-0 font-serif text-2xl font-normal\" style={{ color: mode.ink }}>\n                {status === \"won\" ? \"You won\" : \"Game over\"}\n              </h3>\n              <div className=\"mx-auto mt-3 mb-4 h-px w-7\" style={{ background: mode.divider }} />\n              {status === \"won\" && (\n                <button\n                  type=\"button\"\n                  onClick={() => setStatus(\"playing\")}\n                  className=\"mb-2 w-full rounded-full border-none px-4 py-3.5 text-xs font-bold tracking-[0.1em] text-[#0a0a0f] uppercase\"\n                  style={{ background: resolvedAccent }}\n                >\n                  Keep Going\n                </button>\n              )}\n              <button type=\"button\" onClick={init} className=\"w-full rounded-full border-none px-4 py-3.5 text-xs font-bold tracking-[0.1em] text-[#0a0a0f] uppercase\" style={{ background: resolvedAccent }}>\n                Try Again\n              </button>\n            </motion.div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n\n      <p className=\"mt-3.5 mb-0 text-center text-[10px] font-semibold tracking-[0.12em] uppercase\" style={{ color: mode.inkFaint }}>\n        Arrow keys or swipe the board\n      </p>\n    </div>\n  );\n\n  if (!asPopup) {\n    return (\n      <div ref={rootRef} className={cn(\"w-full\", className)} style={style} {...props}>\n        {gameCard}\n      </div>\n    );\n  }\n\n  return (\n    <div ref={rootRef} className={cn(\"relative w-full\", className)} style={style} {...props}>\n      <div className={cn(\"flex\", widgetOnRight ? \"justify-end\" : \"justify-start\")}>\n        <motion.button\n          ref={widgetTriggerRef}\n          type=\"button\"\n          onClick={() => setPopupOpen(true)}\n          whileHover={{ scale: 1.04 }}\n          whileTap={{ scale: 0.97 }}\n          aria-label={activeTheme.triggerText}\n          className=\"flex items-center gap-3 rounded-full border-none bg-white py-1.5 pr-5 pl-1.5\"\n          style={{ boxShadow: `0 8px 30px ${activeTheme.glow}, 0 4px 16px rgba(0,0,0,0.4)` }}\n        >\n          <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-full border\" style={{ background: \"#121212\", borderColor: \"rgba(255,255,255,0.1)\" }}>\n            {widgetIcon ? (\n              // eslint-disable-next-line @next/next/no-img-element\n              <img src={widgetIcon} alt=\"\" className=\"h-6 w-6 rounded-full object-cover\" />\n            ) : (\n              <GiftGridIcon />\n            )}\n          </span>\n          <span className=\"flex flex-col gap-0.5 text-left\">\n            <span className=\"text-[9px] font-bold tracking-[0.1em] whitespace-nowrap uppercase\" style={{ color: \"rgba(23,26,33,0.4)\" }}>\n              {activeTheme.triggerText}\n            </span>\n            <motion.span\n              className=\"text-[13px] font-bold tracking-[0.02em] whitespace-nowrap text-[#171a21] uppercase\"\n              animate={{ textShadow: [`0 0 3px ${widgetGlowStrong}`, `0 0 10px ${widgetGlowStrong}`, `0 0 3px ${widgetGlowStrong}`] }}\n              transition={{ duration: 2, repeat: Infinity, ease: \"easeInOut\" }}\n            >\n              Play Now\n            </motion.span>\n          </span>\n        </motion.button>\n      </div>\n\n      <AnimatePresence>\n        {popupOpen && (\n          <motion.div\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            onClick={(e) => {\n              if (e.target === e.currentTarget) setPopupOpen(false);\n            }}\n            className=\"fixed inset-0 z-[9999] flex items-center justify-center p-5\"\n            style={{ background: \"rgba(0,0,0,0.7)\", backdropFilter: \"blur(4px)\" }}\n          >\n            <motion.div\n              initial={{ scale: 0.94, y: 16 }}\n              animate={{ scale: 1, y: 0 }}\n              exit={{ scale: 0.96, opacity: 0 }}\n              transition={{ duration: 0.35, ease: [0.16, 1, 0.3, 1] }}\n              role=\"dialog\"\n              aria-modal=\"true\"\n              aria-labelledby={`${uid}-title`}\n              onKeyDown={(e) => {\n                if (e.key === \"Escape\") setPopupOpen(false);\n              }}\n              className=\"relative w-full max-w-[420px]\"\n            >\n              {gameCard}\n              <button\n                type=\"button\"\n                onClick={() => setPopupOpen(false)}\n                aria-label=\"Close game\"\n                className=\"absolute -top-3.5 -right-3.5 z-[100] flex h-8 w-8 items-center justify-center rounded-full border text-[17px] leading-[30px]\"\n                style={{ background: mode.chromeBg, borderColor: mode.chromeBorder, color: mode.ink }}\n              >\n                ×\n              </button>\n            </motion.div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}