# Slipstream Garden — UX Architecture

## Screen Inventory

- `SCR-ONBOARDING`: opens on the real three-ring FTUE basin with one constrained snap, live `M-PREVIEW`, Skip, and an accessibility shortcut. It teaches turn, current direction, age, and proposed destination without a carousel.
- `SCR-HOME`: shows the radial botanical ledger, Continue, chapter/level grid, settings, accessibility, and legal routes. Store messaging never replaces Continue.
- `SCR-GAMEPLAY`: contains `UI-TOPBAR`, full `UI-BOARD`, generous ring hit bands, `UI-WAKE-KEY`, lower consequence sentence, pause, restart, and contextual rule help.
- `SCR-PAUSE`: modal overlay with Resume, Restart, Settings, and Home. It freezes input and preserves the last stable state; an uncommitted preview is cancelled before the overlay opens.
- `SCR-SUCCESS`: retains the solved basin, plays `V-SUCCESS`, shows turns/par and cosmetic stamps, then offers Next, Replay, and Home.
- `SCR-FAILURE`: retains the decisive paths and cells, names `FAIL-COLLISION`, `FAIL-SWAP`, `FAIL-THORN`, or `FAIL-BUDGET`, then offers Retry, Inspect, and Home. No purchase or ad appears.
- `SCR-SETTINGS`: music, ambience, effects, haptics, tutorial replay, data controls, purchase restore if present, accessibility, and legal links.
- `SCR-ACCESSIBILITY`: previews symbol redundancy, wake arrows/ticks, high contrast, type scale, reduced motion, haptics, audio, and assistive board labels.
- `SCR-LEGAL`: cached privacy, terms, licenses, credits, support, consent status, purchase terms, and last-updated dates.

Loading is an inline radial skeleton before `ST-FRESH`, not a separate primary screen. It never covers interactive state. A compact offline badge appears only when an optional adapter is unavailable.

## State Inventory

- `ST-FRESH`: exact authored ring offsets, pieces, wakes, and budget before a committed action.
- `ST-ACTIVE`: idle, drag, snap-preview, or deterministic resolution. Input locks only during committed resolution.
- `ST-PAUSED`: stable simulation state with motion and input stopped; modal focus is trapped.
- `ST-SUCCESS`: all matching seeds and buds resolved; result controls enable after the reduced or standard success treatment.
- `ST-FAILURE`: collision, swap, thorn, or exhausted budget is frozen with every implicated path visible.
- `ST-ERROR`: invalid level, save, entitlement, or optional-network failure with Retry and Return Home. It never fabricates a level or completion.

Disabled rings use lower contrast plus an anchor icon and assistive “locked ring” label. Disabled actions retain their label and expose the reason. An OS interruption requests pause after any in-flight 400 ms-or-shorter resolution reaches its stable endpoint; if termination occurs, production restores the previous stable checkpoint.

## Navigation and Back Behavior

First launch → `SCR-ONBOARDING` → tutorial `SCR-SUCCESS` → `SCR-HOME`. Skip goes directly home and leaves Tutorial Replay available. Returning launch → home. Continue or level selection → gameplay in `ST-FRESH`. Commit keeps gameplay active until success or failure. Success Next and failure Retry load gameplay; Replay restores the same authored state.

Gameplay pause or Android back → pause. Pause Resume or back → gameplay. Pause Restart asks for confirmation only after at least one commit; Home writes a stable production checkpoint then returns. Settings, accessibility, and legal push onto one navigation stack and back returns to the caller. Android back closes the top modal, then pops the stack; back from home requests native exit. iOS uses visible navigation controls and no destructive edge gesture.

`M-PREVIEW` cancels before any modal or screen transition. A released commit cannot be cancelled. No navigation bypasses success/failure rules, changes a canonical budget, or opens a purchase from failure.

## Overlays, Loading, and Error Recovery

Modals use a 56% graphite scrim, one clear title, one reason, and at most four actions. Reduced motion removes panel travel. Level JSON is decoded and solver metadata sanity-checked before gameplay appears. `ST-ERROR` identifies the category in plain language: “Level could not load,” “Progress could not be read,” “Purchase could not be verified,” or “Optional service unavailable.”

Level error offers Retry and Home. Save corruption restores the most recent checksum-valid production snapshot and states which newer progress could not be read. Entitlement uncertainty preserves already verified owned content and defers only new access. Analytics/cloud failure is silent except for the optional offline badge. The HTML prototype persists none of FTUE, gameplay, levels, or results and always starts fresh.

