/* Game Over Popup Styling */
.game-over-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-in-out;
}

.game-over-content {
    background-color: rgba(20, 10, 30, 0.95);
    border: 2px solid #eedbf1;
    border-radius: 15px;
    padding: 30px 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(238, 219, 241, 0.3);
    backdrop-filter: blur(5px);
    animation: scaleIn 0.4s ease-out;
}

.victory-header {
    color: #6eff9e;
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(110, 255, 158, 0.6);
}

.defeat-header {
    color: #ff6e6e;
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 110, 110, 0.6);
}

/* Warning (e.g., opponent disconnected) */
.warning-header {
    color: #ffd966;
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 217, 102, 0.6);
}

.game-over-content p {
    color: #eedbf1;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.return-lobby-btn {
    background-color: rgba(30, 10, 40, 0.8);
    color: #eedbf1;
    border: 2px solid #eedbf1;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.return-lobby-btn:hover {
    background-color: rgba(50, 20, 60, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.return-lobby-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Animation for victory/defeat/warning text */
.victory-header {
    animation: pulseGreen 2s infinite;
}

.defeat-header {
    animation: pulseRed 2s infinite;
}

.warning-header {
    animation: pulseYellow 2s infinite;
}

@keyframes pulseGreen {
    0% { text-shadow: 0 0 10px rgba(110, 255, 158, 0.6); }
    50% { text-shadow: 0 0 20px rgba(110, 255, 158, 0.9); }
    100% { text-shadow: 0 0 10px rgba(110, 255, 158, 0.6); }
}

@keyframes pulseYellow {
    0% { text-shadow: 0 0 10px rgba(255, 217, 102, 0.6); }
    50% { text-shadow: 0 0 20px rgba(255, 217, 102, 0.9); }
    100% { text-shadow: 0 0 10px rgba(255, 217, 102, 0.6); }
}

@keyframes pulseRed {
    0% { text-shadow: 0 0 10px rgba(255, 110, 110, 0.6); }
    50% { text-shadow: 0 0 20px rgba(255, 110, 110, 0.9); }
    100% { text-shadow: 0 0 10px rgba(255, 110, 110, 0.6); }
}
