{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "minesweeper-game",
  "title": "Minesweeper Game",
  "description": "A classic Minesweeper with three board sizes, flood-fill reveal, right-click flagging, a live mine counter and timer, and a confetti burst on a win.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/minesweeper-game/minesweeper-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 MinesweeperTheme = \"night\" | \"neon\" | \"gold\" | \"tide\";\nexport type MinesweeperDifficulty = \"beginner\" | \"intermediate\" | \"expert\";\nexport type MinesweeperTrigger = \"manual\" | \"delay\" | \"scroll\";\nexport type MinesweeperWidgetPosition = \"bottom-right\" | \"bottom-left\";\ntype GameStatus = \"ready\" | \"playing\" | \"won\" | \"lost\";\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<MinesweeperTheme, ThemeConfig> = {\n  night: {\n    title: \"Mines\",\n    subtitle: \"Clear the field. Flag the rest.\",\n    buttonText: \"New Field\",\n    triggerText: \"Play Mines\",\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: \"Sweep\",\n    subtitle: \"First click is always safe\",\n    buttonText: \"Reset Grid\",\n    triggerText: \"Open Sweep\",\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: \"Field\",\n    subtitle: \"Beginner to expert\",\n    buttonText: \"New Board\",\n    triggerText: \"Start Field\",\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: \"Clear\",\n    subtitle: \"Left open · right flag\",\n    buttonText: \"Replay\",\n    triggerText: \"Play Clear\",\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 SETTINGS: Record<MinesweeperDifficulty, { rows: number; cols: number; mines: number; label: string }> = {\n  beginner: { rows: 9, cols: 9, mines: 10, label: \"Beginner\" },\n  intermediate: { rows: 16, cols: 16, mines: 40, label: \"Medium\" },\n  expert: { rows: 16, cols: 30, mines: 99, label: \"Expert\" },\n};\n\nfunction MineIcon() {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n      <circle cx=\"12\" cy=\"12\" r=\"5\" fill=\"#ffc93c\" />\n      <path d=\"M12 3v3M12 18v3M3 12h3M18 12h3\" stroke=\"#fffceb\" strokeWidth=\"1.6\" />\n    </svg>\n  );\n}\n\nexport interface MinesweeperGameProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  theme?: MinesweeperTheme;\n  lightMode?: boolean;\n  accentColor?: string;\n  difficulty?: MinesweeperDifficulty;\n  asPopup?: boolean;\n  trigger?: MinesweeperTrigger;\n  delaySeconds?: number;\n  widgetPosition?: MinesweeperWidgetPosition;\n  widgetIcon?: string;\n}\n\nexport function MinesweeperGame({\n  theme = \"night\",\n  lightMode = false,\n  accentColor = \"#ffffff\",\n  difficulty: difficultyProp = \"beginner\",\n  asPopup = false,\n  trigger = \"manual\",\n  delaySeconds = 4,\n  widgetPosition = \"bottom-right\",\n  widgetIcon,\n  className,\n  style,\n  ...props\n}: MinesweeperGameProps) {\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 gridHostRef = React.useRef<HTMLDivElement>(null);\n  const delayTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const timerRef = React.useRef<ReturnType<typeof setInterval> | undefined>(undefined);\n  const isVisibleRef = React.useRef(true);\n  const wasPopupOpenRef = React.useRef(false);\n\n  const [difficulty, setDifficulty] = React.useState<MinesweeperDifficulty>(difficultyProp);\n  const [board, setBoard] = React.useState<number[]>([]);\n  const [revealed, setRevealed] = React.useState<boolean[]>([]);\n  const [flagged, setFlagged] = React.useState<boolean[]>([]);\n  const [gameStatus, setGameStatus] = React.useState<GameStatus>(\"ready\");\n  const [time, setTime] = React.useState(0);\n  const [minesLeft, setMinesLeft] = React.useState(SETTINGS[difficultyProp].mines);\n  const [firstClick, setFirstClick] = React.useState(true);\n  const [popupOpen, setPopupOpen] = React.useState(!asPopup);\n  const [scrollTriggered, setScrollTriggered] = React.useState(false);\n  const [prevAsPopup, setPrevAsPopup] = React.useState(asPopup);\n  const [boardScale, setBoardScale] = React.useState(1);\n  const [focused, setFocused] = React.useState(false);\n\n  if (asPopup !== prevAsPopup) {\n    setPrevAsPopup(asPopup);\n    setPopupOpen(!asPopup);\n  }\n\n  const config = SETTINGS[difficulty] || SETTINGS.beginner;\n  const { rows, cols, mines } = config;\n  const totalCells = rows * cols;\n  const cellSize = difficulty === \"expert\" ? 14 : difficulty === \"intermediate\" ? 17 : 22;\n  const cardMax = difficulty === \"expert\" ? 560 : difficulty === \"intermediate\" ? 500 : 420;\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  const gridGap = 3;\n  const gridPad = 16;\n  const gridW = cols * cellSize + (cols - 1) * gridGap + gridPad;\n  const gridH = rows * cellSize + (rows - 1) * gridGap + gridPad;\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        cell: \"rgba(23,26,33,0.06)\",\n        cellOpen: \"rgba(23,26,33,0.03)\",\n        cellBoom: \"rgba(23,26,33,0.12)\",\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        cell: \"rgba(255,255,255,0.08)\",\n        cellOpen: \"rgba(255,255,255,0.03)\",\n        cellBoom: \"rgba(255,255,255,0.16)\",\n        focusRing: \"0 0 0 2px rgba(255,255,255,0.45)\",\n      };\n\n  const numberColors = lightMode\n    ? [\"\", \"#1d4ed8\", \"#15803d\", \"#b91c1c\", \"#1e3a8a\", \"#7f1d1d\", \"#0f766e\", \"#111\", \"#6b7280\"]\n    : [\"\", \"#93c5fd\", \"#86efac\", \"#fca5a5\", \"#bfdbfe\", \"#fecaca\", \"#5eead4\", \"#fff\", \"#9ca3af\"];\n\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(delayTimerRef.current);\n      if (timerRef.current) clearInterval(timerRef.current);\n    };\n  }, []);\n\n  React.useEffect(() => {\n    if (!rootRef.current) return;\n    const observer = new IntersectionObserver(([entry]) => {\n      isVisibleRef.current = entry.isIntersecting;\n    }, { threshold: 0 });\n    observer.observe(rootRef.current);\n    return () => observer.disconnect();\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    const el = gridHostRef.current;\n    if (!el) return;\n    const apply = (w: number) => {\n      const next = w <= 0 ? 1 : Math.min(1, w / gridW);\n      setBoardScale(next);\n    };\n    apply(el.clientWidth);\n    const ro = new ResizeObserver(([entry]) => apply(entry.contentRect.width));\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, [gridW, popupOpen, asPopup]);\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 initBoard = React.useCallback(() => {\n    if (timerRef.current) clearInterval(timerRef.current);\n    setBoard(Array(totalCells).fill(0));\n    setRevealed(Array(totalCells).fill(false));\n    setFlagged(Array(totalCells).fill(false));\n    setGameStatus(\"ready\");\n    setTime(0);\n    setMinesLeft(mines);\n    setFirstClick(true);\n  }, [totalCells, mines]);\n\n  React.useEffect(() => {\n    initBoard();\n    return () => {\n      if (timerRef.current) clearInterval(timerRef.current);\n    };\n  }, [difficulty, initBoard]);\n\n  const getNeighbors = (index: number) => {\n    const r = Math.floor(index / cols);\n    const c = index % cols;\n    const res: number[] = [];\n    for (let dr = -1; dr <= 1; dr++) {\n      for (let dc = -1; dc <= 1; dc++) {\n        if (dr === 0 && dc === 0) continue;\n        const nr = r + dr;\n        const nc = c + dc;\n        if (nr >= 0 && nr < rows && nc >= 0 && nc < cols) res.push(nr * cols + nc);\n      }\n    }\n    return res;\n  };\n\n  const placeMines = (firstIndex: number) => {\n    const newBoard = Array(totalCells).fill(0);\n    let placed = 0;\n    while (placed < mines) {\n      const idx = Math.floor(Math.random() * totalCells);\n      if (idx !== firstIndex && newBoard[idx] !== -1) {\n        newBoard[idx] = -1;\n        placed++;\n      }\n    }\n    for (let i = 0; i < totalCells; i++) {\n      if (newBoard[i] === -1) continue;\n      let count = 0;\n      getNeighbors(i).forEach((n) => {\n        if (newBoard[n] === -1) count++;\n      });\n      newBoard[i] = count;\n    }\n    setBoard(newBoard);\n    return newBoard;\n  };\n\n  const revealCells = (index: number, currentBoard: number[], currentRevealed: boolean[], currentFlagged: boolean[]): boolean[] => {\n    if (currentRevealed[index] || currentFlagged[index]) return currentRevealed;\n    const next = [...currentRevealed];\n    next[index] = true;\n    if (currentBoard[index] === 0) {\n      getNeighbors(index).forEach((n) => {\n        if (!next[n]) {\n          const deeper = revealCells(n, currentBoard, next, currentFlagged);\n          deeper.forEach((v, i) => {\n            next[i] = v;\n          });\n        }\n      });\n    }\n    return next;\n  };\n\n  const handleClick = (index: number) => {\n    if (gameStatus === \"won\" || gameStatus === \"lost\" || flagged[index]) return;\n    let currentBoard = board;\n    if (firstClick) {\n      currentBoard = placeMines(index);\n      setFirstClick(false);\n      setGameStatus(\"playing\");\n      timerRef.current = setInterval(() => {\n        if (!isVisibleRef.current) return;\n        setTime((t) => t + 1);\n      }, 1000);\n    }\n    if (currentBoard[index] === -1) {\n      const allRevealed = revealed.map((_, i) => (currentBoard[i] === -1 ? true : revealed[i]));\n      allRevealed[index] = true;\n      setRevealed(allRevealed);\n      setGameStatus(\"lost\");\n      if (timerRef.current) clearInterval(timerRef.current);\n      return;\n    }\n    const newRevealed = revealCells(index, currentBoard, revealed, flagged);\n    setRevealed(newRevealed);\n    const unrevealed = newRevealed.filter((r) => !r).length;\n    if (unrevealed === mines) {\n      setGameStatus(\"won\");\n      if (timerRef.current) clearInterval(timerRef.current);\n      setFlagged(currentBoard.map((v) => v === -1));\n      setMinesLeft(0);\n    }\n  };\n\n  const handleRightClick = (e: React.MouseEvent, index: number) => {\n    e.preventDefault();\n    if (gameStatus === \"won\" || gameStatus === \"lost\" || revealed[index]) return;\n    const next = [...flagged];\n    next[index] = !next[index];\n    setFlagged(next);\n    setMinesLeft((prev) => (next[index] ? prev - 1 : prev + 1));\n  };\n\n  const formatTime = (s: number) => `${Math.floor(s / 60).toString().padStart(2, \"0\")}:${(s % 60).toString().padStart(2, \"0\")}`;\n\n  const gameCard = (\n    <div\n      ref={gameRootRef}\n      tabIndex={0}\n      role=\"application\"\n      aria-label={`${activeTheme.title} minesweeper`}\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] 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        maxWidth: cardMax,\n        padding: difficulty === \"beginner\" ? \"28px 22px\" : \"20px 16px\",\n        ...(asPopup ? { maxHeight: `calc(100vh - 56px)`, overflow: \"hidden\" } : {}),\n      }}\n    >\n      <header className=\"mb-3 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-2.5 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 flex w-full max-w-[380px] gap-2\" aria-live=\"polite\">\n        {[\n          { label: \"Mines\", value: minesLeft.toString().padStart(2, \"0\") },\n          { label: \"Time\", value: formatTime(time) },\n          { label: \"Level\", value: config.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 flex flex-wrap justify-center gap-2\">\n        {(Object.keys(SETTINGS) as MinesweeperDifficulty[]).map((level) => {\n          const on = difficulty === level;\n          return (\n            <button\n              key={level}\n              type=\"button\"\n              aria-pressed={on}\n              onClick={() => setDifficulty(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              {SETTINGS[level].label}\n            </button>\n          );\n        })}\n      </div>\n\n      <motion.button\n        type=\"button\"\n        onClick={initBoard}\n        whileHover={{ scale: 1.03 }}\n        whileTap={{ scale: 0.97 }}\n        className=\"mb-3.5 rounded-full border-none px-7 py-3 text-xs font-bold tracking-[0.1em] text-[#0a0a0f] uppercase\"\n        style={{ background: resolvedAccent }}\n      >\n        {activeTheme.buttonText}\n      </motion.button>\n\n      <div ref={gridHostRef} className=\"w-full overflow-hidden\" style={{ maxWidth: cardMax }}>\n        <div className=\"flex justify-center\" style={{ height: gridH * boardScale }}>\n          <div\n            className=\"grid w-max gap-[3px] rounded-[14px] p-2\"\n            style={{ gridTemplateColumns: `repeat(${cols}, ${cellSize}px)`, border: `1px solid ${mode.surfaceBorder}`, transform: `scale(${boardScale})`, transformOrigin: \"top center\" }}\n          >\n            {Array.from({ length: totalCells }).map((_, i) => {\n              const isOpen = revealed[i];\n              const isMine = board[i] === -1;\n              const boom = isOpen && isMine && gameStatus === \"lost\";\n              return (\n                <button\n                  key={i}\n                  type=\"button\"\n                  aria-label={flagged[i] ? \"Flagged\" : isOpen ? (isMine ? \"Mine\" : board[i] > 0 ? `${board[i]} adjacent` : \"Empty\") : \"Hidden cell\"}\n                  onClick={() => handleClick(i)}\n                  onContextMenu={(e) => handleRightClick(e, i)}\n                  disabled={gameStatus === \"won\" || gameStatus === \"lost\"}\n                  className=\"cursor-pointer rounded-[4px] border-none p-0 font-bold transition-colors\"\n                  style={{\n                    width: cellSize,\n                    height: cellSize,\n                    lineHeight: `${cellSize}px`,\n                    fontSize: cellSize > 16 ? 11 : 9,\n                    background: boom ? mode.cellBoom : isOpen ? mode.cellOpen : mode.cell,\n                    color: board[i] > 0 && isOpen ? numberColors[board[i]] : mode.ink,\n                  }}\n                >\n                  {flagged[i] && !isOpen ? \"▴\" : isOpen && isMine ? \"●\" : isOpen && board[i] > 0 ? board[i] : \"\"}\n                </button>\n              );\n            })}\n          </div>\n        </div>\n      </div>\n      <p className=\"mt-3 mb-0 text-center text-[10px] font-semibold tracking-[0.12em] uppercase\" style={{ color: mode.inkFaint }}>\n        Click to open · hold to flag\n      </p>\n\n      <AnimatePresence>\n        {(gameStatus === \"won\" || gameStatus === \"lost\") && (\n          <motion.div\n            role=\"dialog\"\n            aria-labelledby={`${uid}-end`}\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}-end`} className=\"m-0 font-serif text-[22px] font-normal\" style={{ color: mode.ink }}>\n                {gameStatus === \"won\" ? \"Field cleared\" : \"Mine hit\"}\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                {formatTime(time)} · {config.label}\n              </p>\n              <button type=\"button\" onClick={initBoard} 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              <MineIcon />\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-4\"\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\"\n              style={{ maxWidth: cardMax }}\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"
}