@keyframes ambientFloatA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(18px, 26px, 0) scale(1.05); }
}

@keyframes ambientFloatB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-22px, -16px, 0) scale(0.96); }
}

@keyframes loadingWiggle {
    0% { left: -22%; transform: translateY(-50%) rotate(0deg); }
    20% { transform: translateY(-50%) rotate(2deg); }
    50% { transform: translateY(-50%) rotate(-2deg); }
    100% { left: 104%; transform: translateY(-50%) rotate(0deg); }
}

@keyframes buttonShine {
    0% { left: -35%; }
    42%, 100% { left: 130%; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(-0.4deg); }
    50% { transform: translateY(-4px) rotate(0.5deg); }
}

@keyframes coinPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.22) rotate(-5deg); }
    75% { transform: scale(0.94) rotate(3deg); }
    100% { transform: scale(1); }
}

@keyframes heartBreak {
    0% { transform: scale(1) rotate(0); opacity: 1; }
    35% { transform: scale(1.25) rotate(-8deg); opacity: 1; }
    100% { transform: scale(0.25) rotate(18deg) translateY(18px); opacity: 0; }
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

@keyframes comboPop {
    0% { transform: translateX(140%) rotate(12deg) scale(0.5); opacity: 0; }
    65% { transform: translateX(-6%) rotate(1deg) scale(1.08); opacity: 1; }
    100% { transform: translateX(0) rotate(3deg) scale(1); opacity: 1; }
}

@keyframes tutorialBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes modalBackdropIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes modalCardIn {
    0% { transform: translateY(30px) scale(0.76); opacity: 0; }
    68% { transform: translateY(-4px) scale(1.035); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes modalCardOut {
    from { transform: translateY(0) scale(1); opacity: 1; }
    to { transform: translateY(20px) scale(0.92); opacity: 0; }
}

@keyframes starEarned {
    0% { transform: scale(0) rotate(-60deg); opacity: 0; }
    60% { transform: scale(1.24) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes levelCardIn {
    0% { transform: translateY(18px) scale(0.75); opacity: 0; }
    72% { transform: translateY(-2px) scale(1.03); opacity: 1; }
    100% { transform: none; opacity: 1; }
}

@keyframes toastIn {
    from { transform: translateX(110%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(110%) scale(0.92); opacity: 0; }
}

@keyframes achievementIn {
    0% { transform: translate(-50%, -140%) scale(0.8); opacity: 0; }
    65% { transform: translate(-50%, 8%) scale(1.04); opacity: 1; }
    100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

@keyframes achievementOut {
    from { transform: translate(-50%, 0) scale(1); opacity: 1; }
    to { transform: translate(-50%, -140%) scale(0.9); opacity: 0; }
}

@keyframes settingTogglePop {
    0% { transform: translateY(-50%) scale(1); }
    55% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}

@keyframes progressGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.16); }
}

.ambient-blob-a { animation: ambientFloatA 10s ease-in-out infinite; }
.ambient-blob-b { animation: ambientFloatB 13s ease-in-out infinite; }
.ambient-blob-c { animation: ambientFloatA 16s ease-in-out infinite reverse; }
.loading-snake { animation: loadingWiggle 2.1s ease-in-out infinite; }
.button-shine { animation: buttonShine 3.2s ease-in-out infinite 0.6s; }
.menu-logo { animation: logoFloat 4.8s ease-in-out infinite; }
.coin-medallion.is-animating { animation: coinPop 420ms cubic-bezier(.2,.8,.2,1); }
.heart-icon:not(.is-empty) { animation: heartPulse 1.8s ease-in-out infinite; }
.heart-icon.is-breaking { animation: heartBreak 520ms cubic-bezier(.2,.8,.2,1) forwards; }
.combo-badge.is-entering { animation: comboPop 420ms cubic-bezier(.2,.8,.2,1) both; }
.tutorial-bubble.is-bouncing { animation: tutorialBounce 1.8s ease-in-out infinite; }
.modal-overlay.is-opening { animation: modalBackdropIn 260ms ease both; }
.modal-overlay.is-opening .modal-card { animation: modalCardIn 420ms cubic-bezier(.18,.89,.32,1.28) both; }
.modal-overlay.is-closing .modal-card { animation: modalCardOut 180ms ease-in both; }
.result-star.is-earned { animation: starEarned 540ms cubic-bezier(.18,.89,.32,1.28) both; }
.level-card.is-entering { animation: levelCardIn 420ms cubic-bezier(.18,.89,.32,1.18) both; }
.toast.is-entering { animation: toastIn 320ms cubic-bezier(.18,.89,.32,1.18) both; }
.toast.is-leaving { animation: toastOut 220ms ease-in both; }
.achievement-toast.is-entering { animation: achievementIn 460ms cubic-bezier(.18,.89,.32,1.2) both; }
.achievement-toast.is-leaving { animation: achievementOut 280ms ease-in both; }
.toggle-switch.is-changing span { animation: settingTogglePop 260ms ease; }
.game-progress-fill { animation: progressGlow 2.2s ease-in-out infinite; }
