Create a single-file HTML page drawing a richly detailed 3D lighthouse in a blocky Minecraft / Roblox inspired voxel style. Use actual 3D geometry and perspective (WebGL or your own projected 3D renderer), not a flat illustration spun in CSS. Automatically rotate the camera around the island so every side becomes visible. Add as many coherent details as possible: striped masonry tower, lantern room and revolving light beam, balcony and railings, door and windows, keeper's cottage, stairs, rocky island, dock, small boat, waves, foam, trees, grass, flowers, crates, birds and clouds. Use directional lighting, depth sorting or depth testing, and distinct materials. The lighthouse must be the clear focal point.
Support pointer dragging to orbit horizontally and vertically, wheel zoom, pause/resume, and reset view. Make the scene fit both desktop and mobile. Do not load external libraries or assets; a compact hand-written 3D renderer is acceptable.
Interaction contract for reproducible testing: render the scene in canvas#scene. Provide button#toggle-rotation with aria-pressed="true" while auto-rotation is running and "false" while paused. Start running. Pausing must freeze ALL animation (water, birds and beam included), while manual orbit still works. Provide button#reset-view: reset camera orientation and zoom to the same initial view and pause all animation. These controls must be visible and outside the canvas.
Sandbox contract (global) — appended to the prompt
Every task whose output runs in the demo iframe gets this contract appended verbatim. It is part of the prompt hash, so editing it re-runs the task rather than replaying a cached response.
EXECUTION ENVIRONMENT — your artifact runs inside a locked-down sandboxed iframe (sandbox="allow-scripts", opaque origin, NO network access). Hard requirements:
- Produce ONE complete, self-contained HTML document: <!DOCTYPE html> through </html>.
- Use this exact skeleton: <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>...</title><style>...</style></head><body>...</body></html>. The DOCTYPE must be the very first node — a DOCTYPE after any other content still triggers quirks mode, and the canvas/CSS sizing comes out wrong. All visible content must live inside <body>, never as bare siblings of <html>.
- Inline ALL CSS and JavaScript. Nothing may load from the network: no <script src>, no <link href>, no @import, no CDN (React/Tailwind/three.js/fonts/images included). If you need a library, hand-write the code instead.
- Write plain browser JavaScript only. No JSX, no <script type="text/babel">, no Babel standalone, no TypeScript, no build step, no runtime compilation.
- localStorage/sessionStorage/cookies may be unavailable — feature-detect or wrap in try/catch; the page must still work without them.
- No alert/confirm/prompt; render all feedback into the page itself.
- Wrap your top-level script body in try/catch and, on failure, write the error message into a visible <div role="alert"> inside <body>. The sandbox auto-injects an error overlay, but a model that catches its own errors and renders them gives a much better demo than one that crashes silently.
LAYOUT — the showcase frame is short and sometimes narrow (~1200×600 CSS px on desktop, ~380×480 on mobile). Fill it; don't sit in the corner:
- Set html,body{margin:0;padding:0;min-height:100%;box-sizing:border-box;background:#0c0c10;color:#ececf0;font-family:ui-sans-serif,system-ui} so the page fills the frame and inherits a dark backdrop.
- Size any <canvas> with CSS — width:100%;height:100% or width:100vw;height:100vh — NOT with the canvas.width/canvas.height attributes, which set the bitmap (not the displayed size) and leave the canvas stuck at its initial size inside the larger frame.
- Add a window 'resize' listener that recomputes the canvas backing store from window.innerWidth/innerHeight × devicePixelRatio and redraws the scene. A canvas that doesn't resize on viewport change is the single most common rendering bug in this benchmark.
- Animate with requestAnimationFrame; cancel on window 'unload' to avoid leaks across navigations.
QUALITY BAR — the artifact is showcased head-to-head against other frontier models:
- Fill the viewport; default to a polished dark theme with a small overlay containing the title and any controls (sliders, buttons, stats).
- The showcase frame is short and sometimes narrow — roughly 1200×600 CSS px on desktop and 380×480 on mobile. Keep HUD overlays compact (they must not cover the scene on small screens), and compose the scene so the critical action is visible at those sizes from the first frame.
- Every control must actually work. No placeholder text, no TODOs, no dead buttons, no lorem ipsum.
- Make the first frame already look intentional — no unstyled white flash, no collapsed layout while scripts boot.