/* Body and Container Styling */
body {
    font-family: 'Arial', sans-serif;
    background-color: #ecf0f1;
    display: flex;
    justify-content: center;
    height: 100vh;
    text-align: center;
    overflow: hidden;
}

/* Adjust anchor positioning */
a {
    text-decoration: none;
    border: none;
    height: 30px;
    width: 30px;
    font-size: 18px;
    margin-top: 20px;
    position: absolute; /* Positioning relative to the container */
    left: 10rem; /* Align it to the very left */
}

a:hover {
    color: #232425; /* Darker blue on hover */
}

/* Ensure the container has relative positioning */
.container {
    position: relative; /* So the link stays inside */
    align-self: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
}

/* Game Board Styling */
.game-board {
    display: grid;
    grid-template-columns: repeat(5, 120px);
    gap: 20px;
    margin-bottom: 20px;
}

/* Card Styling */
.card {
    width: 100px;
    height: 100px;
    background-color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    color: white;
    border-radius: 15px; /* Rounded borders */
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.card .card-front,
.card .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hide back when flipped */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
}

.card .card-front {
    background-color: #3498db;
    color: white;
}

.card .card-back {
    background-color: #2ecc71;
    color: black;
    transform: rotateY(180deg); /* Rotate the back side */
}

/* Flip the card when clicked */
.card.flipped {
    transform: rotateY(180deg); /* Flip card */
}

/* Animations for Flipping */
.card.flipped {
    animation: flip-card 0.5s forwards;
}

@keyframes flip-card {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
#next-button{
    margin-left: auto;
    margin-right: auto;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
}

button:hover {
    background-color: #2980b9;
}
