body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #d4edda;
    min-height: 100vh;
}

header {
    background: #4CAF50;
    color: white;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
}

main {
    width: 90%;
    max-width: 800px;
    flex: 1;
}

.game-info {
    margin: 1rem 0;
    text-align: center;
}

.controls {
    margin-bottom: 1rem;
    text-align: center;
}

button {
    padding: 0.6rem 1.2rem;
    margin: 0.3rem;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

.game-board {
    display: grid;
    gap: 10px;
    margin: 0 auto 2rem;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

.card {
    background: #ccc;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.5s, background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.disabled {
    pointer-events: none;
    opacity: 0.6;

}

#sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: gold;
    border-radius: 50%;
    opacity: 0.8;
    animation: sparkle-animation 1s linear forwards;
}

@keyframes sparkle-animation {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}


footer {
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    position: relative;
    bottom: 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .card {
        height: 60px;
        font-size: 1.2rem;
    }

    button {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .card {
        height: 70px;
        font-size: 1.4rem;
    }
}

@media (min-width: 901px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
    }

    .card {
        height: 100px;
        font-size: 1.6rem;
    }
}