.invite-backdrop,
.invite-backdrop * {
    box-sizing: border-box;
}

.invite-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
            radial-gradient(circle at 30% 20%, rgba(250, 204, 21, 0.18), transparent 28%),
            radial-gradient(circle at 72% 80%, rgba(59, 130, 246, 0.18), transparent 32%),
            rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(14px);
}

.invite-backdrop[hidden] {
    display: none !important;
}

.invite-modal {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border-radius: 30px;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
            radial-gradient(circle at top right, rgba(250, 204, 21, 0.14), transparent 36%),
            linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.98));
    box-shadow:
            0 34px 100px rgba(0, 0, 0, 0.54),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: inviteModalEnter 0.28s cubic-bezier(.2, .8, .2, 1) both;
}

.invite-modal-top {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.invite-chess-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #111827;
    background: linear-gradient(135deg, #facc15, #f97316);
    font-size: 1.6rem;
    font-weight: 950;
    box-shadow: 0 18px 38px rgba(249, 115, 22, 0.26);
}

.invite-title-block {
    min-width: 0;
}

.invite-pill {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.11);
    border: 1px solid rgba(34, 197, 94, 0.22);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.invite-live-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.invite-modal h3 {
    margin: 9px 0 0;
    color: #f8fafc;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.invite-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.invite-player-box {
    padding: 16px;
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.invite-small-label {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invite-player-name {
    display: block;
    max-width: 100%;
    color: #fef3c7;
    font-size: 1.15rem;
    font-weight: 950;
    line-height: 1.25;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.invite-player-box p {
    margin: 8px 0 0;
    color: #cbd5e1;
    line-height: 1.55;
}

.invite-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invite-info-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 15px;
    border-radius: 18px;
    background:
            linear-gradient(135deg, rgba(250, 204, 21, 0.08), rgba(249, 115, 22, 0.04)),
            rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(250, 204, 21, 0.12);
}

.invite-info-row span {
    min-width: 0;
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 850;
}

.invite-info-row strong {
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 950;
    white-space: nowrap;
}

.modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.accept-btn,
.decline-btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border-radius: 16px;
    font-weight: 950;
    cursor: pointer;
    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            border-color 0.2s ease,
            background 0.2s ease;
}

.accept-btn {
    border: none;
    color: #111827;
    background: linear-gradient(135deg, #facc15, #f97316);
    box-shadow: 0 18px 38px rgba(249, 115, 22, 0.28);
}

.decline-btn {
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.24);
    background: rgba(239, 68, 68, 0.1);
}

.accept-btn:hover:not(:disabled),
.decline-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.accept-btn:disabled,
.decline-btn:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.invite-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(17, 24, 39, 0.26);
    border-top-color: #111827;
    animation: inviteSpin 0.8s linear infinite;
}

@keyframes inviteSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes inviteModalEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@media (max-width: 520px) {
    .invite-backdrop {
        padding: 16px;
    }

    .invite-modal {
        padding: 20px;
        border-radius: 26px;
    }

    .invite-modal-top {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .invite-pill {
        margin: 0 auto;
    }

    .invite-info-row {
        grid-template-columns: 1fr;
        gap: 4px;
        text-align: center;
    }

    .modal-buttons {
        grid-template-columns: 1fr;
    }
}