BUILD REQUEST - PL-176 Mole Patch - please build this now I'm sending you this as my request: please build the one-file HTML app described below. Start now and do the whole build in your answer to this message. - This is a build job, not a document to summarize, review or discuss. Don't ask me anything first: if a detail is unclear, pick the most sensible option and keep going. - The spec is everything between the BEGIN SPEC and END SPEC lines. Follow all of it exactly. - If your tool can create files, also save the finished file as PL-176-mole-patch.html. ===== BEGIN SPEC ===== MOLE PATCH: 60-Second Whack Party HOOK OBJECT: window.__moles Build "MOLE PATCH": a cheerful 60-second whack-a-mole game in Canvas 2D (no libraries). Nine dirt holes in a grass patch, round furry moles pop up and duck down again, and you tap them before they hide. Keep a streak going and your points multiply. It plays itself in the demo, so it is always fun to watch. LOOK - Style: bright, chunky cartoon with thick outlines #3A2418, soft gradients and shine spots. Sky gradient #9FE0FF to #E6F8FF at the top; grass #6CCB5F with darker stripes #58B84E; dirt rings #7A4B2A with dark hole centers #2B1A10. - A 3 x 3 grid of holes, each 150 px wide at 1280x720 (scale with the screen), with 40 px of space around them. The grid fills about 75% of the screen height. - Moles: round brown furry balls #8B5A3C with a pink nose #FF8FA6, two small eyes (#FFFFFF with black pupils), two tiny front paws and a belly #D6A27A. A mole pops up from the hole (the part below the hole rim is hidden), and its eyes look slightly toward the pointer. - A big wooden mallet #B97A3E with a red band follows the pointer and swings down on a tap. - HUD: a bar at the top with "SCORE", "TIME 60" and "STREAK" in big numbers (at least 28 px), never over the holes. - FIRST FRAME (t = 0, no input): the full grid, at least 1 mole already poking up, TIME 60, SCORE 0, STREAK 0, and a "TAP THE MOLES" hint under the grid (it disappears after the first whack). MOTION / PLAY - A round lasts 60 s of game time. Moles come out of random holes (use the seed); never more than 3 are up at once, and a new mole appears about every 0.7 s on average. Each mole takes 0.25 s to rise, stays up for 0.9 s (1.2 s in the first 15 s of the round, 0.6 s in the last 15 s), and takes 0.25 s to sink. - Tap, click or press 1–9 (in a grid layout on a numeric keypad) to whack. A tap hits if it lands on a mole that is at least halfway up; the mole squashes flat with stars for 0.4 s and sinks. A tap on an empty hole or on a mole that is not up yet just makes the mallet thud. - Score: a hit scores 10 times the streak multiplier. The streak counts hits in a row without a mole escaping. The multiplier is based on the streak before the hit: 1 for streaks 0–2, 2 for 3–5, 3 for 6–8, and so on, up to 5. A mole that sinks without being hit is an escape: the streak goes back to 0. - At 0 s the round ends, a results card shows the final score for 3 s ("TIME'S UP"), then a new round starts. - ATTRACT MODE: with no input, a hands-free demo starts on load and loops every 25–30 s: it plays one full 60-second round at about 2.15x speed (28 s of real time, with every game number kept in game time), with a robot player that taps each mole 0.35–0.7 s after it is up (and misses about 1 in 8 on purpose). Any input takes over at normal speed; the demo resumes after 8 s with no input. SOUND - A short rubbery "boing" each time a mole rises. - A bonk plus a squeaky "oof" when a mole is hit (pitch goes up with the streak). - A soft "whiff" when the mallet misses. - A sad little slide-down when a mole escapes. - A rising "ding" when the multiplier goes up, and a fanfare when the round ends. COUNTERS stats() returns { fps, score, hits, escapes, bestStreak, rounds }. - score: +10 x the multiplier exactly when a mole is hit and squashes. - hits: +1 exactly when a mole is hit. - escapes: +1 exactly when a mole finishes sinking without having been hit. - bestStreak: the longest streak so far; it goes up only when a hit makes the streak longer than the old best. - rounds: +1 exactly when a round ends and the results card appears. - On screen: score, time and streak in the top bar, readable in a paused frame and never over the holes. CHECKS for ?test=1 With ?test=1, run an accelerated self-test that measures real positions and real events (not self-set flags) and logs "TEST n PASS" or "TEST n FAIL: reason" to the console and to window.__testResults: Each check starts from a fresh load; advance() steps in 1/60 s increments. 1. There are exactly 9 holes, the grid is at least 60% of the screen height, at least 1 mole is up at t = 0, and over advance(60) there are never more than 3 moles up at the same time. 2. A tap on the center of a mole that is fully up adds exactly 1 to hits and 10 x the multiplier to score; a tap on an empty hole changes neither. 3. Three hits in a row make the multiplier 2 (the next hit adds 20 to score), and a mole that escapes sets the streak back to 0 and adds exactly 1 to escapes. 4. After advance(60) the round ends: rounds goes from 0 to 1, the results card shows the score, and a new round with TIME 60 starts 3 s later. 5. In a 28 s attract loop the robot lands at least 20 hits, every mole that is not hit stays up (from the start of its rise to the start of its sinking) at least 0.5 s, and there are zero console errors. KEEP IT SHORT - Keep the whole file under about 1,500 lines (soft target) so you can write it in one pass and finish well inside 15 minutes. - Save lines with helpers, loops and instancing, not by dropping features. Everything above must really work: no placeholders, no TODOs. BUILD RULES (all required): - Deliver ONE self-contained HTML file: inline CSS and JS, no build step, no local assets. Libraries only from a CDN. If you use Three.js, use exactly this import map: {"imports":{"three":"https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js","three/addons/":"https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/"}} - It must open straight from disk in desktop Chrome and on an iPhone (Safari), fill the full screen, handle resize and touch, and stay smooth (target 60 fps). - It must look stunning in the very FIRST frame: no black screen, no loading wait, no tiny subject. The main subject fills at least 50% of the screen height. - SOUND (required): all sound is made in code with Web Audio (no audio files). Show a small "🔊 TAP FOR SOUND" chip; on the first tap create ONE AudioContext, route everything through a master gain of 0.6 into a DynamicsCompressor, and hide the chip. Also expose enableAudio() on the hook object named at the top. - Expose the hook object named at the top with: setCameraOrbit(azimuthDeg, elevationDeg, distance) (or an equivalent camera setter), advance(seconds) that steps the simulation exactly that much for still captures, enableAudio(), and stats() returning {fps, ...the counters named above}. Use a fixed random seed of 360 so every run is the same. - Every on-screen counter must count a real event you can see happen. No fake numbers. - No text overlapping the subject; any label must be readable in a paused frame. - No brand logos, no real people, no copyrighted characters, brand names or logos. FAILURE MODES TO AVOID - A blank page, or only the HUD on a blank page, because one script error stopped the scene. - Moles that are visible below the hole rim, or that pop up with no hole. - A tap that hits when it was not on a mole, or misses when it clearly was. - A score that goes up with no hit, or a streak multiplier that never changes. - More than 3 moles up at once, or a round that does not end at 60 s of game time. - A demo that plays at a different game speed than a real round, so the 60-second clock and the real time disagree. - Counters that tick on a timer instead of when a hit or escape happens. - A HUD that is tiny, unreadable, or drawn over the holes. - The same variable declared twice, or methods called on objects that don't exist yet. SELF-TEST LOOP - If you can run code: build the file, open it, read the console, run ?test=1, and take screenshots at 3 s, 10 s and 30 s at 1280x720 and 390x844. Look at the screenshots and fix what looks wrong. Fix and retest until all 5 checks pass with zero console errors. Mark anything you could not run as UNMEASURED; never invent results. - If you are chat-only: go through this prompt line by line, check your code against each line, and fix anything that would fail. Then write one corrected, complete file. - Final answer: ONE complete HTML file in ONE code block, then the 5 checks marked PASS, FAIL or UNMEASURED. No snippets, no "rest unchanged". ===== END SPEC ===== Now build it. Reply with ONE complete HTML file in ONE code block, then the 5 checks marked PASS, FAIL or UNMEASURED.