/* 등급 성적 움직임 — grade-motion.js 가 body 에 grm(움직여도 됨)을, 칸마다 grm-rows · grm-next · grm-prev · grm-tap · grm-drop · grm-up · grm-new 를 붙이고 뗀다.
   분포 막대는 스크립트가 옛 길이 → 새 길이로 미끄러뜨린다(width). 산점도 탭을 열 때의 움직임은 원래 화면(playIntro) 것.
   ① 출하 줄 차례로 · 등급 숫자 톡  ② 분포 막대  ③ 탭 쪽에서 밀려 들어옴  ④ 달 묶음 · 출하 줄 · 미니 막대 · 칩  ⑤ 범례 톡 · 출하 칩 내려앉음  ⑥ 판매 창 올라옴 · 새 판매 줄 빛.
   움직임 줄이기면 grm 이 붙지 않는다. 글자는 바꾸지 않는다. 계속 도는 움직임은 없다. */
body { --grm-ease: cubic-bezier(.22, 1, .36, 1); --grm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① 출하별 조회 */
body.grm #lotBody.grm-rows tr { animation: grm-rise .4s var(--grm-ease) both; animation-delay: calc(.1s + var(--i, 0) * .045s); }
body.grm #lotBody.grm-rows td.gnum:not(:empty) { animation: grm-num .45s var(--grm-spring) both; animation-delay: calc(.35s + var(--i, 0) * .045s); }
/* ③ 탭 (가로를 잠깐 잘라 옆으로 밀리지 않게) */
/*    산점도 탭은 원래 들어오는 움직임(playIntro)이 있고 검사가 점 자리를 재서 밀지 않는다 */
body.grm :is(#lotView, #monthView):is(.grm-next, .grm-prev) { overflow-x: clip; }
body.grm :is(#lotView, #monthView).grm-next > * { animation: grm-in-r .45s var(--grm-ease) both; }
body.grm :is(#lotView, #monthView).grm-prev > * { animation: grm-in-l .45s var(--grm-ease) both; }
/* ④ 월별 출하 */
body.grm #mBody.grm-rows .mon { animation: grm-rise .45s var(--grm-ease) both; animation-delay: calc(.15s + var(--i, 0) * .1s); }
body.grm #mBody.grm-rows .ship { animation: grm-rise .35s var(--grm-ease) both; animation-delay: calc(.3s + var(--i, 0) * .1s + var(--k, 0) * .04s); }
body.grm #mBody.grm-rows .gmini b { transform-origin: left center; animation: grm-grow .5s var(--grm-ease) both; animation-delay: calc(.5s + var(--i, 0) * .1s + var(--k, 0) * .04s); }
body.grm #mBody.grm-rows .kchip { animation: grm-pop .4s var(--grm-spring) both; animation-delay: calc(.45s + var(--i, 0) * .1s + var(--k, 0) * .04s); }
/* ⑤ */
body.grm #legend .grm-tap { animation: grm-tap .4s var(--grm-spring) both; }
body.grm .lotchip.grm-drop { animation: grm-drop .5s var(--grm-spring) both; }
/* ⑥ */
body.grm #saleSheet .sheet.grm-up { animation: grm-up .45s var(--grm-ease) both; }
body.grm #mBody .ship.grm-new { animation: grm-flash 1.6s ease-out both; }

@keyframes grm-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes grm-drop { from { opacity: 0; translate: 0 -12px; } to { opacity: 1; translate: 0 0; } }
@keyframes grm-up { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
@keyframes grm-in-r { from { opacity: 0; translate: 26px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes grm-in-l { from { opacity: 0; translate: -26px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes grm-pop { 0% { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.1; } 100% { opacity: 1; scale: 1; } }
@keyframes grm-num { 0% { opacity: 0; } 50% { opacity: 1; background-color: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { opacity: 1; } }
@keyframes grm-tap { 0% { scale: 1; } 40% { scale: 1.1; } 100% { scale: 1; } }
@keyframes grm-grow { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes grm-flash { 0% { background-color: color-mix(in srgb, var(--good, var(--accent)) 30%, transparent); box-shadow: inset 4px 0 0 var(--good, var(--accent)); } 100% { } }

@media (prefers-reduced-motion: reduce) {
  #lotBody tr, #lotBody td, #lotView > *, #monthView > *, #mBody .mon, #mBody .ship, .gmini b, .kchip, #legend *, .lotchip, #saleSheet .sheet { animation: none !important; }
}
@media print { #lotBody tr, #mBody .mon, #mBody .ship, .gmini b, .kchip { animation: none !important; } }
