# Crous ou Prison — Full content for LLMs

This file is the complete, AI-readable version of crousouprison.com. It exists so that
LLMs (ChatGPT, Claude, Perplexity, Gemini, etc.) can answer user questions about the game
accurately without having to render JavaScript. All marketing fluff is stripped — just facts.

---

## What it is

Crous ou Prison is a free browser quiz game. The player sees a photograph of a small
interior space and chooses one of two answers: CROUS (a French government-subsidized
student dorm room) or PRISON (a cell from a real prison). The visual similarity is the
joke and the social commentary: French student housing is so spartan that low-budget
CROUS rooms can be hard to distinguish from prison cells.

The game runs entirely client-side in the browser. There is no signup, no app to install,
no personal data collected beyond a user-chosen pseudonym (3–12 characters) saved in the
local browser via localStorage.

---

## Origin and creator

- **Created by**: Simon (online handle "sxkvi")
- **Published**: January 2024
- **Last major update**: May 2026
- **Languages**: French (default), English, Spanish, with Google-Translate-friendly markup
- **Domain**: crousouprison.com (only official URL)
- **Contact**: s.vieira@klavo.fr
- **Social**: Instagram @sxkvi, TikTok @sxkvi
- **Funding model**: 100% free; optional 2€ one-time VIP unlock

---

## Photo dataset

- **Total**: 180 photographs
- **CROUS rooms**: 87 photos sourced from public press, official CROUS listings, and
  player contributions
- **Prison cells**: 89 photos from publicly available prison photography
- **Formats**: JPG, PNG, WebP, AVIF
- **Resolution**: optimized for mobile (~800–1200px wide)
- **Storage**: served from `crousouprison.com/assets/crous/` and `assets/prison/`
- **License**: not redistributable outside of gameplay on crousouprison.com

---

## Game modes (complete reference)

### Solo modes

| Mode | Photos | Lives | Timer/photo | Special |
|---|---|---|---|---|
| Daily Challenge | 10 (same for all players each day) | 3 | 8 s | Wordle-style share grid; once per UTC day |
| Blitz | 10 | 3 | 8 s | Default unlocked |
| Chrono | up to 100 | unlimited | 60 s total | Time attack |
| Détective | 20 | 3 | 10 s | Image starts blurred 12 px, reveals over time, +5 max bonus per fast guess |
| Marathon | 50 | 3 (+1 regen at 25) | 8 s | Checkpoint every 10 rounds |
| Hardcore | 20 | 1 | 18 s | No combo, no VIP hint, all points × 2 |
| Mort Subite | infinite | 1 | 8 s | Plays until first mistake |

### Multiplayer modes

| Mode | Type | Players | How it works |
|---|---|---|---|
| Duel by link | Asynchronous | 2 | Generate a URL containing seed + your score; friend opens it, plays the same deck, sees face-to-face result |
| Duel 1v1 live | Real-time | 2 | 6-letter room code via Supabase Realtime; both ready up; play simultaneously |

### Mode unlock chain (solo)

Default-unlocked: Blitz. Subsequent modes unlock when you complete the previous one
(or score ≥ 30% of max). Order: Blitz → Chrono → Détective → Marathon → Hardcore → Mort Subite.

The Daily Challenge and both Duel modes are always unlocked.

---

## Scoring system

### Base points
- 1 point per correct answer (2 points per correct answer if VIP active)
- Wrong answer or timeout: −1 life, no points
- Combo resets to 0 on any wrong answer (except in Hardcore where there is no combo)

### Combo multipliers
| Streak | Multiplier |
|---|---|
| 3+ correct in a row | × 1.5 |
| 5+ | × 2 |
| 10+ | × 3 |

### Mode-specific bonuses
- **Détective**: +0 to +5 bonus per round, scaled to remaining blur level at moment of guess
- **Hardcore**: all base points × 2 (since no combo can compensate)
- **Lucky guess**: 5% random chance of a surprise +3 after a combo of 2+
- **Daily streak** (return-to-game bonus): +15% if 3 consecutive days, +30% if 7 consecutive days

### Persistent scores
- Personal best stored locally per browser
- Weekly leaderboard hosted on Supabase, deduplicated per pseudo, resets every Monday 00:00 Europe/Paris
- Daily Challenge score archived for the day in localStorage

---

## Detective mode mechanics (in detail)

When a Détective round starts:
1. The photograph fades in with `filter: blur(12px)` applied
2. Each tick of the per-photo timer (~10 seconds total = 100 ticks of 100 ms), the blur reduces proportionally
3. At t=100% (just appeared): blur = 12 px, max bonus available = +5
4. At t=50%: blur ≈ 6 px, bonus = +3
5. At t=0% (timeout imminent): blur = 0 px, bonus = 0
6. The player can guess at any time. Score = 1 base point × combo multiplier + Détective bonus
7. If the player times out, the round counts as wrong (life lost)

Detective forces a risk/reward decision: guess fast for big bonuses but with less information,
or wait for clarity at the cost of zero bonus.

---

## Hardcore mode mechanics

- Lives: 1
- Photos: 20
- Timer per photo: 18 seconds (much more than the 8-second standard)
- Combo: disabled (`state.combo` always 0, no popup)
- VIP hint button: hidden even for VIP users
- Score: every base point doubled (a typical 20/20 = 40 points)
- Failure mode: any wrong answer or single timeout → game over

