/* Solo2 Component: El Duende (Connection Lobby) */
/* Immersive waiting experience with radar, messages, and transitions */

.lobby-fullscreen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
    background: var(--color-bg);
    z-index: 100;
    transition: opacity 0.4s ease-out, visibility 0.4s;
}

.lobby-fullscreen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Fondo con gradiente que "respira" */
.lobby-fullscreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.15) 0%,
        rgba(99, 102, 241, 0.05) 50%,
        transparent 70%
    );
    animation: lobby-breathe 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lobby-breathe {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Radar — círculo protagonista con pulso */
.lobby-radar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-jumbo);
    position: relative;
    z-index: 1;
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 0 20px var(--color-primary));
    animation: duendeFloat 3s ease-in-out infinite;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes duendeFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

/* Radar pulse animations */
@keyframes radar-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.radar-pulse {
    animation: radar-pulse 2s ease-out infinite;
}

@keyframes radar-pulse-enhanced {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7),
                    0 0 40px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 0 25px rgba(99, 102, 241, 0),
                    0 0 60px rgba(99, 102, 241, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0),
                    0 0 40px rgba(99, 102, 241, 0.3);
    }
}

/* Estado conectado — transformación satisfactoria */
.lobby-radar.connected {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    animation: connected-celebrate 0.6s ease-out forwards;
}

@keyframes connected-celebrate {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Mensajes del Duende */
.lobby-message {
    text-align: center;
    max-width: 280px;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.lobby-message-main {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-sm);
}

.lobby-message-sub {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.4;
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transición al ocultar el lobby */
.lobby-exit {
    animation: lobby-fade-out 0.4s ease-out forwards;
}

@keyframes lobby-fade-out {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Estado de éxito: Destello */
.lobby-fullscreen.success::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    animation: successFlash 0.5s ease-out;
}

@keyframes successFlash {
    0% { opacity: 0.5; }
    100% { opacity: 0; }
}
