/* Slitherlink board (archetype 06, "mark-the-grid") scoped under .slk-root. A square
   grid of numbered cells; the player draws a single closed loop along the cell edges.
   Rendered as one SVG so the loop lines stay crisp at any size. Uses the shared
   design tokens (gold accent + warm neutrals); light + dark via .mode-dark. */

.slk-root {
  --ink: #2a2620; --paper: #fbf9f3; --grid: #d9d2c2;
  --dot: #b8b0a0; --line: #b68235; --line-soft: #e7d3a3;
  --x: #a89e88; --bad: #c8503b; --done: #5c8a4a; --gold: #b68235;
  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. */
.slk-root.mode-dark {
  --ink: #ece8e2; --paper: #262a21; --grid: #3a4030;
  --dot: #5a5648; --line: #d8b65c; --line-soft: #4a4126;
  --x: #6b6552; --bad: #d9694f; --done: #7dab68; --gold: #d8b65c;
}

.slk-board { width: 100%; display: flex; justify-content: center; }

.slk-svg {
  width: min(100%, 520px); height: auto; display: block;
  background: var(--paper); border-radius: 12px;
  padding: 0; touch-action: manipulation;
}

/* Numbers inside cells */
.slk-clue {
  font-size: 0.44px; font-weight: 700; fill: var(--ink);
  font-variant-numeric: tabular-nums; user-select: none; pointer-events: none;
}
.slk-clue.done { fill: var(--done); }
.slk-clue.bad { fill: var(--bad); }

/* Lattice dots at every vertex */
.slk-vert { fill: var(--dot); pointer-events: none; }
.slk-vert.bad { fill: var(--bad); }

/* Edge groups: the visible drawn line, the "no line" cross, and a wide hit target */
.slk-edge { cursor: pointer; }
.slk-line {
  stroke: var(--line); stroke-width: 0.13; stroke-linecap: round;
  opacity: 0; transition: opacity 0.1s ease;
}
.slk-edge.on .slk-line { opacity: 1; }
.slk-x { stroke: var(--x); stroke-width: 0.05; stroke-linecap: round; opacity: 0; }
.slk-edge.off .slk-x { opacity: 1; }
.slk-hit { stroke: transparent; stroke-width: 0.34; stroke-linecap: round; }
.slk-edge:hover .slk-hit { stroke: var(--line-soft); }
.slk-edge.on:hover .slk-hit { stroke: transparent; }
.slk-edge.sel .slk-line { stroke: var(--gold); }
.slk-edge.sel .slk-hit { stroke: var(--line-soft); }

.slk-root.solved .slk-line { stroke: var(--done); opacity: 1; }
.slk-root.solved .slk-x { opacity: 0; }

@media (prefers-reduced-motion: reduce) { .slk-line { transition: none; } }
.slk-root.no-motion .slk-line { transition: none; }
