/* Kakurasu board (archetype 05, grille de chiffres) scoped under .kak-root.
   An n×n grid of shadeable cells wrapped by a weight track (top + left) and a
   clue track (right + bottom). Uses the shared design tokens (gold accent +
   warm neutrals). */

.kak-root {
  --cell: 60px; --edge: 48px;
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3; --paper-2: #f2eee3;
  --gold: #b68235; --gold-soft: #e7d3a3; --peer: #f6f1e2; --bad: #c8503b; --good: #5c8a4a;
  --shade: #3b3a34;
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vw, 24px);
  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. */
.kak-root.mode-dark { --line: #3a4030; --ink: #ece8e2; --paper: #232620; --paper-2: #1c1f19; --gold: #d8b65c; --gold-soft: #4a4126; --peer: #2b2f24; --bad: #d9694f; --good: #86b16f; --shade: #d8b65c; }

.kak-grid { display: grid; justify-content: center; gap: 2px; }

.kak-corner { inline-size: var(--edge); block-size: var(--edge); }

/* positional weights on the top and left edges */
.kak-w {
  display: grid; place-items: center;
  color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: calc(var(--edge) * 0.42);
}
.kak-w-top { inline-size: var(--cell); block-size: var(--edge); align-self: end; }
.kak-w-left { inline-size: var(--edge); block-size: var(--cell); justify-self: end; }

/* target clues on the right and bottom edges */
.kak-clue {
  display: grid; place-items: center;
  background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 6px;
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: calc(var(--edge) * 0.44);
}
.kak-clue-right { inline-size: var(--edge); block-size: var(--cell); }
.kak-clue-bottom { inline-size: var(--cell); block-size: var(--edge); }
.kak-clue.over { color: var(--bad); border-color: var(--bad); }
.kak-clue.done { color: var(--good); border-color: var(--good); }

.kak-cell {
  inline-size: var(--cell); block-size: var(--cell);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 6px;
  cursor: pointer; user-select: none; transition: background 0.12s, box-shadow 0.12s;
}
.kak-cell.peer { background: var(--peer); }
.kak-cell.on { background: var(--shade); border-color: var(--shade); }
.kak-cell.sel { outline: 3px solid var(--gold); outline-offset: -1px; z-index: 2; }

.kak-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kak-key {
  min-inline-size: 52px; block-size: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper);
  color: var(--ink); font-size: 19px; font-weight: 600; cursor: pointer;
}
.kak-key:hover { border-color: var(--gold); }
.kak-key:active { background: var(--gold-soft); }
.kak-key-shade { color: var(--shade); }

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