/* =========================================================================
   Приглашения в матч: всплывающие карточки (краткий + развёрнутый вид) и
   централизованный пикер приглашаемых (поиск по нику). Глобально на всех
   страницах (подключается из base_no_ws).
   ========================================================================= */

/* ------------------------- Всплывающие приглашения --------------------- */
#invitations {
    position: fixed;
    top: 92px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 340px;
    max-width: calc(100vw - 24px);
}

.gp-inv {
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(30, 41, 59, 0.22);
    padding: 16px 16px 14px;
    animation: gp-inv-in 0.25s ease;
}
@keyframes gp-inv-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gp-inv__head { display: flex; gap: 12px; align-items: flex-start; }
.gp-inv__ic {
    font-size: 26px;
    line-height: 1;
    flex: none;
}
.gp-inv__short { font-size: 14px; color: #475569; }
.gp-inv__short b { color: #1e293b; }
.gp-inv__game { font-size: 16px; font-weight: 800; color: #1e293b; margin-top: 2px; }

.gp-inv__toggle {
    margin-top: 10px;
    background: none;
    border: none;
    padding: 0;
    color: var(--ca-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.gp-inv__toggle:hover { text-decoration: underline; }

.gp-inv__full {
    margin-top: 8px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
}
.gp-inv__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 2px 0;
    color: #64748b;
}
.gp-inv__row b { color: #334155; font-weight: 600; }

.gp-inv__actions { display: flex; gap: 8px; margin-top: 14px; }
.gp-inv__btn {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease, background .15s ease;
}
.gp-inv__accept { color: #fff; background: linear-gradient(135deg, #3b82f6, #7c3aed); }
.gp-inv__accept:hover { filter: brightness(1.07); }
.gp-inv__decline { color: #475569; background: #eef2f7; }
.gp-inv__decline:hover { background: #e2e8f0; }

/* ------------------------- Кружок онлайн/офлайн ------------------------ */
.gp-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cbd5e1;            /* офлайн — серый */
    box-shadow: 0 0 0 2px rgba(203, 213, 225, 0.35);
    vertical-align: middle;
    margin-right: 4px;
    flex: none;
    transition: background .2s ease, box-shadow .2s ease;
}
.gp-dot--on {
    background: #22c55e;            /* онлайн — зелёный */
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

/* --------------------------- Пикер (общий) ----------------------------- */
.gp-pick__box { position: relative; }
.gp-pick__search {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
}
.gp-pick__search:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

.gp-pick__results {
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gp-pick__item {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid transparent;
}
.gp-pick__item:hover { background: #eff6ff; border-color: #bfdbfe; }
.gp-pick__empty { padding: 10px 12px; font-size: 13px; color: #94a3b8; }

.gp-pick__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gp-pick__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4c1d95;
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    border-radius: 999px;
}
.gp-pick__chip b { cursor: pointer; color: #7c3aed; font-weight: 800; }
.gp-pick__chip b:hover { color: #dc2626; }

/* --------------------------- Модалка пикера ---------------------------- */
.gp-pick-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    padding: 16px;
}
.gp-pick-overlay.show { opacity: 1; visibility: visible; }

.gp-pick-modal {
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    padding: 22px;
    transform: scale(0.96);
    transition: transform .2s ease;
}
.gp-pick-overlay.show .gp-pick-modal { transform: scale(1); }

.gp-pick-modal__head { display: flex; align-items: center; justify-content: space-between; }
.gp-pick-modal__head h3 { font-size: 1.2rem; font-weight: 800; color: #1e293b; margin: 0; }
.gp-pick-modal__x {
    background: none; border: none; font-size: 26px; line-height: 1;
    color: #94a3b8; cursor: pointer;
}
.gp-pick-modal__x:hover { color: #334155; }
.gp-pick-modal__hint { font-size: 13px; color: #64748b; margin: 6px 0 16px; }
.gp-pick-modal__done {
    width: 100%;
    height: 44px;
    margin-top: 18px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
}
.gp-pick-modal__done:hover { filter: brightness(1.07); }

/* --------------------- Панель инициатора (стр. матча) ------------------ */
.gp-sent {
    max-width: 520px;
    margin: 12px auto;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.1);
}
.gp-sent__title { font-size: 15px; font-weight: 800; color: #1e293b; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.gp-sent__row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f1f5f9; }
.gp-sent__name { flex: 1; font-size: 14px; color: #334155; font-weight: 600; }
.gp-sent__status {
    font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.gp-sent__status.pending  { color: #92400e; background: #fef3c7; }
.gp-sent__status.seen     { color: #1e40af; background: #dbeafe; }
.gp-sent__status.declined { color: #991b1b; background: #fee2e2; }
.gp-sent__status.accepted { color: #166534; background: #dcfce7; }
.gp-sent__reinvite {
    border: 1px solid #bfdbfe; background: #fff; color: var(--ca-accent);
    font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; cursor: pointer;
}
.gp-sent__reinvite:hover { background: #eff6ff; }
.gp-sent__reinvite[disabled] { opacity: .5; cursor: default; }
.gp-sent__add {
    margin-top: 12px; width: 100%; height: 40px;
    border: 1px dashed #cbd5e1; background: #f8fafc; color: #475569;
    font-size: 14px; font-weight: 700; border-radius: 10px; cursor: pointer;
}
.gp-sent__add:hover { border-color: #7c3aed; color: #7c3aed; }

/* Свёрнутая панель после старта матча (приглашать уже незачем). */
.gp-sent__title { justify-content: space-between; }
.gp-sent__collapse {
    background: none; border: none; font-size: 20px; line-height: 1;
    color: #94a3b8; cursor: pointer; padding: 0 4px;
}
.gp-sent__collapse:hover { color: #334155; }
.gp-sent__toggle {
    width: 100%; background: #fff; border: 1px solid #e3e8ef; border-radius: 12px;
    padding: 10px 16px; font-size: 14px; font-weight: 700; color: #475569; cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.1);
}
.gp-sent__toggle:hover { border-color: #cbd5e1; color: #1e293b; }

@media (max-width: 480px) {
    #invitations { left: 12px; right: 12px; width: auto; }
}
