#game {
    width: 600px; /* Set to 600px as requested */
    margin: 0 auto; /* Center the game container with 0 top margin */
    padding: 0px; /* Add some padding around the game */
    box-sizing: border-box; /* Include padding in the width */
}

.settings {
    text-align: center; /* Center buttons within the settings div */
    margin-bottom: 20px; /* Add some space below the buttons */
}

.settings button {
    margin: 5px; /* Add some space between buttons */
    padding: 0px 20px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    line-height: 1.2; /* Explicit line height for consistency */
    height: 42px; /* Explicit height to ensure consistency, considering padding */
    box-sizing: border-box; /* Ensure padding is included in height */
}

.settings button:hover {
    background-color: #e0e0e0;
}

#game-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    position: relative; /* For positioning the curtain */
}

#ladder-curtain {
    position: absolute;
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for element's own size */
    background-color: #555;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
    border: 1px solid black;
}

#ladder-curtain.hidden {
    display: none;
}

.input-group {
    display: flex;
    justify-content: space-evenly; /* Changed to space-evenly */
    margin: 10px 0;
}

.input-group input {
    width: 80px;
    height: 42px;
    text-align: center;
    border: 1px solid #ccc;
    padding: 5px;
    font-size: 16px;
    font-weight: bold;
    color: black;
    background: white; /* Standard white background */
    border-radius: 3px; /* Slightly less rounded than buttons */
    box-sizing: border-box;
}

.result-label {
    width: 80px;
    height: 42px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ladder-start-button {
    margin: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    line-height: 1.2;
    height: 42px;
    box-sizing: border-box;
}

.ladder-start-button:hover {
    background-color: #e0e0e0;
}

.ladder-start-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Removed #start-buttons button specific styles as .settings button will now apply */

#ladder-canvas {
    height: 300px; /* Fixed height as set in JS */
}

@media (max-width: 768px) {
    #game {
        width: 600px; /* Keep the fixed width for the game content */
        margin: 0 auto; /* Center horizontally with 0 top margin */
        padding: 0px;
        overflow-x: auto; /* Enable horizontal scrolling */
        -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
    }

    #ladder-canvas {
        /* width: 100%; Removed to prevent stretching */
        /* height: auto; Removed to prevent height scaling */
    }

    .input-group input {
        width: 60px; /* Adjust input width for smaller screens */
        font-size: 14px;
    }

    .result-label {
        width: 60px; /* Adjust result label width for smaller screens */
        font-size: 14px;
    }
}

#playerCountContainer {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px; /* Consistent with horse game */
}