/* ==========================================================================
   Room Waiting & Opponent Invite Panel Styles
   ========================================================================== */

/* Room Overview HUD Strip */
.room-overview {
    background: rgba(18, 21, 27, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 12px;
}

.room-overview .room-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0;
}

.room-overview h2#waiting-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.room-code-label {
    margin: 0;
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-code-label strong#waiting-code {
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
}

.room-presence {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 0.85rem;
    min-height: 20px;
}

.room-overview .room-players {
    display: flex;
    gap: 12px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.room-overview .room-players li {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid #38bdf8;
    font-size: 0.85rem;
}

.room-overview .room-players li:nth-child(2) {
    border-left-color: #fb7185;
}

.room-overview .room-players li[data-empty="true"] {
    border-left-color: #64748b;
    border-left-style: dashed;
    opacity: 0.7;
}

.player-role {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}

.room-overview .room-players strong {
    color: #f8fafc;
    font-weight: 600;
}

.player-preparation {
    color: #22c55e;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

/* ==========================================================================
   Opponent Panel as Invite Panel (Housed in .camera-stage.opponent-stage)
   ========================================================================== */

/* Hide placeholder when invitation is active */
.opponent-stage:has(#room-invitation:not([hidden])) #opponent-placeholder,
#room-invitation:not([hidden]) ~ #opponent-placeholder {
    display: none !important;
}

#room-invitation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.07) 0%, rgba(8, 10, 14, 0.96) 100%);
    overflow-y: auto;
}

/* Animated Radar Ping */
.invite-radar {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.radar-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.radar-ping,
.radar-ping-delayed {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid #38bdf8;
    animation: radarRipple 2.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    pointer-events: none;
}

.radar-ping-delayed {
    animation-delay: 1.1s;
}

@keyframes radarRipple {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.invite-content {
    max-width: 380px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#invite-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 6px 0;
    letter-spacing: 0.01em;
}

.invite-desc {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0 0 16px 0;
}

.invite-input-row {
    width: 100%;
    margin-bottom: 12px;
}

#room-invitation .form-control {
    width: 100%;
    min-height: 42px;
    background: #151922;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    text-align: center;
    padding: 8px 12px;
    transition: border-color 0.15s ease;
}

#room-invitation .form-control:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.invitation-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.invitation-actions .btn {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.invitation-actions #copy-link {
    background: #38bdf8;
    color: #0c0e12;
    border: 0;
    flex: 1;
    max-width: 160px;
    justify-content: center;
}

.invitation-actions #copy-link:hover:not(:disabled) {
    background: #0ea5e9;
    transform: translateY(-1px);
}

.invitation-actions #share-invite {
    background: #22c55e;
    color: #0c0e12;
    border: 0;
    flex: 1;
    max-width: 140px;
    justify-content: center;
}

.invitation-actions #share-invite:hover:not(:disabled) {
    background: #16a34a;
}

.invite-feedback {
    min-height: 20px;
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #38bdf8;
    font-weight: 600;
}

.invite-waiting-state {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.waiting-beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    animation: beaconPulse 1.4s ease-in-out infinite;
}

@keyframes beaconPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

/* Room actions (Refresh, Dev buttons) */
.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.room-actions .btn {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
}

.room-actions .btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .room-overview .room-players {
        flex-direction: column;
    }
    #room-invitation {
        padding: 16px;
    }
    #invite-title {
        font-size: 1.15rem;
    }
}

/* Quick Sharing Strip */
.quick-share-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.share-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.share-chip.share-wa { color: #22c55e; border-color: rgba(34, 197, 94, 0.25); }
.share-chip.share-wa:hover { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.share-chip.share-tg { color: #38bdf8; border-color: rgba(56, 189, 248, 0.25); }
.share-chip.share-tg:hover { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }

.share-chip.share-x { color: #f1f5f9; border-color: rgba(255, 255, 255, 0.2); }
.share-chip.share-x:hover { background: rgba(255, 255, 255, 0.15); }

.share-chip.share-fb { color: #60a5fa; border-color: rgba(96, 165, 250, 0.25); }
.share-chip.share-fb:hover { background: rgba(96, 165, 250, 0.15); }

.share-chip.share-reddit { color: #fb923c; border-color: rgba(251, 146, 60, 0.25); }
.share-chip.share-reddit:hover { background: rgba(251, 146, 60, 0.15); }

.share-chip.share-email { color: #cbd5e1; border-color: rgba(203, 213, 225, 0.2); }
.share-chip.share-email:hover { background: rgba(203, 213, 225, 0.15); }

/* QR Code Panel */
.invite-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 14px 0 6px;
    padding: 12px;
    background: rgba(10, 13, 18, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.invite-qr-display svg {
    max-width: 150px;
    height: auto;
    display: block;
}

.qr-hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
}