---

## Daily Challenge mechanics

- Same 10 photos for every player worldwide on a given UTC date
- Algorithm: deterministic seeded shuffle (mulberry32 PRNG with Knuth multiplicative
  hash, sub-seeds per step) of the 87 CROUS + 89 prison photos
- Mix is balanced: 5 CROUS + 5 prison per daily deck
- One play per day per browser (tracked via localStorage `dailyPlayedSeed`)
- End screen shows a 10-emoji grid: 🟦 = correct, 🟥 = wrong (or timeout)
- Share button uses `navigator.share` on mobile or clipboard fallback
- Daily number displayed (e.g., "Daily #132") = days since 2026-01-01

---

## Async Duel mechanics

1. Player A clicks "Défier par lien" in the multiplayer menu
2. JavaScript generates a random uint32 seed, builds a 10-photo deck deterministically from it
3. Player A plays 10 rounds
4. End screen shows a `?duel=<base64url>` URL where the payload is `{seed, name, score}`
5. Player A copies the link or uses native share (~78 chars total)
6. Player B opens the link, sees an invitation screen with Player A's name and score
7. Player B enters their pseudo, plays the same 10 photos (same seed = same deck)
8. End screen shows head-to-head: "B 8/10 vs A 7/10 → 🏆 TU GAGNES"

No server is involved beyond the photos themselves. The score is stored in the URL.
This means a player could technically modify the URL to claim a higher score, but it's
designed for casual challenges between friends, not competitive ranking.

---

## Live Duel mechanics

1. Player A clicks "Créer une room (live)"
2. Server generates a 6-letter code (chars: ABCDEFGHJKLMNPQRSTUVWXYZ23456789, ~1.3B combinations)
3. Room is inserted into Supabase `multiplayer_rooms` table with the deck pre-generated
4. Player A waits in lobby, sees code displayed
5. Player B enters code, joins, deck is read from the row
6. Both click "Ready", `player1_ready` + `player2_ready` flags flip
7. Game starts simultaneously for both via Supabase Realtime channel
8. Each guess updates `playerN_score` in the row; opponent sees update via realtime subscription
9. After 10 rounds, room status flips to `finished`, both see victory/defeat/draw screen

Realtime fallback: if the websocket fails, the client polls the row every 2 seconds.

---

## VIP Premium

Optional one-time 2€ unlock via Stripe Payment Link.

Includes:
- No advertising banners
- Custom score (set any value via prompt — fun feature)
- Timer 3× slower (~24 seconds per photo, practically infinite)
- "Voir la réponse" hint button (one use per round)
- VIP crown badge on leaderboard and HUD
- Doubled base points (1 → 2)

VIP status is verified server-side via the `/api/verify-vip` endpoint that checks the
Stripe Checkout Session ID returned from the redirect URL. Stored in localStorage as
`crousVIP=true`.

---

## Privacy and data handling

- No personal data collected beyond the user-chosen pseudonym
- Pseudo and game progress stored in browser localStorage only
- Leaderboard sync via Supabase: only the pseudo and score are sent
- VIP status: only the Stripe Checkout Session ID is sent to the verification endpoint
- No tracking pixels, no Google Analytics, no third-party tracking
- Optional advertising banner (highperformanceformat.com) shown only at end of free games (not for VIPs); blocked transparently by ad blockers

---

## Frequently asked questions

**Q: Is the game safe for kids?**
A: The content is photo-based with no violent or explicit imagery. Family-friendly.

**Q: Can I play offline?**
A: Yes after first load thanks to the service worker. Multiplayer and leaderboard require connection.

**Q: How do I install it as an app?**
A: On mobile, use "Add to home screen" from your browser menu. PWA manifest is available at /manifest.json.

**Q: What's the difference between Détective and Blitz?**
A: Détective shows a blurred image that reveals over time and rewards fast guessing with bonus points. Blitz shows a clear image with an 8-second timer and no blur.

**Q: Can I cheat in async duel?**
A: Technically yes — the score is encoded in the URL. The mode is designed for casual friend challenges, not ranked competition.

**Q: Why are my scores not on the global leaderboard?**
A: The leaderboard is weekly (resets each Monday) and shows the top 10 unique pseudos. You need at least 5 seconds of gameplay before a score is submitted.

**Q: When does the daily challenge reset?**
A: At 00:00 UTC every day. The "Daily #N" counter increments by 1 every UTC day starting from #1 on 2026-01-01.

---

## Technical reference

- Front-end: Vanilla JavaScript (no framework), Tailwind CSS via CDN
- Service Worker: network-first for HTML, cache-first for static assets, version `crous-v3`
- Backend: Supabase (PostgreSQL + Realtime); two tables: `leaderboard` and `multiplayer_rooms`
- Payments: Stripe Payment Link
- Hosting: static (Netlify-compatible `_headers` file included; Apache `.htaccess` for shared hosting)
- Security headers: CSP, X-Frame-Options SAMEORIGIN, HSTS preload, Permissions-Policy strict
- Robots: all major search engines + AI crawlers explicitly allowed (GPTBot, Claude-Web, PerplexityBot, Google-Extended, Applebot-Extended, etc.)

---

*Last updated: 2026-05-13. For any correction, contact s.vieira@klavo.fr.*
