/* ===== Личный кабинет v2: переработанный интерфейс ===== */

/* Flash-сообщения на странице профиля */
.messages-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.messages-list .message {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.messages-list .message--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: var(--text-primary);
}
.messages-list .message--error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}
.messages-list .message--warning {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.35);
}
.messages-list .message--info {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}
.messages-wrap {
    margin-top: 1rem;
}

.cabinet-v2 {
    --cabinet-gap: 1.5rem;
    --cabinet-radius: 10px;
    --cabinet-accent: rgba(224, 36, 36, 0.25);
    --cabinet-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Макет: слева кнопки (компактно) | по центру карточка | справа премиум */
.cabinet-layout {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}
.cabinet-main {
    min-width: 0;
    max-width: 100%;
}
.cabinet-main .card.profile-main {
    min-width: 0;
    max-width: 100%;
    padding: var(--cabinet-gap);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Сайдбар — панель навигации */
.cabinet-sidebar {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 200px;
    flex-shrink: 0;
    padding: 0.75rem;
    background: var(--glass-bg, rgba(17, 18, 23, 0.72));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.cabinet-sidebar-block {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.cabinet-sidebar-block:last-child {
    border-bottom: none;
}
.cabinet-sidebar .cabinet-section-label {
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}
.cabinet-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0;
}
.cabinet-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s var(--cabinet-ease), color 0.2s var(--cabinet-ease), transform 0.15s var(--cabinet-ease);
}
.cabinet-right {
    position: sticky;
    top: 1.5rem;
    width: 300px;
    flex-shrink: 0;
}
.cabinet-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.cabinet-sidebar-link:active {
    transform: scale(0.98);
}
.cabinet-sidebar-link--out {
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-weight: 400;
}
.cabinet-sidebar-link--out:hover {
    color: var(--color-red, #e02424);
    background: rgba(224, 36, 36, 0.12);
}
.cabinet-sidebar-link--settings .btn-settings-icon {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}
.cabinet-sidebar-link--small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}
.cabinet-achievements-trigger {
    width: 100%;
    justify-content: flex-start;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.cabinet-sidebar-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.15s var(--cabinet-ease), box-shadow 0.2s var(--cabinet-ease);
}
.cabinet-sidebar-btn:hover {
    transform: translateY(-1px);
}
.cabinet-sidebar-form {
    width: 100%;
}
.cabinet-sidebar-form .cabinet-sidebar-btn {
    width: 100%;
}
.cabinet-friend-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.65rem;
}
.cabinet-friend-status--ok {
    color: var(--color-green, #22c55e);
}
.cabinet-theme-btn {
    margin-top: 0.25rem;
}
.cabinet-verify--sidebar {
    font-size: 0.8rem;
    margin: 0;
    padding: 0.5rem 0.65rem 0 0;
}
.cabinet-verify--sidebar a {
    color: var(--color-red);
    text-decoration: none;
}
.cabinet-verify--sidebar a:hover {
    text-decoration: underline;
}

/* Блок премиума справа */
.cabinet-premium {
    padding: 1.35rem 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--cabinet-radius);
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.cabinet-premium::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(224, 36, 36, 0.5), rgba(180, 20, 20, 0.3));
    border-radius: var(--cabinet-radius) var(--cabinet-radius) 0 0;
}
.cabinet-premium-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.85rem 0;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
.cabinet-premium-text,
.cabinet-premium-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.45;
}
.cabinet-premium-desc {
    margin-bottom: 1rem;
}
.cabinet-premium .btn-primary {
    margin-top: 0.25rem;
    width: 100%;
    justify-content: center;
    font-weight: 600;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    transition: transform 0.15s var(--cabinet-ease), box-shadow 0.2s var(--cabinet-ease);
}
.cabinet-premium .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(224, 36, 36, 0.35);
}
.cabinet-premium .badge-green {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Модальное окно достижений */
.cabinet-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.cabinet-modal-overlay[hidden],
.cabinet-modal-overlay.cabinet-modal-closed {
    display: none !important;
    pointer-events: none;
}
.cabinet-modal {
    background: var(--glass-bg, rgba(17, 18, 23, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.cabinet-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cabinet-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
.cabinet-modal-close {
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--cabinet-ease), color 0.2s var(--cabinet-ease);
}
.cabinet-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.cabinet-modal-body {
    padding: 0;
    overflow-y: auto;
}
.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.achievement-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}
.achievement-row:last-child {
    border-bottom: none;
}
.achievement-row:hover {
    background: rgba(255, 255, 255, 0.02);
}
.achievement-row--unlocked {
    border-left: 3px solid var(--color-green, #22c55e);
    background: rgba(34, 197, 94, 0.04);
}
.achievement-row--unlocked .achievement-row-status {
    color: var(--color-green, #22c55e);
}
.achievement-row--locked {
    border-left: 3px solid transparent;
}
.achievement-row--locked .achievement-row-name,
.achievement-row--locked .achievement-row-desc {
    color: var(--text-secondary);
}
.achievement-row-status {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.3;
}
.achievement-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    font-size: 0.7rem;
    font-weight: 700;
}
.achievement-lock {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.85rem;
}
.achievement-row-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.achievement-row-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.achievement-row-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Шапка: аватар + ник + био */
.cabinet-identity {
    position: relative;
    overflow: hidden;
    border-radius: var(--cabinet-radius);
    margin: calc(-1 * var(--cabinet-gap)) calc(-1 * var(--cabinet-gap)) var(--cabinet-gap);
    padding: var(--cabinet-gap);
    min-height: 120px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(224, 36, 36, 0.08) 50%, rgba(0, 0, 0, 0.3) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.cabinet-identity .profile-header-bg--default {
    background: transparent;
}
.cabinet-identity .profile-header-bg {
    border-radius: var(--cabinet-radius);
}
.cabinet-identity-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1.35rem;
}
.cabinet-avatar-wrap .profile-avatar img,
.cabinet-avatar-wrap .profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.cabinet-avatar-wrap .profile-avatar-placeholder {
    font-size: 2.25rem;
}
.cabinet-identity-text {
    flex: 1;
    min-width: 0;
}
.cabinet-username {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    letter-spacing: 0.02em;
    line-height: 1.25;
}
.cabinet-bio {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.cabinet-identity .profile-ready-voice {
    margin: 0;
}

/* Блок ранга и тира в одну строку */
.cabinet-dashboard {
    margin-bottom: var(--cabinet-gap);
}
.cabinet-dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.cabinet-rank-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Карточки ранга/тира внутри дашборда */
.rank-card--cabinet,
.tier-card--cabinet {
    max-width: none;
    margin-top: 0;
    padding: 1.1rem 1.35rem;
    border-radius: var(--cabinet-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s var(--cabinet-ease), box-shadow 0.2s var(--cabinet-ease);
}
.rank-card--cabinet {
    border-left: 4px solid var(--color-red, #e02424);
    background: linear-gradient(135deg, rgba(17, 18, 23, 0.97) 0%, rgba(13, 14, 18, 0.98) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.rank-card--cabinet:hover {
    border-color: rgba(224, 36, 36, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(224, 36, 36, 0.08);
}
.tier-card--cabinet {
    border-left: 4px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(17, 18, 23, 0.97) 0%, rgba(13, 14, 18, 0.98) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.tier-card--cabinet:hover {
    border-left-color: rgba(255, 255, 255, 0.25);
}
.tier-card--empty {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.35rem;
}
.tier-card--empty .tier-card-right {
    flex: 1;
}

/* Сезон */
.cabinet-season {
    margin-bottom: var(--cabinet-gap);
    padding: 1.1rem 1.35rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--cabinet-radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.cabinet-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.rank-card--season {
    max-width: none;
    margin-top: 0;
}

/* Статистика: 4 блока в ряд */
.cabinet-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: var(--cabinet-gap);
    padding: 0;
    border: none;
}
.cabinet-stat {
    text-align: center;
    padding: 1.1rem 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--cabinet-radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: background 0.2s var(--cabinet-ease), border-color 0.2s var(--cabinet-ease);
}
.cabinet-stat:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.08);
}
.cabinet-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    line-height: 1.2;
}
.cabinet-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.cabinet-stat--highlight {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.06);
}
.cabinet-stat--highlight .cabinet-stat-value {
    color: var(--color-green, #22c55e);
}
.cabinet-stat--highlight:hover {
    border-color: rgba(34, 197, 94, 0.3);
}

/* Контент: блоки с заголовками */
.cabinet-content {
    margin-bottom: var(--cabinet-gap);
}
.cabinet-block {
    margin-bottom: 1.5rem;
}
.cabinet-block:last-child {
    margin-bottom: 0;
}
.cabinet-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin: 0 0 0.85rem 0;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}
.cabinet-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}
.cabinet-block--tip {
    padding: 0.9rem 1.15rem;
    background: rgba(224, 36, 36, 0.08);
    border-radius: var(--cabinet-radius);
    border-left: 4px solid var(--color-red, #e02424);
    border: 1px solid rgba(224, 36, 36, 0.15);
    border-left-width: 4px;
}
.cabinet-tip-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.cabinet-map-stats {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cabinet-map-stats li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    transition: background 0.15s ease;
}
.cabinet-map-stats li:hover {
    background: rgba(255, 255, 255, 0.03);
}
.cabinet-map-name { color: var(--text-primary); }
.cabinet-map-value { color: var(--text-secondary); }
.cabinet-survey-options { display: flex; flex-direction: column; gap: 0.5rem; }
.cabinet-survey-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.4rem 0;
}
.cabinet-survey-label:hover { color: var(--text-primary); }
.cabinet-matches-list { list-style: none; padding: 0; margin: 0 0 0.75rem 0; }
.cabinet-matches-list li {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    transition: background 0.15s ease;
}
.cabinet-matches-list li:hover {
    background: rgba(255, 255, 255, 0.03);
}
.cabinet-friends-list li,
.cabinet-requests-list li {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}
.cabinet-friends-list li:hover,
.cabinet-requests-list li:hover {
    background: rgba(255, 255, 255, 0.03);
}
.cabinet-block .btn-outline,
.cabinet-block .btn-primary {
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.15s var(--cabinet-ease);
}
.cabinet-block .btn-outline:hover,
.cabinet-block .btn-primary:hover {
    transform: translateY(-1px);
}
.cabinet-settings {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.cabinet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cabinet-verify {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .cabinet-layout {
        grid-template-columns: 1fr;
    }
    .cabinet-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }
    .cabinet-right {
        width: 100%;
        position: static;
    }
    .cabinet-sidebar-block {
        padding: 0;
        border: none;
        margin-right: 0.5rem;
    }
    .cabinet-sidebar-block .cabinet-section-label {
        margin-right: 0.5rem;
        display: inline;
    }
    .cabinet-sidebar-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .cabinet-sidebar-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .cabinet-sidebar-btn {
        width: auto;
    }
    .cabinet-sidebar-form {
        width: auto;
    }
    .cabinet-sidebar-form .cabinet-sidebar-btn {
        width: auto;
    }
}
@media (max-width: 768px) {
    .cabinet-identity {
        margin-left: -1rem;
        margin-right: -1rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    .cabinet-identity-inner {
        flex-direction: column;
        text-align: center;
    }
    .cabinet-dashboard-cards {
        grid-template-columns: 1fr;
    }
    .cabinet-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .cabinet-modal-overlay {
        padding: 1rem;
    }
}

/* ===== Личный кабинет: анимации, галочки, цветные ники, радуга ===== */

/* Анимированный фон секции профиля */
.profile-section {
    position: relative;
    overflow: hidden;
}
.profile-section::before {
    content: "";
    position: absolute;
    inset: -30%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 30% 20%, rgba(224, 36, 36, 0.12), transparent 45%),
        radial-gradient(ellipse 50% 60% at 70% 70%, rgba(180, 20, 20, 0.1), transparent 45%),
        conic-gradient(from 0deg at 50% 50%, rgba(224, 36, 36, 0.04) 0deg, transparent 90deg, rgba(224, 36, 36, 0.06) 180deg, transparent 270deg);
    animation: profileBgPulse 12s ease-in-out infinite alternate;
}
.profile-section .container {
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    max-width: 100%;
}
@keyframes profileBgPulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    100% { transform: scale(1.1) rotate(3deg); opacity: 1; }
}

/* Кастомный фон блока профиля (шапка с аватаром и рейтингом) */
.profile-header--has-bg {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}
.profile-header-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}
.profile-header-bg--default {
    /* Фон по умолчанию — прозрачный, виден фон карточки */
}
.profile-header-bg--color {
    opacity: 0.95;
}
.profile-header-bg--image,
.profile-header-bg--animated {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.profile-header-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.profile-header--has-bg .profile-avatar-wrap,
.profile-header--has-bg .profile-info {
    position: relative;
    z-index: 1;
}

/* Плавающие частицы/орбы в блоке профиля */
.profile-main::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 36, 36, 0.15) 0%, transparent 70%);
    top: -20px;
    right: -20px;
    pointer-events: none;
    animation: profileOrbFloat 8s ease-in-out infinite;
}
@keyframes profileOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-10px, -10px) scale(1.1); opacity: 0.9; }
}

