.t-frame { container-type: inline-size; }
.t-board {
  --n: 6;
  --gap: clamp(3px, 1.1cqw, 6px);
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  gap: var(--gap);
  padding: var(--gap);
  border-radius: 14px;
  background: var(--line);
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--text));
  outline: none;
}
.t-cell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  border-radius: clamp(5px, 1.8cqw, 10px);
  background: var(--surface);
  cursor: pointer;
  transition: background-color .12s;
}
@media (hover: hover) {
  .t-board:not(.locked) .t-cell:not(.given):hover { background: color-mix(in srgb, var(--surface) 92%, var(--game)); }
}
.t-cell.given { background: color-mix(in srgb, var(--surface-2), var(--text) 9%); cursor: default; }
.t-board.locked .t-cell { cursor: default; }
.t-cell svg { width: 64%; height: 64%; pointer-events: none; }
.t-cell svg.t-sun { animation: t-pop .14s ease-out; }
.t-cell svg.t-moon { width: 58%; height: 58%; animation: t-pop .14s ease-out; }
@keyframes t-pop { from { transform: scale(.6); opacity: .4; } }

/* Keyboard focus ring (shown only after keyboard use). */
.t-board.kb:focus-visible .t-cell.focus,
.t-board.kb:focus .t-cell.focus { box-shadow: 0 0 0 3px var(--accent); z-index: 1; }

/* Constraint badges sit on the shared edge of two cells. */
.t-sign {
  --s: clamp(15px, 5cqw, 26px);
  position: absolute; z-index: 2;
  width: var(--s); height: var(--s);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid color-mix(in srgb, var(--line) 40%, var(--text));
  font-size: calc(var(--s) * .66); font-weight: 800; line-height: 1;
  pointer-events: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.t-sign.h { top: 50%; right: calc(var(--gap) / -2); transform: translate(50%, -50%); }
.t-sign.v { left: 50%; bottom: calc(var(--gap) / -2); transform: translate(-50%, 50%); }
.t-sign.err { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Rule violations. */
.t-cell.err::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 38%, transparent) 0 4px, transparent 4px 10px);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--danger) 70%, transparent);
}

.t-msg {
  min-height: 1.5em; margin: 10px 0 0; text-align: center;
  color: var(--danger); font-size: .92rem; font-weight: 600;
}
.t-msg:empty::before { content: "\00a0"; }
