@import url('../global.css');

:root {
  --title-color: var(--color-shikaku);
  --shikaku-rect: color-mix(in srgb, var(--color-shikaku) 30%, var(--white-color));
  --shikaku-rect-2: color-mix(in srgb, var(--color-shikaku) 16%, var(--white-color));
  --shikaku-good: color-mix(in srgb, var(--success) 32%, var(--white-color));
}

.shikaku-board {
  display: grid;
  grid-template-columns: repeat(var(--shikaku-size, 6), 1fr);
  grid-template-rows: repeat(var(--shikaku-size, 6), 1fr);
  gap: 0;
  aspect-ratio: 1;
  place-content: center;
  padding: 2px;
  background: var(--logic-grid-frame-border);
  border: 2px solid var(--logic-grid-frame-border);
  border-radius: var(--border-radius-md);
  touch-action: none; /* let the pointer drag draw rectangles without scrolling */
  transition:
    background 0.2s,
    border-color 0.2s;
}

.shikaku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  margin: 0;
  border: 1px solid var(--logic-grid-cell-border);
  background: var(--logic-grid-cell-bg);
  color: var(--logic-grid-ink);
  font-size: clamp(0.9rem, 4.5vmin, 1.6rem);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  user-select: none;
}

.shikaku-cell.is-clue {
  color: var(--color-shikaku);
}

/* Committed rectangles: alternating tint + green when correctly sized. */
.shikaku-cell.in-rect {
  background: var(--shikaku-rect-2);
}
.shikaku-cell.in-rect.is-even {
  background: var(--shikaku-rect);
}
.shikaku-cell.in-rect.is-good {
  background: var(--shikaku-good);
}

/* Thick outline on rectangle edges (each side toggled by the renderer). */
.shikaku-cell.edge-t {
  border-top: 3px solid var(--color-shikaku);
}
.shikaku-cell.edge-b {
  border-bottom: 3px solid var(--color-shikaku);
}
.shikaku-cell.edge-l {
  border-left: 3px solid var(--color-shikaku);
}
.shikaku-cell.edge-r {
  border-right: 3px solid var(--color-shikaku);
}

/* Live drag preview. */
.shikaku-cell.is-preview {
  background: color-mix(in srgb, var(--color-shikaku) 22%, var(--white-color));
  outline: 2px dashed var(--color-shikaku);
  outline-offset: -2px;
}
