Problem
Build a memory card game (concentration) on a 4×4 grid.
Requirements
- 8 pairs of cards shuffled face-down; click to flip (max 2 face-up).
- Matching pair stays open; mismatch flips back after 600ms.
- Track moves and elapsed time; show win modal when all matched.
- Disable input while comparing two cards.
- (Bonus) difficulty levels (4×4, 6×6), restart, best score in localStorage.
Hints / Approach
- State:
cards[{id, symbol, flipped, matched}],first,second,locked. - Shuffle with Fisher–Yates; duplicate symbols for pairs.
- Win:
cards.every(c => c.matched).