# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

**Virtue Slots** is a browser-based Phaser 3 slot machine game with a Christian religious theme. The full design specification is in `software.md`.

## Tech Stack

- **Phaser 3** (loaded via CDN or local script tag — no bundler)
- **Vanilla JavaScript with ES6 modules** (`import`/`export`)
- **No build step, no webpack/vite/bundler** — files are served directly
- **1600x900 canvas**, scaled to the user's viewport

## Running the Game

Serve the files over HTTP (browsers block ES6 module imports from `file://`):

```bash
python3 -m http.server 8080
# or
npx serve .
```

Then open `http://localhost:8080` in a browser.

## Architecture

The game uses ES6 modules with direct object references — no bundler required. Structure files as Phaser Scenes or plain classes, each in its own file, exported and imported directly.

Key architecture decisions from `software.md`:
- **No web packager** — all JS must be loadable via `<script type="module">` or Phaser's own loader
- **Modular and scalable** — each symbol, scene, and UI component should be its own class/file
- **Vector graphics first** — use Phaser's Graphics API as placeholders; sprites can replace them later

### Game Structure (from spec)

- **UI layout**: Three boxes at top (Your Funds / The Lord / Sin), slot reels in center, wide message/spin area at bottom
- **Economy**: Player starts with $1000; spins cost $50; wins split 60% player / 40% to "The Lord" (tithing)
- **Symbols**: 10 religious Christian symbols (baby jesus, cross, jesus on cross, crown of thorns, halo, etc.) — holier symbols yield higher payouts on match
- **Win rate**: ~1 in 15 spins
- **Win animation**: Screen brightens, gold/money icons rise to player and lord funds (angel-ascending-with-cash effect)
- **Loss animation**: Devil carries spent money up to the Sin box; message "Thou Hath Sinned." + "Redeem Yourself!" near spin button
- **Controls**: Click Spin button or press Space Bar

### Suggested Scene/File Layout

```
index.html          — Loads Phaser and main.js as type="module"
main.js             — Phaser game config, registers scenes
scenes/
  BootScene.js      — Asset preload
  GameScene.js      — Main gameplay
  UIScene.js        — Overlay HUD (funds display, message box)
objects/
  Reel.js           — Single reel logic and animation
  SlotMachine.js    — Orchestrates 3 reels, spin/result logic
  Symbol.js         — Symbol definitions, payout values
  WinAnimation.js   — Holy win effect
  LossAnimation.js  — Devil/sin effect
```
