/* General Styles */
* {
    box-sizing: border-box; /* Added to ensure consistent box model */
}

/* Ghost Leg Game Specific Styles */

.setup-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#participant-selector {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    min-width: 100px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='292.4' height='292.4'%3E%3Cpath fill='%23000000' d='M287 69.4a17.6 17.6 0 0 0-13-5.4H18.4c-6.5 0-12.3 3.7-15.9 9.4-3.6 5.7-3.6 13.1 0 18.8l128 128c3.7 5.7 9.4 9.4 15.9 9.4s12.2-3.7 15.9-9.4l128-128c3.6-5.6 3.6-13 0-18.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 35px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

#participant-selector:hover,
#participant-selector:focus {
    border-color: #007bff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    outline: none;
}



#game-area {
    margin: 30px 0;
}

#game-container-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-area {
    display: grid;
    padding: 10px 0;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    margin: 5px 0;
}

.start-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: #e0e0e0;
    color: white;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

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

#ladder-canvas {
    background-color: #f0f2f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 250px; /* Fixed height from ghostLeg.js LADDER_HEIGHT */
}

/* Controls */
/* Controls */
.button-group {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.gray-button {
    background-color: #cccccc !important;
}

.gray-button:hover {
    background-color: #aaaaaa !important;
}

.result-display {
    font-weight: bold;
    animation: highlight 0.8s ease-in-out forwards;
}

@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    h2 {
        font-size: 2em;
    }

    .setup-controls {
        flex-wrap: nowrap; /* 줄바꿈 방지 */
        justify-content: center; /* 중앙 정렬 */
        gap: 10px; /* 요소들 사이의 간격 */
    }

    .setup-controls label,
    .setup-controls select,
    .setup-controls button {
        flex-shrink: 0; /* 요소가 줄어들지 않도록 */
    }

    .input-wrapper input[type="text"] {
        width: 60px;
        font-size: 12px;
    }

    .start-button {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .controls button {
        padding: 10px 20px;
        font-size: 14px;
    }

    #ladder-canvas {
        height: auto;
    }
}

@media (max-width: 600px) {
    .setup-controls {
        flex-wrap: wrap;
    }

    .setup-controls label,
    .setup-controls select,
    .setup-controls button {
        flex-basis: 100%;
        text-align: center;
    }

    .input-wrapper input[type="text"] {
        width: 100%;
    }

    .start-button {
        width: 30px;
        height: 30px;
    }

    .button-group button {
        width: 100%;
        margin: 5px 0;
    }
}