/* 농장 지도 편집 움직임 — farm-map-motion.js 가 body 에 fem(움직여도 됨) 을, 칸마다 fem-in · fem-pick · fem-set · fem-new · fem-pt · fem-bump · fem-form · fem-fade · fem-tap · fem-ok · fem-shake 를 붙이고 뗀다.
   건물 묶음(g.bld)은 transform 속성으로 자리를 잡는다 → 묶음에는 opacity 만, 크기는 그 안의 몸(rect.body)에만 준다.
   ① 도로 · 건물 · 칩 · 스타일 카드 차례로  ② 건물 톡 · 입력 칸 들어옴  ③ 새 색 반짝 · 숫자 톡  ④ 뿅 · 점 톡 · 단추 숨  ⑤ 흔들림 · 빛.  움직임 줄이기면 fem 이 붙지 않는다. */
body { --fem-ease: cubic-bezier(.22, 1, .36, 1); --fem-spring: cubic-bezier(.34, 1.56, .64, 1); }
body.fem #map rect.body, body.fem #map circle { transform-box: fill-box; transform-origin: center; }

/* ① */
body.fem #map.fem-in g.bld { animation: fem-fade .45s ease-out both; animation-delay: calc(.25s + var(--i, 0) * .05s); }
body.fem #map.fem-in g.bld rect.body { animation: fem-pop .5s var(--fem-spring) both; animation-delay: calc(.25s + var(--i, 0) * .05s); }
body.fem #map.fem-in polyline { animation: fem-fade .6s ease-out both; }
body.fem .legend.fem-in .chip { animation: fem-rise .4s var(--fem-ease) both; animation-delay: calc(var(--i, 0) * .04s); }
body.fem #styleGrid.fem-in label { animation: fem-rise .4s var(--fem-ease) both; animation-delay: calc(var(--i, 0) * .05s); }
/* ② ③ ④ */
body.fem #map rect.body.fem-pick { animation: fem-tap .4s var(--fem-spring) both; }
body.fem #map rect.body.fem-set { animation: fem-tap .4s var(--fem-spring) both, fem-lit 1s ease-out both; }
body.fem #map rect.body.fem-new { animation: fem-pop .55s var(--fem-spring) both; }
body.fem #map circle.fem-pt { animation: fem-pop .4s var(--fem-spring) both; }
body.fem #form.fem-form { animation: fem-slide .4s var(--fem-ease) both; }
body.fem #form.fem-fade { animation: fem-fade .3s ease-out both; }
body.fem .fem-bump { display: inline-block; animation: fem-num .5s var(--fem-spring) both; }
body.fem #progress.fem-bump { display: block; transform-origin: 0 50%; }
body.fem #roadBtn.on { animation: fem-breathe 1.4s ease-in-out infinite; }
body.fem .fem-tap { animation: fem-tap .4s var(--fem-spring) both; }
/* ⑤ */
body.fem .fem-ok { border-radius: 8px; animation: fem-glow 1.4s ease-out both; }
body.fem .fem-shake { animation: fem-shake .5s ease-in-out both; }

@keyframes fem-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fem-pop { 0% { transform: scale(0); } 70% { transform: scale(1.08); } 100% { transform: none; } }
@keyframes fem-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fem-tap { 0% { transform: scale(1); } 40% { transform: scale(.92); } 100% { transform: none; } }
@keyframes fem-lit { 0% { filter: brightness(1.6) saturate(1.3); } 100% { filter: none; } }
@keyframes fem-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes fem-num { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: none; } }
@keyframes fem-breathe { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
@keyframes fem-glow { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--good, var(--accent)) 55%, transparent), 0 0 16px color-mix(in srgb, var(--good, var(--accent)) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes fem-shake { 0%, 100% { translate: 0 0; } 20%, 60% { translate: -4px 0; } 40%, 80% { translate: 4px 0; } }

@media (prefers-reduced-motion: reduce) {
  #map g.bld, #map rect.body, #map polyline, #map circle, .legend .chip, .legend em, #styleGrid label, #form, #progress, #roadBtn, .savestat, .b-del { animation: none !important; }
}
@media print { #map *, .legend .chip, #styleGrid label { animation: none !important; } }
