/* Mots croisés — a crossword grid on the design-system paper. Grid lines come
   from the grid's background showing through 1px gaps (uniform, unlike per-cell
   borders). The active entry is tinted; the active cell is stronger. */

.cw-root { padding: clamp(8px, 3vw, 20px); max-inline-size: 520px; margin: 0 auto; color: var(--color-text); }

.cw-top { display: flex; justify-content: center; }
.cw-grid {
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr);
  inline-size: min(100%, 360px); aspect-ratio: 1; gap: 1px; background: var(--color-text);
  outline: 2px solid var(--color-text);
}
.cw-cell {
  position: relative; background: var(--color-neutral-100); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cw-cell.black { background: var(--color-text); cursor: default; }
.cw-num { position: absolute; inset-block-start: 1px; inset-inline-start: 2px; font-size: clamp(7px, 1.6vw, 10px); font-family: var(--font-body); color: var(--color-neutral-600); line-height: 1; }
.cw-let { font-family: var(--font-heading); font-weight: 600; font-size: clamp(16px, 5vw, 26px); text-transform: uppercase; }
.cw-cell.inentry { background: var(--color-accent-200); }
.cw-cell.active { background: var(--color-accent); color: var(--color-accent-900); }

.cw-clue { text-align: center; margin-block: var(--space-4) var(--space-3); font-family: var(--font-body); font-size: clamp(14px, 3.4vw, 17px); min-block-size: 2.6em; line-height: 1.3; }

.cw-lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.cw-col h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-neutral-600); }
.cw-col ul { list-style: none; margin: 0; padding: 0; }
.cw-col li { padding: 4px 6px; border-radius: var(--radius-sm, 4px); cursor: pointer; font-family: var(--font-body); font-size: 13px; line-height: 1.3; }
.cw-col li b { font-variant-numeric: tabular-nums; margin-inline-end: 3px; }
.cw-col li:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.cw-col li.on { background: var(--color-accent-200); }

/* Dark page */
.cw-root.mode-dark .cw-grid { background: #ece8e2; outline-color: #ece8e2; }
.cw-root.mode-dark .cw-cell { background: #262421; }
.cw-root.mode-dark .cw-cell.black { background: #0d0c0b; }
.cw-root.mode-dark .cw-num { color: #98938c; }
.cw-root.mode-dark .cw-cell.inentry { background: var(--color-accent-800, #3a4a2a); }
.cw-root.mode-dark .cw-cell.active { background: var(--color-accent-500); color: #1a1a17; }
.cw-root.mode-dark .cw-col h4, .cw-root.mode-dark .cw-col li { color: #ece8e2; }
.cw-root.mode-dark .cw-col li.on { background: var(--color-accent-800, #3a4a2a); }
