{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "glow-jump-widget",
  "title": "Glow Jump Widget",
  "description": "A floating-action-button popup that opens a glowing 4-level platformer, jump between walls, dodge moving lava, and collect coins to finish each level, keyboard and on-screen touch controls included.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/glow-jump-widget/glow-jump-widget.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\ntype PopupPosition = \"bottom-right\" | \"bottom-left\";\ntype Keys = { left: boolean; up: boolean; right: boolean };\ntype FieldType = \"wall\" | \"lava\";\n\nconst LEVELS = [\n  [\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                    o          o                                 \",\n    \"                                                                 \",\n    \"                 xxxxx      xxxxx                                \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"        o                                                        \",\n    \"      xxxxx                                                      \",\n    \"                                                                 \",\n    \"  @                                                              \",\n    \"xxxxx                    xxxxxxxxxxxxxxxxxxxxx                   \",\n    \"                                                                 \",\n  ],\n  [\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                              o                  \",\n    \"                                           xxxxx                 \",\n    \"                                                                 \",\n    \"                                    o                            \",\n    \"                                 xxxxx                           \",\n    \"                                                                 \",\n    \"                          o                                      \",\n    \"                       xxxxx                                     \",\n    \"                                                                 \",\n    \"                o                                                \",\n    \"             xxxxx                                               \",\n    \"  @                                                              \",\n    \"xxxxx     xxxxx     xxxxx     xxxxx     xxxxx                    \",\n    \"                                                                 \",\n  ],\n  [\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"         o                                      o                \",\n    \"      xxxxx                                  xxxxx               \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                   o                                o             \",\n    \"                xxxxx                             xxxx           \",\n    \"                                                                 \",\n    \"  @           =                                                  \",\n    \"xxxxx     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     xxxxx      \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n  ],\n  [\n    \"                                                                 \",\n    \"                                                                 \",\n    \"                                                                 \",\n    \"         o     o     o     o     o     o     o                   \",\n    \"       xxxxx xxxxx xxxxx x  x     xx  xx     xx                  \",\n    \"                                                                 \",\n    \"                                                   xx            \",\n    \"                                                                 \",\n    \"              =           =           =                          \",\n    \"                                                       xx        \",\n    \"                                                                 \",\n    \"   o                                                         o   \",\n    \"x  xx                                                       xxxxx\",\n    \"  @                                                              \",\n    \"xxxxx     xxxxx     xxxxx     xxxxx     xxxxx     xxxxx     xxxxx\",\n    \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\",\n  ],\n];\n\nclass Vector {\n  x: number;\n  y: number;\n  constructor(x: number, y: number) {\n    this.x = x;\n    this.y = y;\n  }\n  plus(other: Vector) {\n    return new Vector(this.x + other.x, this.y + other.y);\n  }\n  times(scale: number) {\n    return new Vector(this.x * scale, this.y * scale);\n  }\n}\n\nclass Player {\n  pos: Vector;\n  size: Vector;\n  speed: Vector;\n  type = \"player\" as const;\n  constructor(pos: Vector) {\n    this.pos = pos.plus(new Vector(0, -0.5));\n    this.size = new Vector(0.6, 0.9);\n    this.speed = new Vector(0, 0);\n  }\n}\ninterface Player {\n  act: (step: number, level: Level, keys: Keys) => void;\n  moveX: (step: number, level: Level, keys: Keys) => void;\n  moveY: (step: number, level: Level, keys: Keys) => void;\n}\n\nclass Lava {\n  pos: Vector;\n  size: Vector;\n  speed: Vector;\n  repeatPos?: Vector;\n  type = \"lava\" as const;\n  constructor(pos: Vector, ch: string) {\n    this.pos = pos;\n    this.size = new Vector(1, 1);\n    if (ch === \"=\") this.speed = new Vector(2.2, 0);\n    else if (ch === \"|\") this.speed = new Vector(0, 2.2);\n    else {\n      this.speed = new Vector(0, 3);\n      this.repeatPos = pos;\n    }\n  }\n}\ninterface Lava {\n  act: (step: number, level: Level, keys: Keys) => void;\n}\n\nclass Coin {\n  pos: Vector;\n  basePos: Vector;\n  size: Vector;\n  wobble: number;\n  type = \"coin\" as const;\n  constructor(pos: Vector) {\n    this.basePos = this.pos = pos.plus(new Vector(0, 0));\n    this.size = new Vector(1, 1);\n    this.wobble = Math.random() * Math.PI * 2;\n  }\n}\ninterface Coin {\n  act: (step: number, level: Level, keys: Keys) => void;\n}\n\ntype ActorType = Player | Lava | Coin;\n\nconst actorChars: Record<string, new (pos: Vector, ch: string) => ActorType> = {\n  \"@\": Player,\n  o: Coin,\n  \"=\": Lava,\n  \"|\": Lava,\n  v: Lava,\n};\n\nclass Level {\n  width: number;\n  height: number;\n  grid: (FieldType | null)[][];\n  actors: ActorType[];\n  player: Player;\n  status: string | null = null;\n  finishDelay: number | null = null;\n\n  constructor(plan: string[]) {\n    this.width = plan[0].length;\n    this.height = plan.length;\n    this.grid = [];\n    this.actors = [];\n\n    for (let y = 0; y < this.height; y++) {\n      const line = plan[y];\n      const gridLine: (FieldType | null)[] = [];\n      for (let x = 0; x < this.width; x++) {\n        const ch = line[x];\n        let fieldType: FieldType | null = null;\n        const Actor = actorChars[ch];\n        if (Actor) {\n          this.actors.push(new Actor(new Vector(x, y), ch));\n        } else if (ch === \"x\") {\n          fieldType = \"wall\";\n        } else if (ch === \"!\") {\n          fieldType = \"lava\";\n        }\n        gridLine.push(fieldType);\n      }\n      this.grid.push(gridLine);\n    }\n    this.player = this.actors.find((a) => a.type === \"player\") as Player;\n  }\n\n  isFinished() {\n    return this.status != null && this.finishDelay! < 0;\n  }\n}\ninterface Level {\n  obstacleAt: (pos: Vector, size: Vector) => FieldType | undefined;\n  actorAt: (actor: ActorType) => ActorType | undefined;\n  animate: (step: number, keys: Keys) => void;\n  playerTouched: (type: string, actor?: ActorType) => void;\n}\n\nconst scale = 18;\n\nfunction createElement(name: string, className?: string) {\n  const el = document.createElement(name);\n  if (className) el.className = className;\n  return el;\n}\n\nclass DOMDisplay {\n  wrap: HTMLElement;\n  level: Level;\n  actorLayer: HTMLElement | null = null;\n\n  constructor(parent: HTMLElement, level: Level) {\n    this.wrap = parent.appendChild(createElement(\"div\", \"gj-stage\")) as HTMLElement;\n    this.level = level;\n    this.wrap.appendChild(this.drawBackground());\n    this.drawFrame();\n  }\n\n  drawBackground() {\n    const table = createElement(\"table\", \"gj-background\") as HTMLTableElement;\n    table.style.width = this.level.width * scale + \"px\";\n    table.style.height = this.level.height * scale + \"px\";\n    this.level.grid.forEach((row) => {\n      const rowEl = table.appendChild(createElement(\"tr\")) as HTMLTableRowElement;\n      rowEl.style.height = scale + \"px\";\n      row.forEach((type) => {\n        rowEl.appendChild(createElement(\"td\", type ? `gj-${type}` : undefined));\n      });\n    });\n    return table;\n  }\n\n  drawActors() {\n    const wrap = createElement(\"div\");\n    this.level.actors.forEach((actor) => {\n      const rect = wrap.appendChild(createElement(\"div\", \"gj-actor gj-\" + actor.type)) as HTMLElement;\n      rect.style.width = actor.size.x * scale + \"px\";\n      rect.style.height = actor.size.y * scale + \"px\";\n      rect.style.left = actor.pos.x * scale + \"px\";\n      rect.style.top = actor.pos.y * scale + \"px\";\n    });\n    return wrap;\n  }\n\n  drawFrame() {\n    if (this.actorLayer) this.wrap.removeChild(this.actorLayer);\n    this.actorLayer = this.wrap.appendChild(this.drawActors()) as HTMLElement;\n    this.wrap.className = \"gj-stage \" + (this.level.status ? `gj-${this.level.status}` : \"\");\n    this.scrollPlayerIntoView();\n  }\n\n  scrollPlayerIntoView() {\n    const width = this.wrap.clientWidth;\n    const height = this.wrap.clientHeight;\n    const margin = width / 3;\n    const left = this.wrap.scrollLeft;\n    const right = left + width;\n    const top = this.wrap.scrollTop;\n    const bottom = top + height;\n\n    const player = this.level.player;\n    const center = player.pos.plus(player.size.times(0.5)).times(scale);\n\n    if (center.x < left + margin) this.wrap.scrollLeft = center.x - margin;\n    else if (center.x > right - margin) this.wrap.scrollLeft = center.x + margin - width;\n    if (center.y < top + margin) this.wrap.scrollTop = center.y - margin;\n    else if (center.y > bottom - margin) this.wrap.scrollTop = center.y + margin - height;\n  }\n\n  clear() {\n    if (this.wrap.parentNode) this.wrap.parentNode.removeChild(this.wrap);\n  }\n}\n\nLevel.prototype.obstacleAt = function (this: Level, pos: Vector, size: Vector): FieldType | undefined {\n  const xStart = Math.floor(pos.x);\n  const xEnd = Math.ceil(pos.x + size.x);\n  const yStart = Math.floor(pos.y);\n  const yEnd = Math.ceil(pos.y + size.y);\n\n  if (xStart < 0 || xEnd > this.width || yStart < 0) return \"wall\";\n  if (yEnd > this.height) return \"lava\";\n\n  for (let y = yStart; y < yEnd; y++) {\n    for (let x = xStart; x < xEnd; x++) {\n      const fieldType = this.grid[y][x];\n      if (fieldType) return fieldType;\n    }\n  }\n  return undefined;\n};\n\nLevel.prototype.actorAt = function (this: Level, actor: ActorType): ActorType | undefined {\n  for (const other of this.actors) {\n    if (\n      other !== actor &&\n      actor.pos.x + actor.size.x > other.pos.x &&\n      actor.pos.x < other.pos.x + other.size.x &&\n      actor.pos.y + actor.size.y > other.pos.y &&\n      actor.pos.y < other.pos.y + other.size.y\n    ) {\n      return other;\n    }\n  }\n  return undefined;\n};\n\nLevel.prototype.animate = function (this: Level, step: number, keys: Keys) {\n  if (this.status != null) this.finishDelay! -= step;\n\n  while (step > 0) {\n    const thisStep = Math.min(step, 0.05);\n    this.actors.forEach((actor) => actor.act(thisStep, this, keys));\n    step -= thisStep;\n  }\n};\n\nLava.prototype.act = function (this: Lava, step: number, level: Level) {\n  const newPos = this.pos.plus(this.speed.times(step));\n  if (!level.obstacleAt(newPos, this.size)) {\n    this.pos = newPos;\n  } else if (this.repeatPos) {\n    this.pos = this.repeatPos;\n  } else {\n    this.speed = this.speed.times(-1);\n  }\n};\n\nCoin.prototype.act = function (this: Coin, step: number) {\n  this.wobble += step * 9;\n  const wobblePos = Math.sin(this.wobble) * 0.08;\n  this.pos = this.basePos.plus(new Vector(0, wobblePos));\n};\n\nPlayer.prototype.moveX = function (this: Player, step: number, level: Level, keys: Keys) {\n  this.speed.x = 0;\n  if (keys.left) this.speed.x -= 11;\n  if (keys.right) this.speed.x += 11;\n\n  const motion = new Vector(this.speed.x * step, 0);\n  const newPos = this.pos.plus(motion);\n  const obstacle = level.obstacleAt(newPos, this.size);\n  if (obstacle) level.playerTouched(obstacle);\n  else this.pos = newPos;\n};\n\nPlayer.prototype.moveY = function (this: Player, step: number, level: Level, keys: Keys) {\n  this.speed.y += step * 32;\n  const motion = new Vector(0, this.speed.y * step);\n  const newPos = this.pos.plus(motion);\n  const obstacle = level.obstacleAt(newPos, this.size);\n  if (obstacle) {\n    level.playerTouched(obstacle);\n    if (keys.up && this.speed.y > 0) this.speed.y = -18;\n    else this.speed.y = 0;\n  } else {\n    this.pos = newPos;\n  }\n};\n\nPlayer.prototype.act = function (this: Player, step: number, level: Level, keys: Keys) {\n  this.moveX(step, level, keys);\n  this.moveY(step, level, keys);\n\n  const otherActor = level.actorAt(this);\n  if (otherActor) level.playerTouched(otherActor.type, otherActor);\n\n  if (level.status === \"lost\") {\n    this.pos.y += step;\n    this.size.y -= step;\n  }\n};\n\nLevel.prototype.playerTouched = function (this: Level, type: string, actor?: ActorType) {\n  if (type === \"lava\" && this.status == null) {\n    this.status = \"lost\";\n    this.finishDelay = 1;\n  } else if (type === \"coin\") {\n    this.actors = this.actors.filter((other) => other !== actor);\n    if (!this.actors.some((a) => a.type === \"coin\")) {\n      this.status = \"won\";\n      this.finishDelay = 1;\n    }\n  }\n};\n\nconst ARROW_KEYS: Record<string, keyof Keys> = {\n  ArrowLeft: \"left\",\n  ArrowUp: \"up\",\n  ArrowRight: \"right\",\n};\n\nfunction JumpIcon() {\n  return (\n    <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\">\n      <rect x=\"4\" y=\"13\" width=\"7\" height=\"7\" rx=\"2\" fill=\"white\" fillOpacity=\"0.9\" />\n      <path d=\"M13 17L20 10M20 10H14M20 10V16\" stroke=\"white\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n    </svg>\n  );\n}\n\nexport interface GlowJumpWidgetProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  asPopup?: boolean;\n  position?: PopupPosition;\n  defaultOpen?: boolean;\n}\n\nexport function GlowJumpWidget({ className, style, asPopup = false, position = \"bottom-right\", defaultOpen = false, ...props }: GlowJumpWidgetProps) {\n  const [isOpen, setIsOpen] = React.useState(defaultOpen);\n  const [levelNumber, setLevelNumber] = React.useState(1);\n  const [statusText, setStatusText] = React.useState(\"\");\n  const [prevAsPopup, setPrevAsPopup] = React.useState(asPopup);\n\n  if (asPopup !== prevAsPopup) {\n    setPrevAsPopup(asPopup);\n    if (asPopup) setIsOpen(defaultOpen);\n  }\n\n  const containerRef = React.useRef<HTMLDivElement>(null);\n  const panelRef = React.useRef<HTMLDivElement>(null);\n  const keysRef = React.useRef<Keys>({ left: false, up: false, right: false });\n  const statusTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const instanceId = React.useId();\n  const active = !asPopup || isOpen;\n\n  React.useEffect(() => {\n    if (!active || !containerRef.current) return;\n\n    const container = containerRef.current;\n    let stopAnimation: number | null = null;\n    let currentDisplay: DOMDisplay | null = null;\n\n    function runLevel(level: Level, andThen: (status: string) => void) {\n      currentDisplay = new DOMDisplay(container, level);\n\n      let lastTime: number | null = null;\n      function frame(time: number) {\n        if (lastTime !== null) {\n          const step = Math.min(time - lastTime, 100) / 1000;\n          level.animate(step, keysRef.current);\n          currentDisplay!.drawFrame();\n\n          if (level.isFinished()) {\n            currentDisplay!.clear();\n            currentDisplay = null;\n            andThen(level.status!);\n            return;\n          }\n        }\n        lastTime = time;\n        stopAnimation = requestAnimationFrame(frame);\n      }\n      stopAnimation = requestAnimationFrame(frame);\n    }\n\n    function startLevel(n: number) {\n      setLevelNumber(n + 1);\n      runLevel(new Level(LEVELS[n]), (status) => {\n        if (status === \"lost\") {\n          startLevel(n);\n        } else if (n < LEVELS.length - 1) {\n          startLevel(n + 1);\n        } else {\n          setStatusText(\"All levels complete!\");\n          if (statusTimerRef.current) clearTimeout(statusTimerRef.current);\n          statusTimerRef.current = setTimeout(() => setStatusText(\"\"), 2000);\n          startLevel(0);\n        }\n      });\n    }\n\n    startLevel(0);\n    const focusFrame = requestAnimationFrame(() => {\n      panelRef.current?.focus({ preventScroll: true });\n    });\n\n    return () => {\n      cancelAnimationFrame(focusFrame);\n      if (stopAnimation) cancelAnimationFrame(stopAnimation);\n      if (statusTimerRef.current) clearTimeout(statusTimerRef.current);\n      if (currentDisplay) (currentDisplay as DOMDisplay).clear();\n      container.innerHTML = \"\";\n      keysRef.current = { left: false, up: false, right: false };\n    };\n  }, [active]);\n\n  const refocusPanel = () => {\n    panelRef.current?.focus({ preventScroll: true });\n  };\n\n  const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    const dir = ARROW_KEYS[e.key];\n    if (dir) {\n      keysRef.current[dir] = true;\n      e.preventDefault();\n    }\n  };\n\n  const handleKeyUp = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    const dir = ARROW_KEYS[e.key];\n    if (dir) {\n      keysRef.current[dir] = false;\n      e.preventDefault();\n    }\n  };\n\n  const setTouchKey = (dir: keyof Keys, value: boolean) => (e: React.PointerEvent<HTMLButtonElement>) => {\n    e.preventDefault();\n    keysRef.current[dir] = value;\n  };\n\n  return (\n    <div\n      data-gj={instanceId}\n      className={cn(\"relative\", className)}\n      style={{ width: \"100%\", maxWidth: 640, height: 480, fontFamily: \"Inter, system-ui, sans-serif\", ...style }}\n      {...props}\n    >\n      <style>{`\n        [data-gj=\"${instanceId}\"] * { box-sizing: border-box; }\n\n        [data-gj=\"${instanceId}\"] .gj-fab {\n          position: absolute;\n          bottom: 0;\n          width: 56px;\n          height: 56px;\n          border-radius: 50%;\n          border: none;\n          cursor: pointer;\n          background: linear-gradient(135deg, #00e5ff, #7b61ff);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 16px rgba(0,229,255,0.5);\n          transition: transform 0.2s ease, opacity 0.2s ease;\n          z-index: 10;\n        }\n        [data-gj=\"${instanceId}\"] .gj-fab.bottom-right { right: 0; }\n        [data-gj=\"${instanceId}\"] .gj-fab.bottom-left { left: 0; }\n        [data-gj=\"${instanceId}\"] .gj-fab:hover { transform: scale(1.06); }\n        [data-gj=\"${instanceId}\"] .gj-fab.gj-hidden {\n          opacity: 0;\n          pointer-events: none;\n          transform: scale(0.8);\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-panel {\n          position: absolute;\n          bottom: 0;\n          width: 100%;\n          height: 100%;\n          border-radius: 16px;\n          overflow: hidden;\n          box-shadow: 0 20px 60px rgba(0,0,0,0.5);\n          opacity: 0;\n          transform: scale(0.85) translateY(12px);\n          pointer-events: none;\n          transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;\n          z-index: 20;\n          background: #0b0b12;\n          color: white;\n          display: flex;\n          flex-direction: column;\n          outline: none;\n        }\n        [data-gj=\"${instanceId}\"] .gj-panel.bottom-right { right: 0; transform-origin: bottom right; }\n        [data-gj=\"${instanceId}\"] .gj-panel.bottom-left { left: 0; transform-origin: bottom left; }\n        [data-gj=\"${instanceId}\"] .gj-panel.gj-open {\n          opacity: 1;\n          transform: scale(1) translateY(0);\n          pointer-events: auto;\n        }\n        [data-gj=\"${instanceId}\"] .gj-panel.gj-inline {\n          position: static;\n          width: 100%;\n          height: 100%;\n          opacity: 1;\n          transform: none;\n          pointer-events: auto;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-header {\n          flex-shrink: 0;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 10px 14px;\n          background: rgba(255,255,255,0.06);\n          font-size: 13px;\n          font-weight: 600;\n          gap: 12px;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-title {\n          background: linear-gradient(90deg, #00e5ff, #7b61ff);\n          -webkit-background-clip: text;\n          -webkit-text-fill-color: transparent;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-close-btn {\n          background: rgba(255,255,255,0.12);\n          border: none;\n          color: white;\n          width: 26px;\n          height: 26px;\n          border-radius: 8px;\n          cursor: pointer;\n          font-size: 15px;\n          line-height: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n        [data-gj=\"${instanceId}\"] .gj-close-btn:hover {\n          background: rgba(255,255,255,0.2);\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-status-banner {\n          position: absolute;\n          top: 46px;\n          left: 0;\n          right: 0;\n          text-align: center;\n          font-size: 12px;\n          font-weight: 600;\n          color: #ffd600;\n          z-index: 30;\n          pointer-events: none;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-game-area {\n          flex: 1;\n          min-height: 0;\n          position: relative;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-game-canvas {\n          width: 100%;\n          height: 100%;\n          position: relative;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-touch-controls {\n          display: none;\n          position: absolute;\n          left: 0;\n          right: 0;\n          bottom: 10px;\n          padding: 0 12px;\n          align-items: flex-end;\n          justify-content: space-between;\n          z-index: 40;\n          pointer-events: none;\n        }\n\n        @media (pointer: coarse) {\n          [data-gj=\"${instanceId}\"] .gj-touch-controls {\n            display: flex;\n          }\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-touch-group {\n          display: flex;\n          gap: 10px;\n          pointer-events: auto;\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-touch-btn {\n          width: 48px;\n          height: 48px;\n          border-radius: 50%;\n          border: none;\n          background: rgba(255,255,255,0.14);\n          color: white;\n          font-size: 22px;\n          line-height: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          touch-action: none;\n          user-select: none;\n          pointer-events: auto;\n        }\n        [data-gj=\"${instanceId}\"] .gj-touch-btn:active {\n          background: rgba(255,255,255,0.28);\n        }\n        [data-gj=\"${instanceId}\"] .gj-touch-jump {\n          width: 56px;\n          height: 56px;\n          background: linear-gradient(135deg, #00e5ff, #7b61ff);\n          box-shadow: 0 0 16px rgba(0,229,255,0.5);\n        }\n\n        [data-gj=\"${instanceId}\"] .gj-stage {\n          position: relative;\n          width: 100%;\n          height: 100%;\n          overflow: hidden;\n          background: linear-gradient(180deg, #0b0b12 0%, #12121f 100%);\n        }\n        [data-gj=\"${instanceId}\"] .gj-background {\n          table-layout: fixed;\n          border-spacing: 0;\n        }\n        [data-gj=\"${instanceId}\"] .gj-background td {\n          padding: 0;\n        }\n        [data-gj=\"${instanceId}\"] .gj-wall {\n          background: linear-gradient(145deg, #2a2a3d, #1e1e2f);\n          border: 2px solid #3d3d55;\n          box-sizing: border-box;\n          border-radius: 4px;\n        }\n        [data-gj=\"${instanceId}\"] .gj-lava {\n          background: linear-gradient(180deg, #ff2d55, #ff6b00);\n          box-shadow: 0 0 12px #ff2d55;\n        }\n        [data-gj=\"${instanceId}\"] .gj-actor {\n          position: absolute;\n          border-radius: 6px;\n        }\n        [data-gj=\"${instanceId}\"] .gj-player {\n          background: linear-gradient(135deg, #00e5ff, #7b61ff);\n          box-shadow: 0 0 16px #00e5ff;\n          border-radius: 8px;\n        }\n        [data-gj=\"${instanceId}\"] .gj-coin {\n          background: radial-gradient(circle at 30% 30%, #fffde7, #ffd600 60%, #ffb300);\n          box-shadow: 0 0 22px 4px #ffd600, 0 0 40px 8px rgba(255, 214, 0, 0.5);\n          -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\"><path d=\"M44.6484 33.9922H95.3484V59.3412H69.9984L44.6484 33.9922ZM44.6484 59.3412H69.9984L95.3484 84.6912H44.6484V59.3412ZM44.6484 84.6912H69.9984V110.041L44.6484 84.6912Z\" fill=\"white\"/></svg>');\n          mask-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\"><path d=\"M44.6484 33.9922H95.3484V59.3412H69.9984L44.6484 33.9922ZM44.6484 59.3412H69.9984L95.3484 84.6912H44.6484V59.3412ZM44.6484 84.6912H69.9984V110.041L44.6484 84.6912Z\" fill=\"white\"/></svg>');\n          -webkit-mask-size: contain;\n          mask-size: contain;\n          -webkit-mask-repeat: no-repeat;\n          mask-repeat: no-repeat;\n          -webkit-mask-position: center;\n          mask-position: center;\n        }\n        [data-gj=\"${instanceId}\"] .gj-lost .gj-player {\n          background: linear-gradient(135deg, #ff2d55, #ff6b6b);\n          box-shadow: 0 0 20px #ff2d55;\n        }\n        [data-gj=\"${instanceId}\"] .gj-won .gj-player {\n          background: linear-gradient(135deg, #00e676, #00c853);\n          box-shadow: 0 0 20px #00e676;\n        }\n      `}</style>\n\n      {asPopup && (\n        <button className={`gj-fab ${position} ${isOpen ? \"gj-hidden\" : \"\"}`} onClick={() => setIsOpen(true)} aria-label=\"Open Glow Jump game\">\n          <JumpIcon />\n        </button>\n      )}\n\n      <div\n        className={asPopup ? `gj-panel ${position} ${isOpen ? \"gj-open\" : \"\"}` : \"gj-panel gj-inline\"}\n        ref={panelRef}\n        tabIndex={0}\n        onKeyDown={handleKeyDown}\n        onKeyUp={handleKeyUp}\n        onMouseDown={refocusPanel}\n      >\n        <div className=\"gj-header\">\n          <span className=\"gj-title\">\n            Glow Jump · Level {levelNumber}/{LEVELS.length}\n          </span>\n          {asPopup && (\n            <div className=\"flex items-center gap-2\">\n              <button className=\"gj-close-btn\" onClick={() => setIsOpen(false)} aria-label=\"Close Glow Jump game\">\n                ×\n              </button>\n            </div>\n          )}\n        </div>\n\n        {statusText && <div className=\"gj-status-banner\">{statusText}</div>}\n\n        <div className=\"gj-game-area\">\n          <div className=\"gj-game-canvas\" ref={containerRef} />\n\n          <div className=\"gj-touch-controls\">\n            <div className=\"gj-touch-group\">\n              <button\n                className=\"gj-touch-btn\"\n                aria-label=\"Move left\"\n                onPointerDown={setTouchKey(\"left\", true)}\n                onPointerUp={setTouchKey(\"left\", false)}\n                onPointerLeave={setTouchKey(\"left\", false)}\n                onPointerCancel={setTouchKey(\"left\", false)}\n              >\n                ‹\n              </button>\n              <button\n                className=\"gj-touch-btn\"\n                aria-label=\"Move right\"\n                onPointerDown={setTouchKey(\"right\", true)}\n                onPointerUp={setTouchKey(\"right\", false)}\n                onPointerLeave={setTouchKey(\"right\", false)}\n                onPointerCancel={setTouchKey(\"right\", false)}\n              >\n                ›\n              </button>\n            </div>\n            <button\n              className=\"gj-touch-btn gj-touch-jump\"\n              aria-label=\"Jump\"\n              onPointerDown={setTouchKey(\"up\", true)}\n              onPointerUp={setTouchKey(\"up\", false)}\n              onPointerLeave={setTouchKey(\"up\", false)}\n              onPointerCancel={setTouchKey(\"up\", false)}\n            >\n              ▲\n            </button>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}