# Battleship

Classic 10x10 Battleship against the computer. Pure HTML/CSS/JS — no build step, no dependencies.

## Run

Open `index.html` in any modern browser, or serve the folder:

```sh
python3 -m http.server 8000
# then visit http://localhost:8000
```

## How to play

- **Place your fleet:** drag a ship from the dock onto your grid, or tap the ship and then tap a square. Use **Rotate (R)** to change orientation, **Random** for an instant fleet, **Clear** to start over. Tap a placed ship to pick it up again.
- **Battle:** press **Start Battle**, then click/tap the enemy grid to fire. The dot in the status bar and the glowing panel show whose turn it is (green = you, red = enemy).
- Hits burn, misses splash, and sunk ships are revealed with a toast message. Sound effects are generated with the Web Audio API — use the speaker button to mute.
- First fleet completely sunk loses. Restart any time with **New Game**, or **Play Again** on the win/lose screen.

## Computer opponent

- **Hunt:** fires on a checkerboard pattern so it cannot miss a 2-deck ship while searching.
- **Target:** after a hit it probes adjacent squares; once two hits line up it follows the line until the ship sinks.

## Files

| File | Purpose |
| --- | --- |
| `index.html` | Markup and layout |
| `styles.css` | Responsive theme, markers and animations |
| `logic.js` | Board rules, random fleets, hunt/target AI |
| `sound.js` | Web Audio sound effects |
| `main.js` | UI, placement (mouse + touch), battle flow |
