/* 같은 번호 갈라내기 움직임 — sow-split-motion.js 가 body 에 ssm(움직여도 됨) · ssm-in 을, 칸마다 ssm-spin · ssm-cards · ssm-keep · ssm-ring · ssm-pv · ssm-sel · ssm-num · ssm-done 을 붙이고 뗀다.
   ① 아이콘 한 바퀴 · 세 칸 차례로  ② 카드 차례로 · 두 상자가 가운데에서 갈라짐 · 기록 막대 · 함께 있던 때 깜빡  ③ 이름표 뒤집힘 · 지킴 상자 빛
   ④ 미리보기 여섯 칸 뒤집힘  ⑤ 거른 칸 빛 · 카드 다시 · 표 줄 차례로 · 바뀐 산차 톡  ⑥ 끝낸 카드 빛 · ✓ 톡 · 숫자 톡.
   움직임 줄이기면 ssm 이 붙지 않는다. 글자는 바꾸지 않는다. 계속 도는 움직임은 없다. */
body { --ssm-ease: cubic-bezier(.22, 1, .36, 1); --ssm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.ssm .ssm-spin { animation: ssm-spin .8s var(--ssm-ease) both; }
body.ssm.ssm-in #sx .sx-c { animation: ssm-rise .5s var(--ssm-ease) both; animation-delay: calc(var(--i, 0) * .1s); }
body.ssm.ssm-in #sx .sx-c .ic { animation: ssm-pop .5s var(--ssm-spring) both; animation-delay: calc(.2s + var(--i, 0) * .1s); }
/* ② 카드 · 갈라지는 두 상자 (상자 칸은 잠깐 가로를 잘라 옆으로 밀리지 않게) */
body.ssm #list.ssm-cards > .pair { animation: ssm-rise .45s var(--ssm-ease) both; animation-delay: calc(.2s + var(--i, 0) * .12s); }
body.ssm #list.ssm-cards .two { overflow-x: clip; }
body.ssm #list.ssm-cards .two .sow:nth-child(odd) { animation: ssm-apart-l .6s var(--ssm-ease) both; animation-delay: calc(.4s + var(--i, 0) * .12s); }
body.ssm #list.ssm-cards .two .sow:nth-child(even) { animation: ssm-apart-r .6s var(--ssm-ease) both; animation-delay: calc(.4s + var(--i, 0) * .12s); }
body.ssm #list.ssm-cards .lane .bar { transform-origin: left center; animation: ssm-bar .6s var(--ssm-ease) both; animation-delay: calc(.9s + var(--i, 0) * .12s); }
body.ssm #list.ssm-cards .lane .ov { animation: ssm-blink .9s ease-in-out both; animation-delay: calc(1.4s + var(--i, 0) * .12s); }
body.ssm #list.ssm-cards .pair :is(.kp, .fx .vp) { animation: ssm-pop .4s var(--ssm-spring) both; animation-delay: calc(.35s + var(--i, 0) * .12s); }
/* ⑤ 같은 기록 두 번 · 산차 안 올라감: 표 줄 차례로 · 바뀌는 산차 */
body.ssm #list.ssm-cards .pair:is([data-kind="dupes"], [data-kind="parity"]) tr { animation: ssm-rise .35s var(--ssm-ease) both; animation-delay: calc(.5s + var(--i, 0) * .12s + var(--k, 0) * .04s); }
body.ssm #list.ssm-cards .pair[data-kind="parity"] tr:not(.same) td:nth-child(2) b { display: inline-block; animation: ssm-pop .4s var(--ssm-spring) both; animation-delay: calc(.9s + var(--i, 0) * .12s + var(--k, 0) * .05s); }
body.ssm #sx .sx-c.ssm-sel { animation: ssm-ring 1s ease-out both; }
body.ssm #sx b.ssm-num { display: inline-block; animation: ssm-num .5s var(--ssm-spring) both; }
/* ③ */
body.ssm .pair.ssm-keep .sow .tag { display: inline-block; animation: ssm-flip .5s var(--ssm-ease) both; }
body.ssm .pair.ssm-keep .sow .no input.num { animation: ssm-pop .4s var(--ssm-spring) .2s both; }
body.ssm .sow.ssm-ring { --c: var(--t-green); animation: ssm-ring 1s ease-out both; }
/* ④ */
body.ssm .pair.ssm-pv .pv-c { animation: ssm-flipin .45s var(--ssm-ease) both; animation-delay: calc(.1s + var(--k, 0) * .08s); }
body.ssm .pair.ssm-pv .pv-c.zero { animation-delay: calc(.6s + var(--k, 0) * .08s); }
body.ssm .pair.ssm-pv .pv-keep .vp { animation: ssm-pop .4s var(--ssm-spring) .8s both; }
/* ⑥ */
body.ssm .pair.ssm-done { --c: var(--good, var(--accent)); animation: ssm-ring 1.5s ease-out both; }
body.ssm .pair.ssm-done .act .msg svg { animation: ssm-pop .5s var(--ssm-spring) .15s both; }

@keyframes ssm-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes ssm-apart-l { from { opacity: .3; translate: 40px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes ssm-apart-r { from { opacity: .3; translate: -40px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes ssm-pop { 0% { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.1; } 100% { opacity: 1; scale: 1; } }
@keyframes ssm-num { from { opacity: 0; translate: 0 -60%; } to { opacity: 1; translate: 0 0; } }
@keyframes ssm-bar { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes ssm-blink { 0%, 100% { opacity: .9; } 30%, 70% { opacity: .2; } 50% { opacity: 1; } }
@keyframes ssm-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes ssm-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes ssm-flipin { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: rotateY(0); } }
@keyframes ssm-ring { 0% { outline: 2px solid var(--c, var(--accent)); outline-offset: 0; } 100% { outline: 2px solid transparent; outline-offset: 10px; } }

@media (prefers-reduced-motion: reduce) {
  #sx .sx-c, #sx .ic, #sx b, #list .pair, #list .sow, #list .lane .bar, #list .lane .ov, #list .kp, #list .vp, #list tr, #list td b, #list .tag, #list input.num, #list .pv-c, .act .msg svg, #find svg { animation: none !important; }
}
@media print { #sx .sx-c, #list .pair, #list .sow, #list .lane .bar, #list tr, #list .pv-c { animation: none !important; } }