/* Строка «Тема» с переключателем в личном кабинете */
.profile-settings-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.profile-settings-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Обёртка ника с галочками */
.profile-username-wrap,
.username-badges-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.profile-info h2.profile-username-wrap {
    margin-bottom: 6px;
}

/* Галочки у ника */
.badge-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-check::after {
    content: "✓";
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
/* Синяя — официальный/сотрудник (выдаётся в админке) */
.badge-check--official {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
/* Зелёная — подтверждён email */
.badge-check--verified {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

/* Цветной ник (кастомный цвет из профиля) */
.username-colored {
    color: var(--nick-color, var(--text-primary));
}
.profile-info .username-colored {
    font-weight: 600;
}

/* Радужный ник (при подписке) */
.username-rainbow {
    background: linear-gradient(
        90deg,
        #e02424,
        #f59e0b,
        #22c55e,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #e02424
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: usernameRainbow 6s linear infinite;
}
@keyframes usernameRainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* В шапке: ник с галочками и радугой/цветом */
.header .username-badges-wrap {
    gap: 4px;
}
.header .username-display {
    font-weight: 600;
}
.header .username-display.username-rainbow {
    font-weight: 700;
}

/* Блок друзей и заявок в профиле */
.profile-friends-block,
.profile-requests-block {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.profile-friends-block h3,
.profile-requests-block h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}
.friends-list,
.requests-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}
.friends-list li,
.requests-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.friends-list li:last-child,
.requests-list li:last-child {
    border-bottom: none;
}
.friend-username {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.friend-actions {
    display: flex;
    gap: 8px;
}

/* Карточка результата поиска игроков */
.player-search-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}
.player-search-card .player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.player-search-card .player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}
.player-search-card .player-name-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-search-card .player-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Анимация аватарки */
.profile-avatar--animated {
    position: relative;
}
.profile-avatar--animated::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(224, 36, 36, 0.6), rgba(234, 179, 8, 0.4), rgba(224, 36, 36, 0.6));
    background-size: 200% 200%;
    animation: avatarRing 4s ease-in-out infinite;
    z-index: -1;
}
.profile-avatar--animated img,
.profile-avatar--animated .profile-avatar-placeholder {
    animation: avatarPulse 3s ease-in-out infinite;
}
@keyframes avatarRing {
    0%, 100% { background-position: 0% 50%; opacity: 0.8; transform: scale(1.02); }
    50% { background-position: 100% 50%; opacity: 1; transform: scale(1.05); }
}
@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 36, 0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(224, 36, 36, 0.2); }
}

