/* ==========================================================================
   The Wilderness Wanderings -- 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 --------------------------------------------- */
    --board-bg:       #1a1440;
    --board-line:     #4b3f8f;
    --board-cell:     #221a52;
    --board-cell-alt: #1d1748;

    /*
       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
 * seven 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 WILDERNESS (decision IIIII). A 9x9 grid: the inner seven by seven is
   sand, the fixed tiles a darker rock, and the paths across every tile are
   drawn by the overlay (rules.overlay) as pale roads. The rim is the ground
   round the wilderness, dark and never played, except for twelve ARROW
   cells -- where the spare tile may go in -- and the one cell the spare
   lies in. The two camps are the only pieces: Gold's disc and Blue's ring.
   The stations are diamonds on the rock; the one the cloud rests over is
   lit; a passed one is dim.
   -------------------------------------------------------------------------- */
.app {
    --ground:         #12102a;
    --sand:           #6b5a3a;
    --sand-edge:      #4a3d25;
    --rock:           #4f4636;
    --road:           #e9dcb8;
    --road-edge:      #8b7a55;
    --arrow:          #c9b98f;
    --arrow-edge:     #2a2314;
    --station:        #b39ddb;
    --station-edge:   #3b2a6b;
    --cloud:          #fff3c4;
    --cloud-edge:     #b08a1a;
    --passed:         #5b5178;

    --board-bg:       var(--ground);
    --board-cell:     var(--sand);
    --board-cell-alt: var(--sand);
    --board-line:     var(--sand-edge);
}

/* The rim is the ground: dark, and drawn so it stays tappable where it is an arrow. */
.board__cell.is-rim {
    fill: var(--ground);
    stroke: var(--ground);
    stroke-width: 1;
}

/* A fixed tile is rock; a loose one is sand. */
.board__cell.is-fixed {
    fill: var(--rock);
}

/* The roads: pale, edged, and one shape per bar (the overlay draws them). */
.board__shape.is-road {
    fill: var(--road);
    stroke: none;
}
.board__shape.is-road.is-on-spare {
    fill: var(--road);
    opacity: 0.85;
}
.board__shape.is-spare-ground {
    fill: var(--sand);
    stroke: var(--arrow);
    stroke-width: 1.5;
}

/* The arrows: a filled point into the wilderness. */
.board__shape.is-arrow-mark {
    fill: var(--arrow);
    stroke: var(--arrow-edge);
    stroke-width: 1.5;
    stroke-linejoin: round;
    paint-order: stroke;
}

/* The stations: a diamond; the cloud's is lit and larger by its stroke. */
.board__shape.is-station {
    fill: var(--station);
    stroke: var(--station-edge);
    stroke-width: 1.5;
    stroke-linejoin: round;
    paint-order: stroke;
}
.board__shape.is-station.is-cloud {
    fill: var(--cloud);
    stroke: var(--cloud-edge);
    stroke-width: 3;
}
.board__shape.is-station.is-passed {
    fill: var(--passed);
    opacity: 0.7;
}

/* A push a child may make is marked the renderer's own way -- the legal-move
   DOT in the middle of the arrow cell -- and on this board the dot is drawn
   at full strength: at 39 px on the dark rim, and on the sand between roads,
   the shared half-opacity dot was not seen in the first picture. */
.board--square .board__hint {
    opacity: 1;
}

@media (forced-colors: active) {
    .board__cell.is-rim { fill: Canvas; stroke: Canvas; }
    .board__cell { fill: Canvas; stroke: CanvasText; }
    .board__cell.is-fixed { fill: Canvas; }
    .board__shape.is-road { fill: CanvasText; stroke: Canvas; }
    .board__shape.is-arrow-mark { fill: CanvasText; stroke: Canvas; }
    .board__shape.is-station { fill: Highlight; stroke: CanvasText; }
    .board__shape.is-station.is-cloud { fill: Highlight; stroke: CanvasText; }
}

/*
   LANDSCAPE: the score chips drop out, as on the Narrow Way and the Living
   Stones. The turn line says the cloud's station and both counts, so the
   chips are the thing to give up.
*/
@media (min-height: 300px) and (max-height: 520px) and (min-width: 520px) {
    .tray {
        display: none;
    }
    .boardbar {
        min-height: 52px;
    }
}
