Original prompt
Write a complete, playable single-file HTML document implementing a Snake game on an HTML5 canvas (NO libraries - pure DOM + Canvas 2D API). Create an 800x600 canvas, render a grid, a snake that moves on a tick timer, grows by one segment when it eats food spawned at random free cells, and dies when it hits a wall or itself. Control the snake with arrow keys/WASD; queue direction changes so a 180-degree reversal is impossible. Show a live score HUD (food eaten / current length) via HTML overlay. Include a Start and Game Over screen with a Restart button. Style the page with a clean, modern look (dark background, rounded borders, subtle shadows) - no external assets or fonts.SCORING & PERSISTENT HIGH-SCORE BOARD (REQUIRED): The game MUST award points for gameplay actions and maintain a persistent high-score table. When a run finishes, prompt the player to enter their name/initials and record it with the score. Save the top 5 scores (name + score) to a local JSON file in the working directory (e.g. high_scores.json), and also write the latest finished run as {"initials": name, "score": number} to /tmp/alpaca_score.json (overwrite it every run) so the arcade scoreboard can pick it up automatically, load and display them on startup and on the game-over screen, and write a new entry whenever a run finishes. Scores must survive restarting the program. Every new game MUST start with the score reset to 0 - never carry over the previous game's score into the next session. Every new game MUST start with the score reset to 0 - never carry over the previous game's score into the next session. SUCCESS CRITERIA: the page must (1) run a real game loop with collision detection, (2) render the snake, food and grid on canvas, (3) accept keyboard input, (4) persist a top-5 high-score table with name entry, and (5) auto-start the game loop without a user gesture so the headless renderer captures a non-blank frame. OUTPUT FORMAT: Respond with the COMPLETE, self-contained HTML document in ONE single ```html code block. Do NOT split the code across multiple blocks, do NOT include a thinking summary inside the block, and do NOT place any prose, explanation, or comments between the opening and closing of the code block. The entire document (doctype through </html>) must be inside one fenced code block so it can be extracted and rendered verbatim. OUTPUT REQUIREMENT: Respond with ONLY the raw, runnable source code in a single fenced code block, with the first line starting at column 0 (no leading indentation). Do not include any thinking, explanation, summary, or prose before or after the code, and keep comments inside the code minimal.