/* General Styles */
body {
    background: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    text-align: center;
    background: #1e1e1e;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
}

h1 {
    margin-bottom: 30px;
    color: #ffffff;
    font-size: 3em;
    font-weight: bold;
}

/* Stats */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 1.2em;
    justify-content: center;
    color: #e0e0e0;
}

/* Board */
.board {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-template-rows: repeat(4, 100px);
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

/* Cards */
.card {
    background: #1e1e1e;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    transition: transform 0.3s;
    transform-style: preserve-3d;
    position: relative;
    width: 100px;
    height: 100px;
}

.card:hover {
    transform: scale(1.05);
}

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.card-front {
    background: #2a2a2a;
}

.card-back {
    background: #6366f1;
    transform: rotateY(180deg);
}

/* Reset Button */
.reset-btn {
    padding: 12px 25px;
    font-size: 16px;
    background: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin: 10px 5px;
    width: auto;
}

.reset-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

.reset-btn:active {
    transform: translateY(0);
}

/* Back Button */
.back-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background: #666;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s, transform 0.2s;
}

.back-btn:hover {
    background: #777;
    transform: translateY(-2px);
    text-decoration: none;
    color: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        width: 95%;
    }
    
    .board {
        grid-template-columns: repeat(4, 70px);
        grid-template-rows: repeat(4, 70px);
        gap: 8px;
    }
    
    .card {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }
    
    .card-front,
    .card-back {
        width: 70px;
        height: 70px;
    }
    
    .stats {
        font-size: 1em;
        gap: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
}