/* Рамка Premium (Basic/Standard) — золотая */
.profile-avatar--premium.profile-avatar--animated::before {
    border-width: 3px;
    background: linear-gradient(135deg, #eab308, #f59e0b, #fbbf24, #eab308);
    background-size: 200% 200%;
    animation: avatarRing 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
}
.profile-avatar--premium.profile-avatar--animated img,
.profile-avatar--premium.profile-avatar--animated .profile-avatar-placeholder {
    box-shadow: 0 0 16px rgba(234, 179, 8, 0.25);
}

/* Радужная рамка — только админская (выдача через админку, slug admin_rainbow) */
.profile-avatar--premium-pro.profile-avatar--animated::before {
    border-width: 4px;
    background: conic-gradient(
        from 0deg,
        #e02424,
        #f59e0b,
        #22c55e,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #e02424
    );
    animation: avatarRainbowSpin 3s linear infinite;
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.5);
}
.profile-avatar--premium-pro.profile-avatar--animated img,
.profile-avatar--premium-pro.profile-avatar--animated .profile-avatar-placeholder {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
}
@keyframes avatarRainbowSpin {
    0% { transform: scale(1.02) rotate(0deg); }
    100% { transform: scale(1.02) rotate(360deg); }
}

/* Обёртка аватара для «ушек» Premium Pro */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
}
/* Ушки над аватаром (радужные дуги) */
.avatar-premium-ears {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 12px;
    pointer-events: none;
    z-index: 1;
}
.avatar-premium-ears::before,
.avatar-premium-ears::after {
    content: "";
    position: absolute;
    top: 0;
    width: 16px;
    height: 10px;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: linear-gradient(90deg, #e02424, #f59e0b, #22c55e, #3b82f6);
    background-size: 200% 100%;
    animation: avatarEarsShine 2s ease-in-out infinite;
    opacity: 0.9;
}
.avatar-premium-ears::before { left: 0; }
.avatar-premium-ears::after { right: 0; left: auto; background-position: 100% 0; }
@keyframes avatarEarsShine {
    0%, 100% { opacity: 0.85; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.15); }
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 8px 0 12px 0;
    max-width: 100%;
}

