/* Binairo / Takuzu board (archetype 05, grille de chiffres) scoped under
   .bin-root. A square grid of cells holding the symbols 0 and 1. Uses the shared
   design tokens (gold accent + warm neutrals); light + dark via .mode-dark. */

.bin-root {
  --cell: 48px; --gap: 4px;
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3; --paper-2: #f2eee3;
  --gold: #b68235; --gold-soft: #e7d3a3; --peer: #f6f1e2; --bad: #c8503b;
  --sym0: #7a5a2a; --sym1: #2f4a6a; --sym0-bg: #f3ead6; --sym1-bg: #e4ecf4;
  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. */
.bin-root.mode-dark {
  --line: #3a4030; --ink: #ece8e2; --paper: #232620; --paper-2: #1c1f19;
  --gold: #d8b65c; --gold-soft: #4a4126; --peer: #2b2f24; --bad: #d9694f;
  --sym0: #e6c98f; --sym1: #9cc0e6; --sym0-bg: #33301f; --sym1-bg: #1f2a36;
}

.bin-grid {
  display: grid; justify-content: center;
  padding: var(--gap); background: var(--line); border-radius: 10px;
}

.bin-cell {
  inline-size: var(--cell); block-size: var(--cell);
  display: grid; place-items: center;
  background: var(--paper); border-radius: 6px;
  font-size: calc(var(--cell) * 0.5); font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none; transition: background 0.1s, color 0.1s;
}
.bin-cell.editable { cursor: pointer; }
.bin-cell.given { background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.bin-cell.v0 { color: var(--sym0); background: var(--sym0-bg); }
.bin-cell.v1 { color: var(--sym1); background: var(--sym1-bg); }
.bin-cell.given.v0 { box-shadow: inset 0 0 0 2px var(--sym0); }
.bin-cell.given.v1 { box-shadow: inset 0 0 0 2px var(--sym1); }
.bin-cell.peer { filter: brightness(0.97); }
.bin-cell.sel { outline: 3px solid var(--gold); outline-offset: -1px; z-index: 2; }
.bin-cell.conflict { color: var(--bad) !important; box-shadow: inset 0 0 0 2px var(--bad); }

.bin-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bin-key {
  min-inline-size: 56px; block-size: 52px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
  color: var(--ink); font-size: 22px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.bin-key:hover { border-color: var(--gold); }
.bin-key:active { background: var(--gold-soft); }
.bin-erase { font-weight: 500; }

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