# Phase 02 — Modal A11y + Simplifier Hygiene Wins **Priority:** Medium **Status:** pending **Effort:** ~M (touches 4-5 files, ~30 LOC saved net) ## Context - Reviewer C3: DonateModal lacks auto-focus on open and focus-restore on close. - Simplifier #12: `.overlay`/`.dialog` CSS duplicated between GameView and DonateModal — extract to `app.css`. - Simplifier #13: `touch-action: manipulation` + `-webkit-tap-highlight-color: transparent` repeated; could move to global `button { }` in `app.css`. - Simplifier #1: `level-parser.js` has `key as cellKey` re-export — only used inside `board-model.js`; alias is purely cosmetic. Drop or pick one name. - Simplifier #3: `BoardModel.isSolved` has `if (this.boxes.length === 0) return false;` — Microban guarantees ≥1 box, but the guard is also cheap to keep. Inline the early-return into the return expression for one-line clarity. - Simplifier #4: `LevelSelectView` declared `completedCount` as `$state` but never reassigns it — should be `const`. - Simplifier #7: `Board.svelte` redeclares `DIRS` array inside `$derived.by` — move to module scope. ## Out of scope - `LevelSelectView.completedCount` not refreshing on return-from-game — separate bug, not a simplification (would belong in a future bugfix plan). - DonateModal extraction into a store (only 2 callsites). ## Architecture ``` app.css + .overlay / .dialog shared classes + global button { touch-action; -webkit-tap-highlight-color } GameView.svelte remove .overlay / .dialog scoped CSS, use shared DonateModal.svelte remove .overlay / .dialog scoped CSS, use shared + auto-focus CLOSE on open, restore on close MobileControls.svelte remove now-redundant button styles AppButton.svelte remove now-redundant touch-action / tap-highlight level-parser.js drop `key as cellKey` re-export board-model.js import key directly (rename usages) board-model.js inline isSolved guard LevelSelectView.svelte $state completedCount → const completedCount Board.svelte hoist DIRS to module scope ``` ## Implementation Steps ### A. Modal a11y — DonateModal focus management ```svelte ...