.profile-verify-hint {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.profile-verify-hint a {
    font-weight: 600;
}

/* Достижения в профиле */
.profile-achievements {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.profile-achievements h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}
.achievements-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.achievement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    cursor: help;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.achievement-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.achievement-unlocked {
    border-color: rgba(224, 36, 36, 0.4);
    background: rgba(224, 36, 36, 0.08);
}
.achievement-locked {
    opacity: 0.6;
    filter: grayscale(0.8);
}
.profile-achievements-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Палитра цвета ника в редактировании профиля */
.form-group--color-picker .color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.form-group--color-picker input[type="color"] {
    width: 48px;
    height: 48px;
    padding: 2px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: #111;
}
.form-group--color-picker .color-hex-input {
    flex: 1;
    max-width: 120px;
}
.form-group--color-picker .color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.form-group--color-picker .color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}
.form-group--color-picker .color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(224, 36, 36, 0.4);
}
.form-group--color-picker .color-swatch[data-color="e02424"] { background: #e02424; }
.form-group--color-picker .color-swatch[data-color="f59e0b"] { background: #f59e0b; }
.form-group--color-picker .color-swatch[data-color="eab308"] { background: #eab308; }
.form-group--color-picker .color-swatch[data-color="22c55e"] { background: #22c55e; }
.form-group--color-picker .color-swatch[data-color="06b6d4"] { background: #06b6d4; }
.form-group--color-picker .color-swatch[data-color="3b82f6"] { background: #3b82f6; }
.form-group--color-picker .color-swatch[data-color="8b5cf6"] { background: #8b5cf6; }
.form-group--color-picker .color-swatch[data-color="ec4899"] { background: #ec4899; }
.form-group--color-picker .color-swatch[data-color="f97316"] { background: #f97316; }
.form-group--color-picker .color-swatch[data-color="14b8a6"] { background: #14b8a6; }

/* ----- Редактор профиля: блок префикса ----- */
.profile-edit-block {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}
.profile-edit-block--prefix {
    background: rgba(0, 0, 0, 0.2);
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -0.5rem;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-edit-block-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
}
.profile-edit-block-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.profile-edit-block-title {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}
.profile-edit-block-desc {
    margin: 0;
    font-size: 0.875rem;
}
.profile-edit-block--profile-bg .profile-bg-value-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.profile-edit-block--profile-bg .profile-bg-color-picker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}
.profile-edit-block--profile-bg .profile-bg-value-wrap #id_profile_background_value {
    flex: 1;
}
.profile-edit-block--profile-bg .form-hint[data-only-for] {
    display: none;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}
.profile-edit-prefix-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.profile-edit-prefix-select-wrap {
    min-width: 180px;
}
.profile-edit-prefix-select-wrap .profile-edit-prefix-select,
.profile-edit-prefix-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.2));
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.95rem;
    cursor: pointer;
}
.profile-edit-prefix-select-wrap .profile-edit-prefix-select:focus,
.profile-edit-prefix-select:focus {
    outline: none;
    border-color: rgba(224, 36, 36, 0.5);
    box-shadow: 0 0 0 2px rgba(224, 36, 36, 0.2);
}
.profile-edit-prefix-preview {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}
.prefix-preview-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #64748b);
    margin-bottom: 4px;
}
.prefix-preview-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.prefix-preview-value .username-prefix {
    font-size: 0.9em;
    color: var(--text-secondary, #94a3b8);
}
.prefix-preview-value .username-display {
    font-weight: 600;
}
@keyframes prefix-preview-flash {
    0% { opacity: 1; }
    40% { opacity: 0.6; }
    100% { opacity: 1; }
}
.prefix-preview-flash .prefix-preview-value {
    animation: prefix-preview-flash 0.3s ease-out;
}
.profile-edit-prefix-hint {
    margin: 0.75rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}
.profile-edit-prefix-hint--locked {
    color: var(--text-secondary, #64748b);
    font-style: italic;
}

/* Карточка ранга (уровень 1–100) */
.rank-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(17, 18, 23, 0.98) 0%, rgba(13, 14, 18, 0.98) 100%);
    border: 1px solid rgba(224, 36, 36, 0.15);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-width: 320px;
    box-shadow: 0 0 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}
.rank-card-left { flex-shrink: 0; }
.rank-card-right { position: relative; flex: 1; min-width: 0; }
.rank-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 0.25rem 0;
}
.rank-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #f9fafb);
    margin: 0;
    letter-spacing: 0.02em;
}
.rank-card-unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
}
.rank-card-info {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}
.rank-card--compact {
    padding: 0.75rem 1rem;
    max-width: 280px;
}
.rank-card--compact .rank-card-info { display: none; }

/* Карточка тира лиги (T5–T1) — такой же формат */
.tier-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(17, 18, 23, 0.98) 0%, rgba(13, 14, 18, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-width: 320px;
    box-shadow: 0 0 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}
.tier-card-left { flex-shrink: 0; }
.tier-card-right { position: relative; flex: 1; min-width: 0; }
.tier-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
}
.tier-card-name { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 0.15rem 0; }
.tier-card-points { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.tier-card--compact { padding: 0.75rem 1rem; max-width: 280px; }

/* Прогресс уровня и звание */
.profile-level-title {
    margin-left: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
}
.profile-level-progress {
    margin-top: 8px;
    margin-bottom: 4px;
    max-width: 200px;
    height: 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.profile-level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-red, #e02424), #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.profile-level-progress-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-top: 4px;
}

/* Кнопка «Настройки» с крутящейся шестерёнкой на фоне */
.btn-settings {
    position: relative;
    overflow: hidden;
}
.btn-settings .btn-settings-text {
    position: relative;
    z-index: 1;
}
.btn-settings-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    pointer-events: none;
    z-index: 0;
    opacity: 0.22;
}
.btn-settings-icon::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 1v4M12 19v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M1 12h4M19 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83'/%3E%3C/svg%3E") center/100% no-repeat;
    animation: settings-gear-spin 6s linear infinite;
}
@keyframes settings-gear-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ----- Рамки аватара (Stalcraft: ржавчина, металл, зона, радиация) ----- */
.avatar-frame {
    position: relative;
}
.avatar-frame::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.profile-avatar-wrap.avatar-frame .profile-avatar,
.profile-avatar-wrap.avatar-frame .profile-avatar-placeholder {
    position: relative;
    z-index: 1;
}

