/* Hitori: ink dabs on washi paper */
.ht-col { gap: 6px; padding: 6px 8px; }
.ht-sheet { position: relative; }
.ht-board {
  --n: 5;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  direction: ltr;
  width: 280px; height: 280px;
  padding: 5px;
  border-radius: 10px;
  background-color: #FBF3EA;
  background-image: radial-gradient(circle at 18% 22%, rgba(217, 178, 95, 0.16), transparent 42%), radial-gradient(circle at 82% 78%, rgba(246, 166, 193, 0.2), transparent 46%);
  box-shadow: 0 0 0 2px #161026, 0 0 0 5px #E0452F, 0 0 0 7px #161026, 0 12px 30px rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  font-size: 26px;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.ht-cell {
  position: relative;
  min-width: 0; min-height: 0;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 0.5px rgba(22, 16, 38, 0.38);
  color: #161026;
  font: inherit; font-weight: 800; line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ht-cell:focus-visible { outline: 3px solid #2E3A7C; outline-offset: -3px; z-index: 3; }
.ht-num { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 2; transition: color 0.25s, opacity 0.25s; }
/* the dab: a dark core with an uneven edge, and a soft halo that keeps spreading into the paper */
.ht-ink { position: absolute; left: 5%; top: 5%; width: 90%; height: 90%; pointer-events: none; opacity: 0; transform: rotate(var(--rot, 0deg)) scale(0.2); }
.ht-ink::before, .ht-ink::after { content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.ht-ink::before { background: radial-gradient(closest-side, rgba(34, 26, 56, 0.6) 55%, rgba(46, 58, 124, 0.34) 80%, rgba(46, 58, 124, 0) 100%); border-radius: 50%; transform: scale(0.8); }
.ht-ink::after { background: radial-gradient(circle at 38% 34%, #33284F, #161026 62%); }
.ht-b0 .ht-ink::after { border-radius: 46% 54% 50% 50% / 55% 44% 56% 45%; }
.ht-b1 .ht-ink::after { border-radius: 58% 42% 47% 53% / 46% 57% 43% 54%; }
.ht-b2 .ht-ink::after { border-radius: 43% 57% 56% 44% / 52% 45% 55% 48%; }
.ht-b3 .ht-ink::after { border-radius: 52% 48% 41% 59% / 58% 50% 50% 42%; }
.ht-cell.is-shade .ht-ink { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(1); animation: ht-dab 0.3s cubic-bezier(.2, 1.5, .5, 1); }
.ht-cell.is-shade .ht-ink::before { transform: scale(1.3); animation: ht-bleed 1.1s ease-out; }
.ht-cell.is-shade .ht-num { color: #FBF3EA; opacity: 0.42; }
.ht-ring { position: absolute; left: 11%; top: 11%; width: 78%; height: 78%; border: 0.11em solid #E0452F; border-radius: 52% 48% 50% 50% / 48% 53% 47% 52%; border-left-color: rgba(224, 69, 47, 0.6); pointer-events: none; opacity: 0; transform: rotate(var(--rot, 0deg)) scale(1.3); }
.ht-cell.is-keep .ht-ring { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(1); transition: transform 0.2s ease-out, opacity 0.15s; }
.ht-cell.is-bad.is-shade { box-shadow: inset 0 0 0 3px #E0452F; }
.ht-cell.is-bad.is-keep { background: rgba(224, 69, 47, 0.24); }
.ht-cell.is-bad .ht-num { animation: ht-shake 0.3s; }
.ht-board.is-done .ht-cell:not(.is-shade) .ht-num { color: #2E3A7C; }
.ht-board.is-done .ht-ring { opacity: 0; }
.ht-seal { position: absolute; right: -14px; bottom: -14px; width: 46px; height: 46px; pointer-events: none; opacity: 0; transform: rotate(-9deg) scale(2.2); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4)); z-index: 4; }
.ht-seal.is-on { opacity: 0.94; transform: rotate(-9deg) scale(1); transition: transform 0.32s cubic-bezier(.5, 0, .3, 1.5) 0.25s, opacity 0.18s 0.25s; }
@keyframes ht-dab { from { opacity: 0.3; transform: rotate(var(--rot, 0deg)) scale(0.2); } }
@keyframes ht-bleed { from { transform: scale(0.7); opacity: 0; } 30% { opacity: 1; } }
@keyframes ht-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
#sub { min-height: 26px; font-size: 0.95rem; }
#sub.is-warn { color: #F6A6C1; }
#sizes .fa-seg button { min-height: 38px; min-width: 56px; }
@media (max-height: 600px) { #sizes .fa-seg button { min-height: 34px; } #sub { min-height: 22px; } }
@media (max-width: 359px) { #solved-chip { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .ht-cell.is-shade .ht-ink, .ht-cell.is-shade .ht-ink::before, .ht-cell.is-bad .ht-num { animation: none; }
  .ht-seal.is-on, .ht-cell.is-keep .ht-ring { transition: none; }
}
