html, body {
    height: 100vh;
    padding: 0;
    margin: 0;
}

#game {
    display: flex;
    flex-wrap: wrap;
    min-height: 80%;
    max-height: 100%;
    margin: 0;
    justify-content: center; /* Center the game section horizontally */
}

#boardWrapper {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-height: 70vh;
}

#canvas {
    width: 100%;
    height: auto;
    min-width: 320px;
    max-width: 1280px;
    max-height: 70vh;
}

#board, #side-menu {
    box-sizing: border-box;
    flex-grow: 1;
    padding: 0;
    margin: 0;
}

#board {
    position: relative;
    width: 100%;
}

#side-menu {
    height: 100%;
    min-width: 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    flex-basis: 30%;
    margin: 0;
    padding: 1em;
    background-color: lightgray;
    border-radius: 5px;
    overflow-y: auto;
}

#side-menu p {
    margin: 0;
    padding: 0;
}

#move-history {
    flex-grow: 1;
    margin: 0;
    margin-top: 0.5em;
    padding: 1em;
    min-height: 2em;
    max-height: 100%;
    background-color: white;
    overflow-y: auto; /* Allow vertical scrolling */
}

#move-history li {
    list-style: none;
}

#options-menu p {
    display: inline;
}

#options-menu ul {
    margin-top: 1em;
    margin-bottom: 1em;
    padding: 0;
}

#options-menu li {
    list-style: none;
    margin-top: 0.6em;
    margin-bottom: 0.6em;
}

#options-menu input[type="text"] {
    width: 100%;
}

#options-menu input[type="number"] {
    width: 4em;
}

/* Adjust layout for smaller screens */
@media (max-width: 940px) {
    #game {
        flex-direction: column; /* Stack elements vertically */
        height: auto;
    }

    #boardWrapper, #side-menu {
        width: 100%;
        flex-basis: auto;
        max-width: 100%;
    }

    #side-menu {
        align-self: center;
    }
}

/* Adjust layout for larger screens */
@media (min-width: 941px) {
    #game {
        flex-direction: row; /* Arrange elements side by side */
        justify-content: center;
        align-items: flex-start;
    }

    #boardWrapper {
        max-width: calc(100% - 300px);
    }

    #side-menu {
        max-width: 300px;
    }
}