-**Framework:** Vite + React 19 + TypeScript (keeping current)
-**Styling:** Tailwind CSS v4 with strict design tokens from spec
-**State:** Zustand stores
-**Backend:** Supabase (self-hosted at caprover.al-arcade.com)
-**Realtime:** Supabase Realtime channels
-**Animations:** Framer Motion (restrained per spec)
-**Bot API:** Stockfish API at stockfishapi.caprover.al-arcade.com
## Rebuild Rules
1. Every phase ends with a deployable build (`npm run build` must pass)
2. After human confirms build is live, I screenshot, analyze, fix or proceed
3. Design system spec is LAW — strict 8pt grid, correct palette, correct radii
4. All data from DB — no hardcoded constants for things that exist in tables
5. Arabic-first, RTL-native
6. Mobile-first, desktop expands
---
## PHASE 0 — Design System Foundation & Token Reset
**Goal:** Rip out all spec-violating styles. Establish the correct token system as the single source of truth. Every component after this phase uses ONLY these tokens.
### Tasks:
1. Rewrite `src/index.css` @theme with correct spec colors:
- Background: `#071120` (not #0B0E1A)
- Secondary Surface: `#0D1728`
- Elevated Card: `#132238`
- Gold: `#E7B83D` (not #FFC83D)
- Royal Blue: `#2979FF`
- Cyan: `#15D7FF`
- Border: `rgba(255,255,255,0.08)`
- Status colors: Win=Emerald, Loss=Crimson, Draw=Amber, Live=Gold, Online=Green
2. Typography tokens:
- Load Inter (English) + IBM Plex Sans Arabic (Arabic primary) + Cairo (fallback)