/* ==========================================================================
   The Father's House -- this board's own look  (styles.css)
   ==========================================================================
   Shared chrome comes from theme.css, shell.css and board/board.css. This file
   holds ONLY what is particular to this board -- 01-Architecture.md §9: Go
   stones and Mancala seeds are not the same object, so a board's own colours
   and piece artwork are never shared.

   Every colour and measurement is a token in the block below, so changing the
   look is one place rather than a hunt.

   THE PAGE MUST NEVER SCROLL, and nothing may ever scroll sideways. .stage is
   the only element allowed to grow or shrink. The max-height: 299px exception
   in Standards.md §5 applies unchanged.
   ========================================================================== */

/*
   EVERY LINE BELOW IS A TOKEN, AND THAT IS THE WHOLE CUSTOMISATION SURFACE.

   board.css already wires these to the real class hooks -- `.board__piece` gets
   `.is-side-0`, `.is-side-1` and so on from sprites.js, and an alternating cell
   gets `.is-alt`. A game that writes its own `.board__piece--0` rule instead is
   writing a selector that matches nothing: the page renders, the pieces are the
   shared gold and blue, and no tool anywhere reports a thing. That was the
   first version of this scaffold, and it is why the token list is the only
   thing here.
*/
.app {
    /* ---- the board surface ---------------------------------------------
       A wooden board: the frame dark, the points alternating light and dark
       the way every backgammon board has always done, because that alternation
       is how a player counts six without counting. */
    --board-bg:       #241812;
    --board-line:     #8a6244;
    --board-cell:     #3c2a1e;
    --board-cell-alt: #58402e;

    /*
       The two players' colours. NOT their shapes: those come from sprites.js
       and are the signal that survives a colour-blind eye, a photocopy and
       Windows High Contrast. Change a colour here and rename the side in
       rules.js to match, or the board will say "Gold to play" in blue.

       Each colour has an EDGE, and it is not decoration: a piece is drawn with
       `paint-order: stroke`, so the darker edge is what keeps a pale piece
       legible against a pale square.
    */
    --piece-0:        #ffd45c;
    --piece-0-edge:   #7a5313;
    --piece-1:        #7fc8ff;
    --piece-1-edge:   #143d5c;
}

/*
 * THE BOARD'S SIZE IS NOT THIS FILE'S BUSINESS, AND THAT IS DELIBERATE.
 *
 * board.css already gives .board__frame `flex: 1 1 auto; min-height: 0` and the
 * SVG carries `preserveAspectRatio="xMidYMid meet"`, so the browser fits the
 * board into whatever space the column leaves -- at every viewport, for all
 * eight topologies, with no media query and no JavaScript.
 *
 * A per-game override here fights that. The first version of this scaffold
 * capped the frame at `calc(100vh - 16rem)`, which on a 360px-tall phone in
 * landscape is 104px: the board shrank into the top-left corner with two-thirds
 * of the screen empty. NOTHING FAILED. There was no overflow, no scrolling and
 * no console error -- every automated check passed and the game was unplayable.
 * Only the screenshot showed it (2026-09-03).
 *
 * If a board genuinely needs a different shape, change its viewBox in the
 * TOPOLOGY, which is the one place that knows the geometry.
 */

/*
   THE POINTS ALTERNATE, AND THAT IS NOT DECORATION.

   `topo-track`'s geometry shades every other cell, and on this board that is
   how a player counts a six at a glance instead of counting to six. board.css
   already draws `.is-alt`; these two tokens are what it draws it in.

   Six checkers can share one point, so the renderer lays them out in the
   largest SQUARE that fits each slot -- a squashed disc and a squashed ring
   are much harder to tell apart than round ones, which is the whole reason
   shape is the signal that survives (Standards.md §2).
*/

.board__cell {
    stroke-width: 2;
}

/*
   THE TWO ROADS, WALKED IN OPPOSITE DIRECTIONS.

   `geometry().roads()` gives one line per player in WALKING order, so the two
   lines run the same points the opposite way -- which is the whole geometry of
   backgammon, and the one thing about this board a child has to understand
   before the first throw. They interleave by their dashes so both are visible
   where they lie on top of each other.
*/
.board__road { stroke-width: 6; opacity: 0.6; }
.board__road.is-side-0 { stroke: #ffd45c; stroke-dasharray: 16 14; }
.board__road.is-side-1 { stroke: #7fc8ff; stroke-dasharray: 10 20; stroke-dashoffset: -18; }

/* ==========================================================================
   THE DICE
   ==========================================================================
   TWO numbers, not one, because this game plays them separately -- and the
   readout has to say which two or a child cannot tell a three and a four from
   a two and a five. Scripts.js writes both, and the one still to play is the
   one in front.
   ========================================================================== */

.die {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 8px;
    border: 2px solid #b98b1e;
    border-radius: 10px;
    background: linear-gradient(160deg, #fffbe8, #ffe09a);
    color: #2a1c02;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
}

.die:empty { visibility: hidden; }

@media (max-height: 520px) {
    .die { min-width: 34px; min-height: 34px; font-size: 1.2rem; }
}

@media (forced-colors: active) {
    .die {
        forced-color-adjust: none;
        background: Canvas;
        color: CanvasText;
        border-color: CanvasText;
    }
}
