/* Listas */
#room-list-container {
    width: 100%;
    max-width: 500px;
    height: 300px;
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid #4488ff;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
.room-item {
    padding: 15px;
    border-bottom: 1px solid rgba(68,136,255,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    cursor: pointer;
    color: #ddd;
}
.room-item:hover { background: rgba(68, 136, 255, 0.2); color: #fff; }
.room-item:last-child { border-bottom: none; }

/* Lobby */
#lobby-ui { display: none; } 
.player-list { width: 100%; max-width: 500px; margin-bottom: 20px; }
.player-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(10, 30, 60, 0.5); backdrop-filter: blur(3px); border: 1px solid rgba(68,136,255,0.3); padding: 10px 15px; margin: 5px 0; border-radius: 4px;
}
.color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; box-shadow: 0 0 5px rgba(255,255,255,0.5); }

/* Configurações do Lobby (Responsivas Auto-fit) */
.lobby-settings {
    display: grid;
    /* Adaptação inteligente para celular (1 coluna) e desktop (2 colunas) */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #4488ff;
    box-sizing: border-box;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.lobby-settings .input-group {
    width: 100%;
    margin: 0; /* Remove margem base para usar o gap da grid */
}

/* Campos que devem ocupar a linha toda quando necessário */
.full-width {
    grid-column: 1 / -1;
}

#host-controls {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
}

#host-controls .btn {
    margin: 5px 0;
    width: 100%;
    max-width: 300px;
}

/* Expansível de Configurações */
.settings-toggle-btn {
    background: rgba(10, 30, 60, 0.6);
    backdrop-filter: blur(3px);
    border: 1px solid #4488ff;
    color: #88bbff;
    width: 100%;
    max-width: 500px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    box-sizing: border-box;
    text-transform: uppercase; letter-spacing: 1px; font-size: 0.9em;
}
.settings-toggle-btn:hover { background: rgba(68, 136, 255, 0.3); color: #fff; }
.settings-toggle-btn::after { content: '▼'; font-size: 0.8em; transition: 0.3s; }
.settings-toggle-btn.expanded::after { transform: rotate(180deg); }

#color-selection-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    display: none; justify-content: center; align-items: center; z-index: 1000;
}
#color-options {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    background: rgba(10, 30, 60, 0.9); padding: 30px; border-radius: 8px; border: 1px solid #4488ff;
}

#lobby-settings-content {
    display: none;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}
#lobby-settings-content.expanded { display: block; }
