/* TickelPickel - Animations */

/* Shake animation for violations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.cell.violation {
    animation: shake 0.4s ease-in-out;
}

/* Pulse animation for hints */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: inset 0 0 0 3px #fbbf24, 0 0 15px rgba(251, 191, 36, 0.6);
    }
    50% {
        opacity: 0.8;
        box-shadow: inset 0 0 0 4px #fbbf24, 0 0 25px rgba(251, 191, 36, 0.8);
    }
}

.cell.hinted {
    animation: pulse 1s ease-in-out infinite;
}

/* Pickle placement celebration */
@keyframes placePickle {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.cell.pickle .cell-content {
    animation: placePickle 0.3s ease-out;
}

/* Win celebration */
@keyframes celebrate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.game-grid.won .cell.pickle {
    animation: celebrate 0.5s ease-in-out 3;
}

/* X mark fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.cell.marked .cell-content {
    animation: fadeIn 0.15s ease-out;
}

/* Button press effect */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.control-btn:active,
.diff-btn:active,
.modal-btn:active {
    animation: buttonPress 0.15s ease-out;
}

/* Progress bar fill animation */
@keyframes progressFill {
    from { width: 0; }
}

.progress-fill {
    animation: progressFill 1s ease-out;
}

/* Confetti explosion for win */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-500px) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    animation: confetti 3s ease-out forwards;
}

/* Grid appearance animation */
@keyframes gridAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-grid {
    animation: gridAppear 0.4s ease-out;
}

/* Cell appear stagger effect */
@keyframes cellAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-grid .cell {
    animation: cellAppear 0.3s ease-out backwards;
}

/* Stagger delay classes (applied via JS) */
.cell[data-delay="1"] { animation-delay: 0.02s; }
.cell[data-delay="2"] { animation-delay: 0.04s; }
.cell[data-delay="3"] { animation-delay: 0.06s; }
.cell[data-delay="4"] { animation-delay: 0.08s; }
.cell[data-delay="5"] { animation-delay: 0.10s; }
.cell[data-delay="6"] { animation-delay: 0.12s; }
.cell[data-delay="7"] { animation-delay: 0.14s; }
.cell[data-delay="8"] { animation-delay: 0.16s; }

/* Rank up animation */
@keyframes rankUp {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); filter: brightness(1.5); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.player-rank.rank-up .rank-icon {
    animation: rankUp 0.6s ease-out;
}
