/* Hitori board (archetype 06, mark-the-grid) scoped under .hit-root. A square
   grid of numbers; tap a cell to cycle unknown → shaded → circled. Uses the
   shared design tokens (gold accent + warm neutrals); light + dark via
   .mode-dark. Unique prefix: .hit- */

.hit-root {
  --cell: 52px;
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3; --paper-2: #f2eee3;
  --gold: #b68235; --gold-soft: #e7d3a3; --bad: #c8503b;
  --shade: #2b2924; --shade-ink: #6d6a63; --keep-ring: #b68235; --keep-bg: #f7efdb;
  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. */
.hit-root.mode-dark {
  --line: #3a4030; --ink: #ece8e2; --paper: #232620; --paper-2: #1c1f19;
  --gold: #d8b65c; --gold-soft: #4a4126; --bad: #d9694f;
  --shade: #0d0f0b; --shade-ink: #4a4d44; --keep-ring: #d8b65c; --keep-bg: #33301f;
}

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

.hit-cell {
  inline-size: var(--cell); block-size: var(--cell);
  display: grid; place-items: center;
  background: var(--paper); border: none; border-radius: 4px;
  color: var(--ink); font-size: calc(var(--cell) * 0.46); font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
  position: relative; transition: background 0.12s, color 0.12s;
}
.hit-cell:hover:not(:disabled) { background: var(--paper-2); }
.hit-cell:disabled { cursor: default; }

.hit-cell.shade { background: var(--shade); color: var(--shade-ink); }
.hit-cell.keep { background: var(--keep-bg); }
.hit-cell.keep::after {
  content: ""; position: absolute; inset: calc(var(--cell) * 0.12);
  border: 2.5px solid var(--keep-ring); border-radius: 50%; pointer-events: none;
}
.hit-cell.sel { outline: 3px solid var(--gold); outline-offset: -2px; z-index: 2; }
.hit-cell.conflict { color: var(--bad); box-shadow: inset 0 0 0 2.5px var(--bad); }
.hit-cell.shade.conflict { color: var(--bad); }

.hit-root.solved .hit-cell.shade { background: var(--gold); color: var(--gold-soft); }

.hit-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; font-size: 14px; color: var(--ink); }
.hit-leg { display: inline-flex; align-items: center; gap: 7px; }
.hit-swatch { inline-size: 18px; block-size: 18px; border-radius: 4px; position: relative; flex: none; }
.hit-swatch.sw-shade { background: var(--shade); }
.hit-swatch.sw-keep { background: var(--keep-bg); box-shadow: inset 0 0 0 1px var(--line); }
.hit-swatch.sw-keep::after { content: ""; position: absolute; inset: 2px; border: 2px solid var(--keep-ring); border-radius: 50%; }

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