/* 모돈 한 바퀴 원판 움직임 — sow-wheel.js 가 #sowWheel 에 swm(움직여도 됨) · swm-in(처음 그리는 중) 을 붙이고 뗀다.
   지연은 모두 calc(… + var(--swm-t)) — 처음 그리는 도중에 다시 그려지면(서버 값 · 점 고르기) 지난 시간만큼 앞당겨 이어서 움직인다.
   ① 원판이 12시부터 시계 방향으로 그려짐  ② 무리 점이 붓끝을 따라 톡 · 가운데 글자 올라옴
   ③ '이번 주' 표시가 한 바퀴 돌아 이번 주 무리 자리에 멈춤, 그 점은 계속 숨 쉼
   ④ 점을 고르면 물결 · 카드가 들어오고 줄이 차례로 · 성적 막대가 참
   ⑤ 이번 주 할 일 줄이 차례로 들어오고, 줄에 손을 올리면 원판의 그 점이 빛남
   ⑥ 안쪽 고리를 따라 빛 한 점이 천천히 돎 (12초에 한 바퀴, 계속)
   ⑦ 아래 메뉴 칸이 차례로 피어남
   움직임 줄이기 · 태극이면 swm 이 붙지 않는다. */
#sowWheel { --swm-ease: cubic-bezier(.22, 1, .36, 1); --swm-spring: cubic-bezier(.34, 1.56, .64, 1); }
#sowWheel .sw-dot, #sowWheel .sw-c1, #sowWheel .sw-c2, #sowWheel .sw-c3 { transform-box: fill-box; transform-origin: center; }
.swm-mark, .swm-comet { transform-box: view-box; transform-origin: 170px 170px; }

/* ③ 이번 주 표시 (움직이지 않아도 보인다) */
.swm-mark path { fill: var(--accent); }
.swm-mark text { font-size: 10px; font-weight: 800; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

/* ① 원판 그리기 · 할 일 점선 · 가운데 글자 */
#sowWheel.swm.swm-in .swm-sweep { animation: swm-sweep 1.25s cubic-bezier(.5, 0, .3, 1) both; animation-delay: calc(.15s + var(--swm-t, 0s)); }
#sowWheel.swm.swm-in .swm-ev { animation: swm-fade .5s ease-out both; animation-delay: calc(1.25s + var(--swm-t, 0s)); }
#sowWheel.swm.swm-in .sw-c1 { animation: swm-up .5s var(--swm-ease) both; animation-delay: calc(1.05s + var(--swm-t, 0s)); }
#sowWheel.swm.swm-in .sw-c2 { animation: swm-pop .6s var(--swm-spring) both; animation-delay: calc(1.2s + var(--swm-t, 0s)); }
#sowWheel.swm.swm-in .sw-c3 { animation: swm-up .5s var(--swm-ease) both; animation-delay: calc(1.35s + var(--swm-t, 0s)); }
/* ② 무리 점: 붓끝이 그 자리를 지날 때 */
#sowWheel.swm.swm-in .sw-dot { animation: swm-pop .5s var(--swm-spring) both; animation-delay: calc(.25s + var(--swm-a, 0) * 1.15s + var(--swm-t, 0s)); }
/* ③ 이번 주 표시가 12시에서 한 바퀴 더 돌아 제자리에 */
#sowWheel.swm.swm-in .swm-mark { animation: swm-spin 1.6s cubic-bezier(.3, 0, .15, 1) both; animation-delay: calc(1.1s + var(--swm-t, 0s)); }
#sowWheel.swm .sw-dot.swm-now circle { animation: swm-breathe 2.4s ease-in-out infinite; }
#sowWheel.swm.swm-in .sw-dot.swm-now circle { animation-delay: calc(2.7s + var(--swm-t, 0s)); }
/* ④ 고른 점 · 카드 */
#sowWheel.swm .sw-dot.swm-hit { animation: swm-bounce .6s ease-out both; }
#sowWheel.swm .swm-ripple { fill: none; stroke: var(--sc, var(--accent)); stroke-width: 3; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: swm-ripple .8s ease-out both; }
#sowWheel.swm .sw-card.swm-card-in { animation: swm-card .5s var(--swm-ease) both; }
#sowWheel.swm .sw-card.swm-card-in :is(.r, .kv) { animation: swm-row .4s var(--swm-ease) both; animation-delay: calc(.12s + var(--n, 0) * 50ms); }
#sowWheel.swm .sw-card.swm-card-in .bar i { animation: swm-bar .9s var(--swm-ease) both; animation-delay: .35s; }
/* ⑤ 이번 주 할 일 줄 · 줄과 원판 잇기 */
#sowWheel.swm.swm-in .sw-it { animation: swm-row .45s var(--swm-ease) both; animation-delay: calc(1.4s + var(--n, 0) * 70ms + var(--swm-t, 0s)); }
#sowWheel.swm.swm-in .sw-it.today { animation: swm-row .45s var(--swm-ease) both, swm-flash 1s ease-out both; animation-delay: calc(1.4s + var(--n, 0) * 70ms + var(--swm-t, 0s)), calc(2s + var(--n, 0) * 70ms + var(--swm-t, 0s)); }
#sowWheel.swm .sw-dot.swm-glow { transform: scale(1.22); transition: transform .25s var(--swm-spring); }
#sowWheel.swm .sw-dot.swm-glow circle { stroke-width: 5; filter: drop-shadow(0 0 6px var(--sc, var(--accent))); }
/* ⑥ 흐르는 빛 */
.swm-comet { display: none; }
#sowWheel.swm .swm-comet { display: inline; fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); pointer-events: none; animation: swm-orbit 12s linear infinite; }
#sowWheel.swm.swm-in .swm-comet { animation: swm-fade .6s ease-out both, swm-orbit 12s linear infinite; animation-delay: calc(1.6s + var(--swm-t, 0s)), calc(1.6s + var(--swm-t, 0s)); }
/* ⑦ 아래 메뉴 칸 */
.grid.swm-tiles .tile { animation: swm-rise .55s var(--swm-ease, ease-out) both; animation-delay: calc(1.5s + var(--swm-i, 0) * 60ms); }
.grid.swm-tiles .tile .ico { animation: swm-pop .55s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(1.65s + var(--swm-i, 0) * 60ms); }

@keyframes swm-sweep { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 100 0; } }
@keyframes swm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes swm-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes swm-pop { 0% { opacity: 0; transform: scale(0); } 60% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes swm-spin { from { transform: rotate(calc(-360deg - var(--swm-deg, 0deg))); opacity: 0; } 15% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes swm-breathe { 0%, 100% { stroke-width: 2.5; filter: none; } 50% { stroke-width: 4.5; filter: drop-shadow(0 0 7px var(--sc, var(--accent))); } }
@keyframes swm-bounce { 0%, 100% { transform: none; } 30% { transform: scale(1.35); } 60% { transform: scale(.92); } 80% { transform: scale(1.08); } }
@keyframes swm-ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
@keyframes swm-card { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes swm-row { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes swm-bar { from { width: 0; } }
@keyframes swm-flash { 0%, 100% { filter: none; } 40% { filter: brightness(1.3); } }
@keyframes swm-orbit { to { transform: rotate(360deg); } }
@keyframes swm-rise { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  #sowWheel *, .grid.swm-tiles .tile, .grid.swm-tiles .tile * { animation: none !important; transition: none !important; }
  .swm-comet { display: none !important; }
}
@media print { #sowWheel *, .grid .tile { animation: none !important; } .swm-comet { display: none !important; } }
