/* lobby.css - Lobby and Game Setup Styles */

/* Main Lobby Container */
.lobby-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Lobby Form */
.lobby-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lobby-section {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.lobby-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

/* Single Player Section */
.single-player-section {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.difficulty-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.difficulty-btn.active {
    background: #2563eb;
}

/* Hosted Games Section */
.hosted-games {
    display: grid;
    gap: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.game-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 0.75rem;
    transition: transform 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.game-item:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.05);
}

.game-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.game-host {
    color: #9ca3af;
    font-size: 0.75rem;
}

.game-details {
    margin: 0.5rem 0;
    font-size: 0.75rem;
    color: #9ca3af;
}

.game-players {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.game-player {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
}

/* Separator */
.separator {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.separator::before { left: 0; }
.separator::after { right: 0; }

.separator span {
    background: #1a1a1a;
    padding: 0 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Power-Up and Attack Selectors */
.attack-selector-group,
.power-up-selector-group {
    margin-top: 1rem;
}

.power-up-selector,
.attack-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.power-up-option,
.attack-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.power-up-option:hover,
.attack-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.power-up-option.selected,
.attack-option.selected {
    background: rgba(37, 99, 235, 0.3);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.power-up-option.selected:hover,
.attack-option.selected:hover {
    background: rgba(37, 99, 235, 0.35);
    transform: translateX(4px);
}

.power-up-icon,
.attack-icon {
    font-size: 0.875rem;
    line-height: 1;
    flex-shrink: 0;
}

.power-up-name,
.attack-name {
    font-size: 0.875rem;
    color: #fff;
    flex-grow: 1;
    font-weight: normal;
}

.power-up-count,
.attack-count {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: #2563eb;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.power-up-option.selected .power-up-count,
.attack-option.selected .attack-count {
    opacity: 1;
}

/* Clear Buttons */
.power-up-clear,
.attack-clear {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.power-up-option.selected .power-up-clear,
.attack-option.selected .attack-clear {
    display: flex;
}

.power-up-clear:hover,
.attack-clear:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.power-up-clear:active,
.attack-clear:active {
    transform: scale(0.95);
}

/* Input Fields and Form Elements */
.player-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.player-input:focus {
    outline: none;
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.1);
}

.player-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* Section Header with Button */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Light Theme Adjustments */
.theme-light .power-up-option,
.theme-light .attack-option {
    background: rgba(0, 0, 0, 0.1);
}

.theme-light .power-up-name,
.theme-light .attack-name {
    color: #1f2937;
}

.theme-light .power-up-option.selected,
.theme-light .attack-option.selected {
    background: rgba(37, 99, 235, 0.2);
}

/* Dialog Buttons */
.dialog-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .difficulty-toggles {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 0.25rem;
        width: 100%;
    }

    .difficulty-btn {
        flex: 1;
        padding: 0.4rem;
        font-size: 0.675rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .power-up-selector,
    .attack-selector {
        grid-template-columns: 1fr;
    }

    .power-up-option,
    .attack-option {
        padding: 0.5rem;
    }
}

@media (max-width: 360px) {
    .difficulty-toggles {
        gap: 0.15rem;
    }

    .difficulty-btn {
        padding: 0.3rem;
        font-size: 0.625rem;
    }
}