Algorithm
Positions are encoded as a pair of 64-bit bitboards (one per player) following Pascal Pons' convention, which lets win detection, move generation and symmetry checks run in a handful of bitwise operations.
The search is a negamax with alpha-beta, anticipated-loss pruning (a move that creates an immediate threat for the opponent is cut), iterative deepening on a null-window, and a transposition table keyed by the canonical position key.
Move ordering is center-first (columns 3, 2, 4, 1, 5, 0, 6) — empirically the strongest static ordering, since central squares participate in the most four-in-a-row lines.
Opening book
An opening book stored in public/c4-book.json caches exact scores (in the Pons convention: positive = win for the side to move, magnitude = distance to the end) for early positions so the UI returns instantly.