.slitherlink-wrap {
  width: min(100%, 780px);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  color: inherit;
}

.slitherlink-board-shell {
  width: 100%;
  display: grid;
  place-items: center;
  padding: clamp(.45rem, 1.5vw, 1rem);
  border: 1px solid color-mix(in srgb, currentColor 13%, transparent);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--game-accent-2, #22d3ee) 10%, transparent), transparent 44%),
    color-mix(in srgb, currentColor 3%, transparent);
}

.slitherlink-board {
  width: min(100%, 720px);
  aspect-ratio: 1;
  display: block;
  overflow: visible;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.slither-clue {
  fill: currentColor;
  font: 700 22px/1 system-ui, sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill .15s ease, opacity .15s ease;
}

.slither-clue.is-satisfied { opacity: .48; }
.slither-clue.is-error,
.slither-dot.is-error { fill: #ef4444; }

.slither-dot {
  fill: color-mix(in srgb, currentColor 72%, transparent);
  pointer-events: none;
  transition: fill .15s ease, transform .15s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.slither-dot.is-error { transform: scale(1.35); }

.slither-edge { cursor: pointer; outline: none; }
.slither-edge-hit {
  stroke: transparent;
  stroke-width: 18;
  stroke-linecap: round;
  pointer-events: stroke;
}
.slither-edge-line {
  stroke: var(--game-accent, #0f766e);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, stroke-width .12s ease, stroke .12s ease;
}
.slither-edge[data-state="1"] .slither-edge-line { opacity: 1; stroke-width: 7; }
.slither-edge.is-error[data-state="1"] .slither-edge-line { stroke: #ef4444; }
.slither-edge-x {
  fill: color-mix(in srgb, currentColor 55%, transparent);
  font: 700 20px/1 system-ui, sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.slither-edge[data-state="0"] .slither-edge-x { opacity: 1; }
.slither-edge:focus-visible .slither-edge-line {
  opacity: .55;
  stroke: var(--game-accent-2, #22d3ee);
  stroke-width: 7;
}
.slither-edge[data-state="1"]:focus-visible .slither-edge-line { opacity: 1; }

.slitherlink-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem .9rem;
  color: color-mix(in srgb, currentColor 72%, transparent);
  font-size: .84rem;
}
.slitherlink-legend span { display: inline-flex; align-items: center; gap: .38rem; }
.slitherlink-legend i {
  width: 1.45rem;
  height: .22rem;
  border-radius: 999px;
  background: var(--game-accent, #0f766e);
  display: inline-block;
}
.slitherlink-legend b { font-size: 1rem; line-height: 1; }

@media (max-width: 640px) {
  .slitherlink-wrap { gap: .65rem; }
  .slitherlink-board-shell { padding: .25rem; border-radius: .9rem; }
  .slither-edge-hit { stroke-width: 22; }
}

@media (prefers-reduced-motion: reduce) {
  .slither-edge-line,
  .slither-edge-x,
  .slither-clue,
  .slither-dot { transition: none; }
}
