/* ── Suguru (Tectonic) ───────────────────────────────────────────────────────
   The play chrome (.q-chrome / .q-stage / .q-foot) is the shared shell from
   queens.css; the board borrows Queens' riso region palette (--q-r0…--q-r8) and
   its edge tokens (--q-edge / --q-grid) so a region reads as a block of ink with
   a thick rule between neighbours. Below is Suguru's own: the coloured grid, the
   digits (bold ink for givens, accent for what you write), and the number dock
   layout in the foot. */

.sg-play { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sg-hold { display: grid; place-items: center; }

/* ── the coloured board ─────────────────────────────────────────────────── */
.sg-board {
  --n: 5;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  width: min(92vw, 62vh, 480px);
  aspect-ratio: 1;
  outline: 2px solid var(--q-edge);
  border-radius: 2px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sg-cell {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: clamp(15px, 6.2vw, 30px);
  font-weight: 600;
  color: var(--accent);                 /* what the player writes reads as accent ink */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--duration-1, .12s) var(--ease, ease), color .12s ease;
}
.sg-cell:hover { filter: brightness(1.04); }

/* a given: darker ink, heavier, and never editable */
.sg-cell.given {
  color: var(--q-edge);
  font-weight: 800;
  cursor: default;
}
@media (prefers-color-scheme: dark) {
  .sg-cell.given { color: var(--q-ink); }
}

/* a rule break flagged by Check (or a live clash) — red digit + red inset ring */
.sg-cell.bad {
  color: var(--danger-text) !important;
  box-shadow: inset 0 0 0 2px var(--danger-text);
}

/* the drag-target highlight the number dock adds while a chip is over a cell */
.sg-cell.ng-tgt {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 2;
}

.sg-board.sg-solved .sg-cell { animation: sg-pop var(--duration-2, .24s) var(--ease, ease) both; }
@keyframes sg-pop { from { transform: scale(.88); } to { transform: scale(1); } }

/* ── the foot: number dock on top, Check / Solve beneath ────────────────── */
.sg-foot {
  flex-direction: column;
  gap: var(--space-4, 14px);
  align-items: stretch;
}
.sg-pal { width: 100%; }
.sg-tools {
  display: flex;
  justify-content: center;
  gap: var(--space-4, 14px);
}
.sg-tools .pill { display: inline-flex; align-items: center; gap: var(--space-2, 8px); }
.sg-tools .pill svg { width: var(--icon-sm, 18px); height: var(--icon-sm, 18px); flex: none; }
.sg-solve { color: var(--dim); }
.sg-solve:hover { color: var(--text); }

.pz-review {
  margin-top: var(--space-4, 14px);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: var(--text-xs, 12px);
  letter-spacing: var(--tracking-label, .12em);
  text-transform: uppercase;
  color: var(--mute);
  text-align: center;
}

/* ── landscape phone: board left, dock stacked right (mirrors Queens) ────── */
@media (orientation: landscape) and (max-height: 700px) {
  .sg-play { flex-direction: row; }
  .sg-foot {
    border-top: none;
    border-left: var(--hairline) solid var(--line);
    justify-content: center;
  }
  .sg-board { width: min(88vh, 60vw); }
}

/* ── the level-card thumbnail ───────────────────────────────────────────── */
.sg-mini {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  aspect-ratio: 1;
  width: 100%;
  outline: 1.5px solid var(--q-edge);
}
.sg-mini i {
  display: grid;
  place-items: center;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: clamp(7px, 2.4vw, 13px);
  font-weight: 700;
}
.sg-mini-v { color: var(--accent); }
.sg-mini-v.given { color: var(--q-edge); }
@media (prefers-color-scheme: dark) {
  .sg-mini-v.given { color: var(--q-ink); }
}