/* Basic: статичные */
.avatar-frame--rust::before {
    border: 3px solid #8b5a2b;
    box-shadow: inset 0 0 12px rgba(139, 90, 43, 0.4), 0 0 8px rgba(139, 90, 43, 0.3);
    background: linear-gradient(135deg, transparent 40%, rgba(139, 90, 43, 0.15) 50%, transparent 60%);
}
.avatar-frame--steel::before {
    border: 3px solid #4a5568;
    box-shadow: inset 0 0 14px rgba(0,0,0,0.5), 0 0 6px rgba(148, 163, 184, 0.25);
    background: linear-gradient(145deg, rgba(148,163,184,0.1) 0%, transparent 50%);
}
.avatar-frame--shard::before {
    border: 2px solid #d97706;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4), inset 0 0 8px rgba(217, 119, 6, 0.15);
    background: linear-gradient(180deg, transparent 30%, rgba(251, 191, 36, 0.08) 50%, transparent 70%);
}

/* Standard: анимированные */
.avatar-frame--pulse::before {
    border: 3px solid #e02424;
    box-shadow: 0 0 16px rgba(224, 36, 36, 0.5), inset 0 0 12px rgba(224, 36, 36, 0.2);
    background: radial-gradient(circle at 30% 30%, rgba(224, 36, 36, 0.2), transparent 50%);
}
.avatar-frame--radiation::before {
    border: 2px solid #84cc16;
    box-shadow: 0 0 14px rgba(132, 204, 22, 0.45), inset 0 0 10px rgba(132, 204, 22, 0.15);
    background: radial-gradient(circle, rgba(132, 204, 22, 0.12) 0%, transparent 70%);
}
.avatar-frame--scanner::before {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), inset 0 0 8px rgba(59, 130, 246, 0.1);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.25) 0%, transparent 40%, transparent 60%, rgba(59, 130, 246, 0.15) 100%);
    background-size: 100% 24px;
}

