/* 카메라 연결 움직임 — cameras-motion.js 가 body 에 cmm(움직여도 됨) · cmm-in 을, 칸마다 cmm-ok · cmm-no · cmm-bump · cmm-all · cmm-tap · cmm-open · cmm-shake · cmm-steps · cmm-run · cmm-saved · cmm-flash 를 붙이고 뗀다.
   ① 세 칸 톡 · 전파 · 축사 카드 · 방 줄 차례로  ② 서버 칸 톡 / 흔들 · 방식 톡  ③ 알약 · 숫자 톡 · 다 이으면 반짝  ④ 눈 단추 · 미리보기 펼침 · 네 단계 차례로  ⑤ 빗금 · 글 빛 · 세 칸 반짝.
   움직임 줄이기면 cmm 이 붙지 않는다. 지금 상태 칸 그림자는 화면이 잡고 있어 빛은 테두리 밖 선으로. */
body { --cmm-ease: cubic-bezier(.22, 1, .36, 1); --cmm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.cmm.cmm-in #cmNow .cm-t { animation: cmm-pop .5s var(--cmm-spring) both; animation-delay: calc(var(--i, 0) * .09s); }
body.cmm.cmm-in #tSrv .ic { animation: cmm-wave 1.1s ease-out 2; animation-delay: .5s; }
body.cmm.cmm-in #rooms .cg { animation: cmm-rise .45s var(--cmm-ease) both; animation-delay: calc(.3s + var(--i, 0) * .08s); }
body.cmm.cmm-in #rooms .cg .cr { animation: cmm-fade .35s ease-out both; animation-delay: calc(.45s + var(--i, 0) * .08s + var(--r, 0) * .04s); }
/* ② ③ — 처음 열 때의 차례 움직임 중에 눌러도 이기게 #cmNow 를 붙인다 */
body.cmm #cmNow #tSrv.cmm-ok { animation: cmm-tap .45s var(--cmm-spring) both, cmm-ring 1s ease-out both; }
body.cmm #cmNow #tSrv.cmm-no { animation: cmm-shake .5s ease-in-out both; }
body.cmm .cmm-bump { display: inline-block; animation: cmm-num .5s var(--cmm-spring) both; }
body.cmm #cmMode.cmm-bump, body.cmm #cmN.cmm-bump { display: block; transform-origin: 0 50%; }
body.cmm #cmNow #tRooms.cmm-all { animation: cmm-ring 1.3s ease-out both; }
/* ④ */
body.cmm .cmm-tap { animation: cmm-tap .4s var(--cmm-spring) both; }
body.cmm #thumb.cmm-open { animation: cmm-drop .5s var(--cmm-ease) both; }
body.cmm .cmm-shake { animation: cmm-shake .5s ease-in-out both; }
body.cmm #cmPrep.cmm-steps .cm-s { animation: cmm-drop .4s var(--cmm-ease) both; animation-delay: calc(var(--i, 0) * .12s); }
body.cmm #cmPrep.cmm-steps .cm-s .n { animation: cmm-pop .45s var(--cmm-spring) both; animation-delay: calc(.05s + var(--i, 0) * .12s); }
body.cmm #cmPrep.cmm-steps .cm-s:not(:last-child)::before { transform-origin: 50% 0; animation: cmm-line .5s var(--cmm-ease) both; animation-delay: calc(.2s + var(--i, 0) * .12s); }
/* ⑤ */
body.cmm #save.cmm-run { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent-ink, #fff) 20%, transparent) 0 8px, transparent 8px 16px) !important; background-size: 22px 22px !important; animation: cmm-stripe .6s linear infinite; }
body.cmm #msg.cmm-saved { display: inline-block; border-radius: 8px; animation: cmm-glow 1.4s ease-out both; }
body.cmm #cmNow.cmm-flash .cm-t { animation: cmm-ring 1.1s ease-out both; animation-delay: calc(var(--i, 0) * .12s); }

@keyframes cmm-pop { 0% { opacity: 0; transform: scale(.75); } 60% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes cmm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cmm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmm-wave { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes cmm-tap { 0% { transform: scale(1); } 40% { transform: scale(.94); } 100% { transform: none; } }
@keyframes cmm-ring { 0% { outline: 3px solid color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); outline-offset: 0; } 100% { outline: 3px solid transparent; outline-offset: 9px; } }
@keyframes cmm-shake { 0%, 100% { translate: 0 0; } 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
@keyframes cmm-num { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: none; } }
@keyframes cmm-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes cmm-line { from { transform: scaleY(0); } to { transform: none; } }
@keyframes cmm-stripe { from { background-position: 0 0; } to { background-position: 22px 0; } }
@keyframes cmm-glow { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  #cmNow .cm-t, #cmNow .cm-t *, #rooms .cg, #rooms .cg *, #thumb, #cmPrep .cm-s, #cmPrep .cm-s *, #cmPrep .cm-s::before, #save, #msg { animation: none !important; }
}
@media print { #cmNow .cm-t, #rooms .cg, #rooms .cr { animation: none !important; } }