## Orientation, Safe Areas, and Reachability

Portrait is the only orientation. At 360×800, the top inset is max(device inset, 24), side insets max(device inset, 16), and bottom inset max(device inset, 20). `UI-TOPBAR` occupies y=24–88, `UI-BOARD` y=104–610, the consequence/wake key y=620–688, and the lower action zone y=696–780. On 430×932, extra height is divided above and below the board while the basin grows only until the inner ring retains a 72-pixel usable diameter.

All ordinary controls are at least 48×48 with eight pixels separation. Each ring's interactive band extends 12 pixels across visible boundaries and resolves overlap to the ring whose centerline is nearest the initial touch. Once selected, only that ring tracks the pointer. Angular snap uses hysteresis: a new sector becomes active only after crossing its midpoint plus four degrees, preventing flicker. The inner ring can be selected through a centered 72-pixel target. No action requires two fingers, long press, edge swipe, precise water art, or device rotation.

## Gameplay Feedback and Focus

Idle focus order is heading → level/turn status → board summary → ring controls inner-to-outer → wake key → restart → pause. During preview, the assistive announcement is: ring number, direction, distance, refreshed wake lifetime, each seed destination, and predicted outcome. Repeated pointer movement within the same snap does not repeat the announcement.

Visual order is selected ring outline → carried-piece ghosts → refreshed wake arrows/ticks → seed path arrows → result icons. Collision paths meet at a cross, swaps show a double-headed crossing, thorns grow a static outline, stone blocks terminate in a square cap, and matching buds show the shared pair glyph. Text below the board summarizes only the highest-priority consequence while every affected cell remains marked.

## Accessibility and Recovery

- `A-COLOR`: every seed and bud pair shares a silhouette/internal glyph; thorns are clipped black shapes; stones use square caps; selection, safe, blocked, and failure states have distinct outlines and patterns.
- `A-WAKE`: direction is an arrowhead and lifetime is one to three parallel ticks, never color or animation alone.
- `A-MOTION`: continuous water and easing are removed; ring commits crossfade in 100 ms, destinations step once, bloom uses three static growth stages, and no cue flashes.
- `A-TEXT`: 100%, 125%, and 150% interface type; the top status may wrap, the consequence strip grows upward, and neither may cover `UI-BOARD`.
- `A-HAPTIC`: independent toggle for snap tick, commit pulse, bloom light pulse, block knock, and failure double pulse. Visual/text feedback remains complete when disabled.
- `A-AUDIO`: music, ambience, and effects are independent. Wake age tones, bloom, block, and failure always have visual and text equivalents.
- `A-ASSISTIVE`: board summary and ring controls expose logical state and preview consequences; focus is trapped in modals and returns to the opener.

Accessibility is reachable from onboarding and settings. Tutorial can skip and replay. Error recovery uses plain language, retains a safe route, never asks the player to disable device protections, and never discards the last checksum-valid production save without notice.

## Transitions and Back Behavior

The first-launch, home, gameplay, pause, result, settings, accessibility, legal, retry, replay, and safe-error transitions above form the complete navigation graph. Android back closes the top overlay, then pops the stack, and only requests exit from home; iOS uses visible controls. An uncommitted preview cancels before navigation and a commit resolves to a stable state first.

## Overlays, Loading, and Errors

Graphite-scrim modals trap focus and contain at most four actions. Inline loading completes before `ST-FRESH`. Level, save, entitlement, and optional-service errors use the explicit recovery behavior above and always retain Retry or Home.

## Orientation and Safe Areas

Portrait-only anchors, logical regions, cutout insets, bottom gesture clearance, and 360×800 through 430×932 scaling follow the exact measurements above; rotation never rearranges or hides the basin.

## Touch and Reachability

Ring bands, overlap resolution, snap hysteresis, inner-ring target size, ordinary target size, separation, lower action placement, and prohibited precision gestures follow the exact touch contract above.

## Accessibility Matrix

`A-COLOR`, `A-WAKE`, `A-MOTION`, `A-TEXT`, `A-HAPTIC`, `A-AUDIO`, and `A-ASSISTIVE` apply to onboarding, gameplay, pause, success, failure, settings, accessibility, legal, and error recovery. Every semantic state has non-color, non-motion, and non-audio support where applicable.