/* Premium */
.avatar-frame--core::before {
    border: 3px solid #ea580c;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.6), 0 0 40px rgba(224, 36, 36, 0.3), inset 0 0 15px rgba(234, 88, 12, 0.25);
    background: radial-gradient(circle at 50% 50%, rgba(251, 146, 60, 0.25), transparent 60%);
}
.avatar-frame--elite::before {
    border: 3px solid #eab308;
    box-shadow: 0 0 18px rgba(234, 179, 8, 0.5), 0 0 8px rgba(224, 36, 36, 0.3), inset 0 0 12px rgba(234, 179, 8, 0.2);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, transparent 50%, rgba(224, 36, 36, 0.1) 100%);
}
.avatar-frame--artifact::before {
    border: 2px solid #a855f7;
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.55), 0 0 12px rgba(236, 72, 153, 0.3), inset 0 0 14px rgba(168, 85, 247, 0.2);
    background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.2), transparent 65%);
}

/* Анимации для Standard и Premium */
.avatar-frame--animated.avatar-frame--pulse::before {
    animation: frame-pulse 2s ease-in-out infinite;
}
.avatar-frame--animated.avatar-frame--radiation::before {
    animation: frame-radiation 3s ease-in-out infinite;
}
.avatar-frame--animated.avatar-frame--scanner::before {
    animation: frame-scanner 4s linear infinite;
}
.avatar-frame--animated.avatar-frame--core::before {
    animation: frame-core 2.5s ease-in-out infinite;
}
.avatar-frame--animated.avatar-frame--elite::before {
    animation: frame-elite 3s ease-in-out infinite;
}
.avatar-frame--animated.avatar-frame--artifact::before {
    animation: frame-artifact 3.5s ease-in-out infinite;
}
@keyframes frame-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 16px rgba(224, 36, 36, 0.5), inset 0 0 12px rgba(224, 36, 36, 0.2); }
    50% { opacity: 0.9; box-shadow: 0 0 24px rgba(224, 36, 36, 0.7), inset 0 0 16px rgba(224, 36, 36, 0.35); }
}
@keyframes frame-radiation {
    0%, 100% { box-shadow: 0 0 14px rgba(132, 204, 22, 0.45), inset 0 0 10px rgba(132, 204, 22, 0.15); filter: brightness(1); }
    50% { box-shadow: 0 0 20px rgba(132, 204, 22, 0.6), inset 0 0 14px rgba(132, 204, 22, 0.25); filter: brightness(1.1); }
}
@keyframes frame-scanner {
    0% { background-position: 0 0; }
    100% { background-position: 0 24px; }
}
@keyframes frame-core {
    0%, 100% { box-shadow: 0 0 20px rgba(234, 88, 12, 0.6), 0 0 40px rgba(224, 36, 36, 0.3), inset 0 0 15px rgba(234, 88, 12, 0.25); }
    50% { box-shadow: 0 0 28px rgba(234, 88, 12, 0.8), 0 0 50px rgba(224, 36, 36, 0.4), inset 0 0 20px rgba(234, 88, 12, 0.4); }
}
@keyframes frame-elite {
    0%, 100% { box-shadow: 0 0 18px rgba(234, 179, 8, 0.5), 0 0 8px rgba(224, 36, 36, 0.3), inset 0 0 12px rgba(234, 179, 8, 0.2); }
    50% { box-shadow: 0 0 26px rgba(234, 179, 8, 0.7), 0 0 14px rgba(224, 36, 36, 0.4), inset 0 0 16px rgba(234, 179, 8, 0.35); }
}
@keyframes frame-artifact {
    0%, 100% { box-shadow: 0 0 22px rgba(168, 85, 247, 0.55), 0 0 12px rgba(236, 72, 153, 0.3), inset 0 0 14px rgba(168, 85, 247, 0.2); }
    50% { box-shadow: 0 0 30px rgba(168, 85, 247, 0.75), 0 0 18px rgba(236, 72, 153, 0.45), inset 0 0 18px rgba(168, 85, 247, 0.35); }
}

