The playground

The playground is the game board: a grid of cells, a walking mouse, a cheese target, and the traps. It is rendered as a real <table> for the simple reason that a table is the correct semantic model of a labelled grid, and screen readers understand it for free.

Structure

The sizing math (why cells are square)

Tables want to size themselves from content, which would make a 5x7 map's cells slightly tall. The app refuses that: all geometry is computed from two custom properties and applied explicitly.

  1. .playground-box caps the board at --playground-limit (the largest square that fits the viewport, with a sane cap on huge screens).
  2. .playground-frame is an inline-size query container.
  3. .playground-grid gets --playground-columns and --playground-rows (the map size) and derives:
    • --playground-label-size - the label track, clamp(1.5rem, 6% of the limit, min(2.25rem, half a tile)), so digits fit but never eat the board;
    • --playground-tile-size - the smaller of (frame width minus label) per column and (limit minus label) per row.
  4. Each track type gets explicit sizes: the corner and the two label tracks take the label size on one axis, and every data cell takes --playground-tile-size for both width and height.

Because one value drives both axes of every data cell, cells are square by construction, on any map shape and any viewport. The historical aspect-ratio on the table was removed for exactly this reason: it ignored the label row and column and drifted to 1:1.05 on non-square maps.

Terrain and textures

Each cell's background comes from its terrain identifier (data-terrain

The full art direction is on the Design system page.

Entities

Only the player and the lava animate; everything else is deliberately still. prefers-reduced-motion disables the player and lava animations.

Accessibility of the board

Every cell is a real table cell with an accessible name: column and row headers announce the coordinates, and each cell carries a title and a screen-reader-only label for its contents (ground, wall, ice, lava, hole, target, player). Details on Accessibility.

Next: Design system.