body {
    background-color: #0d0d0d;
    color: #e0e0e0;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    gap: 0;
    min-height: calc(100vh - 20px);
}

.nav-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    width: 100%;
    max-width: 800px;
    flex-wrap: wrap;
}

.nav-bar .button {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
}

.nav-bar .button:hover,
.nav-bar .button:focus {
    background-color: rgba(138, 43, 226, 0.7);
}

.nav-bar .button:nth-child(2) {
    background-color: rgba(0, 128, 0, 0.7);
}

.nav-bar .button:nth-child(2):hover,
.nav-bar .button:nth-child(2):focus {
    background-color: rgba(0, 255, 0, 0.7);
}

.game-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 10px 0;
    display: block;
}

#gameCanvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 800 / 800;
    border: 2px solid #e0e0e0;
    background-color: #0a3d62;
    margin: 0;
}

#name-entry-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 10px 0;
}

#name-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    padding: 0 10px;
    box-sizing: border-box;
}

#playerNameInput {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #e0e0e0;
    padding: 10px;
    width: 100%;
    max-width: 300px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

#startGameButton {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 26px;
    width: 100%;
    max-width: 300px;
}

#startGameButton:hover,
#startGameButton:focus {
    background-color: rgba(138, 43, 226, 0.7);
}

#controls {
    margin-top: 10px;
    text-align: center;
    width: 100%;
    max-width: 800px;
    position: relative;
}

#game-info {
    margin: 10px auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

#player-info,
#moves,
#time {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #e0e0e0;
    text-align: center;
    margin: 5px 0;
}

#game-controls {
    margin: 10px auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.game-button {
    background-color: rgba(106, 13, 173, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    min-height: 48px;
    transition: background-color 0.2s;
}

.game-button:hover,
.game-button:focus {
    background-color: rgba(138, 43, 226, 0.7);
}

.game-button#newGameButton {
    background-color: rgba(0, 128, 0, 0.7);
}

.game-button#newGameButton:hover,
.game-button#newGameButton:focus {
    background-color: rgba(0, 255, 0, 0.7);
}

.game-button#undoButton {
    background-color: rgba(255, 0, 0, 0.7);
}

.game-button#undoButton:hover,
.game-button#undoButton:focus {
    background-color: rgba(255, 99, 71, 0.7);
}

#outcome-pane {
    margin: 10px auto;
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #e0e0e0;
    display: none;
}

#outcome-pane.win {
    background: rgba(0, 128, 0, 0.2);
}

#auto-complete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 20;
}

#auto-complete-content {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-sizing: border-box;
}

#auto-complete-content p {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    color: #e0e0e0;
    margin: 0 0 20px 0;
}

.auto-complete-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.game-button#auto-complete-yes {
    background-color: rgba(0, 128, 0, 0.7);
}

.game-button#auto-complete-yes:hover,
.game-button#auto-complete-yes:focus {
    background-color: rgba(0, 255, 0, 0.7);
}

.game-button#auto-complete-no {
    background-color: rgba(255, 0, 0, 0.7);
}

.game-button#auto-complete-no:hover,
.game-button#auto-complete-no:focus {
    background-color: rgba(255, 99, 71, 0.7);
}

#mute-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

#mute-toggle:hover,
#mute-toggle:focus {
    background: rgba(0, 255, 0, 0.7);
}

@media (max-width: 600px) {
    #gameCanvas {
        width: 100%;
        max-width: 100vw;
        height: auto;
        max-height: 100vh;
        aspect-ratio: 800 / 800;
    }

    .nav-bar {
        flex-direction: nowrap;
        gap: 5px;
        padding: 6px 10px;
        margin: 5px 0;
    }

    .nav-bar .button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .game-image {
        max-width: 100%;
    }

    #game-info,
    #game-controls,
    #outcome-pane {
    margin: 5px auto;
    padding: 15px;
    width: auto;
    max-width: 100%;
    }

    #auto-complete-content {
        max-width: 200px;
        padding: 15px;
    }

    #auto-complete-content p {
        font-size: 16px;
        margin-bottom: 15px;

    }

    .auto-complete-buttons {
    gap: 5px;
    }

    #player-info,
    #moves,
    #time {
        font-size: 20px;
        margin: 5px auto;
    }

    .game-button {
        padding: 12px 24px;
        font-size: 18px;
        min-height: 66px;
        min-width: 150px;
    }

    #outcome-pane {
        font-size: 24px;
    }

    #mute-toggle {
        top: 5px;
        left: 5px;
        font-size: 20px;
        padding: 3px;
    }

    #controls {
        font-size: 14px;
        padding: 0 10px;
    }

    #playerNameInput {
        width: calc(100% - 20px);
        max-width: 100%;
        font-size: 16px;
        padding: 10px;
    }

    #startGameButton {
        padding: 12px 24px;
        font-size: 18px;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #player-info,
    #moves,
    #time {
        font-size: 18px;
    }

    .game-button {
        padding: 9px 18px;
        font-size: 16px;
        min-height: 60px;
    }

    #playerNameInput {
        font-size: 14px;
    }

    #startGameButton {
        font-size: 16px;
        padding: 10px 20px;
    }

    #outcome-pane {
        font-size: 18px;
    }

    #auto-complete-content {
        max-width: 180px;
        padding: 10px;
    }

    #auto-complete-content p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .game-button#auto-complete-yes,
    .game-button#auto-complete-no {
        padding: 8px 16px;
        font-size: 14px;
        min-height: 40px;
    }
}