@keyframes flame-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(1.15) rotate(-2deg); }
}

.flame-animate {
    animation: flame-flicker 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse-ring {
    0% { stroke-dashoffset: var(--ring-offset, 100); }
    100% { stroke-dashoffset: var(--ring-target, 0); }
}

.progress-ring-animate {
    animation: pulse-ring 1.2s ease-out forwards;
}

@keyframes tree-grow {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.tree-grow-animate {
    animation: tree-grow 0.8s ease-out forwards;
}

@keyframes badge-unlock {
    0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.badge-unlock-animate {
    animation: badge-unlock 0.6s ease-out forwards;
}

@keyframes rank-up {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.rank-up-animate {
    animation: rank-up 0.4s ease-out forwards;
}

@keyframes urgency-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.urgency-pulse {
    animation: urgency-pulse 2s ease-in-out infinite;
}

@keyframes counter-tick {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.counter-tick {
    animation: counter-tick 0.3s ease-out;
}

@keyframes ghost-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.ghost-avatar {
    animation: ghost-fade 3s ease-in-out infinite;
}

.badge-locked {
    filter: grayscale(100%);
    opacity: 0.4;
}

@keyframes slide-up-modal {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal-slide-up {
    animation: slide-up-modal 0.3s ease-out forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100px) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    animation: confetti-fall 2s ease-out forwards;
    position: absolute;
}

.stat-tile {
    transition: transform 0.2s ease;
}

.stat-tile:hover {
    transform: translateY(-2px);
}

.share-export-canvas {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

@keyframes growth-pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 20px 8px rgba(16, 185, 129, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ms-growth-prompt {
    animation: slide-up-modal 0.35s ease-out forwards, growth-pulse-glow 2s ease-in-out 0.4s;
}

.ms-tree-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.leaderboard-toggle-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
