body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    max-width: 90vmin; /* Constrain max width to 90% of the viewport's smaller dimension */
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* Remove spaces between grid items */
    width: 100%;
    max-height: 90vmin; /* Ensure grid height fits within the viewport */
    margin-bottom: 10px; /* Adjust margin as needed */
}

.grid-box {
    background-color: lightgray;
    flex: 1 0 auto;
    width: calc(100% / var(--cols) - 0px); /* Adjust for no gap */
    height: calc(100% / var(--rows) - 0px); /* Adjust for no gap */
    box-sizing: border-box;
    border: 2px solid black;
    aspect-ratio: 1 / 1; /* Ensure each grid box is square */
}

.button-div {
    text-align: center;
    margin-top: 10px; /* Space between grid and button */
}
