/* Loop (Slitherlink): a sheet of washi paper and a red silk cord */
.sl-col { gap: 6px; padding: 6px 8px; }
.sl-board {
  direction: ltr;
  width: 280px; height: 280px;
  border-radius: 14px;
  background: radial-gradient(120% 90% at 20% 10%, #FFFDF8, #FBF3EA 55%, #F1E3D3);
  box-shadow: 0 0 0 2px rgba(246, 166, 193, 0.7), 0 0 0 6px rgba(246, 166, 193, 0.14), 0 12px 30px rgba(0, 0, 0, 0.45);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sl-svg { display: block; width: 100%; height: 100%; cursor: pointer; outline: none; touch-action: none; overflow: visible; }
.sl-g { stroke: #2E3A7C; stroke-opacity: 0.13; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.sl-d { fill: #161026; }
.sl-d.is-bad { fill: #FBF3EA; stroke: #E0452F; stroke-width: 5; }
.sl-n {
  font-family: var(--font-display); font-weight: 800; font-size: 56px;
  fill: #221A38; text-anchor: middle; dominant-baseline: central;
  transition: fill 0.2s, opacity 0.2s;
}
.sl-n.is-ok { fill: #5E8A2C; opacity: 0.8; }
.sl-n.is-over { fill: #C2261A; }
.sl-ring { fill: none; stroke: #E0452F; stroke-width: 3; stroke-dasharray: 5 7; opacity: 0; }
.sl-ring.is-over { opacity: 0.85; }
.sl-c, .sl-t, .sl-x { opacity: 0; pointer-events: none; }
.sl-c { stroke: #E0452F; stroke-width: 15; stroke-linecap: round; }
.sl-t { stroke: #FF9A7E; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 7 11; }
.sl-x { fill: none; stroke: #7A6E96; stroke-width: 4.5; stroke-linecap: round; }
.sl-e.is-on .sl-c { opacity: 1; filter: drop-shadow(0 2px 1.5px rgba(22, 16, 38, 0.3)); }
.sl-e.is-on .sl-t { opacity: 0.95; }
.sl-e.is-x .sl-x { opacity: 1; }
.sl-e.is-on .sl-c, .sl-e.is-on .sl-t { animation: sl-draw 0.18s ease-out; }
.sl-e.is-x .sl-x { animation: sl-pop 0.16s ease-out; transform-box: fill-box; transform-origin: center; }
.sl-cur { fill: none; stroke: #2E3A7C; stroke-width: 5; opacity: 0; }
.sl-svg:focus-visible .sl-cur { opacity: 1; }
.sl-win, .sl-shine { fill: none; stroke-linejoin: round; stroke-linecap: round; opacity: 0; pointer-events: none; }
.sl-win { stroke: #E0452F; stroke-width: 11; }
.sl-shine { stroke: #FFF3D6; stroke-width: 4; stroke-dasharray: 9 91; }
.is-won .sl-e, .is-won .sl-g, .is-won .sl-cur { opacity: 0; transition: opacity 0.35s; }
.is-won .sl-win { opacity: 1; animation: sl-tighten 1.1s cubic-bezier(0.3, 1.6, 0.5, 1) both; filter: drop-shadow(0 0 7px rgba(224, 69, 47, 0.75)) drop-shadow(0 0 16px rgba(217, 178, 95, 0.65)); }
.is-won .sl-shine { opacity: 0.95; animation: sl-run 1.5s linear 0.25s 2 both; }
.is-won .sl-n { fill: #221A38; opacity: 1; }
.sl-board.is-won { animation: sl-breathe 1.1s ease-out; }
@keyframes sl-draw { from { opacity: 0; stroke-width: 26; } }
@keyframes sl-pop { from { transform: scale(0.3); opacity: 0; } }
@keyframes sl-tighten {
  0% { stroke-width: 19; filter: none; }
  55% { stroke-width: 8; }
  100% { stroke-width: 11; }
}
@keyframes sl-run { from { stroke-dashoffset: 100; opacity: 0.95; } to { stroke-dashoffset: 0; opacity: 0.95; } }
@keyframes sl-breathe { 0% { transform: scale(1); } 40% { transform: scale(0.975); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .sl-e.is-on .sl-c, .sl-e.is-on .sl-t, .sl-e.is-x .sl-x, .is-won .sl-win, .is-won .sl-shine, .sl-board.is-won { animation: none; }
  .is-won .sl-shine { opacity: 0; }
}
