# ArenaGeo
Geometry kit for the Rogue Ice arena set (`game.arena.Arena`, `game.arena.Stands`, `game.arena.Office`): a mesh builder that accumulates the flat arrays `asset.create("mesh")` / `build.asset("mesh")` take (positions, normals, uvs, vertex colours, indices), flat-shaded box/quad emitters and a cheap 8-vertex box for crowds, a light-shaft cone, a deterministic hash, sRGB-hex to linear colour, and the rink perimeter: the rounded rectangle of `Core.RINK` and any outward offset of it, sampled as a path with outward normals, arc length and side labels, which boards, glass, stands, suite ring and crowd are swept along (`sweepWall`, `sweepFlat`).
# Crowd
Drives the Rogue Ice arena crowd. `Crowd.setExcitement(x)` (0..1, hype) sets how worked-up the whole bowl is and eases toward it; `Crowd.pulse(amount?)` fires a decaying burst (goals, big hits, wins); `Crowd.snap()` jumps to the target; `Crowd.state()` reads it back. It writes `excite` / `pop` on the `game.arena.Stands.Fans` material (the `game.arena.shaders.fans` crowd shader), so all ~13k spectators react at once on the GPU. `game.arena.ArenaFx` calls `Crowd.update(dt)` every frame and feeds it from the game bus; any slice may call `setExcitement` / `pulse`.
# Core
The shared contract of ROGUE ICE, a hockey roguelite deckbuilder. Every part of the game requires `game.Core` and talks to the others only through it.
- **Constants**: `PALETTE`, `FONTS`, `KIND_COLOR`, `RARITY_COLOR`, `HOME` (Frostbite HC), `RINK` dimensions, `ZONE_X` (puck lane to world X), `ANCHORS` (scene entity names), `SHOTS` (named camera poses), `SETS` (where the office set sits), `PHASES`, `MATCH_STEPS`, `COMMANDS`, `EVENTS`, `RULES`, `EVENT_TYPES`, `NODE_TYPES`, `CARDS` (+ `Core.card(id)`), `GOALIES`, `TEAMS` (+ `Core.team(id)`), `SPONSORS`, `ACHIEVEMENTS`, `ART_DIRECTION`.
- **State**: `Core.state()` is the live game; `game.rules.Director` is its only writer and calls `Core.touch()` (bumps `state.version`) after each change. `Core.reset()` restores a fresh state in place.
- **Bus**: `Core.on(name, fn, tag?)`, `Core.off(name, tag)`, `Core.offAll(tag)`, `Core.emit(name, payload)`, `Core.cmd(name, payload)` (= emit `"cmd."..name`). Tagged subscriptions replace themselves, so reloaded components never double-subscribe.
- **Live positions**: `Core.live.puck`, `Core.live.skaters`, `Core.live.focus`, written by the 3D match presentation.
- **Random**: `Core.seed(n)`, `Core.random()`, `Core.randomIndex(n)`, `Core.shuffle(list)` — one seeded stream per run.
- **Helpers**: `Core.rgba(hex, a)`, `Core.rgb(hex)`, `Core.money(n)`, `Core.compact(n)`.
The full contract (state shape, who writes what) is `/zero/source/design/spec.md`.
# Arena
The whole set of ROGUE ICE as one scene module, placed once at the origin by `scenes/main.scene/build.luau`, matching `design/references/arena_rink.png`: the rink at true scale (60 x 26 m, long axis X) with glossy scuffed ice and every marking plus the Frostbite crest drawn by `game.arena.shaders.ice`; white boards with a yellow kick plate, navy cap and sponsor ad panels (Core.SPONSORS + the home brand); glass with aluminium stanchions; two generated red goals with white netting; the four-sided cyan jumbotron over centre ice with live score labels; roof truss, catwalk, rafter banners, a spotlight rig with additive light shafts through the haze and coloured stand washes; post-processing (haze fog, bloom, colour grade, vignette) and screen-space reflections on the ice. It places `game.arena.Stands` (bowl, suites, animated crowd) and `game.arena.Office` (the GM front office), and attaches `game.arena.ArenaFx` for the runtime crowd and jumbotron. Owned by the arena slice — see `/zero/source/design/spec.md`.