* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    /*min-height: 100vh;*/
    /*display: flex;*/
    /*justify-content: center;*/
    /*align-items: center;*/
    /*padding: 20px;*/
}

.game-container {
    background: white;
    /*border-radius: 20px;*/
    /*box-shadow: 0 10px 30px rgba(0,0,0,0.2);*/
    /*padding: 20px;*/
    max-width: 500px;
    /*width: 100%;*/
    /*margin: 0 auto;*/
    text-align: right;
}

.score-display {
    /*margin-bottom: 20px;*/
    padding: 15px;
    /*background: #f8f9fa;*/
    /*border-radius: 12px;*/
    display: inline-block;
    min-width: 150px;
    width: 100%;
}

.score-label {
    /*font-size: 1.2rem;*/
    /*font-weight: bold;*/
    color: #666;
    margin-right: 5px;
}

.score-value {
    /*font-size: 1.5rem;*/
    font-weight: bold;
    /*color: #ff6b6b;*/
}

.board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin: 0 auto;
    max-width: 100%;
    aspect-ratio: 1/1;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.candy {
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.4s ease;
    position: relative;
    overflow: hidden;
    background-color: transparent;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.candy:hover {
    transform: scale(1.05);
    /*border: 2px solid #ccc;*/
}

.selected {
    box-shadow: inset 0 0 0 2px #ec4899;
    /*transform: scale(1.15) !important;*/
    /*box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);*/
    z-index: 10;
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    60% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.popping {
    animation: pop 0.65s ease-out forwards;
}

/* Updated animations in style.css — replace the existing specialExplode and add new sucking keyframe */

@keyframes sucking {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    }
    100% {
        transform: scale(0.1) translate(0, 0); /* Scale down to nothing at center */
        opacity: 0;
        box-shadow: 0 0 30px rgba(255, 255, 255, 1);
    }
}

.sucking {
    animation: sucking 2s ease-in forwards;
    z-index: 15; /* Above everything while pulling */
}

@keyframes specialPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.9);
    }
}

.special-waiting {
    animation: specialPulse 1.2s ease-in-out infinite;
}

@keyframes specialExplode {
    0% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
    40% {
        transform: scale(4);
        opacity: 1;
        box-shadow: 0 0 80px rgba(255, 255, 255, 1);
    }
    100% {
        transform: scale(0);
        opacity: 0;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
}

.special-explode {
    animation: specialExplode 1s ease-out forwards;
}

@keyframes explosionPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.8); /* Red glow for bomb feel */
    }
    50% {
        transform: scale(1.3); /* Bigger enlarge than 4-match */
        box-shadow: 0 0 60px rgba(255, 0, 0, 1);
    }
}

.explosion-waiting {
    animation: explosionPulse 1s ease-in-out infinite; /* ← Change 0.8s for faster/slower pulse cycle */
}

.instructions {
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

/* Desktop */
@media (min-width: 769px) {
    .board {
        gap: 10px;
    }

    .score-display {
        padding: 20px;
    }

    .candy {
        border-radius: 12px;
    }

    .candy:hover {
        transform: scale(1.08);
    }
}

@media (max-width: 768px) {

    .board {
        gap: 3px;
    }
    
    .score-display {
        padding: 12px;
    }
    
}

@media (max-width: 480px) {
    
    .board {
        gap: 2px;
    }
    
    .instructions {
        font-size: 0.8rem;
        padding: 0 10px;
    }
}