/* Ponts / Bridges (Hashiwokakere) board — archetype 06, "mark-the-grid", scoped
   under .brg-root. Numbered islands sit on a landscape grid; the player draws
   single or double bridges between them. Uses the shared design tokens (gold
   accent + warm neutrals); light + dark via .mode-dark. */

.brg-root {
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3;
  --water: #eef1ee; --water-2: #e2e8e6;
  --isle: #fbf3df; --isle-edge: #c9a86a; --isle-ink: #4a3b1e;
  --gold: #b68235; --gold-soft: #e7d3a3;
  --bridge: #6f5a34; --bridge-soft: #b79d6e;
  --bad: #c8503b; --done: #5c8a4a;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(12px, 3vw, 22px);
  padding: clamp(10px, 2.5vw, 22px) 0;
  color: var(--ink);
}
/* Board tonality is fixed by the surface panel (BOARD_SURFACES.md): the board
   follows our .mode-dark class only, never the OS colour-scheme. */
.brg-root.mode-dark {
  --line: #3a4030; --ink: #ece8e2; --paper: #262a21;
  --water: #202a2b; --water-2: #1a2223;
  --isle: #33301f; --isle-edge: #7a6636; --isle-ink: #f1e6c8;
  --gold: #d8b65c; --gold-soft: #4a4126;
  --bridge: #cbb277; --bridge-soft: #7d6a3f;
  --bad: #d9694f; --done: #7dab68;
}

.brg-board { inline-size: 100%; display: flex; justify-content: center; }
.brg-svg {
  inline-size: 100%; height: auto;
  background: linear-gradient(160deg, var(--water), var(--water-2));
  border: 1px solid var(--line); border-radius: 12px;
  touch-action: manipulation;
}

/* Bridges: a centred line for a single, a symmetric pair for a double */
.brg-line {
  stroke: var(--bridge); stroke-width: 5; stroke-linecap: round;
  visibility: hidden;
  transition: stroke 0.12s ease;
}
.brg-edge.b1 .brg-c { visibility: visible; }
.brg-edge.b2 .brg-d { visibility: visible; }
.brg-edge.sel .brg-line { stroke: var(--gold); }
.brg-edge.bad .brg-line { stroke: var(--bad); }

/* Invisible fat hit target along each candidate edge */
.brg-hit {
  stroke: transparent; stroke-width: 30; stroke-linecap: round;
  cursor: pointer;
}
.brg-edge:hover .brg-hit { stroke: color-mix(in srgb, var(--gold) 16%, transparent); }

/* Islands */
.brg-island circle {
  fill: var(--isle); stroke: var(--isle-edge); stroke-width: 3;
  transition: stroke 0.12s ease, fill 0.12s ease;
}
.brg-num {
  fill: var(--isle-ink); font-weight: 800; font-size: 44px;
  font-variant-numeric: tabular-nums;
  pointer-events: none; user-select: none;
}
.brg-island.done circle { stroke: var(--done); fill: color-mix(in srgb, var(--done) 16%, var(--isle)); }
.brg-island.over circle { stroke: var(--bad); fill: color-mix(in srgb, var(--bad) 18%, var(--isle)); }

.brg-root.solved .brg-island circle { stroke: var(--done); }
.brg-root.solved .brg-line { stroke: var(--done); }

@media (prefers-reduced-motion: reduce) { .brg-line, .brg-island circle { transition: none; } }
.brg-root.no-motion .brg-line, .brg-root.no-motion .brg-island circle { transition: none; }
