body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: #0f212e;
    color: white;
    flex-direction: column;
}

.game-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    max-width: 100%; /* Ensure the game container fits the screen width */
}

/* Image at the top */
.top-image {
    width: 100%; /* Full width relative to the game container */
    max-width: 350px; /* Match the width of the grid */
    margin-bottom: 20px; /* Add some space below the image */
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(5, 60px);
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    padding-top: 0; /* Removed padding-top since we added the image */
}

.grid div {
    width: 60px;
    height: 60px;
    background-color: #2f4553;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

.grid div img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.right-control button {
    background-color: #00e701;
    color: black;
    padding: 20px 80px;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
    width: 100%; /* Full width for the button */
    max-width: 350px; /* Adjusts the button width to match 5 boxes */
    font-family: "Kanit", serif;
    font-weight: 400;
    font-style: normal;
}

.right-control button:hover {
    background-color: #00d600;
}

#status {
    margin-top: 20px;
    font-size: 18px;
    text-align: center;
}

/* Pop-up Animation for Diamonds */
@keyframes pop-up {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

.grid div img {
    animation: pop-up 0.5s ease-in-out;
}

/* Responsive Design for Mobile */
@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(5, 50px);
        grid-template-rows: repeat(5, 50px);
        gap: 8px;
    }

    .grid div {
        width: 50px;
        height: 50px;
    }

    .right-control button {
        padding: 15px 60px;
        font-size: 20px;
    }

    .game-container {
        padding: 10px;
    }

    body {
        justify-content: flex-start; /* Fixes centering issues on small mobile devices */
    }

    /* Make image responsive */
    .top-image {
        max-width: 100%;
        width: auto;
        padding-top: 50px;
    }
}

/* Updated Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid rgb(0, 0, 0);
    border-radius: 10px;
    margin-top: 20px;
}
th, td {
    border: 1px solid rgb(0, 0, 0);
    padding: 10px;
    text-align: center;
}
th {
    background-color: #00e701; /* Same background as button */
    color: black;
}
td {
    background-color: #000;
    color: #00e701; /* Same green color as button text */
}

/* Pop-down Animation for Diamonds */
/* Button Pop-Down and Pop-Up Animations */
@keyframes button-pop-down {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.95);
    }
}

@keyframes button-pop-up {
    0% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.button-pop-down {
    animation: button-pop-down 0.1s forwards;
}

.button-pop-up {
    animation: button-pop-up 0.1s forwards;
}

/* Pop-down Animation for Diamonds */
@keyframes pop-down {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.pop-down {
    animation: pop-down 0.5s ease;
}
