# Benchmark Specification: KL Star Runner (1-Shot Prompt)

Build "KL Star Runner" — a single-file web game (ONE index.html, no build step, no
asset files, everything else generated in code) in the spirit of Star Fox 64:
an on-rails flight shooter through a stylized golden-hour Kuala Lumpur skyline.

## GAMEPLAY (all decided — do not re-ask):
- On-rails corridor: world scrolls toward player at ~60 units/s (total route
  10,800 units ≈ 3 min). Ship steers within a bounded flight screen
  (X ±22, Y 2–30). Shift = boost ×1.6, Ctrl = brake ×0.6. Camera chases with lag.
- Keyboard only: Arrows/WASD steer, Space hold-to-fire rapid lasers (8/s),
  B smart bomb (start 2), Enter pause/confirm, Esc to title.
- 3-hit shield, 1s invulnerability after each hit. Building collision =
  1 hit + bounce toward corridor center.
- Route segments (by distance): 
  - `0` Approach (warm-up drone waves) →
  - `2700` KLCC CANYON (thread BETWEEN the Petronas Twin Towers, pass under the Skybridge; rooftop turrets introduced) → 
  - `5400` KL TOWER · 118 flypast (denser mixed waves, 2 turret clusters) → 
  - `8400` BOSS (arena opens; boss gunship hovers in front of Merdeka 118's crown) → 
  - `10800` end.
- Enemies: 
  - drones 1hp/100pts (weaving paths, some fire single aimed shots)
  - turrets 2hp/150pts (rooftops, aimed fire).
- Boss: 100hp, health bar, 3 patterns (aimed 3-burst, fan spray, summon 2 drones), phases scale at 66%/33% hp, drops +1 bomb at half health, 5000pts.
- Scoring: survival 10pts/s, bomb kill +50 each, victory bomb bonus +500/bomb.
- Lose: shield 0 → game over. Win: boss destroyed → victory. Both lead to 3-char arcade name entry if score makes top 10.

## VISUALS — Golden Hour:
- Shader gradient sky dome (amber horizon → dusty rose → indigo zenith) with sun disc low behind the skyline, warm fog (`0xe8a06a`, 60–1500) fading distance into sunset, silhouette buildings with lit windows.
- Landmarks procedural from Three.js primitives (approximate, stylized):
  - **Petronas Twin Towers** at `x=±42`: octagonal tubes with stepped setbacks, crown spires, Skybridge box across at `y=44` (ship maxY 30 → always flies under it). Clear half-gap (`|x|−r = 26`) must exceed flight maxX 22.
  - **KL Tower** at `x=+95`: dark green hill knob, cream shaft, observation deck, spire.
  - **Merdeka 118** at `x=−75`: tapered square prism (4-sided cylinder) with faceted diamond crown, ~174 tall — the boss backdrop.
  - **Instanced filler blocks** flanking the corridor (`|x|>38`), ~6 height classes, canvas-generated lit-window texture (80% warm / 20% cool), emissive.

## HUD:
- Score, 3 shield rings, bomb icons, speed bar, stage label, boss health bar, red damage vignette, pause overlay. 
- Title menu (`START` / `SETTINGS` / `LEADERBOARD`) keyboard-navigated. 
- Briefing card before launch.

## AUDIO:
- WebAudio synth only, NO files. 
- Voices: laser, enemy laser, explosion, big explosion, hit alarm, boss alarm, bomb, UI blip, engine hum looping filtered noise whose pitch follows speed. 
- AudioContext created on first keypress (autoplay policy). Master gain from saved settings volume.

## STORAGE:
- localStorage key `"kl-starfox-save"`:
  ```json
  {
    "scores": [{ "name": "FOX", "score": 10000, "stage": "VICTORY", "date": "2026-10-15" }],
    "settings": { "volume": 0.7, "sensitivity": 1.0 }
  }
  ```
- Top 10 scores. Settings live-applied (volume 0–1, sensitivity 0.5–1.5). Corrupt JSON → defaults, never throw.

## TECH SPECIFICATIONS:
- Three.js 0.160.0 pinned from unpkg via import map, vanilla JS, one `<script type="module">`, fixed-timestep sim (120 Hz accumulator, render decoupled).
- Code sections in order:
  `CONFIG` → `SAVE` → `INPUT` → `AUDIO` → `CITY` → `SHIP` → `BULLETS` → `ENEMIES` → `BOSS` → `HUD` → `GAME` 
- State machine:
  `title` → `briefing` → `playing` → `paused` → `gameover`/`victory` → `leaderboard`/`settings`

## VERIFY:
- Verify before delivery in a real browser: clean boot (no console errors), full route playable, drone killed, damage taken, bomb used, boss beatable, name entry, leaderboard persists across reload. 
- No stubs — every feature above works. If something is ambiguous, pick the most fun option and note it; don't stall on questions.
