# Scoreboard Layout Contract

This file defines the reserved layout areas that every scoreboard consumer must honor.

## Fixed zones

- `clubLogo`: top-left, `31%` width, `15%` height
- `courtHeader`: top-center, `38%` width, `15%` height
- `timers`: top-right, `31%` width, `15%` height
- `scorePanel`: centered block, `20.95%` from the top, `59.8%` height
- `sponsorBand`: full-width bottom band, `17.8%` height

## Fit rules

- `clubLogo` content must fit within a `22%` by `11%` box of the full scoreboard canvas, using `contain` scaling
- `sponsorLogo` content must fit within a `40%` by `8%` box of the full scoreboard canvas, using `contain` scaling
- The upload path in the club-admin repo should reject assets that cannot be rendered inside those boxes without cropping
- Validation should use the contract values from `scoreboard-contract.json`, not hard-coded dimensions in the club-admin repo
- Acceptable asset sources are `http:`, `https:`, or `data:image/*`
- Empty logo slots are valid and should render as blank until a club-admin asset is supplied

## Blank slots

- `clubLogo` starts blank until the club-admin feed supplies a logo
- `sponsorLogo` starts blank until the club-admin feed supplies a bank sponsor asset

## Consumer rule

Any repo rendering the scoreboard must treat these areas as fixed contract space, not optional UI.

## Template helpers

- `ump1re_scoreboard.html` exposes the shared contract surface for the core court board and sanitizes club name HTML before rendering
- `Club Scoreboards/assets/americano_scoreboard.html` exposes validation helpers for asset source sanitization and fit measurement
- `wimbledon_scoreboard.html` exposes the same contract surface and uses `DotMatrix` for numeric readouts
- `asset-upload.schema.json` is the canonical validation schema for club-admin uploads
- `admin-console-contract.md` describes the publish flow between the admin console, D1, and R2
- Blank slots must be published explicitly with `isBlank: true` and `source: ""`
- Consumers should call those helpers or mirror their logic when validating sponsor uploads before accepting them

## Variants

- `ump1re_scoreboard.html`: general court scoreboard
- `americano_scoreboard.html`: americano format
- `wimbledon_scoreboard.html`: tennis-style variant with DotMatrix readouts
