{
  "date": "2026-10-26",
  "service": "Gemini Auto",
  "internal_model": "unknown",
  "editorial_capture": true,
  "responses": [
    {
      "index_html": "<!DOCTYPE html>\n<html lang=\"ru\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Звёздный рейс</title>\n  <style>\n    :root {\n      --bg-color: #121417;\n      --card-bg: #1c2026;\n      --text-main: #f0f4f8;\n      --text-muted: #9ba7b6;\n      --accent-teal: #14b8a6;\n      --accent-teal-hover: #0d9488;\n      --accent-yellow: #eab308;\n      --accent-coral: #f43f5e;\n      --accent-coral-hover: #e11d48;\n      --border-color: #2e3641;\n    }\n\n    * {\n      box-sizing: border-box;\n      margin: 0;\n      padding: 0;\n    }\n\n    body {\n      background-color: var(--bg-color);\n      color: var(--text-main);\n      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n      letter-spacing: 0;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      min-height: 100vh;\n      padding: 12px;\n    }\n\n    .sr-only {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      padding: 0;\n      margin: -1px;\n      overflow: hidden;\n      clip: rect(0, 0, 0, 0);\n      white-space: nowrap;\n      border-0: 0;\n    }\n\n    .game-container {\n      width: 100%;\n      max-width: 720px;\n      background-color: var(--card-bg);\n      border: 1px solid var(--border-color);\n      border-radius: 12px;\n      padding: 16px;\n      display: flex;\n      flex-direction: column;\n      gap: 12px;\n      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);\n    }\n\n    header {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 8px;\n      padding-bottom: 8px;\n      border-bottom: 1px solid var(--border-color);\n    }\n\n    h1 {\n      font-size: 20px;\n      font-weight: 700;\n      color: var(--accent-teal);\n      margin: 0;\n    }\n\n    .stats-panel {\n      display: flex;\n      gap: 12px;\n      font-size: 14px;\n      font-weight: 600;\n    }\n\n    .stat-stars {\n      color: var(--accent-yellow);\n    }\n\n    .stat-misses {\n      color: var(--accent-coral);\n    }\n\n    .status-bar {\n      font-size: 14px;\n      font-weight: 600;\n      padding: 6px 12px;\n      border-radius: 6px;\n      background-color: var(--bg-color);\n      border: 1px solid var(--border-color);\n      text-align: center;\n    }\n\n    #game-parent {\n      width: 100%;\n      aspect-ratio: 640 / 420;\n      background-color: #121417;\n      border-radius: 8px;\n      overflow: hidden;\n      position: relative;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n    }\n\n    #game-parent canvas {\n      display: block;\n      max-width: 100%;\n      max-height: 100%;\n    }\n\n    .controls {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 8px;\n    }\n\n    .btn-group {\n      display: flex;\n      gap: 8px;\n    }\n\n    .btn {\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      gap: 6px;\n      background-color: #2a323d;\n      color: var(--text-main);\n      border: 1px solid var(--border-color);\n      padding: 8px 14px;\n      border-radius: 6px;\n      font-size: 14px;\n      font-weight: 600;\n      cursor: pointer;\n      transition: background-color 0.2s, border-color 0.2s;\n      user-select: none;\n    }\n\n    .btn:hover:not(:disabled) {\n      background-color: #374151;\n      border-color: var(--accent-teal);\n    }\n\n    .btn:focus-visible {\n      outline: 2px solid var(--accent-teal);\n      outline-offset: 2px;\n    }\n\n    .btn:disabled {\n      opacity: 0.5;\n      cursor: not-allowed;\n    }\n\n    .btn-primary {\n      background-color: var(--accent-teal);\n      color: #0d1117;\n      border-color: var(--accent-teal);\n    }\n\n    .btn-primary:hover:not(:disabled) {\n      background-color: var(--accent-teal-hover);\n      border-color: var(--accent-teal-hover);\n    }\n\n    .btn svg {\n      width: 18px;\n      height: 18px;\n      stroke-width: 2.2px;\n    }\n\n    #error-display {\n      color: var(--accent-coral);\n      font-weight: 600;\n      text-align: center;\n      padding: 20px;\n      display: none;\n    }\n  </style>\n</head>\n<body>\n  <main class=\"game-container\">\n    <header>\n      <h1>Звёздный рейс</h1>\n      <div class=\"stats-panel\">\n        <span id=\"stars-count\" class=\"stat-stars\">Звёзды 0/5</span>\n        <span id=\"misses-count\" class=\"stat-misses\">Промахи 0/3</span>\n      </div>\n    </header>\n\n    <div id=\"status-display\" class=\"status-bar\">Готово к старту</div>\n\n    <div id=\"game-parent\">\n      <div id=\"error-display\">Ошибка загрузки игрового движка Phaser</div>\n    </div>\n\n    <p class=\"sr-only\">Управление: стрелки Влево и Вправо на клавиатуре, кнопки интерфейса или клик мышью по одной из трех полос игрового поля.</p>\n\n    <section class=\"controls\" aria-label=\"Панель управления\">\n      <div class=\"btn-group\">\n        <button id=\"btn-play\" class=\"btn btn-primary\" title=\"Играть\" aria-label=\"Начать игру\">\n          <i data-lucide=\"play\"></i>\n          <span>Играть</span>\n        </button>\n        <button id=\"btn-pause\" class=\"btn\" title=\"Пауза\" aria-label=\"Приостановить или продолжить игру\">\n          <i data-lucide=\"pause\"></i>\n          <span id=\"pause-text\">Пауза</span>\n        </button>\n        <button id=\"btn-reset\" class=\"btn\" title=\"Заново\" aria-label=\"Сбросить игру\">\n          <i data-lucide=\"rotate-ccw\"></i>\n          <span>Заново</span>\n        </button>\n      </div>\n      <div class=\"btn-group\">\n        <button id=\"btn-left\" class=\"btn\" title=\"Влево\" aria-label=\"Переместить корабль влево\">\n          <i data-lucide=\"arrow-left\"></i>\n          <span>Влево</span>\n        </button>\n        <button id=\"btn-right\" class=\"btn\" title=\"Вправо\" aria-label=\"Переместить корабль вправо\">\n          <i data-lucide=\"arrow-right\"></i>\n          <span>Вправо</span>\n        </button>\n      </div>\n    </section>\n  </main>\n\n  <script src=\"./vendor/phaser.min.js\"></script>\n  <script src=\"./vendor/lucide.min.js\"></script>\n  <script src=\"./game.js\"></script>\n</body>\n</html>",
      "game_js": "document.addEventListener('DOMContentLoaded', () => {\n  if (typeof lucide !== 'undefined' && lucide.createIcons) {\n    lucide.createIcons();\n  }\n\n  const errorDisplay = document.getElementById('error-display');\n  const statusDisplay = document.getElementById('status-display');\n  const starsCountDisplay = document.getElementById('stars-count');\n  const missesCountDisplay = document.getElementById('misses-count');\n  const btnPlay = document.getElementById('btn-play');\n  const btnPause = document.getElementById('btn-pause');\n  const btnReset = document.getElementById('btn-reset');\n  const btnLeft = document.getElementById('btn-left');\n  const btnRight = document.getElementById('btn-right');\n  const pauseText = document.getElementById('pause-text');\n\n  if (typeof Phaser === 'undefined') {\n    if (errorDisplay) errorDisplay.style.display = 'block';\n    if (statusDisplay) statusDisplay.textContent = 'Ошибка загрузки Phaser';\n    return;\n  }\n\n  const LANES = [120, 320, 520];\n  const LANE_SEQUENCE = [1, 0, 2, 0, 1, 2];\n  const SHIP_Y = 365;\n  const STAR_START_Y = 30;\n  const STAR_SPEED = 100;\n  const SPAWN_DELAY = 500;\n  const WIN_STARS = 5;\n  const MAX_MISSES = 3;\n\n  class MainScene extends Phaser.Scene {\n    constructor() {\n      super({ key: 'MainScene' });\n    }\n\n    create() {\n      this.gameState = 'ready';\n      this.score = 0;\n      this.misses = 0;\n      this.sequenceIndex = 0;\n      this.shipLane = 1;\n      this.spawnTimer = null;\n\n      this.createBackground();\n      this.createTextures();\n      this.createEntities();\n      this.setupPhysicsAndInput();\n\n      this.updateUI();\n    }\n\n    createBackground() {\n      const graphics = this.add.graphics();\n      graphics.fillStyle(0x121417, 1);\n      graphics.fillRect(0, 0, 640, 420);\n\n      graphics.lineStyle(2, 0x2e3641, 0.8);\n      graphics.strokeLineShape(new Phaser.Geom.Line(220, 0, 220, 420));\n      graphics.strokeLineShape(new Phaser.Geom.Line(420, 0, 420, 420));\n\n      graphics.lineStyle(1, 0x1c2026, 0.5);\n      for (let y = 30; y < 420; y += 40) {\n        graphics.strokeLineShape(new Phaser.Geom.Line(20, y, 200, y));\n        graphics.strokeLineShape(new Phaser.Geom.Line(240, y, 400, y));\n        graphics.strokeLineShape(new Phaser.Geom.Line(440, y, 620, y));\n      }\n\n      graphics.fillStyle(0x9ba7b6, 0.4);\n      const dots = [\n        { x: 50, y: 80, r: 1.5 }, { x: 180, y: 220, r: 1 }, { x: 100, y: 340, r: 2 },\n        { x: 260, y: 120, r: 2 }, { x: 380, y: 280, r: 1.5 }, { x: 300, y: 390, r: 1 },\n        { x: 470, y: 50, r: 1 }, { x: 590, y: 180, r: 2 }, { x: 510, y: 310, r: 1.5 }\n      ];\n      dots.forEach(d => graphics.fillCircle(d.x, d.y, d.r));\n    }\n\n    createTextures() {\n      if (!this.textures.exists('ship')) {\n        const g = this.make.graphics({ x: 0, y: 0, add: false });\n        g.fillStyle(0x14b8a6, 1);\n        g.beginPath();\n        g.moveTo(24, 0);\n        g.lineTo(48, 40);\n        g.lineTo(34, 34);\n        g.lineTo(24, 40);\n        g.lineTo(14, 34);\n        g.lineTo(0, 40);\n        g.closePath();\n        g.fillPath();\n        g.fillStyle(0xf0f4f8, 1);\n        g.fillTriangle(24, 8, 30, 22, 18, 22);\n        g.generateTexture('ship', 48, 40);\n        g.destroy();\n      }\n\n      if (!this.textures.exists('star')) {\n        const g = this.make.graphics({ x: 0, y: 0, add: false });\n        g.fillStyle(0xeab308, 1);\n        const cx = 18, cy = 18, points = 5, outerRadius = 16, innerRadius = 7;\n        let step = Math.PI / points;\n        g.beginPath();\n        for (let i = 0; i < 2 * points; i++) {\n          let r = (i % 2 === 0) ? outerRadius : innerRadius;\n          let angle = i * step - Math.PI / 2;\n          let x = cx + Math.cos(angle) * r;\n          let y = cy + Math.sin(angle) * r;\n          if (i === 0) g.moveTo(x, y);\n          else g.lineTo(x, y);\n        }\n        g.closePath();\n        g.fillPath();\n        g.generateTexture('star', 36, 36);\n        g.destroy();\n      }\n    }\n\n    createEntities() {\n      this.ship = this.physics.add.sprite(LANES[this.shipLane], SHIP_Y, 'ship');\n      this.ship.setCollideWorldBounds(true);\n      this.ship.body.setAllowGravity(false);\n      this.ship.body.setImmovable(true);\n\n      this.star = this.physics.add.sprite(LANES[LANE_SEQUENCE[0]], STAR_START_Y, 'star');\n      this.star.body.setAllowGravity(false);\n      this.star.disableBody(true, true);\n    }\n\n    setupPhysicsAndInput() {\n      this.physics.add.overlap(this.ship, this.star, this.handleCollectStar, null, this);\n\n      this.input.keyboard.on('keydown-LEFT', (e) => {\n        e.preventDefault();\n        this.moveShip(-1);\n      });\n      this.input.keyboard.on('keydown-RIGHT', (e) => {\n        e.preventDefault();\n        this.moveShip(1);\n      });\n\n      this.input.on('pointerdown', (pointer) => {\n        if (this.gameState !== 'playing') return;\n        const px = pointer.x;\n        if (px < 220) {\n          this.setShipLane(0);\n        } else if (px >= 220 && px < 420) {\n          this.setShipLane(1);\n        } else {\n          this.setShipLane(2);\n        }\n      });\n    }\n\n    setShipLane(lane) {\n      if (this.gameState !== 'playing') return;\n      this.shipLane = Phaser.Math.Clamp(lane, 0, 2);\n      this.ship.setPosition(LANES[this.shipLane], SHIP_Y);\n      this.ship.body.updateFromGameObject();\n    }\n\n    moveShip(delta) {\n      if (this.gameState !== 'playing') return;\n      this.setShipLane(this.shipLane + delta);\n    }\n\n    startGame() {\n      if (this.gameState === 'ready') {\n        this.gameState = 'playing';\n        this.spawnNextStar();\n        this.updateUI();\n      }\n    }\n\n    togglePause() {\n      if (this.gameState === 'playing') {\n        this.gameState = 'paused';\n        this.physics.pause();\n        if (this.spawnTimer) this.spawnTimer.paused = true;\n        this.updateUI();\n      } else if (this.gameState === 'paused') {\n        this.gameState = 'playing';\n        this.physics.resume();\n        if (this.spawnTimer) this.spawnTimer.paused = false;\n        this.updateUI();\n      }\n    }\n\n    resetGame() {\n      if (this.spawnTimer) {\n        this.spawnTimer.remove(false);\n        this.spawnTimer = null;\n      }\n      this.physics.resume();\n\n      this.gameState = 'ready';\n      this.score = 0;\n      this.misses = 0;\n      this.sequenceIndex = 0;\n      this.shipLane = 1;\n\n      this.ship.setPosition(LANES[this.shipLane], SHIP_Y);\n      this.ship.body.updateFromGameObject();\n\n      this.star.disableBody(true, true);\n      this.star.setVelocity(0, 0);\n\n      this.updateUI();\n    }\n\n    spawnNextStar() {\n      if (this.gameState !== 'playing') return;\n\n      const targetLaneIndex = LANE_SEQUENCE[this.sequenceIndex % LANE_SEQUENCE.length];\n      this.sequenceIndex++;\n\n      this.star.enableBody(true, LANES[targetLaneIndex], STAR_START_Y, true, true);\n      this.star.setVelocityY(STAR_SPEED);\n    }\n\n    handleCollectStar(ship, star) {\n      if (this.gameState !== 'playing' || !star.active) return;\n\n      star.disableBody(true, true);\n      star.setVelocity(0, 0);\n      this.score++;\n      this.updateUI();\n\n      if (this.score >= WIN_STARS) {\n        this.gameState = 'won';\n        this.updateUI();\n      } else {\n        this.spawnTimer = this.time.delayedCall(SPAWN_DELAY, () => {\n          this.spawnNextStar();\n        });\n      }\n    }\n\n    update(time, delta) {\n      if (this.gameState === 'playing' && this.star.active) {\n        if (this.star.y > 420) {\n          this.star.disableBody(true, true);\n          this.star.setVelocity(0, 0);\n          this.misses++;\n          this.updateUI();\n\n          if (this.misses >= MAX_MISSES) {\n            this.gameState = 'lost';\n            this.updateUI();\n          } else {\n            this.spawnTimer = this.time.delayedCall(SPAWN_DELAY, () => {\n              this.spawnNextStar();\n            });\n          }\n        }\n      }\n    }\n\n    updateUI() {\n      starsCountDisplay.textContent = `Звёзды ${this.score}/${WIN_STARS}`;\n      missesCountDisplay.textContent = `Промахи ${this.misses}/${MAX_MISSES}`;\n\n      btnPlay.disabled = this.gameState !== 'ready';\n      btnPause.disabled = this.gameState !== 'playing' && this.gameState !== 'paused';\n      btnLeft.disabled = this.gameState !== 'playing';\n      btnRight.disabled = this.gameState !== 'playing';\n\n      if (this.gameState === 'paused') {\n        pauseText.textContent = 'Продолжить';\n        btnPause.setAttribute('title', 'Продолжить');\n        btnPause.setAttribute('aria-label', 'Продолжить игру');\n      } else {\n        pauseText.textContent = 'Пауза';\n        btnPause.setAttribute('title', 'Пауза');\n        btnPause.setAttribute('aria-label', 'Приостановить игру');\n      }\n\n      switch (this.gameState) {\n        case 'ready':\n          statusDisplay.textContent = 'Готово к старту';\n          statusDisplay.style.color = '#9ba7b6';\n          break;\n        case 'playing':\n          statusDisplay.textContent = 'В полёте';\n          statusDisplay.style.color = '#14b8a6';\n          break;\n        case 'paused':\n          statusDisplay.textContent = 'Пауза';\n          statusDisplay.style.color = '#eab308';\n          break;\n        case 'won':\n          statusDisplay.textContent = 'Победа!';\n          statusDisplay.style.color = '#14b8a6';\n          break;\n        case 'lost':\n          statusDisplay.textContent = 'Игра окончена';\n          statusDisplay.style.color = '#f43f5e';\n          break;\n      }\n    }\n  }\n\n  const config = {\n    type: Phaser.AUTO,\n    parent: 'game-parent',\n    width: 640,\n    height: 420,\n    backgroundColor: '#121417',\n    scale: {\n      mode: Phaser.Scale.FIT,\n      autoCenter: Phaser.Scale.CENTER_BOTH\n    },\n    physics: {\n      default: 'arcade',\n      arcade: {\n        gravity: { y: 0 },\n        debug: false\n      }\n    },\n    scene: MainScene\n  };\n\n  const game = new Phaser.Game(config);\n\n  btnPlay.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.startGame();\n  });\n\n  btnPause.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.togglePause();\n  });\n\n  btnReset.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.resetGame();\n  });\n\n  btnLeft.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.moveShip(-1);\n  });\n\n  btnRight.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.moveShip(1);\n  });\n});"
    },
    {
      "index_html": "<!DOCTYPE html>\n<html lang=\"ru\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Звёздный рейс</title>\n  <style>\n    :root {\n      --bg-color: #121417;\n      --text-main: #f0f4f8;\n      --text-muted: #9ba7b6;\n      --accent-teal: #14b8a6;\n      --accent-teal-hover: #0d9488;\n      --accent-yellow: #eab308;\n      --accent-coral: #f43f5e;\n      --border-color: #2e3641;\n    }\n\n    * {\n      box-sizing: border-box;\n      margin: 0;\n      padding: 0;\n    }\n\n    body {\n      background-color: var(--bg-color);\n      color: var(--text-main);\n      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n      letter-spacing: 0;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      min-height: 100vh;\n      padding: 12px;\n    }\n\n    .sr-only {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      padding: 0;\n      margin: -1px;\n      overflow: hidden;\n      clip: rect(0, 0, 0, 0);\n      white-space: nowrap;\n      border: 0;\n    }\n\n    .game-container {\n      width: 100%;\n      max-width: 720px;\n      background-color: transparent;\n      border: none;\n      border-radius: 0;\n      padding: 0;\n      display: flex;\n      flex-direction: column;\n      gap: 12px;\n      box-shadow: none;\n    }\n\n    header {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 8px;\n      padding-bottom: 8px;\n      border-bottom: 1px solid var(--border-color);\n    }\n\n    h1 {\n      font-size: 20px;\n      font-weight: 700;\n      color: var(--accent-teal);\n      margin: 0;\n    }\n\n    .stats-panel {\n      display: flex;\n      gap: 12px;\n      font-size: 14px;\n      font-weight: 600;\n    }\n\n    .stat-stars {\n      color: var(--accent-yellow);\n    }\n\n    .stat-misses {\n      color: var(--accent-coral);\n    }\n\n    .status-bar {\n      font-size: 14px;\n      font-weight: 600;\n      padding: 6px 12px;\n      border-radius: 6px;\n      background-color: #1c2026;\n      border: 1px solid var(--border-color);\n      text-align: center;\n    }\n\n    #game-parent {\n      width: 100%;\n      aspect-ratio: 640 / 420;\n      background-color: #121417;\n      border-radius: 8px;\n      overflow: hidden;\n      position: relative;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      border: 1px solid var(--border-color);\n    }\n\n    #game-parent canvas {\n      display: block;\n      max-width: 100%;\n      max-height: 100%;\n    }\n\n    .controls {\n      display: flex;\n      flex-wrap: wrap;\n      justify-content: space-between;\n      align-items: center;\n      gap: 8px;\n    }\n\n    .btn-group {\n      display: flex;\n      gap: 8px;\n      min-width: 0;\n      flex-wrap: wrap;\n    }\n\n    .btn {\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      gap: 6px;\n      background-color: #2a323d;\n      color: var(--text-main);\n      border: 1px solid var(--border-color);\n      padding: 8px 14px;\n      border-radius: 6px;\n      font-size: 14px;\n      font-weight: 600;\n      cursor: pointer;\n      transition: background-color 0.2s, border-color 0.2s;\n      user-select: none;\n    }\n\n    .btn-icon-only {\n      width: 44px;\n      height: 44px;\n      padding: 0;\n      flex-shrink: 0;\n    }\n\n    .btn:hover:not(:disabled) {\n      background-color: #374151;\n      border-color: var(--accent-teal);\n    }\n\n    .btn:focus-visible {\n      outline: 2px solid var(--accent-teal);\n      outline-offset: 2px;\n    }\n\n    .btn:disabled {\n      opacity: 0.5;\n      cursor: not-allowed;\n    }\n\n    .btn-primary {\n      background-color: var(--accent-teal);\n      color: #0d1117;\n      border-color: var(--accent-teal);\n    }\n\n    .btn-primary:hover:not(:disabled) {\n      background-color: var(--accent-teal-hover);\n      border-color: var(--accent-teal-hover);\n    }\n\n    .btn svg {\n      width: 18px;\n      height: 18px;\n      stroke-width: 2.2px;\n    }\n\n    #error-display {\n      color: var(--accent-coral);\n      font-weight: 600;\n      text-align: center;\n      padding: 20px;\n      display: none;\n    }\n  </style>\n</head>\n<body>\n  <main class=\"game-container\">\n    <header>\n      <h1>Звёздный рейс</h1>\n      <div class=\"stats-panel\">\n        <span id=\"stars-count\" class=\"stat-stars\">Звёзды 0/5</span>\n        <span id=\"misses-count\" class=\"stat-misses\">Промахи 0/3</span>\n      </div>\n    </header>\n\n    <div id=\"status-display\" class=\"status-bar\">Готово к старту</div>\n\n    <div id=\"game-parent\">\n      <div id=\"error-display\">Ошибка загрузки игрового движка Phaser</div>\n    </div>\n\n    <p class=\"sr-only\">Управление: стрелки Влево и Вправо на клавиатуре, кнопки интерфейса или клик мышью по одной из трех полос игрового поля.</p>\n\n    <section class=\"controls\" aria-label=\"Панель управления\">\n      <div class=\"btn-group\">\n        <button id=\"btn-play\" class=\"btn btn-primary\" title=\"Играть\" aria-label=\"Начать игру\">\n          <i data-lucide=\"play\"></i>\n          <span>Играть</span>\n        </button>\n        <button id=\"btn-pause\" class=\"btn btn-icon-only\" title=\"Пауза\" aria-label=\"Приостановить или продолжить игру\" disabled>\n          <i id=\"icon-pause\" data-lucide=\"pause\"></i>\n        </button>\n        <button id=\"btn-reset\" class=\"btn btn-icon-only\" title=\"Заново\" aria-label=\"Сбросить игру\">\n          <i data-lucide=\"rotate-ccw\"></i>\n        </button>\n      </div>\n      <div class=\"btn-group\">\n        <button id=\"btn-left\" class=\"btn btn-icon-only\" title=\"Влево\" aria-label=\"Переместить корабль влево\" disabled>\n          <i data-lucide=\"arrow-left\"></i>\n        </button>\n        <button id=\"btn-right\" class=\"btn btn-icon-only\" title=\"Вправо\" aria-label=\"Переместить корабль вправо\" disabled>\n          <i data-lucide=\"arrow-right\"></i>\n        </button>\n      </div>\n    </section>\n  </main>\n\n  <script src=\"./vendor/phaser.min.js\"></script>\n  <script src=\"./vendor/lucide.min.js\"></script>\n  <script src=\"./game.js\"></script>\n</body>\n</html>",
      "game_js": "document.addEventListener('DOMContentLoaded', () => {\n  const errorDisplay = document.getElementById('error-display');\n  const statusDisplay = document.getElementById('status-display');\n  const starsCountDisplay = document.getElementById('stars-count');\n  const missesCountDisplay = document.getElementById('misses-count');\n  const btnPlay = document.getElementById('btn-play');\n  const btnPause = document.getElementById('btn-pause');\n  const btnReset = document.getElementById('btn-reset');\n  const btnLeft = document.getElementById('btn-left');\n  const btnRight = document.getElementById('btn-right');\n  const iconPause = document.getElementById('icon-pause');\n\n  function setButtonsDisabled(disabled) {\n    btnPlay.disabled = disabled;\n    btnPause.disabled = disabled;\n    btnReset.disabled = disabled;\n    btnLeft.disabled = disabled;\n    btnRight.disabled = disabled;\n  }\n\n  if (typeof Phaser === 'undefined') {\n    if (errorDisplay) errorDisplay.style.display = 'block';\n    if (statusDisplay) statusDisplay.textContent = 'Ошибка загрузки Phaser';\n    setButtonsDisabled(true);\n    return;\n  }\n\n  const LANES = [120, 320, 520];\n  const LANE_SEQUENCE = [1, 0, 2, 0, 1, 2];\n  const SHIP_Y = 365;\n  const STAR_START_Y = 30;\n  const STAR_SPEED = 100;\n  const SPAWN_DELAY = 500;\n  const WIN_STARS = 5;\n  const MAX_MISSES = 3;\n\n  class MainScene extends Phaser.Scene {\n    constructor() {\n      super({ key: 'MainScene' });\n    }\n\n    create() {\n      this.gameState = 'ready';\n      this.score = 0;\n      this.misses = 0;\n      this.sequenceIndex = 0;\n      this.shipLane = 1;\n      this.spawnTimer = null;\n\n      this.createBackground();\n      this.createTextures();\n      this.createEntities();\n      this.setupPhysicsAndInput();\n\n      this.updateUI();\n    }\n\n    createBackground() {\n      const graphics = this.add.graphics();\n      graphics.fillStyle(0x121417, 1);\n      graphics.fillRect(0, 0, 640, 420);\n\n      graphics.lineStyle(2, 0x2e3641, 0.8);\n      graphics.strokeLineShape(new Phaser.Geom.Line(220, 0, 220, 420));\n      graphics.strokeLineShape(new Phaser.Geom.Line(420, 0, 420, 420));\n\n      graphics.lineStyle(1, 0x1c2026, 0.5);\n      for (let y = 30; y < 420; y += 40) {\n        graphics.strokeLineShape(new Phaser.Geom.Line(20, y, 200, y));\n        graphics.strokeLineShape(new Phaser.Geom.Line(240, y, 400, y));\n        graphics.strokeLineShape(new Phaser.Geom.Line(440, y, 620, y));\n      }\n\n      graphics.fillStyle(0x9ba7b6, 0.4);\n      const dots = [\n        { x: 50, y: 80, r: 1.5 }, { x: 180, y: 220, r: 1 }, { x: 100, y: 340, r: 2 },\n        { x: 260, y: 120, r: 2 }, { x: 380, y: 280, r: 1.5 }, { x: 300, y: 390, r: 1 },\n        { x: 470, y: 50, r: 1 }, { x: 590, y: 180, r: 2 }, { x: 510, y: 310, r: 1.5 }\n      ];\n      dots.forEach(d => graphics.fillCircle(d.x, d.y, d.r));\n    }\n\n    createTextures() {\n      if (!this.textures.exists('ship')) {\n        const g = this.make.graphics({ x: 0, y: 0, add: false });\n        g.fillStyle(0x14b8a6, 1);\n        g.beginPath();\n        g.moveTo(24, 0);\n        g.lineTo(48, 40);\n        g.lineTo(34, 34);\n        g.lineTo(24, 40);\n        g.lineTo(14, 34);\n        g.lineTo(0, 40);\n        g.closePath();\n        g.fillPath();\n        g.fillStyle(0xf0f4f8, 1);\n        g.fillTriangle(24, 8, 30, 22, 18, 22);\n        g.generateTexture('ship', 48, 40);\n        g.destroy();\n      }\n\n      if (!this.textures.exists('star')) {\n        const g = this.make.graphics({ x: 0, y: 0, add: false });\n        g.fillStyle(0xeab308, 1);\n        const cx = 18, cy = 18, points = 5, outerRadius = 16, innerRadius = 7;\n        let step = Math.PI / points;\n        g.beginPath();\n        for (let i = 0; i < 2 * points; i++) {\n          let r = (i % 2 === 0) ? outerRadius : innerRadius;\n          let angle = i * step - Math.PI / 2;\n          let x = cx + Math.cos(angle) * r;\n          let y = cy + Math.sin(angle) * r;\n          if (i === 0) g.moveTo(x, y);\n          else g.lineTo(x, y);\n        }\n        g.closePath();\n        g.fillPath();\n        g.generateTexture('star', 36, 36);\n        g.destroy();\n      }\n    }\n\n    createEntities() {\n      this.ship = this.physics.add.sprite(LANES[this.shipLane], SHIP_Y, 'ship');\n      this.ship.setCollideWorldBounds(true);\n      this.ship.body.setAllowGravity(false);\n      this.ship.body.setImmovable(true);\n\n      this.star = this.physics.add.sprite(LANES[LANE_SEQUENCE[0]], STAR_START_Y, 'star');\n      this.star.body.setAllowGravity(false);\n      this.star.disableBody(true, true);\n    }\n\n    setupPhysicsAndInput() {\n      this.physics.add.overlap(this.ship, this.star, this.handleCollectStar, null, this);\n\n      this.input.keyboard.on('keydown-LEFT', (e) => {\n        if (e.repeat) return;\n        e.preventDefault();\n        this.moveShip(-1);\n      });\n      this.input.keyboard.on('keydown-RIGHT', (e) => {\n        if (e.repeat) return;\n        e.preventDefault();\n        this.moveShip(1);\n      });\n\n      this.input.on('pointerdown', (pointer) => {\n        if (this.gameState !== 'playing') return;\n        const px = pointer.x;\n        if (px < 220) {\n          this.setShipLane(0);\n        } else if (px >= 220 && px < 420) {\n          this.setShipLane(1);\n        } else {\n          this.setShipLane(2);\n        }\n      });\n    }\n\n    setShipLane(lane) {\n      if (this.gameState !== 'playing') return;\n      this.shipLane = Phaser.Math.Clamp(lane, 0, 2);\n      this.ship.setPosition(LANES[this.shipLane], SHIP_Y);\n      this.ship.body.updateFromGameObject();\n    }\n\n    moveShip(delta) {\n      if (this.gameState !== 'playing') return;\n      this.setShipLane(this.shipLane + delta);\n    }\n\n    startGame() {\n      if (this.gameState === 'ready') {\n        this.gameState = 'playing';\n        this.spawnNextStar();\n        this.updateUI();\n      }\n    }\n\n    togglePause() {\n      if (this.gameState === 'playing') {\n        this.gameState = 'paused';\n        this.physics.pause();\n        if (this.spawnTimer) this.spawnTimer.paused = true;\n        this.updateUI();\n      } else if (this.gameState === 'paused') {\n        this.gameState = 'playing';\n        this.physics.resume();\n        if (this.spawnTimer) this.spawnTimer.paused = false;\n        this.updateUI();\n      }\n    }\n\n    resetGame() {\n      if (this.spawnTimer) {\n        this.spawnTimer.remove(false);\n        this.spawnTimer = null;\n      }\n      this.physics.resume();\n\n      this.gameState = 'ready';\n      this.score = 0;\n      this.misses = 0;\n      this.sequenceIndex = 0;\n      this.shipLane = 1;\n\n      this.ship.setPosition(LANES[this.shipLane], SHIP_Y);\n      this.ship.body.updateFromGameObject();\n\n      this.star.disableBody(true, true);\n      this.star.setVelocity(0, 0);\n\n      this.updateUI();\n    }\n\n    spawnNextStar() {\n      if (this.gameState !== 'playing') return;\n\n      const targetLaneIndex = LANE_SEQUENCE[this.sequenceIndex % LANE_SEQUENCE.length];\n      this.sequenceIndex++;\n\n      this.star.enableBody(true, LANES[targetLaneIndex], STAR_START_Y, true, true);\n      this.star.setVelocityY(STAR_SPEED);\n    }\n\n    handleCollectStar(ship, star) {\n      if (this.gameState !== 'playing' || !star.active) return;\n\n      star.disableBody(true, true);\n      star.setVelocity(0, 0);\n      this.score++;\n      this.updateUI();\n\n      if (this.score >= WIN_STARS) {\n        this.gameState = 'won';\n        this.updateUI();\n      } else {\n        this.spawnTimer = this.time.delayedCall(SPAWN_DELAY, () => {\n          this.spawnNextStar();\n        });\n      }\n    }\n\n    update(time, delta) {\n      if (this.gameState === 'playing' && this.star.active) {\n        if (this.star.y > 420) {\n          this.star.disableBody(true, true);\n          this.star.setVelocity(0, 0);\n          this.misses++;\n          this.updateUI();\n\n          if (this.misses >= MAX_MISSES) {\n            this.gameState = 'lost';\n            this.updateUI();\n          } else {\n            this.spawnTimer = this.time.delayedCall(SPAWN_DELAY, () => {\n              this.spawnNextStar();\n            });\n          }\n        }\n      }\n    }\n\n    updateUI() {\n      starsCountDisplay.textContent = `Звёзды ${this.score}/${WIN_STARS}`;\n      missesCountDisplay.textContent = `Промахи ${this.misses}/${MAX_MISSES}`;\n\n      btnPlay.disabled = this.gameState !== 'ready';\n      btnPause.disabled = this.gameState !== 'playing' && this.gameState !== 'paused';\n      btnLeft.disabled = this.gameState !== 'playing';\n      btnRight.disabled = this.gameState !== 'playing';\n\n      if (this.gameState === 'paused') {\n        iconPause.setAttribute('data-lucide', 'play');\n        btnPause.setAttribute('title', 'Продолжить');\n        btnPause.setAttribute('aria-label', 'Продолжить игру');\n      } else {\n        iconPause.setAttribute('data-lucide', 'pause');\n        btnPause.setAttribute('title', 'Пауза');\n        btnPause.setAttribute('aria-label', 'Приостановить игру');\n      }\n\n      if (typeof lucide !== 'undefined' && lucide.createIcons) {\n        lucide.createIcons();\n      }\n\n      switch (this.gameState) {\n        case 'ready':\n          statusDisplay.textContent = 'Готово к старту';\n          statusDisplay.style.color = '#9ba7b6';\n          break;\n        case 'playing':\n          statusDisplay.textContent = 'В полёте';\n          statusDisplay.style.color = '#14b8a6';\n          break;\n        case 'paused':\n          statusDisplay.textContent = 'Пауза';\n          statusDisplay.style.color = '#eab308';\n          break;\n        case 'won':\n          statusDisplay.textContent = 'Победа!';\n          statusDisplay.style.color = '#14b8a6';\n          break;\n        case 'lost':\n          statusDisplay.textContent = 'Игра окончена';\n          statusDisplay.style.color = '#f43f5e';\n          break;\n      }\n    }\n  }\n\n  const config = {\n    type: Phaser.AUTO,\n    parent: 'game-parent',\n    width: 640,\n    height: 420,\n    backgroundColor: '#121417',\n    scale: {\n      mode: Phaser.Scale.FIT,\n      autoCenter: Phaser.Scale.CENTER_BOTH\n    },\n    physics: {\n      default: 'arcade',\n      arcade: {\n        gravity: { y: 0 },\n        debug: false\n      }\n    },\n    scene: MainScene\n  };\n\n  const game = new Phaser.Game(config);\n\n  btnPlay.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.startGame();\n  });\n\n  btnPause.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.togglePause();\n  });\n\n  btnReset.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.resetGame();\n  });\n\n  btnLeft.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.moveShip(-1);\n  });\n\n  btnRight.addEventListener('click', () => {\n    const scene = game.scene.getScene('MainScene');\n    if (scene) scene.moveShip(1);\n  });\n\n  if (typeof lucide !== 'undefined' && lucide.createIcons) {\n    lucide.createIcons();\n  }\n});"
    }
  ]
}
