diff --git a/.agents-docs/AGENTS-architecture.md b/.agents-docs/AGENTS-architecture.md index 3cdcf03..066231c 100644 --- a/.agents-docs/AGENTS-architecture.md +++ b/.agents-docs/AGENTS-architecture.md @@ -5,7 +5,7 @@ ``` plan2code/ -├── src/ # Source workflow prompts (14 markdown files) +├── src/ # Source workflow prompts (17 markdown files) │ ├── plan2code-0-pathfinder-references/ # Reference files for pathfinder skill │ │ ├── brief.md # Dated plain-English decision briefs │ │ ├── chart.md # MODE A: destination + frontier grills, templates @@ -27,13 +27,16 @@ plan2code/ │ │ └── session-end.md # Next-step routing at review session end │ ├── plan2code-init-update-references/ # Reference files for init-update skill │ │ └── ai-agent-file-sync.md # Step 7: replace AI configs with AGENTS.md refs -│ └── plan2code-4-finalize-references/ # Reference files for finalize skill -│ └── community-feedback-submission.md # STEP 6.5 payload schema + submission tiers +│ ├── plan2code-4-finalize-references/ # Reference files for finalize skill +│ │ └── community-feedback-submission.md # STEP 6.5 payload schema + submission tiers +│ ├── skill-scripts/ # Scripts shared across skills: install.js copies the ones a skill lists into skills//scripts/ (specs, commit-msg, review-scope, agents-md, agent-files, common) +│ └── plan2code--scripts/ # A skill's own scripts, same copy rule (pathfinder, finalize, changelog, git and xray each have one) ├── plan2code-bot/ # Autonomous end-to-end workflow test runner (TypeScript, tsup, Claude Agent SDK, vitest); user docs in .readme/test-bot.md ├── plan2code-metrics/ # Recursive self-improvement toolchain │ ├── src/ # TypeScript source │ │ └── prompts/ # Internal AI prompt templates (no char limit) │ └── dist/ # Built output (tsup) +├── plan2code-app/ # Desktop app (Rust + Tauri): wraps the console in a window, agent-less setup screen; cargo fmt/clippy/test, see its README ├── src/statusline-claude/ # Claude CLI status line (Node.js, zero deps, single file) │ ├── statusline.js # Self-contained: config, git, formatters, render │ └── statusline-config.json # Default config template @@ -44,7 +47,7 @@ plan2code/ │ └── plan2code.ico # Desktop shortcut icon (Windows) ├── src/web-console/ # Local browser UI bundled into every skill (Node.js, zero deps, no build) │ ├── console.mjs # CLI the agent drives: open, post, wait, chat, keep, status, stop, help -│ ├── server.mjs, routes.mjs, static.mjs, cmd-*.mjs, picker.mjs, and the by-job files (files, sessions, patches, scan, inbox, workspace, settings) +│ ├── server.mjs, routes.mjs, static.mjs, cmd-*.mjs, picker.mjs, and the by-job files (files, sessions, patches, scan, inbox, workspace, settings, agents, agent-lookup, git-repo, handoffs, in-app, loop-setup, notepads, open-link, pointers, spec-files, update-check) │ ├── console.md, console-*.md, notes/, building*.md # Agent-facing contract (console.md read once, the rest on demand) │ └── public/ # Page assets served to the browser ├── scripts/ # Development scripts @@ -60,12 +63,15 @@ plan2code/ │ ├── node-test.mjs, page-test-helpers.mjs # `npm test`'s `node --test`, files at once capped at one per spare core; the page tests' browser sessions and their redraw-safe `styleOf()`, `stylesOf()`, `scrollCard()` │ ├── test-launcher.mjs, test-getting-started.mjs # Launcher suite; newcomer docs kept in step │ ├── test-skill-scripts.mjs, test-script-.mjs, test-git-repo.mjs, skill-script-helpers.mjs, fixture-helpers.mjs # Skill script suites and fixtures +│ ├── check-versions.mjs, fix-line-endings.mjs, play.mjs # Six-file version sync; restores LF everywhere (also pretest + pre-commit); tries the games from src/ +│ ├── measure-console-wire.mjs, css-helpers.mjs, ghoul-test-helpers.mjs, fixtures/, console-wire-runs/ # Wire-size probe and its captured runs; shared CSS and Ghoul Rush test helpers; skill-script fixtures │ └── validate-char-count.js # Pre-commit character count validator ├── skills/ # Generated, gitignored build output — one Agent Skill per src/ prompt │ └── plan2code-/ # SKILL.md plus references/ and scripts/ where present │ # Generated by npm run build:skills; consumed by skills add ├── .husky/ # Git hooks (husky) -│ └── pre-commit # Runs character count validation +│ └── pre-commit # Runs fix-line-endings, then character count validation +├── .agents-docs/ # The detail files AGENTS.md links to (this file and its siblings) ├── .claude/ # Repo-local Claude Code config (NOT installed by install.js) │ └── skills/ # Maintainer-only dev skills, e.g. plan2code-publish/, plan2code-launcher-update/ ├── .github/ISSUE_TEMPLATE/ # bug.yml, idea.yml, config.yml (target of the console's feedback button) @@ -174,9 +180,9 @@ Anything a workflow step decides with one correct answer (parsing a spec's check | Script | Skills | Does | |---|---|---| -| `specs.mjs` | plan, revise-plan, document, implement, implement-review, review, quick-task, finalize, handoff | `list` / `status` (Phase Checklist, groups, task markers, numbering, the implement selection verdict, consistency checks) / `metrics` / `mark` / `archive`. Imports `scanProject()` from the bundled `web-console/scan.mjs`, so the dashboard and the skills share one spec classifier | +| `specs.mjs` | plan, revise-plan, document, implement, implement-review, review, quick-task, finalize, handoff, diagnose | `list` / `status` (Phase Checklist, groups, task markers, numbering, the implement selection verdict, consistency checks) / `metrics` / `mark` / `archive`. Imports `scanProject()` from the bundled `web-console/scan.mjs`, so the dashboard and the skills share one spec classifier | | `commit-msg.mjs` | implement(-review), review, quick-task, finalize, init-update, git | The `` / `AI Assisted` commit command (two `-m` flags), with optional `git add` | -| `review-scope.mjs` | review, implement(-review), quick-task | Review Mode's git fallback: files, lines, doc share, base branch | +| `review-scope.mjs` | review, implement(-review), quick-task, finalize | Review Mode's git fallback: files, lines, doc share, base branch | | `agents-md.mjs` | init, init-update | AGENTS.md structure, budget, orphans, broken links, always-inline sections | | `agent-files.mjs` | init, init-update | Detect and replace other agents' config files with AGENTS.md pointers | | `pathfinder.mjs` (own) | 0-pathfinder | `reconcile`, `frontier`, `claim`, `resolve`, `rule-out`, `trail`, `gate`, `lint`, `brief-data` | @@ -252,117 +258,126 @@ Optional local browser UI shipped with **every** skill. Source lives in `src/web | `public/activities/bounce-road.js` | Bounce Road's road, rules only: the jump math every hole is sized by (`airMs(v)`, `reach(v)`, `LONGEST_JUMP`, `JUMP_FAIR`, `TOP_SPEED`, `MAX_SPEED`), `stageFor(n)` (built once a stage: the ten of `bounce-roads.js`, then laps from `LAP_FROM`, quicker, keener, busier, the Monster at every Monster Mash) and `stageName`, `newRoad(seed)` and `buildStage(road, n, random)` (a stage's rows from its own seed, by the stage's piece weights: straights, cracks, rivers on bridges with one or two broken spans or a drawbridge, splits round flowerbeds, ramps before a crack with stars beyond, cone or block chicanes, crumbling road, train crossings, swaying bridges, boost strips, slicks, balls, sprinklers, drops and gusts; every hole after a `RUNUP` with a sign and no longer than `MAX_HOLE`, the bridge between two breaks long enough to land `LONGEST_JUMP` on), `ensureRoad`, `groundAt(road, x, d, t)` (a row's edges eased from the row before's; a drawbridge water while lifted, a swaying bridge shifted, crumbled road a hole), `rowGone`, `spanAt`, `holesIn`, `firstAt`, `plainRow`, `safeSpot` (no hole, water, timed part or rails for `RESPAWN_RUN` ahead), and where each timed thing is at a moment: `swayOff`, `drawLift`, `crumbleAt` (falling away `CRUMBLE_DELAY` after you reach it, at `CRUMBLE_SPEED`, under a fair speed), `trainAt` (on, and lit `TRAIN_WARN_MS` before), `ballX`, `sprayAt`, `gustAt`; plus `seeded`, `GROUND`, `MARK`, `SPAN` | | `public/activities/bounce-rivals.js` | Bounce Road's rivals, rules only: `RIVALS` (the Zigzag, Brick, Frog, Nudge, Hauler, Sneak, Bruiser, Racer, Cop and Monster: box, mass, speed, points, how readily each dodges, how often each comes, its car style and whether it comes from behind), `makeCar`, `think(round, car, ms, random)` (each kind's choice of speed and line: the Zigzag's weave, into your path when you follow; the Brick holding your lane and brake-checking from in front, then resting `BRAKE_REST_MS` or more; the Frog's hops toward you; the Nudge's chase and up to 1 + 2 times the stage's `sharp` swipes; the Hauler drifting to block; the Sneak dropping up to `SNEAK_DROPS` cones while you follow; the Bruiser slamming you within `BRUISER_RANGE`; the Racer passing then fleeing; the Cop sitting on your roomier side and leaning in to push you to the near edge for `COP_MS`, never on a bridge or by the water (`nearWater`), nor the Bruiser; the Monster keeping `BOSS_AHEAD` in front, hopping every `BOSS_HOP_MS` to come down where you will be and dropping tires; every rival rubber-banded to stay near you, swerving from under your landing as sharply as its stage allows, keeping to the narrowest road just ahead and the band a swaying bridge always covers, holding a slower car's speed, and hopping any hole, drawbridge, barrier or coming train, or flying off a ramp), `spawnRival`, `pickKind` (one of each special kind at a time), `HEAVY`, `RIVAL_MIN_SPEED` | | `public/activities/bounce-roads.js` | Bounce Road's ten stages as data (no imports): `FIELD_W`, `FIELD_H`, `ROW`, `MAX_HOLE`, `LAP_FROM`, and per stage its length, par time, road widths, piece weights (straights, holes, rivers, splits, ramps, chicanes, crumbling road, trains, swaying bridges, boost strips, slicks, balls, sprinklers, drops, gusts), crack and broken span lengths, bridge widths and shares of broken, double and drawbridge spans, flowerbed sizes, barrier and drop kinds, the rivals' count, kinds, pace and sharpness, power-ups, stars, and whether the Monster comes | -| `public/activities/ghoul.js` | Ghoul Rush: its rules as plain exported functions over a round in one room of a haunted house seen side on, the view `FIELD_W` (96) by `FIELD_H` (54) units with y counted up, scrolled along a room hundreds of units long by `round.camX` (`newRound(seed)`, the stage packs (`PACKS`, see `ghoul-graveyard.js`) merged into its tables and run where its own rules run, through a `KIT` of helpers; `roomFor(id, depth)` (built once per room and depth, the stages already cleared that run: the monsters quicker (`pace`, `DEPTH_PACE` a stage), let out sooner (`every`, `DEPTH_EVERY`), a bolt tougher (`tough`) and more of them out of wall doors (`extra`), each capped, the boss with `BOSS_DEPTH_HP` more hp a stage up to `BOSS_DEPTH_MAX` and more points (`bossPoints`)), `roomName(spec, n)`, the run of stages (it starts in the hall, `ROOMS[0]`; out of the hall and out of each boss room the phase is `pick` with `round.offer`, `OFFER_N` stages from `stagesLeft(round)` shuffled by the `random` handed to `advance`; `steerPick(round, dir)` moves `round.pick`, `pickStage(round, i)` takes one once `PICK_HOLD_MS` has passed and enters its first room, `round.stage`/`stageAt` track the way through its rooms, `round.cleared` the stages done in order, and with none left the run is won: `round.won`, `round.over`, a `won` event), `groundAt` (ground pieces are solid blocks; a gap is a pit), `shelfThere`, `footing` (the highest surface within `STEP_UP` of a walker), `jumpHeightAt(dx)` (the suite's measure of what a jump clears), `jump`, `moveYou` (running at `RUN_SPEED` on the ground and in the air alike, a step of `STEP_UP` walked, a taller one a wall, shelves one way: jumped up through, landed on from above by crossing their line so no fall goes through one, dropped through with down; `COYOTE_MS` to still jump off an edge, a press `JUMP_BUFFER_MS` before landing jumps on it, up let go while rising cuts the jump to `CUT_V`), `spawnMonster`, `solid` (a crawler or a door's zombie still coming up, a gourdling still in the air or finding its feet, and a faded ghost can neither hurt nor be hit; a faded ghost within `GHOST_CLEAR` of you never turns solid), `ghostSight`, `throwBone` (timed to come down at your chest), `aimAt` (a bolt tilts toward the nearest monster or bone ahead within `AIM_DY` of your chest, by up to `AIM_MAX`), `hurt`, `kill` (points times `chainMult(chain)`, the chain stepping for each kill within `CHAIN_MS` up to `MAX_MULT`, doubled for a headshot (the top `HEAD_SHARE`), a stomp or a chandelier; `DROP_CANDY` and `DROP_POWER` drops), `lose`, `applyPower`, `advance` in 4 ms slices over `round.input`, which `key()` and `release()` set: the timers, a jump press, the jump cut, your move, the door, the arena lock, the blaster (a bolt every `FIRE_MS`, `RAPID_MS` with Rapid fire, three with Spread shot, each flying `SHOT_SPEED` until a monster, a bone, the boss, a wall or `SHOT_RANGE`), the spawners (wall doors that hold while you are within `DOOR_CLEAR`, loose boards within `CRAWL_NEAR`, roosting bats within `BAT_NEAR`, the rest as the camera reaches them), the hurry zombies every `HURRY_MS` once the bonus is gone, the monsters (zombies lurch within `LURCH_RANGE` and never walk off an edge or onto a shelf, bats swoop in level passes at your chest turning `BAT_TURN` past you and never drop onto your head, ghosts drift through walls, skeletons wind up `SKEL_WINDUP_MS` and throw every `SKEL_MS` within `SKEL_RANGE` but not closer than `SKEL_NEAR`), the bosses (the Great Gourd waits `GOURD_WAIT_MS`, hops to where you stood (its shadow shows where) and slams down letting up to `MAX_SEEDS` gourdlings loose; Old Rattlebones' fight lives in `ghoul-bones.js`; shockwaves run `WAVE_H` high both ways at `WAVE_SPEED`; a stomp does `STOMP_DAMAGE`), the bones and shockwaves, the bolts, stomps (which bounce you at `STOMP_V`), the chandeliers (`CHANDELIER_SHAKE_MS` once you run under, then down on whatever is below), the hits (a Garlic shield takes one and sees off what touched you), the pickups, the crumbling boards (`CRUMBLE_MS`, back after `CRUMBLE_BACK_MS`) and a fall down a pit), `underBanner(round, y)` and `bannerY`, `chainMult`, `seeded`), the `MONSTERS` and `BOSSES` (with `POWERS`, `TIMED`, `powerHere` and the pickup points re-exported from `ghoul-powers.js`), `NEW_TONES` (the blips it asks `tones.js` for), and the game contract with `release()` (`key(name, repeat)`: held arrows run, up jumps once a press, never on a repeat, never again until let go and never with the press that plays on, down drops through a shelf, held space fires and its release stops; a pause lets go of every key and drops a press); a hit or a fall costs one of `START_LIVES`, holds `CRASH_MS` and puts you back at the room's start (in a locked boss fight, the arena's, the boss's hp kept) for `READY_MS`, safe for `SAFE_MS`, the room's monsters and spawners back where they began; through the door `ROOM_POINTS` times the room, the bonus left (`BONUS_START`, dropping `BONUS_STEP` a second) and `FLAWLESS_POINTS` with no life lost; a boss beaten is its `bossPoints` and a life up to `MAX_LIVES` (9; the 1UP drops at `weight` 1.5); memo is the most stages cleared in one run; a read-only `round` getter for the tests only. Generic hooks the Mine added: a room's `water` spans (`WATER_SPEED` 0.65 of your speed and `WATER_JUMP` 0.93 of a jump on the floor in one, `you.wet`), `you.dimMs`/`you.dimBy` (an imp's stolen light, counted down in `timers`), the secondary weapons' `round.arms`, `round.tap` and the `arm` fields on a shot (see `ghoul-arms.js`). Tuned by a scratch bot: the Manor's rooms take a sharp bot 20 to 30 s each | -| `public/activities/ghoul-draw.js` | Ghoul Rush's drawing: `drawScene(ctx, view)` from one view object `ghoul.js` refills each frame, in room units turned the right way up and scrolled by the camera: the strip above the field in the page's colors with the pills (laid out by `hudLayout`: the room, lives, the bonus, the chain with its window emptying, the key once held, the power-ups; a second row rather than run off the board, the rows centered in the strip), still layers `CHUNK` units of a room wide drawn off screen once per room and scale and copied each frame (a few kept; each room's look in fixed colors, `LOOKS`: wallpaper, moonlit windows, decor by room (portraits, bookcases, curtains, pots, ferns, rafters with cobwebs, headstones), wainscot, floorboards, pits, shelves, wall doors and loose boards), the crumbling boards, a wall door standing open, the chandeliers, the exit door (padlocked, then open and glowing), candy, power-ups and the key, the monsters (a zombie in a ragged shirt with mismatched eyes, lurching; a crawler's hand through the boards, then crawling; a bat with flapping wings; a sheet ghost fading in and out; a skeleton raising a bone; gourdlings), bones and shockwaves, the bosses (the Great Gourd with a carved glowing face and a red shadow where it will land; Old Rattlebones, drawn by `ghoul-bones-draw.js`) and the boss bar, Planny (his star eye in your highlight in every state, stick arms, one holding the flashlight blaster that flares as it fires, stepping, arms up in the air or cheering, spinning with an "o" when hit, slumped at the end, garlic circling him while he has some; arms and feet in `limbInk(look)`), the bolts, sparks, rings, floating words kept on the field by `labelSpot`, the chain's big number, banners (`BANNER_SHADE`) the stage pick (`drawPicker`: a card per stage offered with its picture, `drawStagePicture`, its first room's wall and moonlit window over its boss room's floor with its boss standing there drawn by the same `BOSS_ART` as in play, name, line and boss, the one picked out raised and edged in gold, `stageColor` its boss room's), and the start and end strip with the big final score and a dot per stage, lit in each cleared stage's color (gold for the record before a run); `react(e, kit)` turns each event into those effects and its blips, a monster's own sound through `VOICES` (each kind's tone in `ghoul-sfx.js` by act: `appear` (a runner's `warn`, a bat's `wake`, a wraith's `notice`), `climb`, `hop`, `growl`, `lunge`, `shriek`, `dive`, `spit`, `throw`, `hurt` (one every 140 ms), `die`, and a boss's `wake`, `hop`, `slam`, `windup`; a "throw" event names its thrower in `by` and a "spit" its spitter in `kind`); the stage packs' drawing (`ART`: an `outdoor` look draws its pack's backdrop instead of walls, graves for doors, and each pack's monsters, bosses, missiles, hazards and lights by kind; a pack may also draw `sky` (every frame, under the still layers, so its backdrop leaves the sky clear) and `moving` (what moves in its scenery, over the still layers)); `readColors(canvas)`, `contrast`, `lookOf`; decides nothing | -| `public/activities/ghoul-rooms.js` | Ghoul Rush's rooms and stages as data (no imports): the long hall every run starts in (`ROOMS[0]`), then `STAGES` (each an id, title, line and four room ids, the last a boss's, checked at load; `stageById`, `roomById`), `FIELD_W`, `FIELD_H`, `FLOOR_Y`, `CEILING_Y`, `CHANDELIER_Y`, and per room its look, name and line, length, ground pieces (pits between, steps and walls), shelves (`crumble` kind), start, key, door, candy rows, power-ups, spawns (zombies, wall doors, crawlers' boards, bats, ghosts, skeletons), chandeliers and boss (`gourd`, `bones` or a pack's, the last room of its stage); a door's fifth entry names what comes out of it (rotters out of the Graveyard's graves) | -| `public/activities/ghoul-bones.js` | Old Rattlebones' fight, the East Wing's boss, as a boss pack in the shape of the stage packs (no imports; `ghoul.js` hands each rule its kit `k`; it plugs in through `PACKS` with `bosses`, `boss` and `hazards`, and `ghoul.js` re-exports `BONES_KEEP`, `BONES_MS`, `BONES_RAGE_MS`, `BONES_WINDUP_MS` and `VOLLEY`): 90 hp; every `BONES_MS` he winds up for a volley, a slam or the skull, picked at random by `pickAct` (never one three times running, the first a volley); the skull is a `skull` hazard that flies level at your chest `SKULL_REACH` past you and curves back to his neck while `b.headless` (no weak spot; a bolt to the skull does `SKULL_HIT`, eaten, with `SKULL_STAGGER_MS` between hits); at half his hp (`BONES_RAGE`) he shakes (`BONES_SHAKE_MS`), attacks every `BONES_RAGE_MS`, slams in a double (`DOUBLE_GAP_MS`), hurls bone rain (`rain` hazards: a shadow for `RAIN_WARN_MS`, then a bone) and raises skeletons (`raise` hazards, at most `MAX_BONY` alive or cracking). | -| `public/activities/ghoul-bones-draw.js` | Old Rattlebones' drawing, `boneArt(d)` plugged into `ghoul-draw.js`'s `PACK_ART`: the boss (headless while the skull is out, arms to the skull or up for rain, shaking with flaring eyes in his rage), the skull in flight, the bone rain's shadows and falling bones, the cracking floor, `lights`, `react` cases for his new events (`skullWind`, `skullThrow`, `skullTurn`, `skullBack`, `rainWind`, `rainThrow`, `rainLand`, `bonesRage`, `raiseWind`, `raised`), and `LOSE_WORDS` / `LOSE_SOUNDS` for `skull` and `rain`. | +| `public/md-field.js` | A Markdown answer field on CodeMirror 6: every multiline box the person types into renders its Markdown live. | +| `public/md-field.css` | The frame a Markdown field wears inside its shadow root, linked beside `notepad-editor.css`. | +| `public/activities/ghoul-rush/ghoul.js` | Ghoul Rush's public face and nothing else: it re-exports the parts below, so the page and the tests import from one place. Everything lives under `ghoul-rush/`: `core/` (the rules, rooms, run flow, power-ups, dice, bonus rounds), `arms/` (secondary weapons), `draw/` (shared drawing), `story/` (the intro story, stage and boss cards, game over), `sfx/` (shared sounds), `stages//` and `rides//` (each with its rules, art and sounds). | +| `public/activities/ghoul-rush/core/ghoul-tables.js` | Ghoul Rush's numbers and tables: the shared timings and sizes, `PACKS` with every pack's monsters, bosses and hooks joined in, the seeded dice, and `roomFor`. Loads first and imports none of the other parts. | +| `public/activities/ghoul-rush/core/ghoul-kit.js` | `KIT`, the helpers handed to the stage packs: one object `ghoul-play.js` fills as it loads, so a part that only passes it on has no load-order tie to the play loop. | +| `public/activities/ghoul-rush/core/ghoul-planny.js` | The ground and Planny: surfaces, shelves, landing, and how he runs, jumps and falls. | +| `public/activities/ghoul-rush/core/ghoul-monsters.js` | The monsters: spawning, how each kind moves, and what they throw. | +| `public/activities/ghoul-rush/core/ghoul-fight.js` | Bosses and damage: a boss's fight and fall, hurting and killing a monster, losing a life. | +| `public/activities/ghoul-rush/core/ghoul-play.js` | The play loop: `KIT` and `RUN_KIT`, the blaster and bolts, hits, stomps, timers, one slice of play, and `advance()`. | +| `public/activities/ghoul-rush/core/ghoul-window.js` | The game's contract with the Activities page: `create`, keys and pointer, what events set off, `ROOM_MUSIC`, the view handed to the drawing. | +| `public/activities/ghoul-rush/stages/marrow/ghoul-marrow.js` | The finale's rules: Marrow, the house itself. Kill I, The Lawn: its windows, moves and retreat. Not plugged in yet. | +| `public/activities/ghoul-rush/draw/ghoul-draw.js` | Ghoul Rush's drawing: `drawScene(ctx, view)` from one view object `ghoul.js` refills each frame, in room units turned the right way up and scrolled by the camera: the strip above the field in the page's colors with the pills (laid out by `hudLayout`: the room, lives, the bonus, the chain with its window emptying, the key once held, the power-ups; a second row rather than run off the board, the rows centered in the strip), still layers `CHUNK` units of a room wide drawn off screen once per room and scale and copied each frame (a few kept; each room's look in fixed colors, `LOOKS`: wallpaper, moonlit windows, decor by room (portraits, bookcases, curtains, pots, ferns, rafters with cobwebs, headstones), wainscot, floorboards, pits, shelves, wall doors and loose boards), the crumbling boards, a wall door standing open, the chandeliers, the exit door (padlocked, then open and glowing), candy, power-ups and the key, the monsters (a zombie in a ragged shirt with mismatched eyes, lurching; a crawler's hand through the boards, then crawling; a bat with flapping wings; a sheet ghost fading in and out; a skeleton raising a bone; gourdlings), bones and shockwaves, the bosses (the Great Gourd with a carved glowing face and a red shadow where it will land; Old Rattlebones, drawn by `ghoul-bones-draw.js`) and the boss bar, Planny (his star eye in your highlight in every state, stick arms, one holding the flashlight blaster that flares as it fires, stepping, arms up in the air or cheering, spinning with an "o" when hit, slumped at the end, garlic circling him while he has some; arms and feet in `limbInk(look)`), the bolts, sparks, rings, floating words kept on the field by `labelSpot`, the chain's big number, banners (`BANNER_SHADE`) the stage pick (`drawPicker`: a card per stage offered with its picture, `drawStagePicture`, its first room's wall and moonlit window over its boss room's floor with its boss standing there drawn by the same `BOSS_ART` as in play, name, line and boss, the one picked out raised and edged in gold, `stageColor` its boss room's), and the start and end strip with the big final score and a dot per stage, lit in each cleared stage's color (gold for the record before a run); `react(e, kit)` turns each event into those effects and its blips, a monster's own sound through `VOICES` (each kind's tone in `ghoul-sfx.js` by act: `appear` (a runner's `warn`, a bat's `wake`, a wraith's `notice`), `climb`, `hop`, `growl`, `lunge`, `shriek`, `dive`, `spit`, `throw`, `hurt` (one every 140 ms), `die`, and a boss's `wake`, `hop`, `slam`, `windup`; a "throw" event names its thrower in `by` and a "spit" its spitter in `kind`); the stage packs' drawing (`ART`: an `outdoor` look draws its pack's backdrop instead of walls, graves for doors, and each pack's monsters, bosses, missiles, hazards and lights by kind; a pack may also draw `sky` (every frame, under the still layers, so its backdrop leaves the sky clear) and `moving` (what moves in its scenery, over the still layers)); `readColors(canvas)`, `contrast`, `lookOf`; decides nothing | +| `public/activities/ghoul-rush/core/ghoul-rooms.js` | Ghoul Rush's rooms and stages as data (no imports): the long hall every run starts in (`ROOMS[0]`), then `STAGES` (each an id, title, line and four room ids, the last a boss's, checked at load; `stageById`, `roomById`), `FIELD_W`, `FIELD_H`, `FLOOR_Y`, `CEILING_Y`, `CHANDELIER_Y`, and per room its look, name and line, length, ground pieces (pits between, steps and walls), shelves (`crumble` kind), start, key, door, candy rows, power-ups, spawns (zombies, wall doors, crawlers' boards, bats, ghosts, skeletons), chandeliers and boss (`gourd`, `bones` or a pack's, the last room of its stage); a door's fifth entry names what comes out of it (rotters out of the Graveyard's graves) | +| `public/activities/ghoul-rush/stages/wing/ghoul-bones.js` | Old Rattlebones' fight, the East Wing's boss, as a boss pack in the shape of the stage packs (no imports; `ghoul.js` hands each rule its kit `k`; it plugs in through `PACKS` with `bosses`, `boss` and `hazards`, and `ghoul.js` re-exports `BONES_KEEP`, `BONES_MS`, `BONES_RAGE_MS`, `BONES_WINDUP_MS` and `VOLLEY`): 90 hp; every `BONES_MS` he winds up for a volley, a slam or the skull, picked at random by `pickAct` (never one three times running, the first a volley); the skull is a `skull` hazard that flies level at your chest `SKULL_REACH` past you and curves back to his neck while `b.headless` (no weak spot; a bolt to the skull does `SKULL_HIT`, eaten, with `SKULL_STAGGER_MS` between hits); at half his hp (`BONES_RAGE`) he shakes (`BONES_SHAKE_MS`), attacks every `BONES_RAGE_MS`, slams in a double (`DOUBLE_GAP_MS`), hurls bone rain (`rain` hazards: a shadow for `RAIN_WARN_MS`, then a bone) and raises skeletons (`raise` hazards, at most `MAX_BONY` alive or cracking). | +| `public/activities/ghoul-rush/stages/wing/ghoul-bones-draw.js` | Old Rattlebones' drawing, `boneArt(d)` plugged into `ghoul-draw.js`'s `PACK_ART`: the boss (headless while the skull is out, arms to the skull or up for rain, shaking with flaring eyes in his rage), the skull in flight, the bone rain's shadows and falling bones, the cracking floor, `lights`, `react` cases for his new events (`skullWind`, `skullThrow`, `skullTurn`, `skullBack`, `rainWind`, `rainThrow`, `rainLand`, `bonesRage`, `raiseWind`, `raised`), and `LOSE_WORDS` / `LOSE_SOUNDS` for `skull` and `rain`. | | `scripts/test-web-console-activities-ghoul-bones.mjs` | Old Rattlebones' suite: the random attack order, the volley and slam, the skull's flight and the headless window, the skull shot, the rage, the double slam, bone rain, the skeleton cap and the reactions. | -| `public/activities/ghoul-graveyard.js` | Ghoul Rush's Graveyard stage pack, its rules (no imports: `ghoul.js` hands each rule a kit `k` of its own helpers). A stage pack is plain data and functions that `ghoul.js` merges into its own tables (`PACKS`): `monsters` (with `perch`: its spawn names its height, `flies`: a horde one comes in high), `walkers`/`zombies`/`stackers`/`climbers` (joining the sets of those names), `act` (start), `solid`, `move`, `kill`, `horde` (fields a horde one comes with), `bosses`, `boss` (one slice of its fight), `guard` (true while shots and stomps glance off, a `bossBlock` event) and `hazards` (by kind, one slice of a box on the floor that hurts while `live`; kept in `round.hazards`). Three more fields a stage may add (the Grounds does): `cut` (kinds the Hedge shears kill outright), `weak` (by boss kind, `(boss, shot) => damage multiplier` for a weak spot; `bossHit` then carries `how: "weak"` and `weak: true`) and `cause` (what a boss's touch is called when it costs a life). The Chapel adds more: `tick(round, ms, k)` (a stage-wide twist run first in every slice; it may set `round.stunMs`, which freezes you and every monster, boss, hazard and missile while bolts in flight still fly, and keeps its state in `round.twist`), `stone` (by kind, true while shots glance off and a stomp does nothing; `glance` event), `shot(round, m, s, k, random)` (the damage multiplier of a bolt that hit `m`, free to splash), `target(round, s, k)` (true when a bolt struck something of the pack's that is no monster, such as an organ pipe) and, on a monster, `hasteMs` and `haste` (its time runs faster while `hasteMs` is over 0). On the drawing side a look may be `custom: true` with a `pack` id (the pack's art then draws the whole wall, floor and shelves) and the art may return `decor` (by the look's `decor` name). On the drawing side a stage's art may also return `react(e, k)` (its own events; `ghoul-draw.js`'s `react` falls through to `ART.react`, which returns true when it handled `e`), `ground` and `shelf` (the floor pieces and shelves of an outdoor look), `waves` and `powers`; a boss event must carry `kind` or its voice never plays. The Graveyard's: grasping hands (`HANDS_*`: lurk unseen, rise, grab, sink, creep under level ground after you), the mourner (wails every `WAIL_MS`, slowing you to `SLOW_SHARE` speed for `SLOW_MS` within `WAIL_REACH`; `round.you.slowMs`), the grave robber (digs in within `ROBBER_DIG`, comes up `ROBBER_BEHIND` behind you), the rotter (a zombie whose body-shot death leaves its `legs` walking), the carrion crow (perches, dives at your chest, climbs, dives again), and Mother Mourning (`angel`: weeps `ANGEL_WEEP_MS` as stone flinging headstones, turns `ANGEL_TURN_MS`, watches `ANGEL_WATCH_MS` when only she can be hurt and any move drops a `fist` hazard after `FIST_WARN_MS`; at `ANGEL_RAGE` her wings spread, the weep shorter, the watch longer, a shockwave each way as each weep begins) | -| `public/activities/ghoul-graveyard-draw.js` | The Graveyard's drawing: `LOOKS` for its four rooms (`outdoor: true`, so `ghoul-draw.js` draws `backdrop` instead of walls: the night sky, stars, the moon, hills with dead trees, iron fences, mausoleums, fog and headstones) and `graveyardArt(d)`, handed `ghoul-draw.js`'s helpers, returning the open `grave` and `openGrave` a rotter climbs out of, `monsters`, `bosses` (Mother Mourning: hands over her face while she weeps, lowered with burning eyes while she watches, wings spread in a rage, cracks as she is worn down), `missiles` (a flung headstone), `hazards` (a stone fist: its shadow, then the fist) and `lights` | -| `public/activities/ghoul-grounds.js` | Ghoul Rush's Grounds stage pack, its rules (no imports; same shape as the Graveyard's, plus the pack fields `cut`, `weak` and `cause`): the topiary beast (`still` while you face it, `creep` when your back is turned; events `rustle` and `freeze`), the rootling (`trail`, `warn`, `up`, `sink`; events `rootWarn` and `rootUp`), the lantern moth (flocks of three, quicker in the dark), the mulch crawler (`pile`, `burst`, `crawl`; event `leaves`), the Hedge shears' `snip` event, and the Groundskeeper (`keeper`: a scythe sweep along the floor (or, now and then, a high `sweep` hazard you stay on the ground under), a lobbed lantern fire hazard, his lantern a `weak` spot only while open (`b.lit`), and at half hp a mower with `rev`, `charge` and `stall`) | -| `public/activities/ghoul-grounds-draw.js` | The Grounds' drawing: `LOOKS` for its four rooms (`outdoor: true`), `groundsArt(d)` returning `monsters`, `bosses`, `hazards` (the fire), `waves` (the scythe), `powers` (the shears), `lights`, `backdrop`, `ground`, `shelf` and `react(e, k)` for the Grounds' own events; its `VOICES` (each kind's tone per act, `keeper.weak` for a weak-spot hit instead of `keeper.hurt`, `shears.snip` for a cut instead of the dying cry), `LOSE_WORDS` and `LOSE_SOUNDS`, which `ghoul-draw.js` spreads into its own tables | -| `public/activities/ghoul-chapel.js` | Ghoul Rush's Chapel stage pack, its rules (no imports; same shape as the Grounds', plus the pack hooks `tick`, `stone`, `shot` and `target`, and a room field `toll`): the gargoyle (`perch` as stone, `wake`, `dive`, `return`; events `glance`, `gargoyleWake`, `gargoyleDive`, `gargoylePerch`), the choir ghost (sings, giving nearby monsters `hasteMs`), the censer monk (`smoke` hazard), the bell bat (`roost` until the toll), the bell toll (`tick`: `bellSwing`, `toll`, `tollEnd`, `round.stunMs`), Holy Water's splash (`shot`, event `holySplash`) and the Choirmaster (`choirmaster`: four pipes in `b.pipes` that bolts hit through `target`, a `guard` while any sounds, columns of `note` hazards with one gap, a rage that brings pipes back one by one) | -| `public/activities/ghoul-chapel-draw.js` | The Chapel's drawing: `LOOKS` for its four rooms (indoor but `custom: true` with `pack: "chapel"`, so `ghoul-draw.js` hands the walls, floor and shelves to `chapelArt(d)`'s `backdrop`, `ground` and `shelf`), `chapelArt(d)` returning those plus `decor` (the room's pews, belfry, organ or stalls), `monsters`, `bosses`, `hazards` (smoke, the bell, notes), `powers`, `lights` and `react(e, k)`; its `VOICES` (the bell has only `swing` and `toll`: the thaw after a toll is quiet on purpose), `LOSE_WORDS` and `LOSE_SOUNDS` | -| `public/activities/ghoul-sanatorium.js` | Ghoul Rush's Blackmoor Sanatorium stage pack, its rules (no imports; same shape as the Chapel's, plus the pack fields `unseen`, `harmless`, `platform` and `land`, a room field `flicker`, `round.blackout`/`round.twist` for the lamps and the kit's `fling`): the orderly (`reach`, `hold`, a throw that costs no life, `you.heldMs`; events `orderlyReach`, `orderlyGrab`, `orderlyThrow`, `saltsBreak`), the gurney (`parked` as a floor you can stand on, `rattle`, `roll`, `rest`; `gurneyRattle`, `gurneyRoll`, `gurneyRest`), the flicker (`m.unseen`: bolts and touch go through it until a blackout, the Lantern's light or the Salts' glow; `flickerShow`), the specimen bloater (a `jar` missile with its own `cause` that `land`s as a `formaldehyde` hazard; `jarWind`, `jarBreak`), the lamps (`tick`: `flickerWarn`, `lightsOut`, `lightsOn`), the Salts and the Saw (`shot`) and the Night Matron (`matron`: `b.beam` cone, `b.heat`, `b.cabinets`, syringes, arms, rage; `syringeWind`, `syringes`, `armWarn`, `armReach`, `matronRage`) | -| `public/activities/ghoul-sanatorium-draw.js` | The Sanatorium's art: `LOOKS` (indoor but `custom: true` with `pack: "sanatorium"` and `noMoon`, so `sanatoriumArt(d)`'s `backdrop`, `ground` and `shelf` draw the tiled walls, windows, decor, floors, the ward's cabinets, the baths' tubs and each room's boards), `monsters` (orderly with its grab pose, gurney, flicker with its fade and afterimage, specimen bloater), the `matron` with her cone cut by the floor and the cabinets, `missiles` (jar, syringe), `hazards` (formaldehyde, arm with its crack of light), `powers` (Salts, Saw), `lights`, `react(e, k)` and two generic hooks `ghoul-draw.js` calls: `front(ctx, v)` (over Planny and before the dark: the ceiling lamps, the tubs' water, the orderly's fingers, the Matron's heat on him) and `dim(v)` (the dark layer's alpha, raised in a blackout and in a stutter); its `VOICES` (borrowed tones; `lights`, `salts` and `saw` are no monsters), `LOSE_WORDS` and `LOSE_SOUNDS` | -| `public/activities/ghoul-village.js` | Ghoul Rush's Hollow End Village stage pack, its rules (no imports; no new pack field: it uses `tick`, `shot`, `land`, `weak` (now handed `(boss, shot, round, k)`) and `solid`, and draws no random number): the moonrise (`tick`; `round.twist` = `{ moon, full, ms }`, events `fullMoon`, `villagerTurn`, `villagerWolf`, `houndGrow`), the torch mob villager (a group of three, `torchWind`, the `torch` missile that `land`s as a `torchfire` hazard, `torchLand`; turned into a leaping wolf-man at full moon), the hanged man (`hangedWarn`, `hangedDrop`, `hangedSnap`, `hangedHaul`), the shutter ghoul (`solid` only while out; `shutterRattle`, `shutterLunge`, `shutterPull`), the moonhound (the hellhound's leap, grown at full moon), Wolfsbane's double damage and shying (`baneShy`) and the Beast of Hollow End (`beastLeap`, `beastCling`, `beastPounce` with a `shadow` hazard, `beastLand`, `swipeWind`, `beastSwipe` with a `claw` hazard, `beastHowl`, `houndCall`, `beastMoon`) | -| `public/activities/ghoul-village-draw.js` | The Village's art: `LOOKS` (street, square and green outdoors, the inn a `custom` indoor look, all `pack: "village"`), `villageArt(d)` returning the world's hooks plus the monsters (the torch mob villager and the wolf-man it turns into over 800 ms, the hanged man on his rope, the shutter ghoul reaching out of a window, the moonhound with a glowing mane when grown), the `beast` (a werewolf in every move: cling with a glowing weak spot, bound, pounce, land, swipe, howl at the moon, rage), `missiles` (torch), `hazards` (torchfire, the landing shadow, the claw swipe), `powers` (Wolfsbane's badge), `lights` and `react(e, k)`; its `VOICES` (borrowed tones, plus `moon.full` and `bane.active`), `EVENT_VOICE` (event to `[kind, act]`, each played once; the hounds' call is quiet), `LOSE_WORDS` and `LOSE_SOUNDS`. Its header lists what the art reads off the rules | -| `public/activities/ghoul-village-world.js` | The Village's world: the night sky and the moon that climbs and reddens with `round.twist.moon` (`sky`, drawn every frame under the still layers), the crooked timber-framed houses with a window for every shutter ghoul, the church and spire, the gallows, the green's far cottages, well and arena walls, the Crooked Inn (hearths, barrels, bar, lanterns, the moon in its windows), cobbles, planks and turf (`ground`), awnings, rooftops, balconies, tables, carts and thatch (`shelf`), and `moving` (curtains that twitch as you pass, fire, moonlight falling in), `front` (the full-moon wash, Wolfsbane's petals, the Beast's rage) and `lights` | -| `public/activities/ghoul-mine-world.js` | The Deep Seam Mine's world (no imports; `mineWorld(d)` takes ghoul-draw.js's helpers): the rock wall with its strata and facets, the timber that holds it up (props and cap beams, scaffolds and galleries as `shelf`), rails and sleepers on the floor (`ground`), oil lamps on hooks with their flames and warm halos (`moving`) and their holes in the dark (`lights`, none in a blackout), the shaft's lining, walers, guide rails and headframe with the cage lift drawn on its cable over a winch wheel with a counterweight (`cage`, and its front bars in `front`), the tunnels' low roof, pipes, stalled pump, drips and knee-deep water with a lit surface and Planny's wake (`front`), the collapse's broken props, cracks, rubble heaps and buried cart, the seam's glittering ore vein, stalactites and galleries, and the `rock` hazard in its three states; layouts are worked out once per room from the room alone and kept. Scene tool: `prototypes/ghoul-rush-tools/scene-mine-world.mjs` | -| `public/activities/ghoul-village-wolf.js` | The Village's werewolf, one skeleton for the Beast and a turned villager: poses (`POSES`: stand, rear, swipe, howl, crouch, leap, land, rest, cling, shy, down, sleep), `mixPose` to blend them, and `wolfKit(d).figure` to draw one | -| `public/activities/ghoul-mine.js` | Ghoul Rush's Deep Seam Mine stage pack, its rules (no imports; draws no random number): uses `tick`, `harmless`, `platform`, `solid`, `kill`, `weak` and a boss's blackout (`round.blackout`). The rockfall (`tick`; a room field `rocks` in ms; the `rock` hazard in states `warn`, `fall`, `rubble`, events `rockWarn`, `rockFall`, `rockLand`; the Hard Hat's `rockBounce`), the noise you make (`round.twist` = `{ next, quiet, noise, reach, wade }`, `wade` splashes), the knocker imp (touch steals light, not a life: `you.dimMs` and `you.dimBy`, `impSteal`, `impDrop`; the Hard Hat stops it), the canary ghost (`canaryScream`: three rocks), the dead miner (buried in the wall, `minerDig`, `pickWind`, `pickSwing` with a `pick` hazard, cause `pickaxe`), the blind crawler (`blindLost`, `blindHear`), the cage lift (a spawn row `["cage", x, lowest y, highest y]`, a `platform` kind that is not solid and never hurts), Dynamite placed in each room (its rules, the `stick` and `blast` hazards, `dynThrow` and `dynBlast`, moved to `ghoul-arms.js`) and the Tommyknocker (`tommyKnock`, `sweepWind`, `tommySweep` with a `hammer` hazard, `tommyDark`, `tommySink`, `tommyKnockDark`, `tommyBurst`, `tommyRage`; dazed double damage through `weak`) | -| `public/activities/ghoul-mine-draw.js` | The Mine's art (the rooms in `ghoul-mine-world.js`, the Tommyknocker in `ghoul-mine-tommy.js`): `LOOKS` (`custom: true`, `pack: "mine"`, always dark), `mineArt(d)` returning `backdrop` (rock, strata, timber props, oil lamps), `ground` (rails), `shelf` (timber landings), `front` (the water along the floor), `dim` (the blackout), `monsters` (imp, canary, miner, blind crawler, cage), the `tommy` boss, `hazards` (rock, stick, blast, pick, hammer), `powers` (Hard Hat, Dynamite), `lights` and `react`; its `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS` and `LOSE_SOUNDS`. Its header lists every field the art reads off the rules; `ghoul-draw.js` shrinks Planny's glow and drops his cone while `you.dimMs` is over 0 | -| `public/activities/ghoul-mine-tommy.js` | The Tommyknocker's figure for `ghoul-mine-draw.js`: `tommyKit(d)` (no imports, `ghoul-draw.js`'s helpers handed in) returns `figure(ctx, v, b)`, a miner-giant half grown into the seam (stone shoulder with crystals, lantern on his helmet, a door-sized hammer) drawn by act: leaning on the hammer, the overhead knocks, the drawn-back sweep, rest, sinking, bursting out dazed with stars, raged cracks, hurt flash. | -| `public/activities/ghoul-cart.js` | Ghoul Rush's Runaway Cart, the Mine's ride room, its rules (no imports; draws no random number): the first room where a pack takes Planny's movement over. It adds the pack fields `ride` (a list of `(round, ms, k) => true` hooks run each slice before the walking rules; one that returns true has moved him) and `place` (a list of `(round, k)` hooks run whenever he is put down in a room: a room set up, a respawn), uses `target` (the crates), and `round.camLead` (units the camera leads further). The cart (`round.cart`, null elsewhere) rides the room's `ride.track` polylines (slope speed, lean and brake, jump, air steering, ramp launch, landing on the line under it, derail into the chasm), ducks under `ride.beams`, wrecks on `rubble` and unbroken `crates` (two bolts break one), is chased by the boulder, passes `checks` (a life lost puts it back at the last) and halts at `stop` where the door opens; a ledge imp (`ledgeimp`) leaps into it and steals light, a canary's scream drops a slide of rubble on the track ahead. Exports `flight`, `trackY`, `linesAt` and `linesOf` for the unit suite. Events `cartJump`, `cartLand`, `cartLaunch`, `cartBrake`, `cartDuck`, `crateHit`, `crateBreak`, `cartCrash`, `boulderNear`, `checkpoint`, `cartStop`, `ledgeLeap`, `slideWarn`, `slideFall`; causes `derail`, `beam`, `crash`, `boulder` | -| `public/activities/ghoul-cart-draw.js` | The Runaway Cart's art: `LOOKS` (`custom: true`, `pack: "cart"`, always dark), `cartArt(d)` returning `backdrop`, `ground`, `moving` (every frame: the cave in cached parallax tiles over a chasm, the trestled track, ledge pillars, signal posts, rubble and the buffer stop in cached chunks, hanging lamps, signal lamps, crates, a slide's dust and pour; the cart too once it has stopped, so Planny walks out past it), `front` (the cart over Planny, the beams, the boulder, flying splinters, speed streaks, the foreground rock), `lights` (headlamp, hanging and far lamps, signals, beams), `monsters` (the ledge imp) and `react`; its `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS` and `LOSE_SOUNDS`. It keeps its own offscreen layer cache (keyed by scale), draws no random numbers (a hash) and leaves short-lived bits in the view's `fx` (`cartBits`, `cartPours`, `cartLand`, `cartStop`). Its header lists every field the art reads off the rules | -| `public/activities/ghoul-sfx-mine.js` | The Mine's own sounds as data (no imports): `MINE_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | -| `public/activities/ghoul-bog.js` | Ghoul Rush's Gallows Bog stage pack, its rules (no imports; a pack `ghoul.js` plugs in through `PACKS`, handed the kit `k`): the lurker, leech swarm, will-o'-wisp and bog body (`MONSTERS`, with `walkers`/`zombies` sets), `act`, `solid`, `swoops`, `unseen`, `move`, `kill`, `horde`, `tick` (the wisp's lure), `bosses`/`boss`, `weak`, `cause` and `hazards`, and Old Mother Bog (`BOSSES`). Its header notes the movers, the lure and the boss fight land in a later phase: this file stands the pack up so the stage's rooms can be walked. The stage's second twist lives in the engine, not here: a room field `mud` (frozen `[x0, x1]` spans), `mudAt` in `ghoul.js`, `you.mud` and `you.mudMs` (the run sags from `WATER_SPEED` toward `MUD_SPEED_MIN` and a jump toward `MUD_JUMP_MIN` over `MUD_MS`; a shelf, the air and Stilt Boots (`round.effects.boots`) let go of it) | -| `public/activities/ghoul-bog-draw.js` | The Gallows Bog's drawing: `LOOKS` for its rooms (`outdoor: true`, `pack: "bog"`) and `bogArt(d)`, handed `ghoul-draw.js`'s helpers, returning the night swamp rooms (boardwalk planks over black water, moss veils, fireflies, the hag's lit stilt house and her open-water arena), `monsters` (a lurker's eyes, a leech swarm, a will-o'-wisp, a bog body), `bosses` (Old Mother Bog and her cauldron), `hazards` (the mud wave, the muck patches), the Stilt Boots' and Harpoon's badges and the events' looks and sounds; its `VOICES` are borrowed house tones until the sound page's vote, `LOSE_WORDS` and `LOSE_SOUNDS` already named | -| `public/activities/ghoul-bogboat.js` | The Bog Runner (Gallows Bog's bonus round) as a pack (`BOGBOAT`), modeled on the Midnight Hearse for its lanes and the Torch Mob for its pursuit meter: pack fields `ride`, `place` and `target`; state in `round.runner` (`id: "bogboat"`); a flat channel of two lanes (open water and the mud flats) switched at banks, with sunken snags and cypress knees to jump, moss veils and low limbs to duck, the hag's charms and gas pockets to shoot, and the wake (a leech swarm `gap` units behind that closes on slow or stalled riding and catches you at `WAKE_CATCH`). Its checkpoints and grade (3 to 9 dice) run through the Cart's bonus machinery. Adds no monster, boss or hazard kind and draws no random number; every event starts with `bogboat` and every number is an exported constant documented in its header | -| `public/activities/ghoul-bogboat-draw.js` | The Bog Runner's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK, SHOOT and SWITCH glyphs for the ride's lanes) and `bogboatArt(d)` (pale moon, drowned cypresses, mist, black channel and mud flats by `moving`, the bow, the signs and the wake meter by `front`); no random numbers, everything from a hash | -| `public/activities/ghoul-sfx-bog.js` | Gallows Bog's own sounds as data (no imports): `BOG_SFX` with `tones` (a `ghoul` tone for each act of the lurker, leech, wisp, bog body and Old Mother Bog) and an empty `music` until the music vote is wired in (the rooms play borrowed tracks through `ROOM_MUSIC`); the tones are first drafts (option 1 of each act) until the sound vote; merged by `ghoul-sfx.js` via `STAGE_SFX` | -| `public/activities/ghoul-sfx-bogboat.js` | The Bog Runner's own sounds as data (no imports): `BOGBOAT_SFX` with `tones` (`ghoulBogboat`) and the ride's `music` track; first drafts until the vote; merged by `ghoul-sfx.js` via `STAGE_SFX` | -| `public/activities/ghoul-carnival.js` | Ghoul Rush's Midnight Carnival stage pack, its rules (no imports; draws no random number): uses `tick` (the ring of samples Mirror You reads and its bolts in `round.twist`), `shot` (Cotton Candy's slow, a marionette's string at the top of its body), `target` (a bolt crossing a marionette's string or one of the puppet's three), `guard` (the Ringmaster is open only with the puppet down), `swoops` (a balloon, a circus hound's leap), `solid`, `kill` and `fourLegged`. Grinner and its acid balloons, marionette (drops when you pass under), Mirror You (copies you 500 ms late, mirrored, its bolts cancel yours), strongman (barbells), circus hound, and the Ringmaster (a gantry over the ring that follows its puppet at a lag, the puppet stalking you and working to a fixed script of leap, stomp, whip and charge, three strings from the gantry to its head and hands that move with it, open 4 s when they are cut, rage with hounds from the cages); `CARNIVAL_ROOMS` lists the stage's rooms, with a place before the Big Top for the dark ride. The room field `belts` and Planny's `you.belt` (the funhouse's conveyor floors) are run by `ghoul.js`. | -| `public/activities/ghoul-carnival-draw.js` | The Carnival's art: `LOOKS` (`custom: true`, `pack: "carnival"`), `carnivalArt(d)` returning the world's hooks (from `ghoul-carnival-world.js`) plus `monsters`, the `ringmaster` boss (gantry, puppet in each pose, strings, whip), `missiles` (barbell), `hazards` (foot, whip, charge), `waves` (the puppet's), `powers` (Cotton Candy), `front` (Mirror You's bolts, Cotton Candy's glow), `lights` and `react`, and `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`. Its header lists what the art reads off the rules. | -| `public/activities/ghoul-carnival-world.js` | The Carnival's world (no imports; `carnivalWorld(d)` takes ghoul-draw.js's helpers): the night sky with a Ferris wheel (`sky`), tents, booths and swagged bulbs on the Midway, the Hall of Mirrors' gilded panels and glints, the Funhouse's crooked walls, spiral discs and clown-mouth door, the Big Top's striped canvas, ring curb, crowd, trapeze boards, gantry rail and cages (open once the Ringmaster rages), and the belts' chevrons (`moving`). | -| `public/activities/ghoul-sfx-carnival.js` | The Carnival's own sounds as data (no imports): `CARNIVAL_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | -| `public/activities/ghoul-ride.js` | The Carnival's dark ride (a bonus round) as a pack (`RIDE`), the rules ported from `prototypes/ghoul-rush-ride/gallery.html`. Pack fields `ride` (returns true, so Planny never walks; steps the ride in 16 ms steps), `place` (makes `round.gallery`, the ride's state) and a new `pointer` (the mouse, handed on by `ghoul.js`'s `pointer(type, x, y)`); the entities (`K`: pop, lant, axe, chand, door, hand, head, eyes, boss, inno, mir, web, mini), hit tests with aim assist, the duck zone, hearts through `kit.lose`, the grade (5 to 9 dice, `perf.dice`). Events `ride` (`SOUNDS`), causes `CAUSES`. Its own seeded random stream; draws no `Math.random` | -| `public/activities/ghoul-ride-scenes.js` | The dark ride's scene table as data (12 rooms, lengths, speeds, spawn rows in author coordinates), no imports | -| `public/activities/ghoul-ride-core.js` | The ride's shared basics: the 96 by 54 field's constants, math helpers, the bound state `G` (a live import), `rnd`/`rand` (seeded) and `vrand` (visual) | -| `public/activities/ghoul-ride-draw.js` | The ride's art entry (`rideArt(d, die)`: `field(ctx, v)` draws the whole field by phase, `tick` the cascade's sounds); `ghoul-draw.js` hands over to it when `round.gallery` is set. Parts: `ghoul-ride-gfx.js` (canvas helpers), `ghoul-ride-draw-kinds.js` (animatronics, mini-bosses, the Barker), `ghoul-ride-draw-sets.js` (the 12 sets, far walls, aisle, near layer), `ghoul-ride-draw-hud.js` (car and Planny, HUD, duck strip, reticle, title, end cascade) | -| `public/activities/ghoul-ride-gfx.js` | The ride's drawing helpers: the bound 2D context and the short fill, stroke and shape calls the ride's art is written in | -| `public/activities/ghoul-ride-draw-kinds.js` | The ride's drawn things: every figure, beast, lantern, blade, door, hand, head, mirror, web and boss, a port of the prototype's draw code (`prototypes/ghoul-rush-ride/gallery.html`) | -| `public/activities/ghoul-ride-draw-sets.js` | The ride's rooms drawn: each room's far wall, set pieces front and back, aisle and the near pillars, a port of the prototype's world draw | -| `public/activities/ghoul-ride-draw-hud.js` | The ride's car and the screen around it: Planny in his car, blood and sparks, the lens, the hearts, the progress bar, the room plaque, the aim, the title and the cleared card | -| `public/activities/ghoul-ride-voices.js` | The ride's `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `react` (every `ride` event plays tone `ghoulRide`) | -| `public/activities/ghoul-sfx-ride.js` | The ride's synthesized sounds as `tones` (`ghoulRide`) and its music `ghoulRideDrone` (`RIDE_SFX`, merged by `ghoul-sfx.js`) | -| `public/activities/ghoul-frozen.js` | Ghoul Rush's Frozen Lake stage pack, its rules (imports only `burrow` from the Graveyard; draws no random number): uses `tick` (thin ice, the blizzard, the Widow's spikes, web and barrels), `place`, `unseen`, `solid`, `kill`, `target`, `land`, `weak`, `cause`, `guard`, `swoops` and `slides`. The generic slippery-ice rule (`iceRun`, room field `ice`) and thin-ice rule (`stepThin`, room field `thin`, `round.thin`), the under-ice hand, snow shade (unseen, footprints), Frozen Ghoul (slides, shatters into shards), Ice Wraith (its dive freezes), Hot Cocoa, the Frost Widow (veil, barrels, weak spot, blizzard, spikes, web, rage) and `FROZEN_ROOMS`. Every constant is exported and documented in its header | -| `public/activities/ghoul-frozen-draw.js` | The Frozen Lake's art: `LOOKS` (`custom: true`), `frozenArt(d)` returning the world's hooks (from `ghoul-frozen-world.js`) plus `monsters`, the Frost Widow boss, `hazards` (shards, spikes, webs, barrels, the flare and its fire), `powers` (Hot Cocoa), `front`, `lights` and `react`, and `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`. Its header lists what the art reads off the rules | -| `public/activities/ghoul-frozen-world.js` | The Frozen Lake's world (no imports; `frozenWorld(d)` takes ghoul-draw.js's helpers): the night sky with moon, aurora and far mountains (`sky`), the huts, the Lodge's fallen roof, the Black Ice and the Widow's web (`backdrop`, `ground` with the ice's gloss, `shelf`), and `moving` (open water in the holes, thin ice drawn from `round.thin`, never from `spec.ground`, the faces under the Black Ice, falling snow) and `lights`. Draws no random number | -| `public/activities/ghoul-flare.js` | The Road Flare's rules (`useFlare`, `stepFlareFly`, `stepRoadFire`; no imports, handed the helpers by `ghoul-arms.js`): a lob that lands as a patch of fire, burns monsters on a tick, melts a Frozen Ghoul at once, shows a shade and melts the Widow's veil; never hurts Planny | -| `public/activities/ghoul-sled.js` | The Coffin Sled (the Frozen Lake's bonus round) as a pack (`SLED`), modeled on the Runaway Cart (`ghoul-cart.js`): pack fields `ride`, `place` and `target`; the track of ice lines with cracks, headstones, drifts, low branches, hands, icicles and popping ghouls, checkpoints, hearts through the Cart's bonus machinery and the grade (3 to 9 dice). Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | -| `public/activities/ghoul-hearse.js` | The Midnight Hearse (the Graveyard's bonus round) as a pack (`HEARSE`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in `round.runner` (`id: "hearse"`); a flat road of two lanes (road and verge) switched with LEFT/RIGHT inside the lane gates, open graves, headstones and crosses to jump, low branches and the lychgate arch to duck, hands and crows to shoot, closed stretches to go round, lanterns that keep the lamp lit (an unbroken lamp is the grade's `steady` die), and coffins thrown out by each hit with a ghoul to shoot in each. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | -| `public/activities/ghoul-hearse-draw.js` | The Midnight Hearse's art: `LOOKS` (`pack: "hearse"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK, SHOOT and SWITCH glyphs for the hearse's lane) and `hearseArt(d)` (sky, hills, cemetery, road, verge, things and the hearse by `moving`; the cab door, lows, fog, glyphs and lamp gauge by `front`; `dim` when the lamp is out); no random numbers. Its header lists what the art reads off the rules | -| `public/activities/ghoul-sled-draw.js` | The Coffin Sled's art: `LOOKS`, `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `sledArt(d)` (the sky, hills, ice and things by `moving`, the lid, the lows and foreground flakes by `front`); no random numbers. Its header lists what the art reads off the rules | -| `public/activities/ghoul-gurney.js` | Code Blue (Blackmoor Sanatorium's bonus round) as a pack (`GURNEY`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; the gurney along `ride.track` (shafts are the gaps), wheelchairs that roll, IV stands, lamps and doors overhead, orderlies in doorways, the lights-out waves (`lightsAt`), the surge lamps and the heartbeat monitor's beat; its state is `round.runner` (`pack: "codeblue"`, put back if another pack's `place` clears the shared slot); draws no random number; imports the cart's track helpers | -| `public/activities/ghoul-gurney-draw.js` | Code Blue's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` and `gurneyArt(d)` (the corridors, shafts and floors by `moving`; the gurney, lows, glyphs, countdown and monitor by `front`; `dim` and `lights` for the blackouts); no imports but the Sled's glyph colors | -| `public/activities/ghoul-mower.js` | The Gardener's Revenge (the Grounds' bonus round) as a pack (`MOWER`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `mower`); a flat lawn run on a ride-on mower with gaps (ponds, ha-ha ditches), junk, hedge arches, clothes lines of gloves and snapping topiary beasts, and the twist: holding fire lowers the blades, which cut tall grass, weeds and thorn hedges in the zone ahead (the blades heat and jam, so they are pulsed); the lawn-cut share is the grade's steady die; hearts through the Cart's bonus machinery; no random numbers | -| `public/activities/ghoul-mower-draw.js` | The Gardener's Revenge's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK and CUT glyphs) and `mowerArt(d)` (sky, manor, topiary and railings by `moving`, the lawn with its ponds and ditches, the mower with its blades and heat gauge, the lows and the lawn gauge by `front`); no random numbers | -| `public/activities/ghoul-sfx-frozen.js` | The Frozen Lake's own sounds as data (no imports): `FROZEN_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | -| `public/activities/ghoul-sfx-mower.js` | The Gardener's Revenge's own sounds as data (no imports): `MOWER_SFX` with first-draft `tones` (`ghoulMower`, each under 1.2 s) and the `ghoulMowerRide` track (sound and music picks still pending); merged by `ghoul-sfx.js` via `STAGE_SFX`, the track set in `ROOM_MUSIC` | -| `public/activities/ghoul-pew.js` | Holy Roller (the Chapel's bonus round) as a pack (`PEW`): a Subway-Surfers style endless-runner seen from behind, pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `pew`). `you.x` is only the distance run; the pew's own `lane` (a float to `laneTo`), `h`, `slide`, `combo` and `magnet` live in `round.runner`. Left/right presses change lane (a wall bump at the edge), up jumps, down slides (fast-fall in the air), fire shoots down the lane; a speed ramp by distance (`speedAt`); `KINDS` (switch: pillar, confessional, pewx; jump: kneeler, stand, cracks, hatch; slide: censer, banner, beam; shoot: garg with 2 hp, bell rope), wax souls and halos, the combo and the steady die (souls share); a hit shoves the pew to a calm lane. Pure rules, no random numbers | -| `public/activities/ghoul-pew-course.js` | Holy Roller's seeded course (no imports): written in seconds and laid by the speed ramp (`xAt`, `speedAt`, `V0`, `ACC`), `COURSE` { items [x, lane, kind, len], souls, checks, finish } | -| `public/activities/ghoul-pew-draw.js` | Holy Roller's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `pewArt(d)`, whose `field(ctx, view)` draws the WHOLE field (ghoul-draw.js has a `round.runner.id === "pew"` branch like the dark ride's `round.gallery` one, then adds the hearts, flash, banner, cards and HUD pills) plus the progress track, souls and combo strip, and the events' effects | -| `public/activities/ghoul-pew-world.js` | Holy Roller's pseudo-3D nave: `worldArt(d)` with `paint(ctx, view)`; the projection `(lane, depth, height)` to the screen with scale = near / (near + depth) toward a vanishing point, far-to-near cells with fog as alpha, stained glass, pillars and ribs, pews, candlelight and god rays pulsing on the organ's beat (`pulse`, `BPM`), every thing's art and telegraph glyph, the souls, bolts, the pew and hero from behind, speed streaks and vignette. A reusable pattern for "run into the screen" rides. No random numbers (hashes) | -| `public/activities/ghoul-sfx-pew.js` | Holy Roller's own sounds as data (no imports): `PEW_SFX` with 17 tones (lane, bump, jump, land, slide, dive, soul, halo, crash, check, finish, speed swell, gargoyle and bell) and the driving `ghoulPewDirge` track at 132 BPM (first drafts, merged by `ghoul-sfx.js`) | -| `public/activities/ghoul-sfx-hearse.js` | The Midnight Hearse's own sounds as data (no imports): `HEARSE_SFX` with 19 first-draft `ghoulHearse` tones (none over 1.2 s) and the `ghoulHearseRide` track (a funeral march at a gallop, built from three four-bar parts); merged by `ghoul-sfx.js`, named in `ROOM_MUSIC`. Sounds and music still to be picked by ear | -| `public/activities/ghoul-sfx-sled.js` | The Coffin Sled's own sounds as data (no imports): `SLED_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` (the room plays the Graveyard's `ghoulGraves`) | -| `public/activities/ghoul-banister.js` | The Grand Banister (the Manor's bonus round) as a pack (`BANISTER`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `banister`); YOU slide down a grand staircase's banister along `ride.track` (the first `rails` lines are the handrail, the breaks between them gaps to jump; the rest are brass under-rails beside it, the split track: a jump with DOWN held dives onto one, a jump off its end lands back on the handrail), vases and candlesticks to jump, hanging portrait frames to duck, chandeliers on a pendulum (`swingAt`: a wall from the bob to the roof, lethal to a ducking rider while the bob is mid-swing, so you brake or lean (LEFT/RIGHT) to time them or take the under-rail), ghostly butlers that lunge (jump or two bolts) and cobwebs to shoot. Adds no monster, boss or hazard kind; no random numbers. Its header documents the room fields | -| `public/activities/ghoul-banister-draw.js` | The Grand Banister's art: `LOOKS` (`pack: "banister"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK and DIVE glyphs) and `banisterArt(d)` (damask wall, moonlit windows, a zig-zag of staircase flights, portraits whose eyes follow YOU, the rails, props, butlers and webs by `moving`; the hanging frames, the chandeliers with the arc they swing through, sparks and glyphs by `front`); no random numbers. Its header lists what the art reads off the rules | -| `public/activities/ghoul-sfx-banister.js` | The Grand Banister's own sounds as data (no imports): `BANISTER_SFX` with 14 first-draft `ghoulBan` tones (each under 1.2 s) and the `ghoulBanister` track (a harpsichord waltz at a gallop, built from three four-bar parts); merged by `ghoul-sfx.js` via `STAGE_SFX`, named in `ROOM_MUSIC` (sound and music picks still pending) | -| `public/activities/ghoul-wagon.js` | The Torch Mob (Hollow End Village's bonus round) as a pack (`WAGON`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; a hay wagon along `ride.track` (ditches and the collapsed bridge are the gaps, a rising line end a ramp), barrels and crates, washing lines and inn signs, villagers who hurl pitchforks (duck) and torches (jump), spooked horses, and the pursuit meter (`gap`: the mob runs at `MOB_V`, DOWN is a duck and the brake, a hit, a burning hay load and the surge close it, a shot torch or fork opens it, inside `PANIC_ON` the horses bolt, at `CATCH_GAP` it is a heart); its state is `round.runner` (`id: "wagon"`); draws no random number; imports the cart's track helpers | -| `public/activities/ghoul-wagon-draw.js` | The Torch Mob's art: `LOOKS` (`pack: "wagon"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` and `wagonArt(d)` (the sky, rooftops, street, cobbled road, ditches, the bridge and river, the things, the mob and the wagon by `moving`; the lows, throws in the air, the hay fire, glyphs and the mob's meter by `front`); no random numbers; imports the Sled's glyph colors and the rules' constants | -| `public/activities/ghoul-sfx-wagon.js` | The Torch Mob's own sounds as data (no imports): `WAGON_SFX` with 18 first-sketch `ghoulWagon` tones and the `ghoulWagonRide` track (a D minor gallop built from three 4-bar patterns); merged by `ghoul-sfx.js`, the room's track named in `ROOM_MUSIC` (`wagon`) | -| `public/activities/ghoul-story.js` | Ghoul Rush's intro story: the pages' text as data and the rules (lockout, reveal, skip) as plain functions over a round; drawn by `ghoul-story-draw.js`, sounded by `ghoul-sfx-story.js`, the lore bible in `prototypes/Ghoul-Rush-TODO.md` | -| `public/activities/ghoul-story-draw.js` | The intro story's drawing (`storyArt(d)`): eight animated scenes in canvas shapes (the road, the house on the hill, the hunger, the long arms, the farthest rooms, why YOU, no way back, the door to The Long Hall) with the heading, the lines typing out, the page dots, the always-visible skip hint with its hold bar and the pulsing continue hint; drawn over the field while `round.phase === "story"`; reuses the intro card's helpers (`poly`, `dot`, `stroke`, `faint`, `flame`, `titleLayout`, `dropAt`); no gradients | -| `public/activities/ghoul-story-draw.js` | The intro story's drawing: `ghoulStoryDraw(d)` scenes for the pages in `ghoul-story.js` | -| `public/activities/ghoul-sfx-story.js` | The intro story's own sounds as data (no imports): `STORY_SFX` tones for the pages' `cues` (wind, a bell, a heartbeat, a door creak, knocks, a whisper, the flashlight click, the page turn) and the `hums` drone under the whole story; merged by `ghoul-sfx.js` | -| `public/activities/ghoul-sfx-gurney.js` | Code Blue's own sounds as data (no imports): `GURNEY_SFX`, 18 first-pick `ghoulBlue` tones and the track `ghoulBlueRide`; merged by `ghoul-sfx.js` (the room plays it via `ROOM_MUSIC.codeblue`) | -| `public/activities/ghoul-tray.js` | The Servants' Back Stairs (the East Wing's bonus round) as a pack (`TRAY`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; the track of shelves and stair flights with gaps, rolling pots and cutlery, hams and pans, cooks who fling dishes, the courses (silver domes and flying plates, seven is the grade's acts die), the cherries, grease stretches, checkpoints and the grade (3 to 9 dice). State is `round.runner` (id `tray`), the shared slot for a rolling bonus ride. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | -| `public/activities/ghoul-tray-draw.js` | The Servants' Back Stairs' art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, the telegraph glyphs (`telegraphMarks`, `telegraphs`: JUMP, DUCK, SHOOT) and `trayArt(d)` (the kitchen, shelves and stairs, things and cooks by `moving`; the tray, hams and pans, flour and glyphs by `front`); no random numbers | -| `public/activities/ghoul-sfx-tray.js` | The Servants' Back Stairs' sounds and music as data (no imports): `TRAY_SFX` with 13 first-draft tones and the `ghoulTrayRide` track; merged by `ghoul-sfx.js` | -| `public/activities/ghoul-sfx-chapel.js` | The Chapel's own sounds as data (no imports): `CHAPEL_SFX`, its `tones` (the 35 picked `ghoul` sounds of the gargoyles, choir ghosts, monks, bell bats, the Choirmaster, the bell and Holy Water's splash) and `music` (`ghoulNave`, `ghoulTower`, `ghoulLoft`, `ghoulChoir`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | -| `public/activities/ghoul-sfx-sanatorium.js` | Blackmoor Sanatorium's own sounds as data (no imports): `SANATORIUM_SFX`, its `tones` (the 38 picked `ghoul` sounds of the orderlies, gurneys, flickers, specimen bloaters, the Night Matron, the lamps, Smelling Salts and the Bone Saw) and `music` (`ghoulAdmissions`, `ghoulBaths`, `ghoulTheater`, `ghoulWard`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | -| `public/activities/ghoul-sfx-village.js` | Hollow End Village's own sounds as data (no imports): `VILLAGE_SFX`, its `tones` (the 42 picked `ghoul` sounds of the torch mob, hanged men, shutter ghouls, moonhounds, the Beast, the full moon and Wolfsbane) and `music` (`ghoulStreet`, `ghoulInn`, `ghoulSquare`, `ghoulGreen`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | +| `public/activities/ghoul-rush/stages/graveyard/ghoul-graveyard.js` | Ghoul Rush's Graveyard stage pack, its rules (no imports: `ghoul.js` hands each rule a kit `k` of its own helpers). A stage pack is plain data and functions that `ghoul.js` merges into its own tables (`PACKS`): `monsters` (with `perch`: its spawn names its height, `flies`: a horde one comes in high), `walkers`/`zombies`/`stackers`/`climbers` (joining the sets of those names), `act` (start), `solid`, `move`, `kill`, `horde` (fields a horde one comes with), `bosses`, `boss` (one slice of its fight), `guard` (true while shots and stomps glance off, a `bossBlock` event) and `hazards` (by kind, one slice of a box on the floor that hurts while `live`; kept in `round.hazards`). Three more fields a stage may add (the Grounds does): `cut` (kinds the Hedge shears kill outright), `weak` (by boss kind, `(boss, shot) => damage multiplier` for a weak spot; `bossHit` then carries `how: "weak"` and `weak: true`) and `cause` (what a boss's touch is called when it costs a life). The Chapel adds more: `tick(round, ms, k)` (a stage-wide twist run first in every slice; it may set `round.stunMs`, which freezes you and every monster, boss, hazard and missile while bolts in flight still fly, and keeps its state in `round.twist`), `stone` (by kind, true while shots glance off and a stomp does nothing; `glance` event), `shot(round, m, s, k, random)` (the damage multiplier of a bolt that hit `m`, free to splash), `target(round, s, k)` (true when a bolt struck something of the pack's that is no monster, such as an organ pipe) and, on a monster, `hasteMs` and `haste` (its time runs faster while `hasteMs` is over 0). On the drawing side a look may be `custom: true` with a `pack` id (the pack's art then draws the whole wall, floor and shelves) and the art may return `decor` (by the look's `decor` name). On the drawing side a stage's art may also return `react(e, k)` (its own events; `ghoul-draw.js`'s `react` falls through to `ART.react`, which returns true when it handled `e`), `ground` and `shelf` (the floor pieces and shelves of an outdoor look), `waves` and `powers`; a boss event must carry `kind` or its voice never plays. The Graveyard's: grasping hands (`HANDS_*`: lurk unseen, rise, grab, sink, creep under level ground after you), the mourner (wails every `WAIL_MS`, slowing you to `SLOW_SHARE` speed for `SLOW_MS` within `WAIL_REACH`; `round.you.slowMs`), the grave robber (digs in within `ROBBER_DIG`, comes up `ROBBER_BEHIND` behind you), the rotter (a zombie whose body-shot death leaves its `legs` walking), the carrion crow (perches, dives at your chest, climbs, dives again), and Mother Mourning (`angel`: weeps `ANGEL_WEEP_MS` as stone flinging headstones, turns `ANGEL_TURN_MS`, watches `ANGEL_WATCH_MS` when only she can be hurt and any move drops a `fist` hazard after `FIST_WARN_MS`; at `ANGEL_RAGE` her wings spread, the weep shorter, the watch longer, a shockwave each way as each weep begins) | +| `public/activities/ghoul-rush/stages/graveyard/ghoul-graveyard-draw.js` | The Graveyard's drawing: `LOOKS` for its four rooms (`outdoor: true`, so `ghoul-draw.js` draws `backdrop` instead of walls: the night sky, stars, the moon, hills with dead trees, iron fences, mausoleums, fog and headstones) and `graveyardArt(d)`, handed `ghoul-draw.js`'s helpers, returning the open `grave` and `openGrave` a rotter climbs out of, `monsters`, `bosses` (Mother Mourning: hands over her face while she weeps, lowered with burning eyes while she watches, wings spread in a rage, cracks as she is worn down), `missiles` (a flung headstone), `hazards` (a stone fist: its shadow, then the fist) and `lights` | +| `public/activities/ghoul-rush/stages/grounds/ghoul-grounds.js` | Ghoul Rush's Grounds stage pack, its rules (no imports; same shape as the Graveyard's, plus the pack fields `cut`, `weak` and `cause`): the topiary beast (`still` while you face it, `creep` when your back is turned; events `rustle` and `freeze`), the rootling (`trail`, `warn`, `up`, `sink`; events `rootWarn` and `rootUp`), the lantern moth (flocks of three, quicker in the dark), the mulch crawler (`pile`, `burst`, `crawl`; event `leaves`), the Hedge shears' `snip` event, and the Groundskeeper (`keeper`: a scythe sweep along the floor (or, now and then, a high `sweep` hazard you stay on the ground under), a lobbed lantern fire hazard, his lantern a `weak` spot only while open (`b.lit`), and at half hp a mower with `rev`, `charge` and `stall`) | +| `public/activities/ghoul-rush/stages/grounds/ghoul-grounds-draw.js` | The Grounds' drawing: `LOOKS` for its four rooms (`outdoor: true`), `groundsArt(d)` returning `monsters`, `bosses`, `hazards` (the fire), `waves` (the scythe), `powers` (the shears), `lights`, `backdrop`, `ground`, `shelf` and `react(e, k)` for the Grounds' own events; its `VOICES` (each kind's tone per act, `keeper.weak` for a weak-spot hit instead of `keeper.hurt`, `shears.snip` for a cut instead of the dying cry), `LOSE_WORDS` and `LOSE_SOUNDS`, which `ghoul-draw.js` spreads into its own tables | +| `public/activities/ghoul-rush/stages/chapel/ghoul-chapel.js` | Ghoul Rush's Chapel stage pack, its rules (no imports; same shape as the Grounds', plus the pack hooks `tick`, `stone`, `shot` and `target`, and a room field `toll`): the gargoyle (`perch` as stone, `wake`, `dive`, `return`; events `glance`, `gargoyleWake`, `gargoyleDive`, `gargoylePerch`), the choir ghost (sings, giving nearby monsters `hasteMs`), the censer monk (`smoke` hazard), the bell bat (`roost` until the toll), the bell toll (`tick`: `bellSwing`, `toll`, `tollEnd`, `round.stunMs`), Holy Water's splash (`shot`, event `holySplash`) and the Choirmaster (`choirmaster`: four pipes in `b.pipes` that bolts hit through `target`, a `guard` while any sounds, columns of `note` hazards with one gap, a rage that brings pipes back one by one) | +| `public/activities/ghoul-rush/stages/chapel/ghoul-chapel-draw.js` | The Chapel's drawing: `LOOKS` for its four rooms (indoor but `custom: true` with `pack: "chapel"`, so `ghoul-draw.js` hands the walls, floor and shelves to `chapelArt(d)`'s `backdrop`, `ground` and `shelf`), `chapelArt(d)` returning those plus `decor` (the room's pews, belfry, organ or stalls), `monsters`, `bosses`, `hazards` (smoke, the bell, notes), `powers`, `lights` and `react(e, k)`; its `VOICES` (the bell has only `swing` and `toll`: the thaw after a toll is quiet on purpose), `LOSE_WORDS` and `LOSE_SOUNDS` | +| `public/activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium.js` | Ghoul Rush's Blackmoor Sanatorium stage pack, its rules (no imports; same shape as the Chapel's, plus the pack fields `unseen`, `harmless`, `platform` and `land`, a room field `flicker`, `round.blackout`/`round.twist` for the lamps and the kit's `fling`): the orderly (`reach`, `hold`, a throw that costs no life, `you.heldMs`; events `orderlyReach`, `orderlyGrab`, `orderlyThrow`, `saltsBreak`), the gurney (`parked` as a floor you can stand on, `rattle`, `roll`, `rest`; `gurneyRattle`, `gurneyRoll`, `gurneyRest`), the flicker (`m.unseen`: bolts and touch go through it until a blackout, the Lantern's light or the Salts' glow; `flickerShow`), the specimen bloater (a `jar` missile with its own `cause` that `land`s as a `formaldehyde` hazard; `jarWind`, `jarBreak`), the lamps (`tick`: `flickerWarn`, `lightsOut`, `lightsOn`), the Salts and the Saw (`shot`) and the Night Matron (`matron`: `b.beam` cone, `b.heat`, `b.cabinets`, syringes, arms, rage; `syringeWind`, `syringes`, `armWarn`, `armReach`, `matronRage`) | +| `public/activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium-draw.js` | The Sanatorium's art: `LOOKS` (indoor but `custom: true` with `pack: "sanatorium"` and `noMoon`, so `sanatoriumArt(d)`'s `backdrop`, `ground` and `shelf` draw the tiled walls, windows, decor, floors, the ward's cabinets, the baths' tubs and each room's boards), `monsters` (orderly with its grab pose, gurney, flicker with its fade and afterimage, specimen bloater), the `matron` with her cone cut by the floor and the cabinets, `missiles` (jar, syringe), `hazards` (formaldehyde, arm with its crack of light), `powers` (Salts, Saw), `lights`, `react(e, k)` and two generic hooks `ghoul-draw.js` calls: `front(ctx, v)` (over Planny and before the dark: the ceiling lamps, the tubs' water, the orderly's fingers, the Matron's heat on him) and `dim(v)` (the dark layer's alpha, raised in a blackout and in a stutter); its `VOICES` (borrowed tones; `lights`, `salts` and `saw` are no monsters), `LOSE_WORDS` and `LOSE_SOUNDS` | +| `public/activities/ghoul-rush/stages/village/ghoul-village.js` | Ghoul Rush's Hollow End Village stage pack, its rules (no imports; no new pack field: it uses `tick`, `shot`, `land`, `weak` (now handed `(boss, shot, round, k)`) and `solid`, and draws no random number): the moonrise (`tick`; `round.twist` = `{ moon, full, ms }`, events `fullMoon`, `villagerTurn`, `villagerWolf`, `houndGrow`), the torch mob villager (a group of three, `torchWind`, the `torch` missile that `land`s as a `torchfire` hazard, `torchLand`; turned into a leaping wolf-man at full moon), the hanged man (`hangedWarn`, `hangedDrop`, `hangedSnap`, `hangedHaul`), the shutter ghoul (`solid` only while out; `shutterRattle`, `shutterLunge`, `shutterPull`), the moonhound (the hellhound's leap, grown at full moon), Wolfsbane's double damage and shying (`baneShy`) and the Beast of Hollow End (`beastLeap`, `beastCling`, `beastPounce` with a `shadow` hazard, `beastLand`, `swipeWind`, `beastSwipe` with a `claw` hazard, `beastHowl`, `houndCall`, `beastMoon`) | +| `public/activities/ghoul-rush/stages/village/ghoul-village-draw.js` | The Village's art: `LOOKS` (street, square and green outdoors, the inn a `custom` indoor look, all `pack: "village"`), `villageArt(d)` returning the world's hooks plus the monsters (the torch mob villager and the wolf-man it turns into over 800 ms, the hanged man on his rope, the shutter ghoul reaching out of a window, the moonhound with a glowing mane when grown), the `beast` (a werewolf in every move: cling with a glowing weak spot, bound, pounce, land, swipe, howl at the moon, rage), `missiles` (torch), `hazards` (torchfire, the landing shadow, the claw swipe), `powers` (Wolfsbane's badge), `lights` and `react(e, k)`; its `VOICES` (borrowed tones, plus `moon.full` and `bane.active`), `EVENT_VOICE` (event to `[kind, act]`, each played once; the hounds' call is quiet), `LOSE_WORDS` and `LOSE_SOUNDS`. Its header lists what the art reads off the rules | +| `public/activities/ghoul-rush/stages/village/ghoul-village-world.js` | The Village's world: the night sky and the moon that climbs and reddens with `round.twist.moon` (`sky`, drawn every frame under the still layers), the crooked timber-framed houses with a window for every shutter ghoul, the church and spire, the gallows, the green's far cottages, well and arena walls, the Crooked Inn (hearths, barrels, bar, lanterns, the moon in its windows), cobbles, planks and turf (`ground`), awnings, rooftops, balconies, tables, carts and thatch (`shelf`), and `moving` (curtains that twitch as you pass, fire, moonlight falling in), `front` (the full-moon wash, Wolfsbane's petals, the Beast's rage) and `lights` | +| `public/activities/ghoul-rush/stages/mine/ghoul-mine-world.js` | The Deep Seam Mine's world (no imports; `mineWorld(d)` takes ghoul-draw.js's helpers): the rock wall with its strata and facets, the timber that holds it up (props and cap beams, scaffolds and galleries as `shelf`), rails and sleepers on the floor (`ground`), oil lamps on hooks with their flames and warm halos (`moving`) and their holes in the dark (`lights`, none in a blackout), the shaft's lining, walers, guide rails and headframe with the cage lift drawn on its cable over a winch wheel with a counterweight (`cage`, and its front bars in `front`), the tunnels' low roof, pipes, stalled pump, drips and knee-deep water with a lit surface and Planny's wake (`front`), the collapse's broken props, cracks, rubble heaps and buried cart, the seam's glittering ore vein, stalactites and galleries, and the `rock` hazard in its three states; layouts are worked out once per room from the room alone and kept. Scene tool: `prototypes/ghoul-rush-tools/scene-mine-world.mjs` | +| `public/activities/ghoul-rush/stages/village/ghoul-village-wolf.js` | The Village's werewolf, one skeleton for the Beast and a turned villager: poses (`POSES`: stand, rear, swipe, howl, crouch, leap, land, rest, cling, shy, down, sleep), `mixPose` to blend them, and `wolfKit(d).figure` to draw one | +| `public/activities/ghoul-rush/stages/mine/ghoul-mine.js` | Ghoul Rush's Deep Seam Mine stage pack, its rules (no imports; draws no random number): uses `tick`, `harmless`, `platform`, `solid`, `kill`, `weak` and a boss's blackout (`round.blackout`). The rockfall (`tick`; a room field `rocks` in ms; the `rock` hazard in states `warn`, `fall`, `rubble`, events `rockWarn`, `rockFall`, `rockLand`; the Hard Hat's `rockBounce`), the noise you make (`round.twist` = `{ next, quiet, noise, reach, wade }`, `wade` splashes), the knocker imp (touch steals light, not a life: `you.dimMs` and `you.dimBy`, `impSteal`, `impDrop`; the Hard Hat stops it), the canary ghost (`canaryScream`: three rocks), the dead miner (buried in the wall, `minerDig`, `pickWind`, `pickSwing` with a `pick` hazard, cause `pickaxe`), the blind crawler (`blindLost`, `blindHear`), the cage lift (a spawn row `["cage", x, lowest y, highest y]`, a `platform` kind that is not solid and never hurts), Dynamite placed in each room (its rules, the `stick` and `blast` hazards, `dynThrow` and `dynBlast`, moved to `ghoul-arms.js`) and the Tommyknocker (`tommyKnock`, `sweepWind`, `tommySweep` with a `hammer` hazard, `tommyDark`, `tommySink`, `tommyKnockDark`, `tommyBurst`, `tommyRage`; dazed double damage through `weak`) | +| `public/activities/ghoul-rush/stages/mine/ghoul-mine-draw.js` | The Mine's art (the rooms in `ghoul-mine-world.js`, the Tommyknocker in `ghoul-mine-tommy.js`): `LOOKS` (`custom: true`, `pack: "mine"`, always dark), `mineArt(d)` returning `backdrop` (rock, strata, timber props, oil lamps), `ground` (rails), `shelf` (timber landings), `front` (the water along the floor), `dim` (the blackout), `monsters` (imp, canary, miner, blind crawler, cage), the `tommy` boss, `hazards` (rock, stick, blast, pick, hammer), `powers` (Hard Hat, Dynamite), `lights` and `react`; its `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS` and `LOSE_SOUNDS`. Its header lists every field the art reads off the rules; `ghoul-draw.js` shrinks Planny's glow and drops his cone while `you.dimMs` is over 0 | +| `public/activities/ghoul-rush/stages/mine/ghoul-mine-tommy.js` | The Tommyknocker's figure for `ghoul-mine-draw.js`: `tommyKit(d)` (no imports, `ghoul-draw.js`'s helpers handed in) returns `figure(ctx, v, b)`, a miner-giant half grown into the seam (stone shoulder with crystals, lantern on his helmet, a door-sized hammer) drawn by act: leaning on the hammer, the overhead knocks, the drawn-back sweep, rest, sinking, bursting out dazed with stars, raged cracks, hurt flash. | +| `public/activities/ghoul-rush/rides/cart/ghoul-cart.js` | Ghoul Rush's Runaway Cart, the Mine's ride room, its rules (no imports; draws no random number): the first room where a pack takes Planny's movement over. It adds the pack fields `ride` (a list of `(round, ms, k) => true` hooks run each slice before the walking rules; one that returns true has moved him) and `place` (a list of `(round, k)` hooks run whenever he is put down in a room: a room set up, a respawn), uses `target` (the crates), and `round.camLead` (units the camera leads further). The cart (`round.cart`, null elsewhere) rides the room's `ride.track` polylines (slope speed, lean and brake, jump, air steering, ramp launch, landing on the line under it, derail into the chasm), ducks under `ride.beams`, wrecks on `rubble` and unbroken `crates` (two bolts break one), is chased by the boulder, passes `checks` (a life lost puts it back at the last) and halts at `stop` where the door opens; a ledge imp (`ledgeimp`) leaps into it and steals light, a canary's scream drops a slide of rubble on the track ahead. Exports `flight`, `trackY`, `linesAt` and `linesOf` for the unit suite. Events `cartJump`, `cartLand`, `cartLaunch`, `cartBrake`, `cartDuck`, `crateHit`, `crateBreak`, `cartCrash`, `boulderNear`, `checkpoint`, `cartStop`, `ledgeLeap`, `slideWarn`, `slideFall`; causes `derail`, `beam`, `crash`, `boulder` | +| `public/activities/ghoul-rush/rides/cart/ghoul-cart-draw.js` | The Runaway Cart's art: `LOOKS` (`custom: true`, `pack: "cart"`, always dark), `cartArt(d)` returning `backdrop`, `ground`, `moving` (every frame: the cave in cached parallax tiles over a chasm, the trestled track, ledge pillars, signal posts, rubble and the buffer stop in cached chunks, hanging lamps, signal lamps, crates, a slide's dust and pour; the cart too once it has stopped, so Planny walks out past it), `front` (the cart over Planny, the beams, the boulder, flying splinters, speed streaks, the foreground rock), `lights` (headlamp, hanging and far lamps, signals, beams), `monsters` (the ledge imp) and `react`; its `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS` and `LOSE_SOUNDS`. It keeps its own offscreen layer cache (keyed by scale), draws no random numbers (a hash) and leaves short-lived bits in the view's `fx` (`cartBits`, `cartPours`, `cartLand`, `cartStop`). Its header lists every field the art reads off the rules | +| `public/activities/ghoul-rush/stages/mine/ghoul-sfx-mine.js` | The Mine's own sounds as data (no imports): `MINE_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | +| `public/activities/ghoul-rush/stages/bog/ghoul-bog.js` | Ghoul Rush's Gallows Bog stage pack, its rules (no imports; a pack `ghoul.js` plugs in through `PACKS`, handed the kit `k`): the lurker, leech swarm, will-o'-wisp and bog body (`MONSTERS`, with `walkers`/`zombies` sets), `act`, `solid`, `swoops`, `unseen`, `move`, `kill`, `horde`, `tick` (the wisp's lure), `bosses`/`boss`, `weak`, `cause` and `hazards`, and Old Mother Bog (`BOSSES`, hp 360, her fight in `moveMother` with `startMove` setting each move's wind-up act, wait and telegraph event: the wave opens, then a weighted `pickAttack` by phase (`phaseOf`, `WEIGHTS`; never one move three times running, `COOLDOWN` picks for the slow moves, a summon only under its cap, counted by `hagAdds` on adds marked `m.hag`). Full health: wave, spit, bog hands (`boghand` hazards: a ripple, then a hand), surge (a waist-deep charge past you), mud shell (`shellShot` in `target` chips it; broken she reels in `stagger` with the cauldron open, ignored she heals `SHELL_HEAL`) and dive (relocate); under three quarters the double wave, volley and leech brood join. Under half (after her first dive): stomp (a shadow, a leap, a slam and a wave each way), tide (a `tide` hazard over every plank after `TIDE_WARN_MS`; shelves are dry), drowning pull (drags `you.x` toward her on the planks, never off a plank's end) and call the drowned (bog bodies). Under a quarter: the wisp lantern (her wisps, gone for good once shot out) and combos (`toIdle`, `motherCombo`). `guard` is under water or shelled; `weak` is the open cauldron (late in a rest, or reeling). `planked` keeps her whole body on one plank height except in `UNSTOOD` acts; `b.floor` is the plank height; `b.plan` forces a move for tests). The stage's second twist lives in the engine, not here: a room field `mud` (frozen `[x0, x1]` spans), `mudAt` in `ghoul.js`, `you.mud` and `you.mudMs` (the run sags from `WATER_SPEED` toward `MUD_SPEED_MIN` and a jump toward `MUD_JUMP_MIN` over `MUD_MS`; a shelf, the air and Stilt Boots (`round.effects.boots`) let go of it) | +| `public/activities/ghoul-rush/stages/bog/ghoul-bog-draw.js` | The Gallows Bog's drawing: `LOOKS` for its rooms (`outdoor: true`, `pack: "bog"`) and `bogArt(d)`, handed `ghoul-draw.js`'s helpers, returning the night swamp rooms (boardwalk planks over black water, moss veils, fireflies, the hag's lit stilt house and her open-water arena), `monsters` (a lurker's eyes, a leech swarm, a will-o'-wisp, a bog body), `bosses` (Old Mother Bog and her cauldron, a pose for every move, plus `motherMarks`: the boiling mud of a call, the stomp's shadow, the undertow's streaks), `hazards` (the mud wave, the muck patches, the bog hands' ripples and arms, the tide's warning and its water over the planks), the Stilt Boots' and Harpoon's badges and the events' looks and sounds; its `VOICES` are borrowed house tones until the sound page's vote, `LOSE_WORDS` and `LOSE_SOUNDS` already named | +| `public/activities/ghoul-rush/rides/lantern/ghoul-lantern.js` | The Drowned Lantern (Gallows Bog's bonus round, not a ride) as a pack (`LANTERN`): a top-down game on one fixed screen where YOU carry a lantern over an island of mossy hummocks and plank walks round Old Mother Bog's pool, light five wisp shrines (stand on a stone `SHRINE_MS`, the time kept if you step off), then run back to the boat at the landing. Pack fields `ride` (moves Planny) and `place`; state in `round.runner` (`id` "lantern"), positions in field units with y counted down; the room's `ride` holds the island (`hummocks`, `planks` as hummock pairs, `shrines`, `start`, `boat`, `pool`, `bodies`) and the hunters' tables (`lurker` route, `leeches` routes, `wisps`: a guardian per shrine with its `phase`, roamers with `wake`). Keys: arrows walk (a walk into the water slides along the shore or plank, `slide`), SPACE flares (a ring `FLARE_R` that bursts wisps and scatters leeches, costing `FLARE_OIL`; a sputter without the oil); `fire()` and the arm double-tap are off for this room. The oil burns down over `OIL_MS` and the light (`lightR`) with it; a lit shrine fills it. One rule per hunter: the Lurker hears steps on wood, flares and shrines, swims to the spot, lines up a lane through it (`AIM_MS`) and dashes (it strikes where it heard you), rests deaf, and cowers once Mother rises; guardian wisps circle their shrine and rush a lantern within `GUARD_SENSE` on a `LEASH`, roamers leave the pool at the third to fifth shrine; leeches stay at the light's edge and bite only once the flame gutters; bog bodies rise only for someone standing still beside them; Mother's hand (from the third shrine or `MOTHER_LATE_S`) tracks, locks and slams, one after another once the fifth raises her. Catches cost the bonus round's hearts and never move Planny; `lanternMeet` names each hunter's rule once; `runner.marks` lists what a banner must keep clear of (read by ghoul.js's `underBanner`); `lanternHums` gives ghoul.js the held sounds; the grade is `total` 5, `hits` (kinds that caught you), `acts` (flare pops and close calls), `steady` (the flame never guttered). No random numbers; a Planny put at the door finishes too, as a ride's finish line does | +| `public/activities/ghoul-rush/rides/lantern/ghoul-lantern-draw.js` | The Drowned Lantern's art, the whole field drawn by `lanternArt(d).field` (like Holy Roller's): `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `TAGS` (each hunter's rule, shown once over it, one at a time); the water and Mother's pool, the island and the boat, then one dark layer with a hole per light (`paintDark` from ghoul-draw.js), and over it what the dark must never hide: the island's moonlit edges, the shrines' beacons and progress, the bodies' bubbles and red reach, the leeches' eyes, Mother's eyes, head and hand shadow, the Lurker's eyes, its lane and dash, the wisps, Planny with the ring of his light (the leeches' line, red when the oil is low) and the boat's beacon; the HUD band (shrine flames, the hint line, the oil bar with its flare ticks); no random numbers, everything from a hash and the clock | +| `public/activities/ghoul-rush/stages/bog/ghoul-sfx-bog.js` | Gallows Bog's own sounds as data (no imports): `BOG_SFX` with `tones` (a `ghoul` tone for each act of the lurker, leech, wisp, bog body and Old Mother Bog, her 22 newer acts first drafts too: a telegraph tone per move and one for each effect) and an empty `music` until the music vote is wired in (the rooms play borrowed tracks through `ROOM_MUSIC`); the tones are first drafts (option 1 of each act) until the sound vote; merged by `ghoul-sfx.js` via `STAGE_SFX` | +| `public/activities/ghoul-rush/rides/lantern/ghoul-sfx-lantern.js` | The Drowned Lantern's own sounds as data (no imports): `LANTERN_SFX` with `tones` (`ghoulLantern`: a creak per step on wood, the flare, the shrine, a cue per hunter heard before it reaches you, Mother's wake, rise, hand and slam), `hums` (`ghoulLanternLurk`, `ghoulLanternMother`, asked for through `lanternHums`) and `music` (`ghoulLanternTheme`, the picked Tiptoe plucks track, named in `ROOM_MUSIC`); first drafts until the vote; merged by `ghoul-sfx.js` via `STAGE_SFX` | +| `public/activities/ghoul-rush/stages/carnival/ghoul-carnival.js` | Ghoul Rush's Midnight Carnival stage pack, its rules (no imports; draws no random number): uses `tick` (the ring of samples Mirror You reads and its bolts in `round.twist`), `shot` (Cotton Candy's slow, a marionette's string at the top of its body), `target` (a bolt crossing a marionette's string or one of the puppet's three), `guard` (the Ringmaster is open only with the puppet down), `swoops` (a balloon, a circus hound's leap), `solid`, `kill` and `fourLegged`. Grinner and its acid balloons, marionette (drops when you pass under), Mirror You (copies you 500 ms late, mirrored, its bolts cancel yours), strongman (barbells), circus hound, and the Ringmaster (a gantry over the ring that follows its puppet at a lag, the puppet stalking you and working to a fixed script of leap, stomp, whip and charge, three strings from the gantry to its head and hands that move with it, open 4 s when they are cut, rage with hounds from the cages); `CARNIVAL_ROOMS` lists the stage's rooms, with a place before the Big Top for the dark ride. The room field `belts` and Planny's `you.belt` (the funhouse's conveyor floors) are run by `ghoul.js`. | +| `public/activities/ghoul-rush/stages/carnival/ghoul-carnival-draw.js` | The Carnival's art: `LOOKS` (`custom: true`, `pack: "carnival"`), `carnivalArt(d)` returning the world's hooks (from `ghoul-carnival-world.js`) plus `monsters`, the `ringmaster` boss (gantry, puppet in each pose, strings, whip), `missiles` (barbell), `hazards` (foot, whip, charge), `waves` (the puppet's), `powers` (Cotton Candy), `front` (Mirror You's bolts, Cotton Candy's glow), `lights` and `react`, and `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`. Its header lists what the art reads off the rules. | +| `public/activities/ghoul-rush/stages/carnival/ghoul-carnival-world.js` | The Carnival's world (no imports; `carnivalWorld(d)` takes ghoul-draw.js's helpers): the night sky with a Ferris wheel (`sky`), tents, booths and swagged bulbs on the Midway, the Hall of Mirrors' gilded panels and glints, the Funhouse's crooked walls, spiral discs and clown-mouth door, the Big Top's striped canvas, ring curb, crowd, trapeze boards, gantry rail and cages (open once the Ringmaster rages), and the belts' chevrons (`moving`). | +| `public/activities/ghoul-rush/stages/carnival/ghoul-sfx-carnival.js` | The Carnival's own sounds as data (no imports): `CARNIVAL_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride.js` | The Carnival's dark ride (a bonus round) as a pack (`RIDE`), the rules ported from `prototypes/ghoul-rush-ride/gallery.html`. Pack fields `ride` (returns true, so Planny never walks; steps the ride in 16 ms steps), `place` (makes `round.gallery`, the ride's state) and a new `pointer` (the mouse, handed on by `ghoul.js`'s `pointer(type, x, y)`); the entities (`K`: pop, lant, axe, chand, door, hand, head, eyes, boss, inno, mir, web, mini), hit tests with aim assist, the duck zone, hearts through `kit.lose`, the grade (5 to 9 dice, `perf.dice`). Events `ride` (`SOUNDS`), causes `CAUSES`. Its own seeded random stream; draws no `Math.random` | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-scenes.js` | The dark ride's scene table as data (12 rooms, lengths, speeds, spawn rows in author coordinates), no imports | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-core.js` | The ride's shared basics: the 96 by 54 field's constants, math helpers, the bound state `G` (a live import), `rnd`/`rand` (seeded) and `vrand` (visual) | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw.js` | The ride's art entry (`rideArt(d, die)`: `field(ctx, v)` draws the whole field by phase, `tick` the cascade's sounds); `ghoul-draw.js` hands over to it when `round.gallery` is set. Parts: `ghoul-ride-gfx.js` (canvas helpers), `ghoul-ride-draw-kinds.js` (animatronics, mini-bosses, the Barker), `ghoul-ride-draw-sets.js` (the 12 sets, far walls, aisle, near layer), `ghoul-ride-draw-hud.js` (car and Planny, HUD, duck strip, reticle, title, end cascade) | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-gfx.js` | The ride's drawing helpers: the bound 2D context and the short fill, stroke and shape calls the ride's art is written in | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-kinds.js` | The ride's drawn things: every figure, beast, lantern, blade, door, hand, head, mirror, web and boss, a port of the prototype's draw code (`prototypes/ghoul-rush-ride/gallery.html`) | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-sets.js` | The ride's rooms drawn: each room's far wall, set pieces front and back, aisle and the near pillars, a port of the prototype's world draw | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-hud.js` | The ride's car and the screen around it: Planny in his car, blood and sparks, the lens, the hearts, the progress bar, the room plaque, the aim, the title and the cleared card | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-voices.js` | The ride's `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `react` (every `ride` event plays tone `ghoulRide`) | +| `public/activities/ghoul-rush/rides/dark-ride/ghoul-sfx-ride.js` | The ride's synthesized sounds as `tones` (`ghoulRide`) and its music `ghoulRideDrone` (`RIDE_SFX`, merged by `ghoul-sfx.js`) | +| `public/activities/ghoul-rush/stages/frozen/ghoul-frozen.js` | Ghoul Rush's Frozen Lake stage pack, its rules (imports only `burrow` from the Graveyard; draws no random number): uses `tick` (thin ice, the blizzard, the Widow's spikes, web and barrels), `place`, `unseen`, `solid`, `kill`, `target`, `land`, `weak`, `cause`, `guard`, `swoops` and `slides`. The generic slippery-ice rule (`iceRun`, room field `ice`) and thin-ice rule (`stepThin`, room field `thin`, `round.thin`), the under-ice hand, snow shade (unseen, footprints), Frozen Ghoul (slides, shatters into shards), Ice Wraith (its dive freezes), Hot Cocoa, the Frost Widow (veil, barrels, weak spot, blizzard, spikes, web, rage) and `FROZEN_ROOMS`. Every constant is exported and documented in its header | +| `public/activities/ghoul-rush/stages/frozen/ghoul-frozen-draw.js` | The Frozen Lake's art: `LOOKS` (`custom: true`), `frozenArt(d)` returning the world's hooks (from `ghoul-frozen-world.js`) plus `monsters`, the Frost Widow boss, `hazards` (shards, spikes, webs, barrels, the flare and its fire), `powers` (Hot Cocoa), `front`, `lights` and `react`, and `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`. Its header lists what the art reads off the rules | +| `public/activities/ghoul-rush/stages/frozen/ghoul-frozen-world.js` | The Frozen Lake's world (no imports; `frozenWorld(d)` takes ghoul-draw.js's helpers): the night sky with moon, aurora and far mountains (`sky`), the huts, the Lodge's fallen roof, the Black Ice and the Widow's web (`backdrop`, `ground` with the ice's gloss, `shelf`), and `moving` (open water in the holes, thin ice drawn from `round.thin`, never from `spec.ground`, the faces under the Black Ice, falling snow) and `lights`. Draws no random number | +| `public/activities/ghoul-rush/arms/ghoul-flare.js` | The Road Flare's rules (`useFlare`, `stepFlareFly`, `stepRoadFire`; no imports, handed the helpers by `ghoul-arms.js`): a lob that lands as a patch of fire, burns monsters on a tick, melts a Frozen Ghoul at once, shows a shade and melts the Widow's veil; never hurts Planny | +| `public/activities/ghoul-rush/rides/sled/ghoul-sled.js` | The Coffin Sled (the Frozen Lake's bonus round) as a pack (`SLED`), modeled on the Runaway Cart (`ghoul-cart.js`): pack fields `ride`, `place` and `target`; the track of ice lines with cracks, headstones, drifts, low branches, hands, icicles and popping ghouls, checkpoints, hearts through the Cart's bonus machinery and the grade (3 to 9 dice). Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | +| `public/activities/ghoul-rush/rides/hearse/ghoul-hearse.js` | The Midnight Hearse (the Graveyard's bonus round) as a pack (`HEARSE`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in `round.runner` (`id: "hearse"`); a flat road of two lanes (road and verge) switched with LEFT/RIGHT inside the lane gates, open graves, headstones and crosses to jump, low branches and the lychgate arch to duck, hands and crows to shoot, closed stretches to go round, lanterns that keep the lamp lit (an unbroken lamp is the grade's `steady` die), and coffins thrown out by each hit with a ghoul to shoot in each. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | +| `public/activities/ghoul-rush/rides/hearse/ghoul-hearse-draw.js` | The Midnight Hearse's art: `LOOKS` (`pack: "hearse"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK, SHOOT and SWITCH glyphs for the hearse's lane) and `hearseArt(d)` (sky, hills, cemetery, road, verge, things and the hearse by `moving`; the cab door, lows, fog, glyphs and lamp gauge by `front`; `dim` when the lamp is out); no random numbers. Its header lists what the art reads off the rules | +| `public/activities/ghoul-rush/rides/sled/ghoul-sled-draw.js` | The Coffin Sled's art: `LOOKS`, `VOICES` (borrowed tones), `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `sledArt(d)` (the sky, hills, ice and things by `moving`, the lid, the lows and foreground flakes by `front`); no random numbers. Its header lists what the art reads off the rules | +| `public/activities/ghoul-rush/rides/gurney/ghoul-gurney.js` | Code Blue (Blackmoor Sanatorium's bonus round) as a pack (`GURNEY`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; the gurney along `ride.track` (shafts are the gaps), wheelchairs that roll, IV stands, lamps and doors overhead, orderlies in doorways, the lights-out waves (`lightsAt`), the surge lamps and the heartbeat monitor's beat; its state is `round.runner` (`pack: "codeblue"`, put back if another pack's `place` clears the shared slot); draws no random number; imports the cart's track helpers | +| `public/activities/ghoul-rush/rides/gurney/ghoul-gurney-draw.js` | Code Blue's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` and `gurneyArt(d)` (the corridors, shafts and floors by `moving`; the gurney, lows, glyphs, countdown and monitor by `front`; `dim` and `lights` for the blackouts); no imports but the Sled's glyph colors | +| `public/activities/ghoul-rush/rides/mower/ghoul-mower.js` | The Gardener's Revenge (the Grounds' bonus round) as a pack (`MOWER`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `mower`); a flat lawn run on a ride-on mower with gaps (ponds, ha-ha ditches), junk, hedge arches, clothes lines of gloves and snapping topiary beasts, and the twist: holding fire lowers the blades, which cut tall grass, weeds and thorn hedges in the zone ahead (the blades heat and jam, so they are pulsed); the lawn-cut share is the grade's steady die; hearts through the Cart's bonus machinery; no random numbers | +| `public/activities/ghoul-rush/rides/mower/ghoul-mower-draw.js` | The Gardener's Revenge's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK and CUT glyphs) and `mowerArt(d)` (sky, manor, topiary and railings by `moving`, the lawn with its ponds and ditches, the mower with its blades and heat gauge, the lows and the lawn gauge by `front`); no random numbers | +| `public/activities/ghoul-rush/stages/frozen/ghoul-sfx-frozen.js` | The Frozen Lake's own sounds as data (no imports): `FROZEN_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` via `STAGE_SFX` (its rooms play existing tracks, set in `ROOM_MUSIC`) | +| `public/activities/ghoul-rush/rides/mower/ghoul-sfx-mower.js` | The Gardener's Revenge's own sounds as data (no imports): `MOWER_SFX` with first-draft `tones` (`ghoulMower`, each under 1.2 s) and the `ghoulMowerRide` track (sound and music picks still pending); merged by `ghoul-sfx.js` via `STAGE_SFX`, the track set in `ROOM_MUSIC` | +| `public/activities/ghoul-rush/rides/pew/ghoul-pew.js` | Holy Roller (the Chapel's bonus round) as a pack (`PEW`): a Subway-Surfers style endless-runner seen from behind, pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `pew`). `you.x` is only the distance run; the pew's own `lane` (a float to `laneTo`), `h`, `slide`, `combo` and `magnet` live in `round.runner`. Left/right presses change lane (a wall bump at the edge), up jumps, down slides (fast-fall in the air), fire shoots down the lane; a speed ramp by distance (`speedAt`); `KINDS` (switch: pillar, confessional, pewx; jump: kneeler, stand, cracks, hatch; slide: censer, banner, beam; shoot: garg with 2 hp, bell rope), wax souls and halos, the combo and the steady die (souls share); a hit shoves the pew to a calm lane. Pure rules, no random numbers | +| `public/activities/ghoul-rush/rides/pew/ghoul-pew-course.js` | Holy Roller's seeded course (no imports): written in seconds and laid by the speed ramp (`xAt`, `speedAt`, `V0`, `ACC`), `COURSE` { items [x, lane, kind, len], souls, checks, finish } | +| `public/activities/ghoul-rush/rides/pew/ghoul-pew-draw.js` | Holy Roller's art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS` and `pewArt(d)`, whose `field(ctx, view)` draws the WHOLE field (ghoul-draw.js has a `round.runner.id === "pew"` branch like the dark ride's `round.gallery` one, then adds the hearts, flash, banner, cards and HUD pills) plus the progress track, souls and combo strip, and the events' effects | +| `public/activities/ghoul-rush/rides/pew/ghoul-pew-world.js` | Holy Roller's pseudo-3D nave: `worldArt(d)` with `paint(ctx, view)`; the projection `(lane, depth, height)` to the screen with scale = near / (near + depth) toward a vanishing point, far-to-near cells with fog as alpha, stained glass, pillars and ribs, pews, candlelight and god rays pulsing on the organ's beat (`pulse`, `BPM`), every thing's art and telegraph glyph, the souls, bolts, the pew and hero from behind, speed streaks and vignette. A reusable pattern for "run into the screen" rides. No random numbers (hashes) | +| `public/activities/ghoul-rush/rides/pew/ghoul-sfx-pew.js` | Holy Roller's own sounds as data (no imports): `PEW_SFX` with 17 tones (lane, bump, jump, land, slide, dive, soul, halo, crash, check, finish, speed swell, gargoyle and bell) and the driving `ghoulPewDirge` track at 132 BPM (first drafts, merged by `ghoul-sfx.js`) | +| `public/activities/ghoul-rush/rides/hearse/ghoul-sfx-hearse.js` | The Midnight Hearse's own sounds as data (no imports): `HEARSE_SFX` with 19 first-draft `ghoulHearse` tones (none over 1.2 s) and the `ghoulHearseRide` track (a funeral march at a gallop, built from three four-bar parts); merged by `ghoul-sfx.js`, named in `ROOM_MUSIC`. Sounds and music still to be picked by ear | +| `public/activities/ghoul-rush/rides/sled/ghoul-sfx-sled.js` | The Coffin Sled's own sounds as data (no imports): `SLED_SFX` with an empty `tones` and `music` until the user picks them; merged by `ghoul-sfx.js` (the room plays the Graveyard's `ghoulGraves`) | +| `public/activities/ghoul-rush/rides/banister/ghoul-banister.js` | The Grand Banister (the Manor's bonus round) as a pack (`BANISTER`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; state in the shared `round.runner` slot (id `banister`); YOU slide down a grand staircase's banister along `ride.track` (the first `rails` lines are the handrail, the breaks between them gaps to jump; the rest are brass under-rails beside it, the split track: a jump with DOWN held dives onto one, a jump off its end lands back on the handrail), vases and candlesticks to jump, hanging portrait frames to duck, chandeliers on a pendulum (`swingAt`: a wall from the bob to the roof, lethal to a ducking rider while the bob is mid-swing, so you brake or lean (LEFT/RIGHT) to time them or take the under-rail), ghostly butlers that lunge (jump or two bolts) and cobwebs to shoot. Adds no monster, boss or hazard kind; no random numbers. Its header documents the room fields | +| `public/activities/ghoul-rush/rides/banister/ghoul-banister-draw.js` | The Grand Banister's art: `LOOKS` (`pack: "banister"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` (JUMP, DUCK and DIVE glyphs) and `banisterArt(d)` (damask wall, moonlit windows, a zig-zag of staircase flights, portraits whose eyes follow YOU, the rails, props, butlers and webs by `moving`; the hanging frames, the chandeliers with the arc they swing through, sparks and glyphs by `front`); no random numbers. Its header lists what the art reads off the rules | +| `public/activities/ghoul-rush/rides/banister/ghoul-sfx-banister.js` | The Grand Banister's own sounds as data (no imports): `BANISTER_SFX` with 14 first-draft `ghoulBan` tones (each under 1.2 s) and the `ghoulBanister` track (a harpsichord waltz at a gallop, built from three four-bar parts); merged by `ghoul-sfx.js` via `STAGE_SFX`, named in `ROOM_MUSIC` (sound and music picks still pending) | +| `public/activities/ghoul-rush/rides/wagon/ghoul-wagon.js` | The Torch Mob (Hollow End Village's bonus round) as a pack (`WAGON`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; a hay wagon along `ride.track` (ditches and the collapsed bridge are the gaps, a rising line end a ramp), barrels and crates, washing lines and inn signs, villagers who hurl pitchforks (duck) and torches (jump), spooked horses, and the pursuit meter (`gap`: the mob runs at `MOB_V`, DOWN is a duck and the brake, a hit, a burning hay load and the surge close it, a shot torch or fork opens it, inside `PANIC_ON` the horses bolt, at `CATCH_GAP` it is a heart); its state is `round.runner` (`id: "wagon"`); draws no random number; imports the cart's track helpers | +| `public/activities/ghoul-rush/rides/wagon/ghoul-wagon-draw.js` | The Torch Mob's art: `LOOKS` (`pack: "wagon"`), `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, `telegraphMarks`/`telegraphs` and `wagonArt(d)` (the sky, rooftops, street, cobbled road, ditches, the bridge and river, the things, the mob and the wagon by `moving`; the lows, throws in the air, the hay fire, glyphs and the mob's meter by `front`); no random numbers; imports the Sled's glyph colors and the rules' constants | +| `public/activities/ghoul-rush/rides/wagon/ghoul-sfx-wagon.js` | The Torch Mob's own sounds as data (no imports): `WAGON_SFX` with 18 first-sketch `ghoulWagon` tones and the `ghoulWagonRide` track (a D minor gallop built from three 4-bar patterns); merged by `ghoul-sfx.js`, the room's track named in `ROOM_MUSIC` (`wagon`) | +| `public/activities/ghoul-rush/story/ghoul-story.js` | Ghoul Rush's intro story: the pages' text as data and the rules (lockout, reveal, skip) as plain functions over a round; drawn by `ghoul-story-draw.js`, sounded by `ghoul-sfx-story.js`, the lore bible in `prototypes/Ghoul-Rush-TODO.md` | +| `public/activities/ghoul-rush/story/ghoul-story-draw.js` | The intro story's drawing (`storyArt(d)`): eight animated scenes in canvas shapes (the road, the house on the hill, the hunger, the long arms, the farthest rooms, why YOU, no way back, the door to The Long Hall) with the heading, the lines typing out, the page dots, the always-visible skip hint with its hold bar and the pulsing continue hint; drawn over the field while `round.phase === "story"`; reuses the intro card's helpers (`poly`, `dot`, `stroke`, `faint`, `flame`, `titleLayout`, `dropAt`); no gradients | +| `public/activities/ghoul-rush/story/ghoul-sfx-story.js` | The intro story's own sounds as data (no imports): `STORY_SFX` tones for the pages' `cues` (wind, a bell, a heartbeat, a door creak, knocks, a whisper, the flashlight click, the page turn) and the `hums` drone under the whole story; merged by `ghoul-sfx.js` | +| `public/activities/ghoul-rush/rides/gurney/ghoul-sfx-gurney.js` | Code Blue's own sounds as data (no imports): `GURNEY_SFX`, 18 first-pick `ghoulBlue` tones and the track `ghoulBlueRide`; merged by `ghoul-sfx.js` (the room plays it via `ROOM_MUSIC.codeblue`) | +| `public/activities/ghoul-rush/rides/tray/ghoul-tray.js` | The Servants' Back Stairs (the East Wing's bonus round) as a pack (`TRAY`), modeled on the Coffin Sled: pack fields `ride`, `place` and `target`; the track of shelves and stair flights with gaps, rolling pots and cutlery, hams and pans, cooks who fling dishes, the courses (silver domes and flying plates, seven is the grade's acts die), the cherries, grease stretches, checkpoints and the grade (3 to 9 dice). State is `round.runner` (id `tray`), the shared slot for a rolling bonus ride. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header | +| `public/activities/ghoul-rush/rides/tray/ghoul-tray-draw.js` | The Servants' Back Stairs' art: `LOOKS`, `VOICES`, `EVENT_VOICE`, `LOSE_WORDS`, `LOSE_SOUNDS`, the telegraph glyphs (`telegraphMarks`, `telegraphs`: JUMP, DUCK, SHOOT) and `trayArt(d)` (the kitchen, shelves and stairs, things and cooks by `moving`; the tray, hams and pans, flour and glyphs by `front`); no random numbers | +| `public/activities/ghoul-rush/rides/tray/ghoul-sfx-tray.js` | The Servants' Back Stairs' sounds and music as data (no imports): `TRAY_SFX` with 13 first-draft tones and the `ghoulTrayRide` track; merged by `ghoul-sfx.js` | +| `public/activities/ghoul-rush/stages/chapel/ghoul-sfx-chapel.js` | The Chapel's own sounds as data (no imports): `CHAPEL_SFX`, its `tones` (the 35 picked `ghoul` sounds of the gargoyles, choir ghosts, monks, bell bats, the Choirmaster, the bell and Holy Water's splash) and `music` (`ghoulNave`, `ghoulTower`, `ghoulLoft`, `ghoulChoir`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | +| `public/activities/ghoul-rush/stages/sanatorium/ghoul-sfx-sanatorium.js` | Blackmoor Sanatorium's own sounds as data (no imports): `SANATORIUM_SFX`, its `tones` (the 38 picked `ghoul` sounds of the orderlies, gurneys, flickers, specimen bloaters, the Night Matron, the lamps, Smelling Salts and the Bone Saw) and `music` (`ghoulAdmissions`, `ghoulBaths`, `ghoulTheater`, `ghoulWard`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | +| `public/activities/ghoul-rush/stages/village/ghoul-sfx-village.js` | Hollow End Village's own sounds as data (no imports): `VILLAGE_SFX`, its `tones` (the 42 picked `ghoul` sounds of the torch mob, hanged men, shutter ghouls, moonhounds, the Beast, the full moon and Wolfsbane) and `music` (`ghoulStreet`, `ghoulInn`, `ghoulSquare`, `ghoulGreen`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` via `STAGE_SFX` | | `scripts/test-web-console-activities-ghoul-chapel.mjs` | The Chapel's suite: each monster, the bell toll and its freeze, Holy Water's splash, the Choirmaster's pipes, notes and rage, a voice for every act, each event playing exactly one picked sound, and every picked tone present in the merged tones and in `ghoul-sfx-chapel.js` | | `scripts/test-web-console-activities-ghoul-sanatorium.mjs` | The Sanatorium's suite: the orderly's reach, hold and throw (and the Salts), the gurney's park, rattle, roll and rest and its floor, the flicker's unseen state, the lamps' timing, the specimen's jar and puddle, both power-ups (stage-only), the Matron's cone, heat, cabinets, syringes, arms and rage, endless lives for every new cause, and a voice for every act | | `scripts/test-web-console-activities-ghoul-village.mjs` | The Village's suite: the rooms, the moonrise timing, the turn and the grow at full moon (and the per-room reset), the villager's group, torch and fire, the hanged man's drop, the shutter ghoul hit only while out, the moonhound, Wolfsbane (stage-only, double damage, shying), the Beast's wall leap, cling weak spot, pounce shadow, swipe, howl and its cap, the rage, endless lives for every new cause, no random draws, and a voice for every act and event | | `scripts/test-web-console-activities-ghoul-mine.mjs` | The Mine's suite: the rooms and the cage rows, rockfall timing, aim and crush, the Hard Hat (stage-only, bounce), the imp's light steal (no life, ended by a shot or a stomp, blocked by the hat), the canary's scream and its three rocks, the miner's dig and swing, the blind crawler losing and hearing you (and the water's louder steps), water slowing you, the cage carrying Planny, Dynamite (a double tap, the bag, the blast), every Tommyknocker move including the dark, the decoy, the burst, the dazed double damage and the rage cap on imps, no random draws, endless lives for every new cause, and a voice for every act and event | | `scripts/test-web-console-activities-ghoul-carnival.mjs` | The Carnival's suite: the rooms and the belts, grinners and their balloon cap, balloons and their acid, the marionette's drop and its string, Mirror You (the delay, the mirrored moves, jumps, its bolts and their canceling, stunned by a pie), the strongman, the circus hound (a swoop, duckable), Cotton Candy, the Custard Pie, every Ringmaster move (stalk, leap, charge, stomp, whip, the strings following, open, rage, hounds, the script), no random draws, endless lives for every new cause, and a voice for every act | | `scripts/test-web-console-activities-ghoul-grounds.mjs` | The Grounds' suite: each monster's behavior, the shears, the Groundskeeper's moves and phases, a voice for every act, each event playing exactly one picked sound, and every picked tone present in the merged tones | -| `scripts/test-web-console-activities-ghoul-bog.mjs` | Gallows Bog's suite: the stage row and its rooms, the mud (slow, sink, jump, shelf, boots), each monster's behavior (the lurker's eyes and snap, the leech's latch, the wisp's light, the bog body's rise), the wisp lure and its fairness cap, the harpoon under the water, Old Mother Bog's wave, weak cauldron, muck, sink and resurface, a voice for every act with exactly one picked sound per event, words and a sound for every cause, both cards, the round flow, drawing dark and lit, and a seeded bot on a draw that throws if the pack asks for a random number | -| `scripts/test-web-console-activities-ghoul-bogboat.mjs` | The Bog Runner's suite: the ride's course, the lanes and banks, jumping, ducking and shooting, the wake and its panic, checkpoints, the grade, endless lives, the telegraphs, drawing, and bots that dodge and do not | -| `public/activities/ghoul-picker-draw.js` | The choice of stage, its drawing: `pickerArt(d)`, handed `ghoul-draw.js`'s helpers (`lookOf`, `label`, `roundRect`, `circle`, `BOSS_ART`, `drawGourdFire`, `GOLD`), returning `drawPicker` (a card per stage offered: its picture of its rooms with its boss standing there, its name, line and boss, the pick raised and edged in gold, and how to choose), `drawSelect` (the stage select for testing: every stage in a list, two columns past 8, the one picked out with its picture and a chip per room) and `stageColor` (a stage's boss room's color, also the tally dots'). Split from `ghoul-draw.js` to keep it under the 3,000-line cap | -| `public/activities/ghoul-powers.js` | Ghoul Rush's power-ups and pickups (no imports: `ghoul.js` hands its rules a kit, `POWER_KIT`, of `landing`, `MAX_LIVES` and the numbers they need): `POWERS` (each power-up's name, line, color, `ms` if timed, drop `weight`, and its rule, the Lantern's `dark`), `TIMED`, `PILL_WORDS`, `FLAP_CLEAR`, `HOURGLASS_MS`, `CANDY_POINTS`, `POWER_POINTS`, `CRYSTAL_POINTS`, `powerHere(round, kind)` (whether a power-up can turn up in the room as it is now; a new rule, such as a stage-only power-up, goes in `POWERS` and is checked here), `pickPower`, `applyPower(round, kind, kit)` (`ghoul.js` exports it bound to its kit as `applyPower(round, kind)`) and `pickups` (candy, placed and dropped power-ups, crystals up high and the key, taken by touch; drops fall and fade). Split from `ghoul.js` to keep it under the 3,000-line cap | -| `public/activities/ghoul-arms.js` | Ghoul Rush's secondary weapons (imports only `ghoul-powers.js`; a pack in `PACKS`, `ARMS`): the double tap (`pressFire`, `releaseFire`, called from the game's `key()` and `release()`, never from `round.input.fire`, so bots never throw), the bag `round.arms` (`useArm`, `armOnTop`: a ride room skips what needs a floor), each weapon's rule (a shot with `arm` through `moveShots`, or a hazard), and `armBossDamage` (scaled to depth, capped at `ARM_BOSS_SHARE` of a boss's hp a fight). Weapons' names, bundles and caps are in `POWERS` (`arm: true`, weight 0), the stage's own in `STAGE_ARMS`, the kill drop band in `armDrop`, all in `ghoul-powers.js`. | -| `public/activities/ghoul-arms-draw.js` | The weapons' art (`armsArt(d)`): their badges (`powers`), `hazards`, `shot` for one in flight, `pill` for the HUD's icon and count, `front` (stars over the dazed), `lights` and `react`. Dynamite's stick, blast and badge stay in `ghoul-mine-draw.js`. | -| `public/activities/ghoul-rockets.js` | The Bottle Rocket's rules, the common weapon every stage sells: one use lights three rockets, one ahead, one up and one behind | -| `public/activities/ghoul-rockets-draw.js` | The Bottle Rocket's drawing (`rocketArt(d)`): the muzzle's flash and smoke, the flared rocket on a stick with a glowing head, the fountain of sparks it sheds and the burst when it goes off | -| `public/activities/ghoul-pans.js` | The Cast-Iron Skillet's rules, the East Wing's weapon: three pans that circle Planny, then spiral outward until they are off screen | -| `public/activities/ghoul-sfx-arms.js` | The weapons' `tones` (`ARMS_SFX`), merged by `ghoul-sfx.js` like a stage's. A first pass, not yet picked by ear. | +| `scripts/test-web-console-activities-ghoul-bog.mjs` | Gallows Bog's suite: the stage row and its rooms, the mud (slow, sink, jump, shelf, boots), each monster's behavior (the lurker's eyes and snap, the leech's latch, the wisp's light, the bog body's rise), the wisp lure and its fairness cap, the harpoon under the water, Old Mother Bog's wave, weak cauldron, muck, sink and resurface, every move (wind-up, telegraph event, effect, a clean dodge costs nothing, a hit a heart), the phase unlocks, cooldowns and caps, planks while standing, her fall clearing every hazard and add, a skilled bot that must kill her in 60 to 120 s on four seeds and an idle bot she kills, a voice for every act with exactly one picked sound per event, words and a sound for every cause, both cards, the round flow, drawing dark and lit, and a seeded bot on a draw that throws if the pack asks for a random number | +| `scripts/test-web-console-activities-ghoul-lantern.mjs` | The Drowned Lantern's suite: the room and its tables, the walk and the slide, steps on wood, the flare and the oil, the shrines, Mother's wake and rise and the boat, each hunter's rule (the Lurker's hearing, lane and dash, the guardian and roaming wisps, the leeches at the light's edge and their bite, the bodies that take only the still, Mother's hand and its gaps), hearts, endless lives and the grade, the clock, determinism (no random drawn), the balance (a bot that ignores the hunters loses every shrine order, one that plays them wins each with hearts left), the rule tags and banner marks, the hums, voices and drawing | +| `public/activities/ghoul-rush/draw/ghoul-picker-draw.js` | The choice of stage, its drawing: `pickerArt(d)`, handed `ghoul-draw.js`'s helpers (`lookOf`, `label`, `roundRect`, `circle`, `BOSS_ART`, `drawGourdFire`, `GOLD`), returning `drawPicker` (a card per stage offered: its picture of its rooms with its boss standing there, its name, line and boss, the pick raised and edged in gold, and how to choose), `drawSelect` (the stage select for testing: every stage in a list, two columns past 8, the one picked out with its picture and a chip per room) and `stageColor` (a stage's boss room's color, also the tally dots'). Split from `ghoul-draw.js` to keep it under the 3,000-line cap | +| `public/activities/ghoul-rush/core/ghoul-powers.js` | Ghoul Rush's power-ups and pickups (no imports: `ghoul.js` hands its rules a kit, `POWER_KIT`, of `landing` and the numbers they need): `POWERS` (each power-up's name, line, color, `ms` if timed, drop `weight`, and its rule, the Lantern's `dark`), `TIMED`, `PILL_WORDS`, `FLAP_CLEAR`, `HOURGLASS_MS`, `CANDY_POINTS`, `POWER_POINTS`, `CRYSTAL_POINTS`, `powerHere(round, kind)` (whether a power-up can turn up in the room as it is now; a new rule, such as a stage-only power-up, goes in `POWERS` and is checked here), `pickPower`, `applyPower(round, kind, kit)` (`ghoul.js` exports it bound to its kit as `applyPower(round, kind)`) and `pickups` (candy, placed and dropped power-ups, crystals up high and the key, taken by touch; drops fall and fade). Split from `ghoul.js` to keep it under the 3,000-line cap | +| `public/activities/ghoul-rush/arms/ghoul-arms.js` | Ghoul Rush's secondary weapons (imports only `ghoul-powers.js`; a pack in `PACKS`, `ARMS`): the double tap (`pressFire`, `releaseFire`, called from the game's `key()` and `release()`, never from `round.input.fire`, so bots never throw), the bag `round.arms` (`useArm`, `armOnTop`: a ride room skips what needs a floor), each weapon's rule (a shot with `arm` through `moveShots`, or a hazard), and `armBossDamage` (scaled to depth, capped at `ARM_BOSS_SHARE` of a boss's hp a fight). Weapons' names, bundles and caps are in `POWERS` (`arm: true`, weight 0), the stage's own in `STAGE_ARMS`, the kill drop band in `armDrop`, all in `ghoul-powers.js`. | +| `public/activities/ghoul-rush/arms/ghoul-arms-draw.js` | The weapons' art (`armsArt(d)`): their badges (`powers`), `hazards`, `shot` for one in flight, `pill` for the HUD's icon and count, `front` (stars over the dazed), `lights` and `react`. Dynamite's stick, blast and badge stay in `ghoul-mine-draw.js`. | +| `public/activities/ghoul-rush/arms/ghoul-rockets.js` | The Bottle Rocket's rules, the common weapon every stage sells: one use lights three rockets, one ahead, one up and one behind | +| `public/activities/ghoul-rush/arms/ghoul-rockets-draw.js` | The Bottle Rocket's drawing (`rocketArt(d)`): the muzzle's flash and smoke, the flared rocket on a stick with a glowing head, the fountain of sparks it sheds and the burst when it goes off | +| `public/activities/ghoul-rush/arms/ghoul-pans.js` | The Cast-Iron Skillet's rules, the East Wing's weapon: three pans that circle Planny, then spiral outward until they are off screen | +| `public/activities/ghoul-rush/arms/ghoul-sfx-arms.js` | The weapons' `tones` (`ARMS_SFX`), merged by `ghoul-sfx.js` like a stage's. A first pass, not yet picked by ear. | | `scripts/test-web-console-activities-ghoul-arms.mjs` | The weapons' suite: the double tap through the keys (repeats, feathering, hammering), the bag and its pill, each weapon, bosses (scale, cap, guards, the half-hp drop), placement in every room, the drop band's single draw, ride rooms, drawing and sounds. | -| `public/activities/ghoul-run.js` | Ghoul Rush's run flow (no imports: `ghoul.js` hands its rules `RUN_KIT`, the room and stage tables, the timings and the helpers that set a room up, and binds them): `newRound`, `setupRoom`/`resetRoom`, the stage pick (`stagesLeft`, `nextRoom`, `steerPick`, `pickStage`), the stage select for testing (`openSelect`, `steerSelect`, `takeSelect`: a practice round, `round.practice`, that keeps no best score or record), `camera`, `respawn`, `lockArena`, `clearRoom`, and a room's monster supply (`spawners`, `horde`, `hurry`). `ghoul.js` re-exports `newRound`, `stagesLeft`, `steerPick`, `pickStage`, `steerSelect` and `takeSelect`, and its game answers `stageSelect()`. Split from `ghoul.js` to keep it under the 3,000-line cap, with the same random draws in the same order | -| `public/activities/ghoul-dice.js` | Ghoul Rush's Lucky die rules (no imports: `ghoul.js` hands them `DICE_KIT`): `MAX_DICE` (9), `ROLL_MS`, `TUMBLE_MS`, `SAVED_TIME_MS`, `markRest` (the last solid ground Planny stood on), `reviveSpot`, `beginRoll` (called by `lose` when `round.dice > 0` and not `round.infinite`: the round holds in the phase `roll`), `rollDice` (one die at a time from advance's `random`, events `diceStart`, `diceRoll`, `diceFace`, `diceSaved`, `diceFail`; a six revives with the Garlic shield and `SAFE_MS`, and blows apart every monster in view in a room without a boss (`diceBlast`, kills with `how: "luck"`, points but no drops); no six hands the loss back to `takeLife`) | -| `public/activities/ghoul-bonus.js` | Ghoul Rush's bonus rounds, the rules (imports only `MAX_DICE`; no random numbers): a room with `bonus: true` (the Runaway Cart; the Carnival's dark ride is meant to follow) gets `round.bonusRound = { hearts, max, dice, over, won, perf }` on entering it (null elsewhere; `round.bonus` is already the time bonus score). A life lost in it is a heart lost through the same `lose`/`takeLife` (so Garlic, the safe moment and `round.infinite` work as ever; no Lucky die is rolled for a heart); the last heart gone calls `endBonus(round, false)` from `respawn` (no dice, no game over, the run's lives untouched), and a finish alive calls `endBonus(round, true)` from `clearRoom` (`diceFor`: `BONUS_FLOOR` 3 plus up to 6 by hearts, clean obstacles, acts and a steady hand, added to `round.dice` up to `MAX_DICE`). A room's pack notes its performance in `bonusRound.perf` (`total`, `hits`, `acts`, `goal`, `steady`); both ends hold the phase "clear" for the card (`CARD_MS`, `CARD_LOST_MS`) and set `bonusRound.result`. Events `bonusStart`, `bonusEnd`; `heartsText(b)` is the HUD pill | -| `public/activities/ghoul-bonus-draw.js` | The bonus rounds' art (`bonusArt(d, die)`): `card` ("BONUS CLEARED! +N LUCKY DICE" with the dice tumbling in, or the short "BONUS LOST"), `react` (the intro banner, the end, the hearts-left float) and `tick` (a click for each die landed) | -| `public/activities/ghoul-dice-draw.js` | The Lucky die's art (`diceArt(d)`: the small drop, the rolling die on a panel placed away from Planny, the sweeping "LUCKY-SAVE" word, and `react` for the dice events, which plays `ghoulLuckySave` once on the revive) | -| `public/activities/ghoul-gameover-draw.js` | The lost end screen's "G A M E - O V E R" (`gameOverBanner(d)`, `dropAt`): nine letters dropping in with a stagger and one bounce, then bobbing on a sine wave under a slow pulse, red and bone with a dark shadow, drawn above the score panel and never on a win. `ghoul.js` keeps ticking the clock on the lost end screen (`view.overMs`) and plays the mechanical laugh track there: `ghoulLaughTrack`, `ghoulLaughTrack2` and `ghoulLaughTrack3` in `ghoul-sfx.js`, one second apiece (a tone may not pass 1.2 s). | -| `public/activities/ghoul-intros.js` | The stage intro cards' words and colors: `INTROS` per stage id (`title`, `palette` {a, b, glow}, `kicker`, 3 or 4 `lines` of flavor text at most `MAX_LINE` characters, `boss`), `introFor(id)`. Always addressed to YOU. A test fails for a stage in `STAGES` with no card. | -| `public/activities/ghoul-intro-draw.js` | The intro card's drawing (`introArt(d)`, `titleLayout`, `dropAt`): the title's letters dropping in and glowing, one themed flourish per stage (frost crystals, bunting, pickaxe sparks, leaves, candle flames, ...), the lines fading in, the boss and the pulsing "Press any move key or fire to enter". Drawn over the field while `round.phase === "intro"`. The phase itself lives in `ghoul-run.js` (`startIntro`, `stepIntro`, `takeIntro`, `INTRO_MIN_MS` 1.2 s: any fresh move key, fire or a click moves on after it, repeats never, and the card never moves on by itself); the tone is `ghoulStageIntro`. | -| `public/activities/ghoul-boss-intros.js` | The boss intro cards' words: `BOSS_INTROS` per boss id (`name`, which must equal the boss's `name` in its pack's `bosses` table, an `epithet` of at most `MAX_EPITHET` characters and an optional `accent` color), `bossIntroFor(id)`. A test fails for a boss room whose boss has no entry. | -| `public/activities/ghoul-bossintro-draw.js` | The boss intro card's drawing (`bossIntroArt(d)`): a "BOSS FIGHT" title whose letters slam in with a screen shake and a heartbeat pulse, the boss drawn from its own art (`BOSS_ART`, the way the stage pick does) at a big scale in a spotlight on the stage's palette, its name, the epithet and the pulsing "Press any move key or fire to start the fight"; a boss whose art throws falls back to a silhouette. Drawn over the field while `round.phase === "bossintro"`. The phase lives in `ghoul-run.js` (`startBossIntro`, run by `enter` on every boss room, and `onCard`; it shares `introMs`, `stepIntro`, `takeIntro` and `INTRO_MIN_MS` with the stage card, and a respawn never shows it); the tone is `ghoulBossIntro`. | -| `public/activities/ghoul-monsters-draw.js` | The generic monsters' art (`monsterArt(d)`, no imports; `ghoul-draw.js` hands it its helpers `ellipse`, `circle`, `line`, `rotate`, `turned`, `eye` and the colors): `drawZombie`, `drawZombieKin`, `drawHuntsman`, `drawCrawler`, `drawBat`, `drawGhost`, `drawSkeleton`, `drawGourdling`, `drawHound`, `drawSpider`, `drawWraith`, `drawSpitter` and the missiles `drawBoneShape` and `drawGlob`. Split from `ghoul-draw.js` to keep it under the 3,000-line cap | +| `public/activities/ghoul-rush/core/ghoul-run.js` | Ghoul Rush's run flow (no imports: `ghoul.js` hands its rules `RUN_KIT`, the room and stage tables, the timings and the helpers that set a room up, and binds them): `newRound`, `setupRoom`/`resetRoom`, the stage pick (`stagesLeft`, `nextRoom`, `steerPick`, `pickStage`), the stage select for testing (`openSelect`, `steerSelect`, `takeSelect`: a practice round, `round.practice`, that keeps no best score or record), `camera`, `respawn`, `lockArena`, `clearRoom`, and a room's monster supply (`spawners`, `horde`, `hurry`). `ghoul.js` re-exports `newRound`, `stagesLeft`, `steerPick`, `pickStage`, `steerSelect` and `takeSelect`, and its game answers `stageSelect()`. Split from `ghoul.js` to keep it under the 3,000-line cap, with the same random draws in the same order | +| `public/activities/ghoul-rush/core/ghoul-dice.js` | Ghoul Rush's Lucky die rules (no imports: `ghoul.js` hands them `DICE_KIT`): `MAX_DICE` (9, the most one bonus or ride pays; dice in hand have no limit), `ROLL_MS`, `TUMBLE_MS`, `SAVED_TIME_MS`, `markRest` (the last solid ground Planny stood on), `reviveSpot`, `beginRoll` (called by `lose` when `round.dice > 0` and not `round.infinite`: the round holds in the phase `ask` and asks "Use a Lucky Die?", the event `diceAsk`), `askStep`, `steerAsk`, `answerAsk` (Yes spends one die and holds in the phase `roll`; No keeps every die, the event `diceKeep`, and lets the loss go ahead; a press inside `ASK_GUARD_MS` is ignored so the key held at the death cannot answer), , `rollDice` (one die at a time from advance's `random`, events `diceStart`, `diceRoll`, `diceFace`, `diceSaved`, `diceFail`; a six revives with the Garlic shield and `SAFE_MS`, and blows apart every monster in view in a room without a boss (`diceBlast`, kills with `how: "luck"`, points but no drops); no six hands the loss back to `takeLife`) | +| `public/activities/ghoul-rush/core/ghoul-bonus.js` | Ghoul Rush's bonus rounds, the rules (imports only `MAX_DICE`; no random numbers): a room with `bonus: true` (the Runaway Cart; the Carnival's dark ride is meant to follow) gets `round.bonusRound = { hearts, max, dice, over, won, perf }` on entering it (null elsewhere; `round.bonus` is already the time bonus score). A life lost in it is a heart lost through the same `lose`/`takeLife` (so Garlic, the safe moment and `round.infinite` work as ever; no Lucky die is rolled for a heart); the last heart gone calls `endBonus(round, false)` from `respawn` (no dice, no game over, the run's lives untouched), and a finish alive calls `endBonus(round, true)` from `clearRoom` (`diceFor`: `BONUS_FLOOR` 3 plus up to 6 by hearts, clean obstacles, acts and a steady hand, added to `round.dice`, which has no limit). A room's pack notes its performance in `bonusRound.perf` (`total`, `hits`, `acts`, `goal`, `steady`); both ends hold the phase "clear" for the card (`CARD_MS`, `CARD_LOST_MS`) and set `bonusRound.result`. Events `bonusStart`, `bonusEnd`; `heartsText(b)` is the HUD pill | +| `public/activities/ghoul-rush/core/ghoul-bonus-draw.js` | The bonus rounds' art (`bonusArt(d, die)`): `card` ("BONUS CLEARED! +N LUCKY DICE" with the dice tumbling in, or the short "BONUS LOST"), `react` (the intro banner, the end, the hearts-left float) and `tick` (a click for each die landed) | +| `public/activities/ghoul-rush/core/ghoul-dice-draw.js` | The Lucky die's art (`diceArt(d)`: the small drop, the rolling die on a panel placed away from Planny, the `ask` panel ("Use a Lucky Die?" with YES and NO, the lit one gold), the sweeping "LUCKY-SAVE" word, and `react` for the dice events, which plays `ghoulLuckySave` once on the revive) | +| `public/activities/ghoul-rush/story/ghoul-gameover-draw.js` | The lost end screen's "G A M E - O V E R" (`gameOverBanner(d)`, `dropAt`): nine letters dropping in with a stagger and one bounce, then bobbing on a sine wave under a slow pulse, red and bone with a dark shadow, drawn above the score panel and never on a win. `ghoul.js` keeps ticking the clock on the lost end screen (`view.overMs`) and plays the mechanical laugh track there: `ghoulLaughTrack`, `ghoulLaughTrack2` and `ghoulLaughTrack3` in `ghoul-sfx.js`, one second apiece (a tone may not pass 1.2 s). | +| `public/activities/ghoul-rush/story/ghoul-intros.js` | The stage intro cards' words and colors: `INTROS` per stage id (`title`, `palette` {a, b, glow}, `kicker`, 3 or 4 `lines` of flavor text at most `MAX_LINE` characters, `boss`), `introFor(id)`. Always addressed to YOU. A test fails for a stage in `STAGES` with no card. | +| `public/activities/ghoul-rush/story/ghoul-intro-draw.js` | The intro card's drawing (`introArt(d)`, `titleLayout`, `dropAt`): the title's letters dropping in and glowing, one themed flourish per stage (frost crystals, bunting, pickaxe sparks, leaves, candle flames, ...), the lines fading in, the boss and the pulsing "Press any move key or fire to enter". Drawn over the field while `round.phase === "intro"`. The phase itself lives in `ghoul-run.js` (`startIntro`, `stepIntro`, `takeIntro`, `INTRO_MIN_MS` 1.2 s: any fresh move key, fire or a click moves on after it, repeats never, and the card never moves on by itself); the tone is `ghoulStageIntro`. | +| `public/activities/ghoul-rush/story/ghoul-boss-intros.js` | The boss intro cards' words: `BOSS_INTROS` per boss id (`name`, which must equal the boss's `name` in its pack's `bosses` table, an `epithet` of at most `MAX_EPITHET` characters and an optional `accent` color), `bossIntroFor(id)`. A test fails for a boss room whose boss has no entry. | +| `public/activities/ghoul-rush/story/ghoul-bossintro-draw.js` | The boss intro card's drawing (`bossIntroArt(d)`): a "BOSS FIGHT" title whose letters slam in with a screen shake and a heartbeat pulse, the boss drawn from its own art (`BOSS_ART`, the way the stage pick does) at a big scale in a spotlight on the stage's palette, its name, the epithet and the pulsing "Press any move key or fire to start the fight"; a boss whose art throws falls back to a silhouette. Drawn over the field while `round.phase === "bossintro"`. The phase lives in `ghoul-run.js` (`startBossIntro`, run by `enter` on every boss room, and `onCard`; it shares `introMs`, `stepIntro`, `takeIntro` and `INTRO_MIN_MS` with the stage card, and a respawn never shows it); the tone is `ghoulBossIntro`. | +| `public/activities/ghoul-rush/draw/ghoul-monsters-draw.js` | The generic monsters' art (`monsterArt(d)`, no imports; `ghoul-draw.js` hands it its helpers `ellipse`, `circle`, `line`, `rotate`, `turned`, `eye` and the colors): `drawZombie`, `drawZombieKin`, `drawHuntsman`, `drawCrawler`, `drawBat`, `drawGhost`, `drawSkeleton`, `drawGourdling`, `drawHound`, `drawSpider`, `drawWraith`, `drawSpitter` and the missiles `drawBoneShape` and `drawGlob`. Split from `ghoul-draw.js` to keep it under the 3,000-line cap | | `public/activities/pills.js` | The pills every game but Mini golf draws along its top (no imports): `drawPill(ctx, x, y, w, h, text, color, fill, textY)` on one opaque dark backing, `PILL`, the same in light and dark and over any scene, a timer's share still left tinted at `PILL_TINT`, and the text in `pillInk(color, tinted)`: the pill's own color when it reads at `PILL_CONTRAST` (4.5:1) on the backing (and on the tint while a timer runs), else the least step toward white that does, so warnings stay red; lives are the one solid pill: a pill in the `LIVES` color is drawn on `LIVES_BACK` in white (`LIVES_INK`), its text from `livesText(n)` (a heart per life up to five, `♥ xN` past that, `♡` at none); `pillTint` and `pillContrast` for the unit suite | | `public/activities/golf.js` | Mini golf: six eighteen-hole courses, one round at a time; its rules and physics as plain exported functions (`newRound(courseId)`, `holesOf`, `coursePar`, `strike`, `advance` on a fixed 4 ms sub-step, `nextHole`, `total`, `toPar`, `predictPath` for the spyglass, `moverAt`, `gateShut`, plus ice that barely slows the ball and wells that pull it in or push it away), the `POWERUPS` held for the next putt (`round.held`, then `round.active` for that putt), the arcade swing (`startSwing`, `setPower`, `meterAt`, `meterZone`, `swingShot`: a ping-pong power meter, slow at the bottom and fast at the top, with a MAX band that boosts and an overswing band that shanks; a shot clock in `advance()` that starts the meter after `SHOT_CLOCK_MS` and dribbles the ball after `METER_TRIPS` trips; all on the round's own clock), the pop-up gags, and the game contract with `pointer()` (the aim follows the pointer, a press swings, a press held on a roll fast-forwards), `release()` (held arrows turn the aim, held space fast-forwards) and `lowerIsBetter`, `courses` (the dashboard's cards), `preview(canvas, id, w, h)` (a course's card art) and `setCourse(id)`; deterministic (no `Math.random()`), a read-only `round` getter for the unit suite only | | `public/activities/golf-draw.js` | Mini golf's drawing: `drawCourse(ctx, view)` from a plain view `golf.js` builds, each hole in its theme's fixed palette (`pirate`, `cave` with its darkness and glows, or a newer course's look from `golf-looks.js`, asked first for its grounds, water, tunnels, gates and wells), ice, the scorecard and banners in the course's voice, a bare view for the dashboard's card art, `knownGround`/`knownLiquid` for the unit suite, and `readColors(canvas)`, which reads the `--golf-*` properties `styles/activities.css` mixes from the tokens for the ball, pills and scorecard; decides nothing | @@ -397,9 +412,9 @@ Optional local browser UI shipped with **every** skill. Source lives in `src/web | `public/state.js` | the page's shared state (`page.S` the server's truth, `page.local` what is staged) and the `redraw()` / save hooks every screen calls; defines only | | `public/tones.js` | the activities' sound engine, all synthesized in the browser. Three parts: a shared kit of rich one-shot sounds (`RICH`: `layers` of parts played together, each a wave or a noise (`noise`, `pink`, `brown`) with its own `delay`, `gain`, `attack`, a sweeping `filter` and `vibrato`: `explode`, `smash`, `skid`, `whoosh`, `splashBig`, `fanfare`, `gameOver` and some fifty more, up to 1.2 s, at most `MAX_VOICES` parts sounding at once), held **hums** (`hum(id, name, level, pitch)`, called every frame a game wants it: oscillators and noise through one filter that follows the pitch, pulsed for an engine's strokes; a hum not asked for within `HUM_HOLD_MS` fades by itself, so a paused or closed game goes quiet without saying so, `hushTones()` quiets every one and the Activities window calls it whenever it stops ticking; at most `MAX_HUMS`; shared ones `car`, `toycar`, `electric`, `outboard`, `river`, `wind`, `cycle`, `fuse`, `haunt`, `squeal`, `meter`, `swarm`, `train`, `crowd`), and each game's own extras in `public/activities/-sfx.js` (`{ tones, hums }`, plain objects, names prefixed with the game id, merged and frozen here; a name may be defined once across all of them, which `scripts/test-web-console-tones.mjs` checks along with every spec's shape and every name a game's source asks for). Everything plays through one compressor. The older single blips (`BLIPS`): `tone(name, level, pitch)` with an optional loudness from 0 to 1 and an optional pitch that scales every frequency, kept between 0.25 and 4, `unlockTones()`; Snake's blips plus golf's `putt`, `wall`, `bump`, `cup`, `ace` (a three-note rise), `splash`, `power` (a power-up, three notes), `tunnel`, `boom` (a cannon putt), `sizzle` (lava) and `fall` (the pit), the countdown's `count` and `go`, Stack Deploy's `thunk`, `slice` and `perfect`, which it pitches up a scale step for each perfect in a row, and Bumper Ring's `ram`, pitched and leveled by how hard the hit, and `rev`, a rival winding up a dash, and Hot Potato's `tick`, the fuse, which it ticks quicker and pitches higher as the fuse burns down, and `pop`, a pass, and Crossing Rush's `hop`, which it pitches up a step for each quick hop forward in a row, `boing`, a send-back, `bell`, a train coming, and `horn`, and Bounce Road's `engine`, a soft low triangle hum it plays every few frames while you pick up speed (quiet once you cruise or coast), pitched up with your speed, `spring`, a jump, pitched with your speed, and `squash`, a rival flattened, pitched up a step for each in a chain, and `beat`, a low thump while your wheels run on the verge (it borrows the other games' blips for its hazards and rivals), and Rapids Run's `pew` (a shot, a short soft triangle played quietly about seven times a second while fire is held), `charge` (a buoy taken), `lowcell` (the low battery's two-note beep, quicker the lower it runs), `dambreak` (a dam bursting) and `skim` (a bank skimmed at speed, pitched up the more you have skimmed), and Ghoul Rush's `ghoulBlast` (the blaster's bolt, a short soft triangle repeated while fire is held), `zombiePop` (a kill, pitched up a step for each in the chain), `ghoulStomp`, `ghoulBoo`, `ghoulRoar` and `zombieGroan` (now kept for the other games and the tests: Ghoul Rush's monsters speak with their own voices from `ghoul-sfx.js`), `ghoulCandy` (pitched up for candy in quick succession), `batSwoop` (a bat's kill), `doorUnlock` (the key), `doorThrough` (the door to the next room) and `creakBoard` (a crawler coming up, a chandelier or a crumbling board about to go), all soft triangles and sines), silent while Play sounds is off; separate from `sound.js`'s cue queue | | `public/music.js` | the games' chiptune music: a small sequencer over `tones.js`'s context and compressor (`audioOut()`). A game calls `music(name, intensity)` from its `tick`; the track fades out within `MUSIC_HOLD_MS` once it stops being asked for, picks up again on the bar it left, asking for a different track crossfades the two over `CROSSFADE_S` (the old one keeps playing as it fades, so a new level is not a cut), and `hushMusic()` stops it at once. Tracks are note data under `music` in each game's `activities/-sfx.js` (`{ bpm, rush, voices, patterns, order }`: pulse, triangle and noise-drum voices, each joining once the intensity reaches its `from`; a step a token, `A4`, `-` to hold, `.` a rest, `A3^037` an arpeggio, drums `k s h o`), read by `compileTrack()` and booked `LOOKAHEAD_S` ahead on the audio clock. The window plays it only while Play sounds, Play game sounds and Play game music (`looks.gameMusic`, off by default) are all on | -| `public/activities/snake-sfx.js` · `public/activities/golf-sfx.js` · `public/activities/trails-sfx.js` · `public/activities/bugs-sfx.js` · `public/activities/drive-sfx.js` · `public/activities/stack-sfx.js` · `public/activities/bumper-sfx.js` · `public/activities/rapids-sfx.js` · `public/activities/fuse-sfx.js` · `public/activities/hop-sfx.js` · `public/activities/bounce-sfx.js` · `public/activities/ghoul-sfx.js` | each game's own sound effects as data, `{ tones, hums }` in the shapes `tones.js` documents, every name prefixed with the game id (`driveEngine`, `ghoulMoan`), merged and frozen by `tones.js`; no imports, but for `ghoul-sfx.js`, which merges each Ghoul Rush stage's own `ghoul-sfx-.js` into its `tones`, `hums` and `music` | -| `public/activities/ghoul-sfx-graveyard.js` | The Graveyard's own sounds as data (no imports): `GRAVEYARD_SFX`, its `tones` (the picked `ghoul` sounds of the grasping hands, mourners, grave robbers, rotters and their legs, carrion crows and Mother Mourning) and `music` (`ghoulLychgate`, `ghoulGraves`, `ghoulMausoleums`, `ghoulAngel`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` after the house's own. Every new stage gets its own `ghoul-sfx-.js`, listed in `STAGE_SFX` there | -| `public/activities/ghoul-sfx-grounds.js` | The Grounds' own sounds as data (no imports): `GROUNDS_SFX`, its `tones` (the 32 picked `ghoul` sounds of the topiary beasts, rootlings, lantern moths, mulch crawlers, the Groundskeeper and the Hedge shears' snip) and `music` (`ghoulMaze`, `ghoulTopiary`, `ghoulGazebo`, `ghoulYard`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` after the house's own via `STAGE_SFX` | +| `public/activities/snake-sfx.js` · `public/activities/golf-sfx.js` · `public/activities/trails-sfx.js` · `public/activities/bugs-sfx.js` · `public/activities/drive-sfx.js` · `public/activities/stack-sfx.js` · `public/activities/bumper-sfx.js` · `public/activities/rapids-sfx.js` · `public/activities/fuse-sfx.js` · `public/activities/hop-sfx.js` · `public/activities/bounce-sfx.js` · `public/activities/ghoul-rush/sfx/ghoul-sfx.js` | each game's own sound effects as data, `{ tones, hums }` in the shapes `tones.js` documents, every name prefixed with the game id (`driveEngine`, `ghoulMoan`), merged and frozen by `tones.js`; no imports, but for `ghoul-sfx.js`, which merges each Ghoul Rush stage's own `ghoul-sfx-.js` into its `tones`, `hums` and `music` | +| `public/activities/ghoul-rush/stages/graveyard/ghoul-sfx-graveyard.js` | The Graveyard's own sounds as data (no imports): `GRAVEYARD_SFX`, its `tones` (the picked `ghoul` sounds of the grasping hands, mourners, grave robbers, rotters and their legs, carrion crows and Mother Mourning) and `music` (`ghoulLychgate`, `ghoulGraves`, `ghoulMausoleums`, `ghoulAngel`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` after the house's own. Every new stage gets its own `ghoul-sfx-.js`, listed in `STAGE_SFX` there | +| `public/activities/ghoul-rush/stages/grounds/ghoul-sfx-grounds.js` | The Grounds' own sounds as data (no imports): `GROUNDS_SFX`, its `tones` (the 32 picked `ghoul` sounds of the topiary beasts, rootlings, lantern moths, mulch crawlers, the Groundskeeper and the Hedge shears' snip) and `music` (`ghoulMaze`, `ghoulTopiary`, `ghoulGazebo`, `ghoulYard`, named in `ROOM_MUSIC`), merged by `ghoul-sfx.js` after the house's own via `STAGE_SFX` | | `public/uploads.js` | pictures and documents attached to a note: chips, trays, re-encoding, upload, retry, and the page's shared full-screen picture preview (`openPicview`, the `#picview` dialog every thumbnail opens) | | `public/screens/ask.js` | the Ask chat, the Subagents tab, and attaching files to notes | | `public/screens/cards.js` | question cards: every kind, the pager, settled and in-flight records | @@ -528,11 +543,11 @@ Key design points: - **The Quick question chat is a second, append-only channel beside the card slot.** The page's **Ask** tab (always last, every workflow, still there after a finish) posts to `POST /chat` (a message, or `{ reset: true }` for New conversation) and `POST /chat/decision` (Approve / Decline on an edit the agent proposed). The server is the only writer of `/chat.ndjson` (one JSON line per `message` / `decision` / `reset`, each with a `seq`; `appendChat()` in `inbox.mjs`); `console.mjs` is the only writer of `/chat-cursor.json` (the last seq handed over, advanced only after printing) and of the agent's replies in `state.json` → `chat.replies` (merged by `id`, checked by `validateChat()`: real `re`, proposal paths outside the running `specs//`). The server never writes chat into `state.json` — `post` read-modify-writes it under `withStateLock()` — and `stateFrame()` merges inbox and replies into the frame's `chat` block (`conversation`, `messages`, `typed`, `limit`, `offline`) in memory. `/chat` never checks `pendingResult()`, so neither channel can block the other. `wait` keeps its exit codes 0/10/20/30: exit 0 gains `chat` (or is `type: "chat"` with no actions), and the instant `console.mjs chat` answers 0/10/20 without touching `result.json`, which builds run after every task. Guards: 10 typed messages per conversation (`409 limit`), 4,000 characters (`400 too-long`), own uploads only, of the right kind (`400 image`, `400 file`), `409 offline` when `chatOffline()` says no agent is there, `409 stale` for an old conversation. A hop through the dashboard keeps the conversation: `switchWorkflow()` carries `chat.replies` across and the page keeps its Ask state, so only New conversation appends a `reset` after the opening one. A lone reset never ends a `wait` slice (`deliverableChat()`); it rides along with the next message. - **`validate()` in `patches.mjs` enforces four workflow rules mechanically**: max three open required questions, no internal vocabulary in a title, one recommended option, and no loop markers or metrics-scraper bait. - **The palette is written twice for dark, and that duplication is the mechanism.** `@media (prefers-color-scheme: dark) :root:not([data-theme="light"])` follows the system; `:root[data-theme="dark"]` is the explicit choice from the colors panel. Drop the `:not()` and a system-dark browser overrides someone who asked for light. A chosen accent is applied as an inline custom property on `:root` (CSSOM, which the CSP allows), and the default is applied by REMOVING that override so the stylesheet's own per-theme values win. The server's `data-looks-accent` stand-in only lasts until `applyLooks()` runs, which removes it first thing — left on, its rule would beat "Back to default". -- **Help is in the page, built on first open.** The **?** button (`#btn-about`) opens ``, which replaced the old "What this page is" About dialog. Its 20 panels and their icon sheet are hand-written HTML and SVG in `