.atoms-shell {
  --game-accent: #3c5aa6;
  --at-ink: #2b2b2b;
  --at-bond: #2b2b2b;
  --at-node: #ffffff;
  --at-guide: rgb(0 0 0 / 0.06);
}
:root[data-theme='dark'] .atoms-shell {
  --game-accent: #6f8fe0;
  --at-ink: #ececec;
  --at-bond: #d8d8d8;
  --at-node: #1f1f1f;
  --at-guide: rgb(255 255 255 / 0.06);
}
.atoms-shell .shell-stage {
  padding: 0 var(--space-4);
}
.atoms-shell .shell-board-area {
  width: 100%;
}
.atoms-shell .at-board-wrap {
  width: min(560px, calc(100vw - 32px), calc(100dvh - 210px));
  margin: 0 auto;
  container-type: inline-size;
}
.atoms-shell .at-board {
  --node: calc(100cqw / var(--atoms-cols) * 0.7);
  position: relative;
  width: 100%;
  border-radius: 12px;
  background: radial-gradient(circle, var(--at-guide) 1.5px, transparent 2px) 0 0 / calc(100% / var(--atoms-cols))
    calc(100% / var(--atoms-cols));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* Bridges: an invisible wide hit area; one or two drawn lines inside it. */
.atoms-shell .at-edge {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.atoms-shell .at-edge.horizontal {
  height: calc(var(--node) * 0.8);
  transform: translateY(-50%);
}
.atoms-shell .at-edge.vertical {
  width: calc(var(--node) * 0.8);
  transform: translateX(-50%);
}
.atoms-shell .at-edge i {
  position: absolute;
  display: none;
  border-radius: 2px;
  background: var(--at-bond);
}
.atoms-shell .at-edge.horizontal i {
  right: 0;
  left: 0;
  height: 3px;
}
.atoms-shell .at-edge.vertical i {
  top: 0;
  bottom: 0;
  width: 3px;
}
.atoms-shell .at-edge.single i:first-child,
.atoms-shell .at-edge.double i {
  display: block;
}
.atoms-shell .at-edge.horizontal.double i:first-child {
  transform: translateY(-4px);
}
.atoms-shell .at-edge.horizontal.double i:last-of-type {
  transform: translateY(4px);
}
.atoms-shell .at-edge.vertical.double i:first-child {
  transform: translateX(-4px);
}
.atoms-shell .at-edge.vertical.double i:last-of-type {
  transform: translateX(4px);
}
.atoms-shell .at-edge.just-set i {
  animation: at-draw 160ms ease-out;
}
@keyframes at-draw {
  from {
    opacity: 0.2;
  }
}
.atoms-shell .at-edge b {
  color: var(--text-muted);
  font: 800 clamp(12px, 3.6vw, 16px) / 1 var(--font-app);
}
.atoms-shell .at-edge.auto b {
  opacity: 0.45;
}
.atoms-shell .at-edge.hinted {
  background: color-mix(in srgb, var(--hint-target) 25%, transparent);
  border-radius: 8px;
}
.atoms-shell .at-edge:focus-visible {
  outline: 2px solid var(--text);
  border-radius: 8px;
}
/* Atoms: ring with the number; filled with the game colour once exactly satisfied. */
.atoms-shell .at-node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: var(--node);
  height: var(--node);
  place-items: center;
  padding: 0;
  border: 2.5px solid var(--at-ink);
  border-radius: 50%;
  background: var(--at-node);
  color: var(--at-ink);
  font: 800 calc(var(--node) * 0.46) / 1 var(--font-app);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition:
    background 140ms ease-out,
    color 140ms ease-out;
}
.atoms-shell .at-node.satisfied {
  border-color: var(--game-accent);
  background: var(--game-accent);
  color: #ffffff;
}
.atoms-shell .at-node.exceeded {
  border-color: var(--danger);
  color: var(--danger);
}
.atoms-shell .at-node.selected {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--hint-target);
}
.atoms-shell .at-board.shake {
  animation: at-shake 240ms ease-in-out;
}
@keyframes at-shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.atoms-shell .at-board.solved .at-node {
  animation: at-solved 520ms ease-out both;
  animation-delay: calc(var(--i) * 45ms);
}
@keyframes at-solved {
  40% {
    transform: translate(-50%, -50%) scale(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .atoms-shell .at-edge.just-set i,
  .atoms-shell .at-board.shake,
  .atoms-shell .at-board.solved .at-node {
    animation: none;
  }
}
