/* Gamification & Visual Effects */

/* Combo Counter */
.combo-container {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 20;
    text-align: center;
}

.combo-text {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(to right, #ffb347, #ffcc33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    opacity: 0;
    transition: opacity 0.2s;
}

.combo-text.active {
    opacity: 1;
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-count {
    font-size: 4rem;
    font-weight: 900;
    color: #ffcc33;
    text-shadow: 2px 2px 0px #d97706, 4px 4px 0px rgba(0, 0, 0, 0.1);
    display: block;
    line-height: 1;
}

/* Jackpot Mode */
.jackpot-active #app {
    animation: rainbowBorder 2s linear infinite;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.jackpot-active .grid-cell.active {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    box-shadow: 0 0 20px #FFD700;
}

@keyframes rainbowBorder {
    0% {
        border-color: #ff0000;
    }

    20% {
        border-color: #ffff00;
    }

    40% {
        border-color: #00ff00;
    }

    60% {
        border-color: #00ffff;
    }

    80% {
        border-color: #0000ff;
    }

    100% {
        border-color: #ff00ff;
    }
}

/* Particles */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 1s forwards ease-out;
}

@keyframes particleFade {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes pop {
    0% {
        transform: scale(0.5);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake-screen {
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

/* Jackpot Text Overlay */
.jackpot-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    color: gold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
}

.jackpot-overlay.show {
    animation: jackpotEntrance 1s forwards;
}

@keyframes jackpotEntrance {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) scale(0.9) rotate(-3deg);
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0);
        opacity: 0;
        animation-delay: 2s;
    }

    /* Fade out logic handled by JS or separate animation */
}