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

body {
    font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
    background: #181a20;
    min-height: 100vh;
    color: #f5f6fa;
}

.memory-game {
    min-height: 100vh;
    padding: 20px;
    background: #181a20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f5f6fa;
}

.game-header h1 span {
    color: #ffb347;
}

.game-header p {
    font-size: 1.1rem;
    color: #b2becd;
}

.game-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    background: #23263a;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #353866;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #b2becd;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffb347;
}

.game-controls {
    margin-bottom: 30px;
}

.restart-btn {
    background: #ffb347;
    color: #23263a;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.restart-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.card {
    width: 80px;
    height: 80px;
    background: #23263a;
    border: 2px solid #353866;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.3);
}

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

.card.matched {
    background: #353866;
    border-color: #ffb347;
    animation: matchPulse 0.8s ease;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    border-radius: 10px;
    backface-visibility: hidden;
}

.card-front {
    background: #23263a;
    color: #ffb347;
    transform: rotateY(0deg);
}

.card-back {
    background: #ffb347;
    color: #23263a;
    transform: rotateY(180deg);
    font-size: 2rem;
}

.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.victory-content {
    background: #23263a;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #ffb347;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 90%;
}

.victory-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #ffb347;
}

.victory-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #f5f6fa;
}

.victory-stats {
    margin-bottom: 30px;
}

.victory-stats p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #b2becd;
}

.play-again-btn {
    background: #ffb347;
    color: #23263a;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.play-again-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 179, 71, 0.4);
}
#btn-Return {
    background-color: #23263a;
    color: #ffb347;
    font-size: 1.5rem;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(102, 82, 53, 0.45), 0 2px 8px rgba(0,0,0,0.18);
    border: none;
    cursor: pointer;
    margin-top: 24px;
    margin-left: auto;
    margin-right: auto;
}
#btn-Return:hover {
    color: #fff;
}

/* Ensure scrollbars work properly */
::-webkit-scrollbar {
    width: 10px;
}
    
::-webkit-scrollbar-track {
    background: #181a20;
}
    
::-webkit-scrollbar-thumb {
    background: #ffb347;
    border-radius: 4px;
}
    
::-webkit-scrollbar-thumb:hover {
    background: #ff8c42;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes matchPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsiveness */
@media (max-width: 600px) {
    .cards-grid {
        max-width: 300px;
        gap: 10px;
    }
    
    .card {
        width: 60px;
        height: 60px;
    }
    
    .card-front,
    .card-back {
        font-size: 1.2rem;
    }
    
    .card-back {
        font-size: 1.5rem;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat {
        padding: 10px 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .victory-content {
        padding: 30px 20px;
    }
    
    .return-section {
        margin-top: 15px;
    }
    
    .return-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* Return button section */
.return-section {
    margin-top: 40px;
    text-align: center;
}

.return-btn {
    background: transparent;
    color: #b2becd;
    border: 2px solid #353866;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.return-btn:hover {
    background: #353866;
    color: #ffb347;
    border-color: #ffb347;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(53, 56, 102, 0.4);
}