This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Single-file static web app (index.html) — a hot-seat two-player dinosaur trivia game called "Dino Duel". Players share one device; a privacy "handoff" screen hides Player 1's pick before Player 2 answers. No build system, no dependencies, no tests, no package manifest.
Open index.html directly in a browser, or serve the directory with any static server (e.g. python3 -m http.server). There is no build, lint, or test command — visual verification in a browser is the only check.
Markup, inline <style>, and inline <script> share IDs and CSS hooks — read the three sections together when changing behavior.
- Question pool —
POOLconst (~100 items), each{q, a:<correct>, w:[3 wrong distractors]}.buildGame(n)shuffles the pool, takesnitems, then shuffles the four options per question so the correct index varies per round. - Game state — single
stateobject:names,scores,qi(question index),phase,picks, and the per-gamequestionsarray.QUESTIONS_PER_GAME(default 15) controls round length. - Phase machine —
phasecyclesp1 → handoff → p2 → revealper question. Transitions toggle four<section>cards (#intro,#game,#handoff,#results) via thehiddenclass. Critically,renderOptions()is re-called when handing off to P2 — this rebuilds the<button>elements so the DOM carries no trace of P1's pick (the "no peeking" guarantee). Do not optimize this away. - CSS player theming —
data-p="1"|"2"attributes on score/turn-banner/final cards drive per-player colors (--p1amber,--p2teal). The active player's card gets.activefor glow styling. - Keyboard — global
keydownmapsA/B/C/D(or1-4) to options andEnterto advance past handoff/reveal.
Append to POOL with the exact {q, a, w:[w1,w2,w3]} shape — one correct answer string and three distractor strings. Don't pre-shuffle; buildGame handles randomization and computes the correct index after shuffling.
The repo is initialized for Spec Kit — see .specify/ and the /speckit-* skills. Feature work flows: /speckit-specify → /speckit-plan → /speckit-tasks → /speckit-implement. The project constitution at .specify/memory/constitution.md is still an unfilled template; populate it with /speckit-constitution before relying on /speckit-analyze consistency checks.