/* The shared Cobalt board (landing-v2 handoff, "The board"; pages/board2.ts). Ported from the
   handoff's board2.css, Cobalt only. Root: <figure class="b2 sk-cobalt">; "b2-mini" drops the labels.
   Served in the summary state: every mark shows. The motion layer (board-motion.css/.js) hides
   them while a board plays, keyed on data attributes; nothing here hides a mark.
   Layers inside .b2-board: the squares and marks (svg), the 64 cells with the pieces, the arrows. */

/* ---------- tokens: the board is a light board on either page, so its colours are fixed ---------- */
.b2,.b2-key{
/* marks: red = the move you played, ring = the piece it cost, green = the better move, ink = what it allowed */
--b2-red:#C8283C;--b2-ring:#C8283C;--b2-green:#0E6B4A;--b2-safe-ring:#0E6B4A;--b2-ink:#10141C;
--b2-halo:#FFFFFF;--b2-case:transparent;--b2-yellow:#F0DC82;--b2-safe:#BFE3CF;
/* pieces: white fill / outline / detail, then black */
--b2-wf:#FFFFFF;--b2-ws:#10141C;--b2-wd:#10141C;--b2-bf:#10141C;--b2-bs:#10141C;--b2-bd:#F5F6F5;
--b2-l:#E7EBF7;--b2-d:#93A6EA;--b2-edge:#7389D8;
/* the legend's swatch ground: always the light theme's light square */
--b2-key-l:#E7EBF7}
.b2{margin:0;display:block}
.bs.dark .b2,:root[data-theme=dark] .b2{--b2-l:#DCE2F4;--b2-d:#8799E3;--b2-edge:#8799E3}

/* ---------- board ---------- */
.b2-board{position:relative;aspect-ratio:1;background:var(--b2-l);box-shadow:0 0 0 1px var(--b2-edge)}
.b2-svg{display:block;width:100%;height:100%;overflow:hidden}
.b2-l{fill:var(--b2-l)}
.b2-d{fill:none;stroke:var(--b2-d);stroke-width:10;stroke-dasharray:10;shape-rendering:crispEdges}
.b2-sqs{position:absolute;inset:0;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr))}
.b2-sq{min-width:0;min-height:0}
.b2-ars{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:hidden;pointer-events:none}

/* rank and file labels: fixed 12px, outside the squares. Ranks hang 16px to the left of the board (it needs
   that much room: the page gutter or a column gap); files sit in a strip under it. b2-mini hides both. */
.b2-rk,.b2-fl{display:flex;pointer-events:none;font:700 12px/1 var(--sans);color:var(--mute)}
.b2-rk{position:absolute;right:100%;top:0;bottom:0;width:16px;flex-direction:column}
.b2-rk span{flex:1 1 0;display:flex;align-items:center;justify-content:center}
.b2-fl{padding-top:6px}
.b2-fl span{flex:1 1 0;text-align:center}
.b2.b2-mini .b2-rk,.b2.b2-mini .b2-fl{display:none}

/* ---------- pieces: the project's own drawings, one 40-unit box each, filling a cell ---------- */
.b2-pc{display:block;width:100%;height:100%;overflow:visible}
.b2-pf{stroke-width:1.5;stroke-linejoin:round}
.b2-pl{fill:none;stroke-width:1.1;stroke-linecap:round}
.b2-pc.w .b2-pf{fill:var(--b2-wf);stroke:var(--b2-ws)}
.b2-pc.w .b2-pl{stroke:var(--b2-wd)}
.b2-pc.b .b2-pf{fill:var(--b2-bf);stroke:var(--b2-bs)}
.b2-pc.b .b2-pl{stroke:var(--b2-bd)}

/* ---------- the marks (shown as served; they differ by shape as well as colour) ---------- */
.b2-hl{stroke-width:.8}
.b2-hl.from{fill:color-mix(in srgb,var(--b2-red) 24%,var(--b2-l));stroke:var(--b2-red)}
.b2-hl.lost{fill:var(--b2-yellow);stroke:var(--b2-ring)}
.b2-hl.safe{fill:var(--b2-safe);stroke:var(--b2-safe-ring)}
.b2-ar{stroke:var(--b2-halo);stroke-width:.9;stroke-linejoin:round;paint-order:stroke}
.b2-ar.played{fill:var(--b2-red)}
.b2-ar.good{fill:var(--b2-green)}
.b2-ar.them{fill:var(--b2-ink);stroke:var(--b2-case);stroke-width:.6}

/* ---------- under the board: caption, Replay, legend (on the page, so page tokens) ---------- */
/* The caption is the motion layer's ([data-mo-caption] in the reserved [data-mo-row]): one span per
   phase, only one shown. The row reserves its lines; this sets them to the mock's .b2-cap type. */
.b2 [data-mo-row]{--mo-caption-lines:3;--mo-caption-lh:23px;--mo-caption-size:16px;row-gap:12px;padding-top:14px}
.b2 [data-mo-row] [data-mo-caption]{color:var(--ink);align-self:start}
.b2 [data-mo-cap]{display:block;padding-left:12px;border-left:3px solid var(--mute)}
.b2 [data-mo-cap][hidden]{display:none}
.b2 [data-mo-cap=played]{border-left-color:var(--red)}
.b2 [data-mo-cap=threat]{border-left-color:var(--ink);border-left-style:dashed}
.b2 [data-mo-cap=best]{border-left-color:var(--green)}
.b2 [data-mo-cap=summary]{border-left-color:var(--ink)}
/* Replay: the script adds a plain-text button to the row; this is the mock's .b2-btn without its icon. */
.b2 [data-mo-row] [data-mo-replay]{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1.5px solid var(--ink);border-radius:0;background:transparent;color:var(--ink);font:800 15px var(--sans);cursor:pointer}
.b2 [data-mo-row] [data-mo-replay]:hover{background:var(--ink);color:var(--paper)}
.b2-key{display:flex;flex-wrap:wrap;gap:10px 28px;margin:0;padding:0;list-style:none;font-size:14.5px;line-height:1.3;font-weight:600;color:var(--mute)}
.b2-key li{display:inline-flex;align-items:center;gap:12px}
/* The swatches are a scrap of the board, with its own mark colours, so they match it in both themes. */
.b2-key svg{display:block;height:18px;width:auto;flex:none;overflow:visible;background:var(--b2-key-l);box-shadow:0 0 0 3px var(--b2-key-l)}
.b2-key .k-played{fill:var(--b2-red)}
.b2-key .k-them{fill:var(--b2-ink)}
.b2-key .k-good{fill:var(--b2-green)}
.b2-key .k-from{fill:color-mix(in srgb,var(--b2-red) 24%,var(--b2-key-l));stroke:var(--b2-red);stroke-width:1.2}
.b2-key .k-lost{fill:var(--b2-yellow);stroke:var(--b2-ring);stroke-width:1.2}
.b2-key .k-safe{fill:var(--b2-safe);stroke:var(--b2-safe-ring);stroke-width:1.2}
