/* Fillomino board (archetype 06, "mark-the-grid") scoped under .flmo-root.
   A square grid whose cells carry region sizes; a number pad sets the selected
   cell. Uses the shared design tokens (gold accent + warm neutrals); light + dark
   via .mode-dark. */

.flmo-root {
  --cell: 50px;
  --line: #cfc8b8; --ink: #2a2620; --paper: #fbf9f3;
  --given-bg: #efe8d6; --given-ink: #4a4230;
  --fill-ink: #7a5a1e; --sel: #b68235; --sel-soft: #e7d3a3;
  --gold: #b68235; --bad: #c8503b; --bad-bg: #f4d8d1; --done: #5c8a4a;
  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. */
.flmo-root.mode-dark {
  --line: #3a4030; --ink: #ece8e2; --paper: #262a21;
  --given-bg: #333a2b; --given-ink: #d8d2c2;
  --fill-ink: #e6c877; --sel: #d8b65c; --sel-soft: #4a4126;
  --gold: #d8b65c; --bad: #d9694f; --bad-bg: #4a2a24; --done: #7dab68;
}

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

.flmo-cell {
  inline-size: var(--cell); block-size: var(--cell);
  display: grid; place-items: center;
  padding: 0; margin: 0; border: 0;
  background: var(--paper); color: var(--fill-ink);
  font-size: calc(var(--cell) * 0.46); font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.flmo-cell:not(.given):hover { box-shadow: inset 0 0 0 2px var(--sel-soft); }

.flmo-cell.given { background: var(--given-bg); color: var(--given-ink); cursor: default; }
.flmo-cell.filled { color: var(--fill-ink); }

.flmo-cell.sel { box-shadow: inset 0 0 0 3px var(--sel); }
.flmo-cell.bad { background: var(--bad-bg); color: var(--bad); }
.flmo-cell.given.bad { background: var(--bad-bg); }

.flmo-root.solved .flmo-cell { color: var(--done); }
.flmo-root.solved .flmo-cell.given { color: var(--done); }

/* Number pad */
.flmo-pad {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(6px, 1.6vw, 10px);
}
.flmo-key {
  min-inline-size: clamp(40px, 11vw, 52px); block-size: clamp(40px, 11vw, 52px);
  display: grid; place-items: center;
  padding: 0 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font-size: clamp(16px, 4.4vw, 20px); font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.flmo-key:hover { box-shadow: inset 0 0 0 2px var(--sel-soft); }
.flmo-key:active { transform: translateY(1px); }
.flmo-key.flmo-erase { color: var(--bad); font-size: clamp(15px, 4vw, 18px); }

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