/* Tenner Grid — "Grille de dix" (archetype 05, grille de chiffres) scoped under
   .ten-root. A 10-column grid of number cells with a clue row of column sums
   beneath it. Uses the shared design tokens (gold accent + warm neutrals);
   given digits in ink, player digits in accent, conflicts flagged. */

.ten-root {
  --cell: 44px;
  padding: clamp(6px, 2.5vw, 16px);
  color: var(--color-text);
  display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vw, 22px);
}

.ten-grid {
  display: grid; justify-content: center; gap: 4px;
  font-variant-numeric: tabular-nums;
}

.ten-cell {
  inline-size: var(--cell); block-size: var(--cell);
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; cursor: pointer; user-select: none;
  font-family: var(--font-body); font-weight: 500;
  font-size: calc(var(--cell) * 0.46); line-height: 1;
  background: var(--color-neutral-100); color: var(--color-accent-700);
  border: 1px solid var(--color-neutral-300); border-radius: var(--radius-sm, 6px);
  transition: background 0.1s;
}
.ten-cell.given { color: var(--color-text); font-weight: 700; background: var(--color-neutral-200); cursor: default; }
.ten-cell.peer { background: var(--color-neutral-200); }
.ten-cell.same { color: var(--color-accent); font-weight: 700; }
.ten-cell.sel { background: var(--color-accent-200); box-shadow: inset 0 0 0 2px var(--color-accent); }
.ten-cell.conflict { color: var(--madder, #c0182b); border-color: var(--madder, #c0182b); background: color-mix(in srgb, var(--madder, #c0182b) 12%, transparent); }

/* the clue row: each column's target sum, set apart from the play grid */
.ten-clue {
  inline-size: var(--cell); block-size: calc(var(--cell) * 0.82);
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; user-select: none;
  font-family: var(--font-body); font-weight: 700;
  font-size: calc(var(--cell) * 0.38); line-height: 1;
  color: var(--color-neutral-700); background: transparent;
  border-block-start: 2px solid var(--color-text); margin-block-start: 2px;
}
.ten-clue.bad { color: var(--madder, #c0182b); }

.ten-pad {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-inline-size: min(96vw, 380px); inline-size: 100%;
}
.ten-key {
  min-block-size: 44px; padding: 0;
  font-family: var(--font-body); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer;
  border: 1px solid var(--color-neutral-300); border-radius: var(--radius-sm, 6px);
  background: var(--color-neutral-100); color: var(--color-text);
}
.ten-key:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.ten-key:active { background: var(--color-accent-100); }

/* Dark page — legible cells and dark highlights (the light neutral ramp would
   otherwise read as bright patches). */
.ten-root.mode-dark .ten-cell { background: #26241f; color: var(--color-accent-400); border-color: #4a463f; }
.ten-root.mode-dark .ten-cell.given { color: #f2eee8; background: #322f28; }
.ten-root.mode-dark .ten-cell.peer { background: #322f28; }
.ten-root.mode-dark .ten-cell.same { color: var(--color-accent-400); }
.ten-root.mode-dark .ten-cell.sel { background: #4d3f18; box-shadow: inset 0 0 0 2px var(--color-accent-400); }
.ten-root.mode-dark .ten-cell.conflict { color: #ff9384; border-color: #ff9384; background: rgba(192, 24, 43, 0.3); }
.ten-root.mode-dark .ten-clue { color: #cbc4b8; border-block-start-color: #9c948a; }
.ten-root.mode-dark .ten-clue.bad { color: #ff9384; }
.ten-root.mode-dark .ten-key { background: #2d2b26; border-color: #4a463f; color: #ece8e2; }

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