/* public/css/lobby.css - Styled for Quest Campaign Lobby elements */

/* Solid UI transition backdrop hiding 3D ground plane canvas during UI cross-fades */
#uiTransitionBackdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #1c1512 !important;
    background-image: radial-gradient(circle at center, #3a2f2b 20%, #110d0c 100%) !important;
    z-index: 55000 !important;
    pointer-events: none !important;
    display: none;
}

#multiplayerScreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 60000 !important;
    background: #110d0c url('/webp/box.webp') no-repeat center center fixed !important;
    background-size: cover !important;
    display: none; /* toggled dynamically */
    overflow-y: auto;
}

/* Fireplace Embers drifting upward */
#lobbyParticles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.ember {
    position: absolute;
    bottom: -20px;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ff9d00 0%, rgba(216, 67, 21, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px #ff6a00, 0 0 20px #ff3c00;
    opacity: 0;
    animation: drift 8s infinite linear;
}

.ember:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; width: 6px; height: 6px; }
.ember:nth-child(2) { left: 22%; animation-delay: 1.5s; animation-duration: 8s; width: 3px; height: 3px; }
.ember:nth-child(3) { left: 38%; animation-delay: 0.5s; animation-duration: 7s; width: 5px; height: 5px; }
.ember:nth-child(4) { left: 52%; animation-delay: 3s; animation-duration: 9s; width: 4px; height: 4px; }
.ember:nth-child(5) { left: 68%; animation-delay: 2s; animation-duration: 5s; width: 6px; height: 6px; }
.ember:nth-child(6) { left: 82%; animation-delay: 4s; animation-duration: 7.5s; width: 3px; height: 3px; }
.ember:nth-child(7) { left: 15%; animation-delay: 3.5s; animation-duration: 7s; width: 4px; height: 4px; }
.ember:nth-child(8) { left: 45%; animation-delay: 2.5s; animation-duration: 8.5s; width: 5px; height: 5px; }
.ember:nth-child(9) { left: 75%; animation-delay: 1s; animation-duration: 6.5s; width: 3px; height: 3px; }
.ember:nth-child(10) { left: 90%; animation-delay: 2.2s; animation-duration: 7.2s; width: 5px; height: 5px; }
.ember:nth-child(11) { left: 5%; animation-delay: 5s; animation-duration: 5.5s; width: 4px; height: 4px; }
.ember:nth-child(12) { left: 28%; animation-delay: 4.8s; animation-duration: 8.2s; width: 3px; height: 3px; }
.ember:nth-child(13) { left: 35%; animation-delay: 1.2s; animation-duration: 6.8s; width: 5px; height: 5px; }
.ember:nth-child(14) { left: 58%; animation-delay: 6s; animation-duration: 9.5s; width: 4px; height: 4px; }
.ember:nth-child(15) { left: 63%; animation-delay: 3.2s; animation-duration: 5.2s; width: 6px; height: 6px; }
.ember:nth-child(16) { left: 88%; animation-delay: 0.8s; animation-duration: 7.8s; width: 3px; height: 3px; }
.ember:nth-child(17) { left: 18%; animation-delay: 2.7s; animation-duration: 6.2s; width: 5px; height: 5px; }
.ember:nth-child(18) { left: 48%; animation-delay: 5.5s; animation-duration: 8.8s; width: 4px; height: 4px; }
.ember:nth-child(19) { left: 72%; animation-delay: 3.8s; animation-duration: 7.1s; width: 3px; height: 3px; }
.ember:nth-child(20) { left: 95%; animation-delay: 1.6s; animation-duration: 6.0s; width: 5px; height: 5px; }

@keyframes drift {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    25% {
        transform: translateY(-45vh) translateX(15px) scale(0.9);
    }
    50% {
        transform: translateY(-75vh) translateX(60px) scale(0.75);
    }
    75% {
        transform: translateY(-95vh) translateX(150px) scale(0.6);
        opacity: 0.85;
    }
    100% {
        transform: translateY(-110vh) translateX(280px) scale(0.4);
        opacity: 0;
    }
}

.multiplayer_container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 40px auto;
    padding: 35px;
    background: rgba(18, 12, 8, 0.94); /* Deep dark theme overlay */
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), inset 0 0 100px rgba(140, 40, 31, 0.15);
    backdrop-filter: blur(10px);
    font-family: 'MedievalSharp', serif;
    color: #f5eccd; /* Parchment white */
}

#lobbyTitle {
    font-family: 'Pirata One', serif;
    font-size: 3.5rem;
    color: #8c281f;
    text-shadow: 0 0 15px rgba(140, 40, 31, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.9);
    text-align: center;
    letter-spacing: 3px;
    margin-top: 0;
    margin-bottom: 30px;
    text-transform: uppercase;
    border-bottom: 2px solid #8c281f;
    padding-bottom: 15px;
}

.lobby-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
}

#CreateChallengeButton {
    font-family: 'Pirata One', serif;
    font-size: 1.5rem;
    background: #8c281f;
    color: #f5eccd;
    border: 2px solid #5a1913 !important;
    padding: 8px 28px !important;
    border-radius: 6px;
    text-shadow: 1px 1px 2px black;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

