/* ===== FRIENDS PAGE (Nunito + неон #e300ff, как в макете) ===== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

.friends-page-v2 {
    --fp-bg: #0d0d14;
    --fp-surface: #13121d;
    --fp-text: #e8e0ec;
    --fp-muted: rgba(232, 224, 236, 0.45);
    --fp-primary: #e300ff;
    --fp-primary-dim: #8b00cc;
    max-width: 540px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    font-family: 'Nunito', system-ui, sans-serif;
    color: var(--fp-text);
}

.friends-page-v2 ::-webkit-scrollbar {
    width: 6px;
}
.friends-page-v2 ::-webkit-scrollbar-track {
    background: rgba(227, 0, 255, 0.05);
}
.friends-page-v2 ::-webkit-scrollbar-thumb {
    background: rgba(227, 0, 255, 0.3);
    border-radius: 3px;
}

.friends-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
}

.friends-v2-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friends-v2-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fp-primary), var(--fp-primary-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.friends-v2-title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 900;
    background: linear-gradient(90deg, var(--fp-primary), #ff6bf5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.friends-v2-online-label {
    font-size: 0.72rem;
    color: rgba(232, 224, 236, 0.4);
    font-weight: 600;
    white-space: nowrap;
}

/* Активная комната */
.friends-v2-active-session {
    background: rgba(227, 0, 255, 0.06);
    border: 1px solid rgba(227, 0, 255, 0.2);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    display: none;
}
.friends-v2-active-session.is-visible {
    display: block;
}
.friends-v2-active-session-title {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.friends-v2-active-session-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

/* Поиск */
.friends-v2-search-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}
.friends-v2-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(227, 0, 255, 0.4);
    pointer-events: none;
}
.friends-v2-search {
    background: rgba(227, 0, 255, 0.06);
    border: 1.5px solid rgba(227, 0, 255, 0.15);
    color: var(--fp-text);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.65rem 0.9rem 0.65rem 2.5rem;
    border-radius: 12px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.friends-v2-search::placeholder {
    color: rgba(232, 224, 236, 0.35);
}
.friends-v2-search:focus {
    border-color: var(--fp-primary);
}

.friends-v2-find-toggle {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--fp-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.45rem 0;
    font-family: inherit;
    line-height: 1.45;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    box-sizing: border-box;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.friends-v2-find-toggle:hover {
    text-decoration: underline;
}
.friends-v2-find-toggle:focus-visible {
    outline: 2px solid var(--fp-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.friends-v2-find-panel {
    display: none;
    margin-top: 0.75rem;
    position: relative;
}
.friends-v2-find-panel.is-open {
    display: block;
}
.friends-v2-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--fp-surface);
    border: 1px solid rgba(227, 0, 255, 0.2);
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    display: none;
}
.friends-v2-search-results.is-active {
    display: block;
}
.friends-v2-search-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.friends-v2-search-row:hover {
    background: rgba(227, 0, 255, 0.08);
}
.friends-v2-search-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Табы */
.friends-v2-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(227, 0, 255, 0.04);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.25rem;
}
.friends-v2-tab {
    flex: 1;
    padding: 0.5rem 0.35rem;
    text-align: center;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(232, 224, 236, 0.45);
    transition: color 0.2s, background 0.2s;
}
.friends-v2-tab.active {
    color: var(--fp-primary);
    background: rgba(227, 0, 255, 0.12);
}
.friends-v2-tab .friends-v2-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: var(--fp-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
}

.friends-v2-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.friends-v2-subtab {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(227, 0, 255, 0.25);
    background: transparent;
    color: var(--fp-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.friends-v2-subtab.active {
    border-color: var(--fp-primary);
    color: var(--fp-primary);
    background: rgba(227, 0, 255, 0.08);
}

/* Карточки */
.friends-v2-glow-card {
    background: rgba(227, 0, 255, 0.04);
    border: 1px solid rgba(227, 0, 255, 0.15);
    border-radius: 16px;
    transition: all 0.3s ease;
}
.friends-v2-glow-card:hover {
    border-color: rgba(227, 0, 255, 0.4);
    box-shadow: 0 0 20px rgba(227, 0, 255, 0.1);
    transform: translateY(-2px);
}

.friends-v2-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friends-v2-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
}
.friends-v2-row-no-click {
    cursor: default;
}

.friends-v2-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.friends-v2-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: rgba(227, 0, 255, 0.15);
}
.friends-v2-avatar-initial {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
}
.friends-v2-online-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--fp-bg);
    position: absolute;
    bottom: 0;
    right: 0;
}
.friends-v2-online-dot.on {
    background: #22c55e;
}
.friends-v2-online-dot.off {
    background: #555;
}

.friends-v2-row-main {
    flex: 1;
    min-width: 0;
}
.friends-v2-name {
    font-weight: 800;
    font-size: 0.9rem;
}
.friends-v2-status {
    font-size: 0.75rem;
    color: rgba(232, 224, 236, 0.4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-v2-icon-btn {
    background: rgba(227, 0, 255, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--fp-primary);
    flex-shrink: 0;
    transition: background 0.2s;
}
.friends-v2-icon-btn:hover {
    background: rgba(227, 0, 255, 0.18);
}

.friends-v2-btn-primary {
    background: var(--fp-primary);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.friends-v2-btn-primary:hover {
    background: #c800e0;
    box-shadow: 0 0 12px rgba(227, 0, 255, 0.4);
}
.friends-v2-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.friends-v2-btn-outline {
    background: transparent;
    color: var(--fp-primary);
    border: 1.5px solid rgba(227, 0, 255, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
}
.friends-v2-btn-outline:hover {
    border-color: var(--fp-primary);
    background: rgba(227, 0, 255, 0.08);
}

.friends-v2-request-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Вкладка Смотреть */
.friends-v2-watch-hero {
    text-align: center;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}
.friends-v2-watch-pulse {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fp-primary), var(--fp-primary-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #fff;
    animation: friendsV2Pulse 2s infinite;
}
@keyframes friendsV2Pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(227, 0, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(227, 0, 255, 0);
    }
}
.friends-v2-watch-hero h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 800;
}
.friends-v2-watch-hero p {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: var(--fp-muted);
}
.friends-v2-watch-hero .friends-v2-btn-primary {
    padding: 10px 28px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.friends-v2-empty {
    text-align: center;
    color: rgba(232, 224, 236, 0.3);
    padding: 2rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
}

.friends-v2-pane {
    display: none;
}
.friends-v2-pane.active {
    display: block;
}

.friends-v2-loading {
    text-align: center;
    padding: 2rem;
    color: var(--fp-muted);
    font-size: 0.88rem;
}

/* Пустое / авторизация */
.friends-v2-auth-block {
    text-align: center;
    padding: 2.5rem 1rem;
}
.friends-v2-auth-block .friends-v2-btn-primary {
    margin-top: 1rem;
    padding: 0.65rem 1.5rem;
}

@media (min-width: 900px) {
    .friends-page-v2 {
        max-width: 560px;
    }
}
