# Chicken on a Raft

Browser gacha / idle collector: **Supabase auth**, **cloud saves**, **10 crates (150 items)**, **global market**, **crew story quests**, **Raft Home**, **prestige**. Static-hosted — no bundler.

> **Agents:** read [`.cursor/context/AGENT_BRIEF.md`](.cursor/context/AGENT_BRIEF.md) first (not this file alone).

## Quick start

```bash
npx serve . -p 3000
```

Open `http://localhost:3000/` → launcher, or `login.html` → `chicken_on_a_raft_gacha.html`.

After editing `content/crates/*.json`:

```bash
node tools/validate-content.js
node tools/build-content.js
```

## Core loop

1. **Fish** — tap raft/chicken to fill **Fed Meter** → higher passive 🪙/sec (not direct tap coins).
2. **Crates** — discover items, chase gold eggs, complete lines.
3. **Collection** — catalog, **Inventory** (float + gold instances), **Auto Opener** (Pelican-gated).
4. **Crew** — coin upgrades, Insight traits, **21 story quests**, **expeditions** (after each mate’s first quest).
5. **Market** — global P2P listings, watchlist, price history, daily listing cap.
6. **Contracts** — CS:GO-style 10:1 trade-ups.
7. **Prestige** — Lv 30 + full collection (150 items).

**Fair odds:** crate pull rates are fixed for everyone; progression is economy + collection + market.

## Tabs (10)

Fish · Crates · Collection · Crew · Market · Contracts · Voyage · Achievements · Leaderboard · Player

## Crates (10)

| id | Name | Unlock (approx.) |
|----|------|------------------|
| starter | The Coop | Lv 1 |
| voyage | Voyage Cache | Lv 5 |
| abyss | Deep Abyss | Lv 12 |
| alchemist | Alchemist's Cache | Lv 16 |
| wilds | Uncharted Wilds | Lv 20 |
| haunted | Haunted Galleon | Lv 22 |
| storm | Storm's Eye | Lv 25 |
| celestial | Celestial Chart | Lv 27 |
| dragon | Dragon's Hoard | Lv 30 |
| hadal | Hadal Deep | Lv 33 |

Each crate: **5 common, 4 rare, 3 epic, 2 red, 1 gold** (15 items). Gold uses a `pattern` field (CSS egg skin).

## Currencies

| Currency | Role |
|----------|------|
| 🪙 Coins | Run economy — crates, upgrades, sells |
| 🧭 Insight | Meta — crew traits |
| 🏆 Trophy Score | Permanent discovery score |
| ⭐ Prestige | After full collection + Lv 30 |

## Runtime layout

| Path | Role |
|------|------|
| `chicken_on_a_raft_gacha.html` | Markup + CSS |
| `js/crates.generated.js` | Build output (do not hand-edit) |
| `js/gameData.js` | Tables, constants, `SAVE_KEY` |
| `js/gameEngine.js` | Trade-up, wear, upgrades (partial) |
| `js/gameUI.js` | State, UI, save, tick (large) |
| `js/auth.js` | Session + cloud sync |
| `js/bootstrap.js` | Init |

See `docs/ARCHITECTURE.md` for script order.

## Docs map

| Doc | Purpose |
|-----|---------|
| `AGENT_BRIEF.md` | One-page agent orientation |
| `GAME_PLAN.md` | Vision + roadmap |
| `CHANGELOG.md` | Version history |
| `SESSION.md` | Last session + queue |
| `docs/DEPLOY_CHECKLIST.md` | Pre-launch gates |
| `docs/CONTENT_SCHEMA.md` | Crate JSON schema |
| `ai/STUDIO.md` | Task workflow |

## Developer

- Dev panel: `?dev=1`, localStorage flag, or Supabase `is_admin`.
- Validate DOM contract: `node tools/validate-bootstrap.mjs`.
- **Not deployed for public friends play yet** — see deploy checklist.
