/* Hover animations for icon group classic-a: th-unicorn, th-dragon, th-rocket, th-tractor, th-digger */

.ico-th-unicorn .head, .ico-th-unicorn .mane, .ico-th-unicorn .sparkle,
.ico-th-dragon .wing-l, .ico-th-dragon .wing-r, .ico-th-dragon .tail, .ico-th-dragon .puff,
.ico-th-rocket .ship, .ico-th-rocket .flame, .ico-th-rocket .star,
.ico-th-tractor .wheel, .ico-th-tractor .body, .ico-th-tractor .puff,
.ico-th-digger .arm, .ico-th-digger .bucket, .ico-th-digger .crumb, .ico-th-digger .wh, .ico-th-digger .beacon {
  transform-box: fill-box;
}

/* ---------- Unicorn: head nods gently, mane sways, sparkles twinkle ---------- */
.ico-th-unicorn .head { transform-origin: 40% 100%; }
.ico-th-unicorn .mane { transform-origin: 85% 5%; }
.ico-th-unicorn .sparkle { transform-origin: 50% 50%; }
.hov:hover .ico-th-unicorn .head, .hov:focus-visible .ico-th-unicorn .head, .hov.on .ico-th-unicorn .head {
  animation: th-unicorn-nod 1.6s ease-in-out infinite;
}
.hov:hover .ico-th-unicorn .mane, .hov:focus-visible .ico-th-unicorn .mane, .hov.on .ico-th-unicorn .mane {
  animation: th-unicorn-mane 1.6s ease-in-out infinite;
}
.hov:hover .ico-th-unicorn .sparkle, .hov:focus-visible .ico-th-unicorn .sparkle, .hov.on .ico-th-unicorn .sparkle {
  animation: th-unicorn-twinkle 1.2s ease-in-out infinite;
}
.hov:hover .ico-th-unicorn .sp2, .hov:focus-visible .ico-th-unicorn .sp2, .hov.on .ico-th-unicorn .sp2 { animation-delay: -.4s; }
.hov:hover .ico-th-unicorn .sp3, .hov:focus-visible .ico-th-unicorn .sp3, .hov.on .ico-th-unicorn .sp3 { animation-delay: -.8s; }
@keyframes th-unicorn-nod { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-4deg) translateY(-1px); } }
@keyframes th-unicorn-mane { 0%, 100% { transform: rotate(0deg) skewY(0deg); } 50% { transform: rotate(5deg) skewY(-3deg); } }
@keyframes th-unicorn-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.45) rotate(45deg); opacity: .55; }
}

/* ---------- Dragon: wings flap, tail wags, a tiny heart puff floats up ---------- */
.ico-th-dragon .wing-l { transform-origin: 100% 50%; }
.ico-th-dragon .wing-r { transform-origin: 0% 50%; }
.ico-th-dragon .tail { transform-origin: 0% 90%; }
.ico-th-dragon .puff { transform-origin: 50% 100%; opacity: 0; }
.hov:hover .ico-th-dragon .wing-l, .hov:focus-visible .ico-th-dragon .wing-l, .hov.on .ico-th-dragon .wing-l {
  animation: th-dragon-flap-l .7s ease-in-out infinite;
}
.hov:hover .ico-th-dragon .wing-r, .hov:focus-visible .ico-th-dragon .wing-r, .hov.on .ico-th-dragon .wing-r {
  animation: th-dragon-flap-r .7s ease-in-out infinite;
}
.hov:hover .ico-th-dragon .tail, .hov:focus-visible .ico-th-dragon .tail, .hov.on .ico-th-dragon .tail {
  animation: th-dragon-tail 1.4s ease-in-out infinite;
}
.hov:hover .ico-th-dragon .puff, .hov:focus-visible .ico-th-dragon .puff, .hov.on .ico-th-dragon .puff {
  animation: th-dragon-heart 1.4s ease-out infinite;
}
@keyframes th-dragon-flap-l { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(18deg) scaleX(.9); } }
@keyframes th-dragon-flap-r { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-18deg) scaleX(.9); } }
@keyframes th-dragon-tail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-10deg); } }
@keyframes th-dragon-heart {
  0% { transform: translate(-8px, 8px) scale(.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(2px, -10px) scale(1.15); opacity: 0; }
}

/* ---------- Rocket: lifts and wobbles, flame flickers, stars twinkle ---------- */
.ico-th-rocket .ship { transform-origin: 50% 60%; }
.ico-th-rocket .flame { transform-origin: 50% 0%; }
.ico-th-rocket .star { transform-origin: 50% 50%; }
.hov:hover .ico-th-rocket .ship, .hov:focus-visible .ico-th-rocket .ship, .hov.on .ico-th-rocket .ship {
  animation: th-rocket-lift 1.6s ease-in-out infinite;
}
.hov:hover .ico-th-rocket .flame, .hov:focus-visible .ico-th-rocket .flame, .hov.on .ico-th-rocket .flame {
  animation: th-rocket-flame .4s ease-in-out infinite alternate;
}
.hov:hover .ico-th-rocket .star, .hov:focus-visible .ico-th-rocket .star, .hov.on .ico-th-rocket .star {
  animation: th-rocket-twinkle 1.2s ease-in-out infinite;
}
.hov:hover .ico-th-rocket .st2, .hov:focus-visible .ico-th-rocket .st2, .hov.on .ico-th-rocket .st2 { animation-delay: -.4s; }
.hov:hover .ico-th-rocket .st3, .hov:focus-visible .ico-th-rocket .st3, .hov.on .ico-th-rocket .st3 { animation-delay: -.8s; }
@keyframes th-rocket-lift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-4px) rotate(-2deg); }
  70% { transform: translateY(-5px) rotate(2deg); }
}
@keyframes th-rocket-flame { 0% { transform: scale(.85, .75); } 100% { transform: scale(1.08, 1.2); } }
@keyframes th-rocket-twinkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.55); opacity: .5; }
}