/* Превью рамок в настройках */
.avatar-frame-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.5rem;
}
.avatar-frame-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    border: none;
    cursor: pointer;
    position: relative;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-frame-preview-inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-card);
}
.avatar-frame-preview::before {
    inset: -2px;
}
.avatar-frame-preview.is-selected {
    outline: 2px solid var(--color-red);
    outline-offset: 2px;
}
.avatar-frame-preview-row .avatar-frame-preview::before {
    position: absolute;
    content: "";
    inset: -3px;
    border-radius: 50%;
    pointer-events: none;
}
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--rust::before { border: 2px solid #8b5a2b; box-shadow: inset 0 0 6px rgba(139, 90, 43, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--steel::before { border: 2px solid #4a5568; box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--shard::before { border: 2px solid #d97706; box-shadow: 0 0 6px rgba(217, 119, 6, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--pulse::before { border: 2px solid #e02424; box-shadow: 0 0 8px rgba(224, 36, 36, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--radiation::before { border: 2px solid #84cc16; box-shadow: 0 0 8px rgba(132, 204, 22, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--scanner::before { border: 2px solid #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--core::before { border: 2px solid #ea580c; box-shadow: 0 0 10px rgba(234, 88, 12, 0.6); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--elite::before { border: 2px solid #eab308; box-shadow: 0 0 10px rgba(234, 179, 8, 0.5); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--artifact::before { border: 2px solid #a855f7; box-shadow: 0 0 10px rgba(168, 85, 247, 0.6); }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--pulse::before { animation: frame-pulse 2s ease-in-out infinite; }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--radiation::before { animation: frame-radiation 3s ease-in-out infinite; }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--scanner::before { animation: frame-scanner 4s linear infinite; }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--core::before { animation: frame-core 2.5s ease-in-out infinite; }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--elite::before { animation: frame-elite 3s ease-in-out infinite; }
.avatar-frame-preview-row .avatar-frame-preview.avatar-frame--animated.avatar-frame--artifact::before { animation: frame-artifact 3.5s ease-in-out infinite; }

/* ===== Личные сообщения (ЛС) ===== */
.pm-container { max-width: 720px; }
.pm-container--thread { max-width: 680px; }
.pm-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.pm-search-form {
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.pm-search-input {
    flex: 1; min-width: 200px; max-width: 360px;
    padding: 0.6rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25); color: var(--text-primary); font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pm-search-input::placeholder { color: var(--text-secondary); opacity: 0.8; }
.pm-search-input:focus {
    outline: none; border-color: var(--color-red, #e02424); box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.2);
}
.pm-search-btn { flex-shrink: 0; }
.pm-inbox-card { padding: 1.25rem; position: relative; overflow: hidden; }
.pm-inbox-header { margin-bottom: 1rem; }
.pm-unread-badge {
    display: inline-block; padding: 0.35rem 0.75rem; border-radius: 8px;
    font-size: 0.85rem; font-weight: 600; color: var(--color-red, #e02424);
    background: rgba(224, 36, 36, 0.12); border: 1px solid rgba(224, 36, 36, 0.25);
}
.pm-conversations-list { list-style: none; padding: 0; margin: 0; }
.pm-conversation-item {
    border-radius: 10px; margin-bottom: 0.5rem; overflow: hidden;
    border: 1px solid transparent; transition: background 0.2s, border-color 0.2s;
}
.pm-conversation-item:last-child { margin-bottom: 0; }
.pm-conversation-item--unread .pm-partner-name { font-weight: 700; }
.pm-conversation-item--unread .pm-preview { color: var(--text-primary); opacity: 0.95; }
.pm-conversation-link {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem;
    text-decoration: none; color: inherit; transition: background 0.2s;
}
.pm-conversation-link:hover { background: rgba(255,255,255,0.06); }
.pm-conversation-item:hover { border-color: rgba(255,255,255,0.08); }
.pm-conversation-avatar {
    width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
    background: linear-gradient(135deg, rgba(224, 36, 36, 0.35), rgba(140, 20, 20, 0.4));
    border: 1px solid rgba(224, 36, 36, 0.3);
}
.pm-conversation-body { flex: 1; min-width: 0; }
.pm-conversation-top {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem;
}
.pm-partner-name { font-weight: 600; font-size: 1rem; }
.pm-date { font-size: 0.8rem; color: var(--text-secondary); flex-shrink: 0; }
.pm-preview {
    font-size: 0.9rem; color: var(--text-secondary); display: block;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pm-unread-dot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.5rem; height: 1.5rem; padding: 0 0.45rem; flex-shrink: 0;
    font-size: 0.75rem; font-weight: 700; background: var(--color-red, #e02424); color: #fff;
    border-radius: 50%; margin-left: 0.5rem;
}
.pm-link-with-badge { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; }
.pm-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; padding: 0 0.4rem; font-size: 0.7rem; font-weight: 700; background: var(--color-red); color: #fff; border-radius: 10px; }
.pm-empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.pm-empty-state-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.pm-empty-state-text { color: var(--text-secondary); margin-bottom: 1.25rem; }
.pm-empty-state-text a { color: var(--color-red); text-decoration: none; }
.pm-empty-state-text a:hover { text-decoration: underline; }
/* Диалог (нить) */
.pm-thread-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pm-thread-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}
.pm-thread-back {
    font-size: 0.9rem; color: var(--text-secondary); text-decoration: none; transition: color 0.2s;
}
.pm-thread-back:hover { color: var(--color-red); }
.pm-thread-partner { font-weight: 600; font-size: 0.95rem; }
.pm-flash-messages { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.pm-flash {
    padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-radius: 10px; font-size: 0.9rem;
}
.pm-flash--success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.35); color: #86efac; }
.pm-flash--error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.35); color: #fca5a5; }
.pm-messages {
    max-height: 55vh; overflow-y: auto; padding: 1.25rem;
    margin: 0; background: rgba(0,0,0,0.15); border-radius: 0;
    display: flex; flex-direction: column; gap: 0.85rem;
}
.pm-message {
    padding: 0.85rem 1.1rem; border-radius: 12px; max-width: 82%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pm-message--own {
    margin-left: auto; background: linear-gradient(135deg, rgba(224, 36, 36, 0.2), rgba(224, 36, 36, 0.12));
    border: 1px solid rgba(224, 36, 36, 0.35);
}
.pm-message--other {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
}
.pm-message-quote {
    margin-bottom: 0.5rem; padding: 0.4rem 0.6rem; border-left: 3px solid rgba(224, 36, 36, 0.5);
    background: rgba(0,0,0,0.2); border-radius: 0 6px 6px 0;
    font-size: 0.82rem; color: var(--text-secondary);
}
.pm-message-quote-label { font-weight: 600; margin-right: 0.35rem; }
.pm-message-quote-author { color: var(--color-red, #e02424); margin-right: 0.35rem; }
.pm-message-quote-text { opacity: 0.9; }
.pm-message-sender { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; display: block; color: var(--text-secondary); }
.pm-message--own .pm-message-sender { color: rgba(255,255,255,0.85); }
.pm-message-body { margin: 0 0 0.4rem 0; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.pm-message-reactions {
    display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; margin-bottom: 0.35rem;
}
.pm-reaction-form { display: inline; margin: 0; }
.pm-reaction-btn {
    display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.5rem;
    font-size: 0.8rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2); color: var(--text-secondary); cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.pm-reaction-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.pm-reaction-btn--mine { border-color: rgba(224, 36, 36, 0.4); background: rgba(224, 36, 36, 0.15); color: #fff; }
.pm-reaction-count { font-size: 0.75rem; opacity: 0.9; }
.pm-message-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.pm-message-meta { font-size: 0.72rem; color: var(--text-secondary); }
.pm-message-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pm-action-form { display: inline; margin: 0; }
.pm-action-link {
    background: none; border: none; padding: 0; font-size: 0.78rem; color: var(--text-secondary);
    cursor: pointer; text-decoration: none; transition: color 0.2s;
}
.pm-action-link:hover { color: var(--color-red); }
.pm-action-link--muted { font-size: 0.75rem; opacity: 0.85; }
.pm-report-inline { margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.06); }
.pm-report-form {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
}
.pm-report-reason-label { font-size: 0.8rem; color: var(--text-secondary); margin-right: 0.25rem; }
.pm-report-reason-select {
    padding: 0.35rem 0.6rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.3); color: var(--text-primary); font-size: 0.85rem;
}
.pm-report-note-input {
    flex: 1; min-width: 140px; padding: 0.35rem 0.6rem; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.3);
    color: var(--text-primary); font-size: 0.85rem;
}
.pm-empty { margin: 0; padding: 1.5rem; text-align: center; color: var(--text-secondary); }
.pm-send-form { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.12); }
.pm-send-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.pm-send-textarea {
    width: 100%; padding: 0.75rem 1rem; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.3);
    color: var(--text-primary); font-size: 0.95rem; resize: vertical; min-height: 88px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pm-send-textarea::placeholder { color: var(--text-secondary); }
.pm-send-textarea:focus { outline: none; border-color: var(--color-red); box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.15); }
.pm-send-btn { align-self: flex-end; }
.link-back { color: var(--text-secondary); text-decoration: none; }
.link-back:hover { color: var(--color-red); }
