Game: Tower Defense
Theme: Cyberpunk
Map: Single Path
Date: 2026-04-14

## Prompt
Build a 3D tower defense game in a single HTML file using Three.js. 

**Game Title**: Firewall - The grid defends itself.

**Theme Constraints (Cyberpunk)**: 
Palette: Night black (#0a0a14), neon pink (#ff00aa), electric cyan (#00ffee), warning amber (#ffaa00), grid purple (#8800ff). 
Terrain: Dark city blocks as the grid. Glowing neon path (emissive material). Rain particle system falling from above. 

**Core Mechanics**:
- Economy: Start with 150 gold. Earn gold from kills (5 to 100 based on enemy size).
- Base HP: 20 lives. 
- Map: 15x12 grid with tile size 2.0. Single winding path with 4-6 turns. All tiles adjacent to path are buildable.
- Projectiles must have travel time (no instant hit), except beams.
- Targeting: Towers can be clicked to cycle targeting modes (First, Strongest, Weakest, Fastest).
- HUD: DOM overlay showing Gold, Lives, Wave, Timer, Game Speed (1x, 2x, 3x).
- Tower Panel: UI to select, place, upgrade (3 tiers), and sell towers (60% refund).

**Tower Types (6 types, 3 tiers each)**:
All towers must be programmatically built using Three.js primitives and visually distinct.
1. Turret Node (Basic): Box with rotating top, pink bolts. 
   - T1: 50g, 30dmg, range 4. 
   - T2: 75g, +40% dmg, +10% range. 
   - T3: 125g, +100% dmg, +25% range, piercing shots.
2. Railgun Spike (Sniper): Tall thin spire, charges cyan beam.
   - T1: 75g, 80dmg, range 7, slow fire. 
   - T2: 110g, +40% dmg, +10% range. 
   - T3: 185g, +100% dmg, +25% range, critical hits (2x dmg, 20% chance).
3. EMP Bomb (Splash): Dome that pulses purple shockwave ring on fire.
   - T1: 100g, 20dmg AoE, range 3. 
   - T2: 150g, +40% dmg, +10% range. 
   - T3: 250g, +100% dmg, larger blast radius + DOT.
4. Firewall (Slow): Wall of vertical neon lines.
   - T1: 60g, 5dmg, slows 30%, range 3. 
   - T2: 90g, +40% dmg, +10% range. 
   - T3: 150g, +100% dmg, 1s complete freeze.
5. Bit Storm (Rapid): Hovering cube, sprays rapid cyan projectiles.
   - T1: 80g, 10dmg, very fast fire, range 3.5. 
   - T2: 120g, +40% dmg, +10% range. 
   - T3: 200g, +100% dmg, double barrel.
6. Blackout (Special): Large antenna.
   - T1: 150g, disables enemies in range for 1s, range 4, slow cooldown.
   - T2: 225g, +40% dmg, +10% range.
   - T3: 375g, +100% dmg, disables for 2.5s.

**Enemy Types (6 types)**:
Enemies have geometric bodies colored by type, size scaling with HP. Give them overhead HP bars.
- Malware Drones: Low HP, fast, spawn in swarms.
- Trojan Walkers: Medium HP, medium speed.
- Worm Swarm: Chain of spheres.
- Ransomware Tank: Very high HP, slow, reduces incoming damage.
- Sprinter: Low HP, very fast.
- AI Core Boss: Massive glowing polyhedron. Every 5 waves. 3 lives damage.

**Wave System**:
- 20 manually defined waves.
- Wave 1 is tutorial (scouts only).
- Every 5th wave is a Boss wave.
- 15s between waves with a "Next Wave" skip button.
- HP scales max 8x, speed max 2.5x.

**3D Graphics**:
- Isometric perspective camera (45 deg down). 
- Pan with right-click/two-finger, zoom with scroll/pinch.
- Tower placements show range circles (green/red valid/invalid).
- Explosions and projectile effects.
- 60fps target.

Must be exactly one HTML file containing everything.

## Notes
Cyberpunk aesthetics applied strictly.
