#stadium {
    list-style: none;
    padding: 0;
    margin: 50px auto 0 auto; /* Center horizontally */
    width: 600px; /* Take full width of parent */
}

.race {
    position: relative;
    width: 600px;
    height: 80px;
    border-bottom: 3px solid #999;
    background: white;
    overflow: hidden;
}

.horse-wrapper {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.horse {
    height: 60px;
    display: block;
}

.horse-number {
    position: absolute;
    left: 53%;
    top: 40%;
    transform: translate(-50%, -50%);
    width: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: black;
    background: transparent;
    border: none;
    outline: none;
}

/* 출발선 / 도착선 */
.start-line {
    position: absolute;
    left: 120px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: red;
}

.finish-line {
    position: absolute;
    right: 119px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: blue;
}

#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;
}


#horseCountContainer {
    text-align: center;
    margin-bottom: 20px; /* Add some space below the horse count */
}

@media (max-width: 768px) {
    .horse-game-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
    }

    /* Ensure the game itself maintains its intended width within the scrollable wrapper */
    #game {
        width: 600px; /* Keep the fixed width for the game content */
        margin: 0 auto; /* Center horizontally with 0 top margin */
        padding: 0px;
    }

    .race {
        width: 600px; /* Ensure race tracks also maintain their fixed width */
    }
}

