missionScreens.screens: the controller. `select(model, handlers)`, `briefing(model, handlers)`, `debrief(model, handlers)`, `leaving(model, seconds, done)`, `hide()`, `build(kind, model, styleId?, size?)` for previews and tests, `configure({ screen, env, layer, idPrefix, phoneCard, sound, resolve })`. Routes button callbacks (`<env>:<action>:<arg>`, actions pick/start/outfit/gear/ready/back/replay/select) to the handlers, focuses the first button for gamepad play, uses the compact card on phone-sized canvases, redraws on resize and language change, and calls the optional sound hook with click/open/stamp/leave.
# Mission Dossier: Contract Select, Briefing and Debrief Screens Kit
`missionScreens` draws the three screens a mission, heist, contract or quest game needs, in five crafted styles that swap with one setting:
| Screen | What the player sees | What the game gets back |
|---|---|---|
| **Select** | every mission with its target, location, mastery marks and best grade | `pick(id)` |
| **Briefing** | the orders, the target's portrait, known intel, and chips for a starting point, an outfit and gear (selected, locked behind a mastery level, or free), the crew's ready state | `choose(kind, id)`, `ready()`, `back()` |
| **Debrief** | rating lines that stagger in one by one, a total that ticks up, the grade stamped down, mastery gained and unlocks, the crew and a team grade | `replay()`, `select()` |
| **Leaving** | a short full-screen moment while the player slips away by an exit | `done()` after N seconds |
Styles (family `briefing` draws briefing + debrief, family `select` draws the select):
| id | family | look |
|---|---|---|
| `scroll` | briefing | aged parchment between wooden rollers, wax seal, inked oval portrait, ledger, red ink stamp |
| `caseBoard` | briefing | cork board, polaroid on a pin, intel index cards on red string, typed after-action report, stamp circle |
| `card` | briefing | compact phone-first card with a dark head band and a gold grade medallion (used on phones by default) |
| `board` | select | weathered plank notice board of torn pinned bills under a lamp |
| `list` | select | clean dark list with framed portraits and Play buttons |
Every style fits 1280x720, 1920x1080, a 390x844 phone and an 844x390 landscape phone; phone buttons are at least 48px; buttons are focusable for gamepad and the first one takes focus; reduced motion shows everything at once.
## Use it
```luau
local Screens = require("missionScreens.screens")
local Samples = require("missionScreens.samples") -- invented models to try it with
require("missionScreens.styleScroll"); require("missionScreens.styleCaseBoard"); require("missionScreens.styleCard")
require("missionScreens.selectBoard"); require("missionScreens.selectList")
Screens.configure({ sound = function(name) mySounds.play(name) end }) -- optional: click, hover, open, stamp, leave
require("missionScreens.registry").configure({ briefing = "caseBoard", select = "list" })
Screens.briefing(Samples.briefingModel(), {
choose = function(kind, id) --[[ start / outfit / gear ]] end,
ready = function() end,
back = function() end,
})
```
`Screens.build(kind, model, styleId?, { w, h }?)` returns the widget tree without showing it (previews, galleries, tests). `Screens.configure({ screen, env, layer, idPrefix, phoneCard, sound, resolve })` lets a game keep its own screen id, callback env, button id prefix (default `ms_btn_`, giving `ms_btn_ready`, `ms_btn_pick_<id>`, `ms_btn_<kind>_<id>`) and its own style registry (`resolve(family, id?, ctx)`).
## The model
Plain data, in the game's own words. A mission (`contract`): `id, title, location, client?, brief, targets = {{ name, title, portrait?, description }}, intel = {{ title, text, source }}, starts/outfits/gear = {{ id, title, text }}, mastery = { thresholds }`.
- select: `{ contracts = {{ contract, level, best }}, host, lexicon? }`
- briefing: `{ contract, mastery = { level, best }, choices = { level, starts, outfits, gear } (rows with locked, need), knownIntel, choice = { start, outfit, gear = {ids} }, ready, others = {{ name, ready }}, live, host, lexicon? }`
- debrief: `{ contract, result = { display = "rank"|"letter"|"stars"|"team", grade, tier, tierIndex, tiers, tableTitle, total, unit, lines = {{ label, value, points, kind = base|bonus|penalty|info }}, failed }, mastery = { xpGained, xp, level, levelBefore, unlocked, nextAt }, team?, crew, allDone, host, lexicon? }`
`lexicon` renames the screen words (`contract`, `target`, `intel`, `start`, `outfit`, `gear`, `begin`, `replay`, `waiting` and the rest in `words.module`): a heist game passes `{ contract = "Job", target = "Mark" }`. A word the model does not name comes from the catalog.
## Words
Every word the screens print comes from the model or from `locales/en/missionscreens.json` and `locales/pt-BR/missionscreens.json` (namespace `missionscreens`). A world overrides any line by putting the same key in its own `/locales/<tag>/missionscreens.json`.
## Parts
`screens.module` controller · `registry.module` styles · `widgets.module` shared builders · `words.module` words · `styleScroll`, `styleCaseBoard`, `styleCard`, `selectBoard`, `selectList` · `samples.module` · `missionScreensTests.testSuite` · guide `how-to-show-a-mission-briefing-and-debrief-screen`.
Used by Sealed Orders (package `assassinationKit`; its `assassinationKit.screens` module is a thin adapter over this one).