* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-header h1{
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px  rgba(0, 0, 0,0.3);
}


.game-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 1.2rem;

}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);

}


.game-board {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
    max-width: 600px;
    margin-bottom: 30px;
}

.memory-card {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
    perspective: 1000px;

}

.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    border-radius: 15px;

}

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


.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    box-shadow: 0 8px 16px   rgba(0, 0, 0,0.2);
}


.card-front {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0,0.3);
}



.card-back {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    color: white;
    transform: rotateY(180deg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0,0.3);

}


.memory-card.matched {
    opacity: 0.6;
    transform: scale(0.9);

}


.controls {
    display: flex;
    gap: 15px;

}



.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0,0.3);
}






.btn-reset {
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
}


.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0,0.3);


}

.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow:  0 20px 40px rgba(0, 0, 0,0.3);
    transition: all 0.5s ease;
    z-index: 1000;
}

.win-message.show {
    transform: translate(-50%, -50%) scale(1);

}



.win-message h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2rem;
    
}



.win-message p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 20px;

}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;

}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width:768px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .memory-card {
        width: 90px;
        height: 90px;

    }
    .card-front, .card-back {
        font-size: 2rem;

    }
    .game-header h1 {
        font-size: 2rem;
    }
    .game-stats {
        flex-direction: column;
        gap:10px;
    }

}




























































