#CreateChallengeButton:hover {
    background: #a63026;
    box-shadow: 0 6px 18px rgba(140, 40, 31, 0.6);
    transform: translateY(-2px);
}

.lobby-filter-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.lobby-filter-section label {
    font-size: 1rem;
    margin-bottom: 0;
    color: #8c281f;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#filterTagInput {
    background: #231911;
    border: 2px solid #5a1913;
    color: #f5eccd;
    font-family: 'MedievalSharp', serif;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
    width: 220px;
    transition: all 0.2s ease;
}

#filterTagInput:focus {
    outline: none;
    border-color: #8c281f;
    box-shadow: 0 0 10px rgba(140, 40, 31, 0.6);
}

.lobby-columns-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

/* My Challenge / Invitation Panel */
#myChallengeSection {
    background: rgba(28, 20, 14, 0.85) !important;
    border: 1px solid rgba(140, 40, 31, 0.35) !important;
    border-left: 6px solid #d84315 !important;
    padding: 18px 22px !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.55) !important;
    margin-bottom: 15px !important;
    box-sizing: border-box;
    flex: 1;
    min-width: 320px;
    max-width: 500px;
}

#myChallengeSection h5 {
    font-family: 'Pirata One', serif;
    font-size: 2rem;
    color: #8c281f;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.accepted-user-badge {
    background: rgba(46, 107, 59, 0.2) !important;
    border: 1px solid #2e6b3b !important;
    padding: 8px 16px !important;
    border-radius: 5px !important;
    font-family: 'MedievalSharp', serif !important;
    color: #f5eccd !important;
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Campaign List items */
.lobby-column-right {
    background: rgba(18, 12, 8, 0.75);
    border: 2px solid #5a1913;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.lobby-column-right h5 {
    font-family: 'Pirata One', serif;
    font-size: 2rem;
    color: #8c281f;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #5a1913;
    padding-bottom: 10px;
    letter-spacing: 1.5px;
}

.lobby-campaign-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(28, 20, 14, 0.85);
    border: 1px solid rgba(140, 40, 31, 0.35);
    padding: 18px 22px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.lobby-campaign-item-playing {
    border-left: 6px solid #2e6b3b;
}

.lobby-campaign-item-active {
    border-left: 6px solid #d84315;
}

.lobby-campaign-item-inactive {
    border-left: 6px solid #616161;
}

.lobby-campaign-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-campaign-title {
    font-family: 'MedievalSharp', serif !important;
    font-size: 1.35rem;
    font-weight: bold;
    color: #f5eccd !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lobby-campaign-tag,
.lobby-campaign-tag b {
    font-size: 0.95rem;
    color: #f5eccd !important;
    font-family: 'MedievalSharp', serif !important;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Visual Player Slots / Tokens */
.lobby-player-slots {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.lobby-player-slot {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Roboto Condensed', sans-serif;
    border: 2px solid;
    transition: all 0.2s ease;
}

.lobby-player-slot.filled {
    background-color: var(--user-color, #8c281f);
    border-color: #f5eccd;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    cursor: help;
}

.lobby-player-slot.empty {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.3);
    border-style: dashed;
}

.lobby-player-slot .slot-tooltip {
    display: none;
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e160e;
    color: #f5eccd;
    border: 1px solid #8c281f;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    font-family: 'MedievalSharp', serif;
}

.lobby-player-slot.filled:hover .slot-tooltip {
    display: block;
}

.lobby-campaign-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    margin-left: 20px;
}

#multiplayerScreen button,
#multiplayerScreen .btn,
.lobby-campaign-actions button,
#myChallengeSection button {
    font-family: 'MedievalSharp', serif;
    font-weight: normal;
    text-shadow: 1px 1px 1px black;
    border-radius: 5px !important;
    padding: 6px 18px !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

#multiplayerScreen button:hover,
#multiplayerScreen .btn:hover,
.lobby-campaign-actions button:hover,
#myChallengeSection button:hover {
    transform: none !important;
    transition: none !important;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.5);
}

.lobby-campaign-actions .btn-primary {
    background-color: #2b5c8f !important;
    border: 1px solid #1a3c61 !important;
}
.lobby-campaign-actions .btn-primary:hover {
    background-color: #3b74b3 !important;
}

.lobby-campaign-actions .btn-danger,
#myChallengeSection .btn-danger {
    background-color: #8c281f !important;
    border: 1px solid #5a1913 !important;
}
.lobby-campaign-actions .btn-danger:hover,
#myChallengeSection .btn-danger:hover {
    background-color: #b3392d !important;
}

.lobby-campaign-actions .btn-warning {
    background-color: #d4a318 !important;
    border: 1px solid #9c7710 !important;
    color: #120c06 !important;
    text-shadow: none !important;
}
.lobby-campaign-actions .btn-warning:hover,
.lobby-campaign-actions .btn-warning:focus,
.lobby-campaign-actions .btn-warning:active {
    background-color: #ebd13d !important;
    color: #120c06 !important;
    text-shadow: none !important;
}

.lobby-campaign-actions .btn-success,
#myChallengeSection .btn-success {
    background-color: #216d33 !important;
    border: 1px solid #144720 !important;
}
.lobby-campaign-actions .btn-success:hover,
#myChallengeSection .btn-success:hover {
    background-color: #2f9448 !important;
}
