/* Inondation (Flood It) board — archetype type-05-chiffres, scoped under .fi-root.
   A grid of coloured tiles you flood from the top-left corner. Warm-neutral ground,
   six distinct, colour-blind-friendly tile colours. */

.fi-root {
  --cell: 40px; --figap: 3px;
  --board: #e6dfcd; --ink: #2a2620; --panel: #d9d1bd;
  --c0: #d94f4f; --c1: #e7b53f; --c2: #3fae6a; --c3: #3f7fd9; --c4: #8a5fd0; --c5: #26bccf;
  display: flex; justify-content: center; padding: clamp(12px, 3vw, 26px) 0; color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .fi-root { --board: #1b1e16; --ink: #e8e2d3; --panel: #23271e;
    --c0: #e05a5a; --c1: #e7b53f; --c2: #46b972; --c3: #4d88df; --c4: #9a6fdd; --c5: #33c6d8; }
}
.fi-root.mode-dark { --board: #1b1e16; --ink: #e8e2d3; --panel: #23271e;
  --c0: #e05a5a; --c1: #e7b53f; --c2: #46b972; --c3: #4d88df; --c4: #9a6fdd; --c5: #33c6d8; }

.fi-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.fi-grid {
  display: grid; gap: var(--figap); padding: calc(var(--figap) + 4px);
  background: var(--board); border-radius: 12px; box-shadow: var(--shadow-sm, 0 3px 12px rgba(0,0,0,.18));
}
.fi-cell { inline-size: var(--cell); block-size: var(--cell); border-radius: 4px; }
.fi-cell.in-region { box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), inset 0 0 0 3px rgba(0,0,0,.28); }

.fc-c0 { background: var(--c0); }
.fc-c1 { background: var(--c1); }
.fc-c2 { background: var(--c2); }
.fc-c3 { background: var(--c3); }
.fc-c4 { background: var(--c4); }
.fc-c5 { background: var(--c5); }

.fi-grid.solved { outline: 3px solid var(--color-accent-700, #b8892b); outline-offset: 3px; }
.fi-grid.lost { opacity: .82; }

.fi-status {
  font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  color: var(--ink); opacity: .9; text-align: center;
}

.fi-palette {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  padding: 8px 12px; background: var(--panel); border-radius: 12px;
}
.fi-swatch {
  inline-size: 44px; block-size: 44px; border-radius: 10px; border: 0; cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(255,255,255,.3), 0 2px 5px rgba(0,0,0,.22);
}
.fi-swatch.current { outline: 3px solid var(--color-accent-700, #b8892b); outline-offset: 2px; }
.fi-swatch:disabled { cursor: default; }
.fi-swatch:not(:disabled):active { transform: scale(0.94); }

@media (prefers-reduced-motion: no-preference) {
  .fi-cell { transition: background 0.18s ease, box-shadow 0.14s; }
  .fi-swatch { transition: transform 0.08s, outline-color 0.14s; }
}
.no-motion .fi-cell, .no-motion .fi-swatch { transition: none; }
