.nim {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.status {
  padding: 18px 0 6px;
  text-align: center;
}

.turn {
  margin: 0;
  min-height: 1.4em;
  font-size: 1.5rem;
  font-weight: 900;
}

.turn[data-color='blue'] {
  color: var(--blue);
}

.turn[data-color='red'] {
  color: var(--red);
}

.rule {
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.board {
  --max: 9;
  /* Fit the longest row across the screen, up to a comfortable maximum. */
  --cell: min(44px, calc((100vw - 32px) / var(--max)));
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 4vh, 32px);
  width: 100%;
}

.row {
  display: flex;
  justify-content: center;
}

.dot {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* The ink dot. */
.dot::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 120ms ease, background 120ms ease;
}

.dot.selected::before {
  background: var(--accent);
  transform: scale(1.18);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.dot.taken {
  cursor: default;
}

.dot.taken::before {
  opacity: 0.35;
}

/* The pen stroke crossing out a taken dot. */
.dot.taken::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: calc(50% - 2px);
  height: 4px;
  border-radius: 2px;
  transform: rotate(-55deg);
}

.dot.taken.fresh::after {
  animation: strike 220ms ease-out;
}

.dot.by-blue::after {
  background: var(--blue);
}

.dot.by-red::after {
  background: var(--red);
}

@keyframes strike {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.board.locked .dot {
  cursor: default;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0 20px;
}

.hint {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.take {
  min-width: 180px;
  min-height: 52px;
  font-size: 1.15rem;
}
