# Window-level input guards `attachEndTurn` in `ui.ts` binds its Enter/Space handler to `window`, not to the End Turn button. That one decision has now produced three separate bugs, each found after the guard was believed correct: 1. 2026-09-06 — `button.disabled` suppresses the button's own click but has no effect on a window listener, so Enter/Space kept ending turns after a win. Fixed by moving the real legality check into `game.ts`. 2. 2026-09-07 — adding a `