{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "memory-match-game",
  "title": "Memory Match Game",
  "description": "A flip-card memory matching game with animal emoji, three difficulty levels, a 3D flip animation, move/score tracking, and a win overlay.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/memory-match-game/memory-match-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\nexport type MemoryMatchTheme = \"night\" | \"neon\" | \"gold\" | \"tide\";\nexport type MemoryMatchDifficulty = \"easy\" | \"medium\" | \"hard\";\nexport type MemoryMatchTrigger = \"manual\" | \"delay\" | \"scroll\";\nexport type MemoryMatchWidgetPosition = \"bottom-right\" | \"bottom-left\";\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<MemoryMatchTheme, ThemeConfig> = {\n  night: {\n    title: \"Memory\",\n    subtitle: \"Find the matching marks\",\n    buttonText: \"New Game\",\n    triggerText: \"Play Memory\",\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: \"Recall\",\n    subtitle: \"Flip two. Keep the pair.\",\n    buttonText: \"Shuffle\",\n    triggerText: \"Open Memory\",\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: \"Pairs\",\n    subtitle: \"Fewer moves, higher score\",\n    buttonText: \"Deal Again\",\n    triggerText: \"Start Pairs\",\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  tide: {\n    title: \"Match\",\n    subtitle: \"Easy, medium or hard\",\n    buttonText: \"New Board\",\n    triggerText: \"Play Match\",\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 MARKS = [\n  { id: \"orb\", mark: \"●\" },\n  { id: \"ring\", mark: \"○\" },\n  { id: \"plus\", mark: \"+\" },\n  { id: \"dash\", mark: \"-\" },\n  { id: \"sq\", mark: \"■\" },\n  { id: \"dia\", mark: \"◆\" },\n  { id: \"tri\", mark: \"▲\" },\n  { id: \"star\", mark: \"✶\" },\n];\n\nconst DIFFICULTY: Record<MemoryMatchDifficulty, { pairs: number; label: string; columns: number }> = {\n  easy: { pairs: 4, label: \"Easy\", columns: 4 },\n  medium: { pairs: 6, label: \"Medium\", columns: 4 },\n  hard: { pairs: 8, label: \"Hard\", columns: 4 },\n};\n\nfunction MemoryIcon() {\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\" stroke=\"#ffc93c\" strokeWidth=\"1.6\" />\n      <rect x=\"13\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"#fffceb\" strokeWidth=\"1.6\" />\n      <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"#fffceb\" strokeWidth=\"1.6\" />\n      <rect x=\"13\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"#ffc93c\" strokeWidth=\"1.6\" />\n    </svg>\n  );\n}\n\ninterface Tile {\n  id: number;\n  markId: string;\n  mark: string;\n}\n\nfunction shuffle<T>(array: T[]): T[] {\n  const arr = [...array];\n  for (let i = arr.length - 1; i > 0; i--) {\n    const j = Math.floor(Math.random() * (i + 1));\n    [arr[i], arr[j]] = [arr[j], arr[i]];\n  }\n  return arr;\n}\n\nexport interface MemoryMatchGameProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  theme?: MemoryMatchTheme;\n  lightMode?: boolean;\n  accentColor?: string;\n  asPopup?: boolean;\n  trigger?: MemoryMatchTrigger;\n  delaySeconds?: number;\n  widgetPosition?: MemoryMatchWidgetPosition;\n  widgetIcon?: string;\n}\n\nexport function MemoryMatchGame({\n  theme = \"night\",\n  lightMode = false,\n  accentColor = \"#ffffff\",\n  asPopup = false,\n  trigger = \"manual\",\n  delaySeconds = 4,\n  widgetPosition = \"bottom-right\",\n  widgetIcon,\n  className,\n  style,\n  ...props\n}: MemoryMatchGameProps) {\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 flipTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const winTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const wasPopupOpenRef = React.useRef(false);\n  const generationRef = React.useRef(0);\n\n  const [difficulty, setDifficulty] = React.useState<MemoryMatchDifficulty>(\"medium\");\n  const [tiles, setTiles] = React.useState<Tile[]>([]);\n  const [flipped, setFlipped] = React.useState<number[]>([]);\n  const [matched, setMatched] = React.useState<number[]>([]);\n  const [locked, setLocked] = React.useState(false);\n  const [moves, setMoves] = React.useState(0);\n  const [score, setScore] = React.useState(0);\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        inkSoft: \"rgba(23,26,33,0.7)\",\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        face: \"rgba(23,26,33,0.06)\",\n        faceInk: \"#171a21\",\n        back: \"rgba(255,255,255,0.85)\",\n        focusRing: \"0 0 0 2px rgba(23,26,33,0.35)\",\n      }\n    : {\n        ink: \"#ffffff\",\n        inkSoft: \"rgba(255,255,255,0.7)\",\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        face: \"rgba(255,255,255,0.06)\",\n        faceInk: \"rgba(255,255,255,0.55)\",\n        back: \"rgba(255,255,255,0.1)\",\n        focusRing: \"0 0 0 2px rgba(255,255,255,0.45)\",\n      };\n\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(delayTimerRef.current);\n      clearTimeout(flipTimerRef.current);\n      clearTimeout(winTimerRef.current);\n    };\n  }, []);\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 createBoard = React.useCallback((level: MemoryMatchDifficulty) => {\n    generationRef.current += 1;\n    clearTimeout(flipTimerRef.current);\n    clearTimeout(winTimerRef.current);\n    const pairCount = DIFFICULTY[level].pairs;\n    const selected = MARKS.slice(0, pairCount);\n    const pairs = shuffle([...selected, ...selected]);\n    setTiles(pairs.map((item, index) => ({ id: index, markId: item.id, mark: item.mark })));\n    setFlipped([]);\n    setMatched([]);\n    setLocked(false);\n    setMoves(0);\n    setScore(0);\n    setWon(false);\n  }, []);\n\n  React.useEffect(() => {\n    createBoard(difficulty);\n  }, [difficulty, createBoard]);\n\n  const changeDifficulty = (level: MemoryMatchDifficulty) => {\n    setDifficulty(level);\n    createBoard(level);\n  };\n\n  const handleClick = (tile: Tile) => {\n    if (locked) return;\n    if (flipped.includes(tile.id) || matched.includes(tile.id)) return;\n    if (flipped.length === 2) return;\n\n    const newFlipped = [...flipped, tile.id];\n    setFlipped(newFlipped);\n\n    if (newFlipped.length === 2) {\n      setLocked(true);\n      setMoves((m) => m + 1);\n      const first = tiles.find((t) => t.id === newFlipped[0]);\n      const second = tiles.find((t) => t.id === newFlipped[1]);\n      if (!first || !second) {\n        setLocked(false);\n        return;\n      }\n      const gen = generationRef.current;\n      if (first.markId === second.markId) {\n        clearTimeout(flipTimerRef.current);\n        flipTimerRef.current = setTimeout(() => {\n          if (gen !== generationRef.current) return;\n          setMatched((prev) => [...prev, first.id, second.id]);\n          setFlipped([]);\n          setLocked(false);\n          const points = difficulty === \"hard\" ? 150 : difficulty === \"easy\" ? 80 : 100;\n          setScore((s) => s + points);\n          if (matched.length + 2 === tiles.length) {\n            clearTimeout(winTimerRef.current);\n            winTimerRef.current = setTimeout(() => {\n              if (gen !== generationRef.current) return;\n              setWon(true);\n            }, 400);\n          }\n        }, 420);\n      } else {\n        const delay = difficulty === \"hard\" ? 700 : 900;\n        clearTimeout(flipTimerRef.current);\n        flipTimerRef.current = setTimeout(() => {\n          if (gen !== generationRef.current) return;\n          setFlipped([]);\n          setLocked(false);\n        }, delay);\n      }\n    }\n  };\n\n  const columns = DIFFICULTY[difficulty].columns;\n\n  const gameCard = (\n    <div\n      ref={gameRootRef}\n      tabIndex={0}\n      role=\"application\"\n      aria-label={`${activeTheme.title} memory game`}\n      onPointerDown={() => gameRootRef.current?.focus()}\n      onFocus={() => setFocused(true)}\n      onBlur={() => setFocused(false)}\n      className=\"relative box-border flex w-full flex-col items-center overflow-hidden rounded-[22px] px-5.5 py-7 font-sans outline-none select-none\"\n      style={{ background: lightMode ? activeTheme.lightBackground : activeTheme.background, border: `1px solid ${mode.cardBorder}`, boxShadow: focused ? mode.focusRing : \"none\" }}\n    >\n      <header className=\"mb-3.5 w-full text-center\">\n        <p className=\"m-0 mb-1.5 text-[9px] font-bold tracking-[0.2em] uppercase\" style={{ color: mode.inkFaint }}>\n          Browser puzzle\n        </p>\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-3.5 flex w-full max-w-[380px] gap-2\" aria-live=\"polite\">\n        {[\n          { label: \"Score\", value: `${score}` },\n          { label: \"Moves\", value: `${moves}` },\n          { label: \"Level\", value: DIFFICULTY[difficulty].label },\n        ].map((item) => (\n          <div key={item.label} className=\"min-w-0 flex-1 rounded-[14px] px-2 py-2 text-center backdrop-blur-[8px]\" style={{ background: mode.surface, border: `1px solid ${mode.surfaceBorder}` }}>\n            <div className=\"text-[9px] font-bold tracking-[0.16em] uppercase\" style={{ color: mode.inkFaint }}>\n              {item.label}\n            </div>\n            <div className=\"font-serif text-base font-normal\" style={{ color: mode.ink }}>\n              {item.value}\n            </div>\n          </div>\n        ))}\n      </div>\n\n      <div role=\"group\" aria-label=\"Difficulty\" className=\"mb-3.5 flex gap-2\">\n        {(Object.keys(DIFFICULTY) as MemoryMatchDifficulty[]).map((level) => {\n          const on = difficulty === level;\n          return (\n            <button\n              key={level}\n              type=\"button\"\n              aria-pressed={on}\n              onClick={() => changeDifficulty(level)}\n              className=\"min-w-[72px] cursor-pointer rounded-full px-3.5 py-1.5 text-[11px] font-bold tracking-[0.08em] uppercase transition-colors\"\n              style={{ background: on ? resolvedAccent : mode.surface, color: on ? \"#0a0a0f\" : mode.ink, border: `1px solid ${mode.surfaceBorder}` }}\n            >\n              {DIFFICULTY[level].label}\n            </button>\n          );\n        })}\n      </div>\n\n      <motion.button\n        type=\"button\"\n        onClick={() => createBoard(difficulty)}\n        whileHover={{ scale: 1.03 }}\n        whileTap={{ scale: 0.97 }}\n        className=\"mb-4 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 className=\"grid w-full gap-2.5\" style={{ gridTemplateColumns: `repeat(${columns}, 1fr)`, maxWidth: difficulty === \"hard\" ? 380 : 340 }}>\n        {tiles.map((tile) => {\n          const isFlipped = flipped.includes(tile.id) || matched.includes(tile.id);\n          const isMatched = matched.includes(tile.id);\n          return (\n            <button\n              key={tile.id}\n              type=\"button\"\n              aria-label={isFlipped ? `Mark ${tile.mark}` : \"Hidden card\"}\n              aria-pressed={isFlipped}\n              onClick={() => handleClick(tile)}\n              className=\"aspect-square cursor-pointer border-none bg-transparent p-0\"\n              style={{ perspective: 900 }}\n            >\n              <div className=\"h-full w-full transition-[opacity,transform] duration-[350ms] ease-out\" style={{ opacity: isMatched ? 0 : 1, transform: isMatched ? \"scale(0.6)\" : \"scale(1)\", pointerEvents: isMatched ? \"none\" : \"auto\" }}>\n                <motion.div className=\"relative h-full w-full\" style={{ transformStyle: \"preserve-3d\" }} animate={{ rotateY: isFlipped ? 180 : 0 }} transition={{ duration: 0.45, ease: [0.4, 0, 0.2, 1] }}>\n                  <div className=\"absolute inset-0 flex items-center justify-center rounded-[14px]\" style={{ backfaceVisibility: \"hidden\", background: mode.face, border: `1px solid ${mode.surfaceBorder}` }}>\n                    <span className=\"font-serif text-[22px] font-normal\" style={{ color: mode.faceInk }}>\n                      ?\n                    </span>\n                  </div>\n                  <div className=\"absolute inset-0 flex items-center justify-center rounded-[14px]\" style={{ backfaceVisibility: \"hidden\", transform: \"rotateY(180deg)\", background: mode.back, border: `1px solid ${mode.surfaceBorder}` }}>\n                    <span className=\"text-[22px] leading-none\" style={{ color: mode.ink }}>\n                      {tile.mark}\n                    </span>\n                  </div>\n                </motion.div>\n              </div>\n            </button>\n          );\n        })}\n      </div>\n      <p className=\"mt-3.5 mb-0 text-center text-[10px] font-semibold tracking-[0.12em] uppercase\" style={{ color: mode.inkFaint }}>\n        {DIFFICULTY[difficulty].pairs} pairs · tap two cards\n      </p>\n\n      <AnimatePresence>\n        {won && (\n          <motion.div\n            role=\"dialog\"\n            aria-labelledby={`${uid}-win`}\n            className=\"absolute inset-0 z-50 flex items-center justify-center p-4 backdrop-blur-[6px]\"\n            style={{ background: mode.overlayBg }}\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n          >\n            <div className=\"w-full max-w-[280px] rounded-[18px] px-6 py-7 text-center backdrop-blur-[20px]\" style={{ background: mode.modalBg, border: `1px solid ${mode.modalBorder}` }}>\n              <h3 id={`${uid}-win`} className=\"m-0 font-serif text-[22px] font-normal\" style={{ color: mode.ink }}>\n                You won\n              </h3>\n              <div className=\"mx-auto mt-3 mb-3.5 h-px w-7\" style={{ background: mode.divider }} />\n              <p className=\"m-0 mb-2 text-[13px]\" style={{ color: mode.inkSoft }}>\n                {score} points · {moves} moves\n              </p>\n              <p className=\"m-0 mb-4 text-[13px]\" style={{ color: mode.ink }}>\n                {DIFFICULTY[difficulty].label}\n              </p>\n              <button type=\"button\" onClick={() => createBoard(difficulty)} 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                Play Again\n              </button>\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\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              <MemoryIcon />\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-[520px]\"\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"
}