# Harbury Wildlife Quiz — Phase 2 Specification

> Complete the Phase 1 build first (`spec.md`) and confirm the game plays end-to-end
> before starting any of these additions.

## Leaderboard

Add a live leaderboard to the host screen, shown between questions and at the end of the
game:

- Displays all players ranked by score, highest first
- Shows each player's name and current total score
- Updates automatically each time the host advances to the next question
- At game end, the leaderboard replaces the "Game over" message on the host screen
- Players see their own final score and position (e.g. "You scored 30 — 2nd place")

### Changes required

- `quiz.py` — the `/api/state` response already includes scores; no new endpoints needed
- `templates/host.html` — add a leaderboard panel that renders from the state JSON;
  show it between questions and as the end screen
- `templates/player.html` — update the end screen to show position as well as score

## Stretch ideas (pick one)

Once the leaderboard is working, choose one:

- **Countdown timer** — add a 20-second timer per question; when it runs out the host
  screen advances automatically. Show the countdown on both screens.
- **Answer reveal** — after all players have answered (or the timer runs out), show which
  answer was correct on the host screen before the host clicks Next.
- **Correct/wrong flash** — when a player submits an answer, flash the button green
  (correct) or red (wrong) on their phone immediately.
- **New question type** — add a fifth question pattern using the `Source` column:
  *"Which organisation monitors [Name]?"*
