BUILD REQUEST - PL-159 Coin Dozer Royale - 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-159-coin-dozer-royale.html. ===== BEGIN SPEC ===== COIN DOZER ROYALE: Brass Cascade & Prize Tower HOOK OBJECT: window.__dozer Build "COIN DOZER ROYALE": a gilded boardwalk coin-pusher arcade cabinet in Three.js where a polished reciprocating pusher shelf shoves 160+ glinting embossed brass coins, silver tokens and faceted prize gems toward a precarious front drop-edge. Dropping coins at the right beat packs the upper tier, pushes overhanging stacks over the lip into the player's win chute, and topples prize gems to unleash a 24-coin Jackpot Shower. LOOK - Style: warm gilded boardwalk arcade cutaway, palette walnut cabinet #3B2316, marquee gold #F2BE42, velvet playfield #18362B, brushed chrome pusher #CED6E0, ruby prize #E63956, emerald prize #2EC47A, warm bulb #FFE8A3. - Subject: an angled 3D cutaway cabinet with chasing warm marquee bulbs along the top arch, a reciprocating upper pusher shelf moving smoothly back and forth every 2.8 s, a lower crowded playfield bed holding 140+ settled brass/silver coins (instanced beveled cylinders with stamped star/crown normal/bump texture and crisp metallic reflections) plus 3 faceted jewel prizes, side house-loss gutters, and a front player win lip opening into a brass catch tray. - FIRST FRAME (t = 0, no input): 42-degree elevated three-quarter front view with the lit playfield, reciprocating shelf, coin bed, overhanging front-lip coins and ruby prize gem filling at least 60% of the screen height, HUD neatly in the top bar outside the cabinet playfield. MOTION / PLAY - Controls: click/tap along the back drop rail or press Left/Right + Space to aim the oscillating coin chute and drop a coin onto the upper pusher shelf (up to 6 coins/s); drag outside the chute to orbit the camera slightly (`setCameraOrbit(az, el, dist)`). - Hand-written coin-deck physics: sub-stepped 3D disc/gem rigid-body simulation with two-tier deck support (upper moving pusher shelf + lower fixed bed), friction transfer so coins riding the shelf travel forward with it and get scraped off by the back wall on the retract stroke, coin-to-coin impulse pushing without coins merging (>85% diameter separation in each layer), front-lip overhang tipping under gravity into the player's win chute, and side-rail spill into house gutters! - Dropping a faceted prize gem over the front win lip triggers a visible JACKPOT SHOWER that rains 24 bonus brass coins across the upper shelf over 2.5 s with flashing marquee bulbs. - ATTRACT MODE: with no input, an arcade sharpshooter demo runs on load and loops every 25–30 s, timing coin drops to pack the pusher stroke, triggering multi-coin front-lip cascades, and pushing at least 1 prize gem over the front lip for a Jackpot Shower. Any input takes over; the demo resumes after 8 s with no input. SOUND - Coin drop & metallic clink -> bright multi-harmonic brass coin ring pitched slightly by coin size. - Pusher servo stroke -> quiet rhythmic mechanical glide. - Front-lip coin cascade -> satisfying rapid brass clatter into the steel catch tray. - Side-gutter loss -> low wooden thunk; Prize gem win + Jackpot Shower -> rising arcade bell fanfare. COUNTERS stats() returns { fps, coinsOnDeck, coinsWon, sideLost, prizesWon, jackpots }. - coinsOnDeck: exact live count of coins and gems currently resting on the upper shelf or lower bed. - coinsWon: +1 each time a coin tips past the front win lip and drops into the player's catch tray. Never on a timer, never on load. - sideLost: +1 each time a coin falls off the left or right side gutters. - prizesWon: +1 when a faceted prize gem falls past the front win lip into the catch tray. - jackpots: +1 when a prize gem win starts the 24-coin Jackpot Shower. - On screen: top arcade scoreboard "WON NNN · PRIZES N · DECK NNN", readable in a paused frame and never over the playfield. 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: 1. First frame: cabinet playfield and coins fill at least 55% of the screen height, coinsOnDeck >= 140, and no two coins on the same tier overlap by more than 20% of a coin diameter. 2. Pusher transport & scrape-off: coins placed on the upper pusher shelf move forward with its extension stroke and are pushed onto the lower bed when the back wall scrapes them on retraction (zero coins pass through the back wall). 3. Conservation of coins: across 15 s of rapid coin drops (`dropped` total), `initialDeck + dropped + jackpotSpawned === coinsOnDeck + coinsWon + sideLost` holds exact to 0 discrepancy, and no coin falls through the solid bed floor. 4. Overhang cascade & prize jackpot: pushing a prize gem past the front lip increments prizesWon by 1, jackpots by 1, and spawns 24 falling bonus coins over ~2.5 s. 5. Attract showcase: 28 s of hands-free advance() scores coinsWon >= 12, prizesWon >= 1 and jackpots >= 1 at smooth frame rate with 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 - Coins merging into a single stack at the same X/Z coordinate or tunneling through the pusher face. - Pusher shelf sliding underneath coins with zero friction or failing to scrape coins off its back stop. - Coins vanishing on the lip with no visible tip-and-fall into the catch tray. - Flat dull yellow discs that don't read as metallic brass coins. - Scoreboard text drawn across the middle of the coin bed. - 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.