/* Hidato board (archetype 05, grille de chiffres) scoped under .hid-root. A full
   rectangular grid of number cells; given anchors in ink, player numbers in the
   gold accent, broken chain links and duplicates flagged. Uses the shared design
   tokens (gold accent + warm neutrals) with a fixed board tonality driven by the
   .mode-dark class only, never the OS colour-scheme. */

.hid-root {
  --cell: 52px;
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3; --paper-2: #f2eee3;
  --gold: #b68235; --gold-soft: #e7d3a3; --peer: #f6f1e2; --bad: #c8503b;
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vw, 24px);
  padding: clamp(10px, 2.5vw, 22px) 0;
  max-inline-size: 100%;
  color: var(--ink);
}
.hid-root.mode-dark { --line: #3a4030; --ink: #ece8e2; --paper: #232620; --paper-2: #1c1f19; --gold: #d8b65c; --gold-soft: #4a4126; --peer: #2b2f24; --bad: #d9694f; }

/* One grid so every column and row is sized together and the rules line up.
   Cells carry a thin border on the right and bottom; the grid frames the top and
   left, so no line is doubled. */
.hid-grid {
  display: grid; justify-content: center;
  border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line);
  background: var(--paper);
}
.hid-cell {
  box-sizing: border-box;
  inline-size: var(--cell); block-size: var(--cell);
  display: grid; place-items: center;
  background: var(--paper); color: var(--gold);
  border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line);
  font-size: calc(var(--cell) * 0.42); font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none; transition: background 0.1s;
}
.hid-cell.given { color: var(--ink); font-weight: 800; background: var(--paper-2); cursor: default; }
.hid-cell.peer { background: var(--peer); }
.hid-cell.same { outline: 2px solid var(--gold-soft); outline-offset: -2px; }
.hid-cell.sel { outline: 3px solid var(--gold); outline-offset: -2px; background: var(--gold-soft); z-index: 2; }
.hid-cell.editing { color: var(--gold); font-weight: 700; }
.hid-cell.conflict { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--paper)); }
.hid-cell.given.conflict { color: var(--bad); }

.hid-pad {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  inline-size: 100%; max-inline-size: calc(var(--cell) * 6.4);
}
.hid-key {
  min-inline-size: 42px; block-size: 46px; padding: 0;
  border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper);
  color: var(--ink); font-size: 19px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background 0.1s, border-color 0.1s;
}
.hid-key:hover { border-color: var(--gold); }
.hid-key:active { background: var(--gold-soft); }
.hid-erase { color: var(--gold); }

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