/* ---------- Tractor: wheels turn, body chugs, exhaust puffs rise ---------- */
.ico-th-tractor .wheel { transform-origin: 50% 50%; }
.ico-th-tractor .body { transform-origin: 50% 100%; }
.ico-th-tractor .puff { transform-origin: 50% 50%; }
.hov:hover .ico-th-tractor .wheel, .hov:focus-visible .ico-th-tractor .wheel, .hov.on .ico-th-tractor .wheel {
  animation: th-tractor-roll 1.6s linear infinite;
}
.hov:hover .ico-th-tractor .wheel-front, .hov:focus-visible .ico-th-tractor .wheel-front, .hov.on .ico-th-tractor .wheel-front {
  animation-duration: 1s;
}
.hov:hover .ico-th-tractor .body, .hov:focus-visible .ico-th-tractor .body, .hov.on .ico-th-tractor .body {
  animation: th-tractor-chug .4s ease-in-out infinite;
}
.hov:hover .ico-th-tractor .puff, .hov:focus-visible .ico-th-tractor .puff, .hov.on .ico-th-tractor .puff {
  animation: th-tractor-puff 1.2s ease-out infinite;
}
.hov:hover .ico-th-tractor .pf2, .hov:focus-visible .ico-th-tractor .pf2, .hov.on .ico-th-tractor .pf2 { animation-delay: -.6s; }
@keyframes th-tractor-roll { to { transform: rotate(360deg); } }
@keyframes th-tractor-chug { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }
@keyframes th-tractor-puff {
  0% { transform: translate(-4px, 10px) scale(.4); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(5px, -6px) scale(1.3); opacity: 0; }
}

/* ---------- Digger: arm scoops, bucket curls, crumbs hop, rollers turn ---------- */
.ico-th-digger .arm { transform-origin: 5px 36px; }
.ico-th-digger .bucket { transform-origin: 6px 2px; }
.ico-th-digger .crumb, .ico-th-digger .wh { transform-origin: 50% 50%; }
.hov:hover .ico-th-digger .arm, .hov:focus-visible .ico-th-digger .arm, .hov.on .ico-th-digger .arm {
  animation: th-digger-arm 1.6s ease-in-out infinite;
}
.hov:hover .ico-th-digger .bucket, .hov:focus-visible .ico-th-digger .bucket, .hov.on .ico-th-digger .bucket {
  animation: th-digger-bucket 1.6s ease-in-out infinite;
}
.hov:hover .ico-th-digger .crumb, .hov:focus-visible .ico-th-digger .crumb, .hov.on .ico-th-digger .crumb {
  animation: th-digger-crumb .8s ease-in-out infinite;
}
.hov:hover .ico-th-digger .cr2, .hov:focus-visible .ico-th-digger .cr2, .hov.on .ico-th-digger .cr2 { animation-delay: -.4s; }
.hov:hover .ico-th-digger .wh, .hov:focus-visible .ico-th-digger .wh, .hov.on .ico-th-digger .wh {
  animation: th-digger-roll 1.2s linear infinite;
}
.hov:hover .ico-th-digger .beacon, .hov:focus-visible .ico-th-digger .beacon, .hov.on .ico-th-digger .beacon {
  animation: th-digger-beacon .8s steps(2) infinite;
}
@keyframes th-digger-arm { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(9deg); } }
@keyframes th-digger-bucket { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-28deg); } }
@keyframes th-digger-crumb { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes th-digger-roll { to { transform: rotate(360deg); } }
@keyframes th-digger-beacon { 0% { fill: #f29a4a; } 100% { fill: #f8de95; } }

@media (prefers-reduced-motion: reduce) {
  .ico-th-unicorn *, .ico-th-dragon *, .ico-th-rocket *, .ico-th-tractor *, .ico-th-digger * {
    animation: none !important;
  }
}
