/* ===============================
   Grid Primitives (puzzle boards)
   =============================== */

.grid {
  --cell: 44px;               /* base cell size (mobile) */
  --gap: 2px;                 /* gap between cells */
  display: grid;
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  background: color-mix(in oklch, var(--accent-100), white 10%);
  padding: calc(var(--gap) + 2px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

/* Example 5x5 grid; override per puzzle size */
.grid--5x5 { grid-template-columns: repeat(5, var(--cell)); }
.grid--10x10 { grid-template-columns: repeat(10, var(--cell)); }

/* Cells */
.cell {
  position: relative;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-weight: 600;
  user-select: none;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--accent-300), white 50%);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* States */
.cell.is-selected { 
  outline: 2px solid var(--accent-500);
  outline-offset: 0;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent-100), white 30%) inset;
}
.cell.is-filled {
  background: color-mix(in oklch, var(--accent-100), white 40%);
  border-color: color-mix(in oklch, var(--accent-300), white 20%);
}
.cell.is-error {
  background: oklch(0.92 0.05 20);
  border-color: oklch(0.70 0.20 20);
}
.cell.is-note {
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent-100), white 60%), var(--surface));
}

/* Optional content helpers (e.g., tree ⭑, tent ⛺, number) */
.cell .mark {
  font-size: 18px;
}
.cell .sub {
  position: absolute;
  bottom: 4px; right: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Hover (pointer devices) */
@media (hover: hover) {
  .cell:hover {
    border-color: var(--accent-300);
    background: color-mix(in oklch, var(--accent-100), white 70%);
  }
}

/* Larger grids on wider screens (optional) */
@media (min-width: 480px) {
  .grid { --cell: 50px; }
}
