/* === Элитная рамка 100-го уровня: Black-Red Cyber Tribal === */
.avatar-frame-tribal100 {
    position: relative;
    z-index: 1;
}
.avatar-frame-tribal100::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    pointer-events: none;
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="46" stroke="%23222222" stroke-width="6"/><path d="M50 4 Q55 18 70 10 Q80 5 85 20 Q90 35 99 30 Q95 50 99 70 Q90 65 85 80 Q80 95 70 90 Q55 82 50 96 Q45 82 30 90 Q20 95 15 80 Q10 65 1 70 Q5 50 1 30 Q10 35 15 20 Q20 5 30 10 Q45 18 50 4 Z" stroke="%23ff003c" stroke-width="2.5" fill="none"/><path d="M50 4 Q52 12 60 10" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M70 10 Q80 5 85 20" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M99 30 Q95 50 99 70" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M85 80 Q80 95 70 90" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M50 96 Q45 82 30 90" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M15 80 Q10 65 1 70" stroke="%23ff003c" stroke-width="1.5" fill="none"/><path d="M1 30 Q10 35 15 20" stroke="%23ff003c" stroke-width="1.5" fill="none"/></svg>') center/contain no-repeat;
    box-sizing: border-box;
    border-radius: 50%;
    filter: drop-shadow(0 0 4px #ff003c88) drop-shadow(0 0 12px #111a);
}
.avatar-frame-tribal100 img,
.avatar-frame-tribal100 .avatar-inner,
.avatar-frame-tribal100 .avatar-container {
    position: relative;
    z-index: 2;
    border: none !important;
    background: none !important;
}
/* === Элитная рамка 100-го уровня: Neotribal/Cybersigilism === */
/* ==========================================================================
   1. CORE VARIABLES & THEME (MONOCHROME DARK NEON)
   ========================================================================== */
:root {
    /* --- Цветовая палитра (Deep Dark) --- */
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-glass: rgba(20, 20, 20, 0.7);
    
    /* --- Текст --- */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    
    /* --- Акценты --- */
    --primary-color: #ffffff;
    
    /* --- Границы и Тени --- */
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    --border-light: 1px solid rgba(255, 255, 255, 0.15);
    --border-radius: 14px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    
    /* --- Статусы --- */
    --danger-color: #cf3535;
    --success-color: #35cf6d;
    
    /* --- Типографика --- */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* --- Анимации --- */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. RESET & GLOBAL STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 0%, #151515 0%, #050505 70%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Скроллбар */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Глобальные настройки для текста */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
a { color: var(--text-primary); text-decoration: none; transition: var(--transition); }
button, input, textarea { font-family: var(--font-main); }

/* ==========================================================================
   3. UTILITY CLASSES (GLASSMORPHISM)
   ========================================================================== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-glass);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glass);
}

/* Класс для скрытия элементов */
.hidden {
    display: none !important;
}

/* Анимации появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* ==========================================================================
   4. NAVBAR (HEADER)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; 
    height: 60px;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
    display: flex;
    justify-content: center;
}

.nav-container {
    max-width: 1200px; 
    width: 100%;
    height: 100%; 
    margin: 0 auto; 
    padding: 0 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

/* Логотип */
.logo { flex: 1; display: flex; align-items: center; }
.logo h1 {
    font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 2px; cursor: pointer; margin: 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Центральное меню */
.nav-links { flex: 2; display: flex; justify-content: center; gap: 12px; }

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px;
    border-radius: 12px;
    transition: var(--transition);
    font-size: 0.9rem; font-weight: 500;
    border: 1px solid transparent;
}

.nav-item i { font-size: 1rem; }

/* Ховер */
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Активное состояние */
.nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Правая панель */
.nav-actions { 
    flex: 1; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center;
    gap: 12px; 
}
.search-wrapper { position: relative; display: inline-flex; align-items: center; }

/* --- УМНЫЙ ПОИСК (STATIC + ABSOLUTE EXPANSION) --- */

.search-toggle-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    color: inherit;
}

.search-toggle-btn i {
    font-size: 1.4rem; 
}

/* Поле ввода */
.search-input-field {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    width: 42px;
    height: 42px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0;
    color: transparent;
    opacity: 0;
    cursor: pointer;
    pointer-events: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background 0.3s ease;
    outline: none;
    z-index: 2;
}

/* Активное состояние */
.search-wrapper.active .search-input-field {
    width: 200px;
    background: #050505;
    border-color: rgba(255, 255, 255, 0.2);
    padding: 0 40px 0 16px; 
    color: var(--text-primary);
    opacity: 1;
    cursor: text;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.search-wrapper.active .search-toggle-btn {
    color: var(--text-primary);
    pointer-events: none;
}

/* ШТОРКА РЕЗУЛЬТАТОВ */
.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    margin-top: 8px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    display: none;
    z-index: 1999;
    animation: fadeIn 0.2s ease-out;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 60px;
}

.search-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 10px;
    line-height: 1.2;
}

.search-username {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.search-handle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cosmetics-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.cosmetics-preview-message {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cosmetics-preview .message {
    max-width: none;
    margin: 0;
    animation: none;
    align-items: center;
    width: auto;
}

.cosmetics-preview .message-content {
    padding-left: 0;
    padding-right: 0;
}

.cosmetics-preview .message-avatar {
    width: 42px;
    height: 42px;
}

.cosmetics-preview .message-text {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 14px;
    border-radius: 12px 12px 12px 8px;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Единый размер иконок (1.4rem) */
.icon-btn svg, .icon-btn i {
    width: 20px;
    height: 20px;
    font-size: 1.25rem; 
    display: flex !important;
    justify-content: center;
    align-items: center;
    fill: currentColor;
    visibility: visible !important;
    opacity: 1 !important;
}

.icon-btn i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem !important;
    width: auto !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
}

/* Принудительно показываем иконки в кнопках чата */
.icon-btn.btn-edit-chat i,
.icon-btn.btn-delete-chat i,
.icon-btn.btn-leave-chat i {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 1.4rem !important;
    width: auto !important;
    height: auto !important;
    color: inherit !important;
}

/* Гарантируем видимость иконок Font Awesome */
.icon-btn i.fa-edit,
.icon-btn i.fa-trash,
.icon-btn i.fa-sign-out-alt,
.icon-btn i.fa-times,
.icon-btn i[class*="fa-"] {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.notification-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--text-primary); color: #000;
    font-size: 0.6rem; padding: 2px 5px;
    border-radius: 6px; font-weight: 800;
    min-width: 16px; text-align: center;
}

/* ==========================================================================
   5. UI COMPONENTS (BUTTONS & INPUTS)
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: 10px; cursor: pointer;
    font-weight: 600; transition: var(--transition); gap: 8px;
    font-size: 0.95rem; letter-spacing: 0.3px; border: none;
    transform: scale(1);
}
.btn:hover {
    transform: scale(1.05);
}
.btn:active { 
    transform: scale(0.97);
    transition: transform 0.1s ease;
}
.btn-sm { padding: 8px 20px; font-size: 0.85rem; border-radius: 8px; }

/* Основная кнопка */
.btn-primary {
    background: var(--text-primary); color: #000;
    border: 1px solid var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
    background: #e0e0e0;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

/* Вторичная кнопка */
.btn-secondary {
    background: transparent; color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Кнопка "Опасного действия" */
.btn-danger {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    box-shadow: 0 0 10px rgba(207, 53, 53, 0.1);
}
.btn-danger:hover {
    background: var(--danger-color);
    color: #fff;
    box-shadow: 0 0 20px rgba(207, 53, 53, 0.4);
}

/* Поля ввода */
.form-group input[type="text"], 
.form-group input[type="password"], 
.form-group input[type="email"], 
.form-group textarea {
    width: 100%; padding: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; color: var(--text-primary);
    font-size: 1rem; transition: var(--transition);
}

.form-group textarea {
    resize: none; 
    overflow-y: auto;
}

.textarea-wrapper {
    position: relative;
    width: 100%;
}

.character-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: color 0.2s;
}

.character-counter.warning {
    color: #ffa500;
}

.character-counter.danger {
    color: var(--danger-color);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: none;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4) inset;
    -webkit-text-fill-color: var(--text-primary);
    font-size: 1rem !important;
    line-height: 1.5 !important;
    transition: background-color 9999s ease-in-out 0s;
}

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 46px; }
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}
.password-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.password-toggle:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.1); }

/* --- ХЕШТЕГИ --- */
.hashtag-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.hashtag-link:hover {
    color: #ffffff;
    text-decoration: underline;
    opacity: 0.9;
}

/* ==========================================================================
   6. PROFILE LAYOUT (CENTERED)
   ========================================================================== */
.feed-container, .profile-container {
    max-width: 720px; margin: 0 auto;
    padding: 0 20px;
    padding-top: 80px;
    padding-bottom: 48px;
    min-height: calc(100vh - 60px);
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.leaderboard-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.leaderboard-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.podium-card {
    position: relative;
    padding: 14px 14px 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.podium-rank {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 800;
    color: #000000;
    position: relative;
}

.podium-rank i {
    font-size: 14px;
}

.podium-rank-num {
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.podium-gold {
    background: linear-gradient(135deg, #f8e17a, #d7b100);
    box-shadow: 0 8px 20px rgba(216, 181, 0, 0.25);
}

.podium-silver {
    background: linear-gradient(135deg, #dfe5eb, #b8c2cc);
    box-shadow: 0 8px 20px rgba(150, 161, 175, 0.22);
}

.podium-bronze {
    background: linear-gradient(135deg, #f0c29a, #c77b48);
    box-shadow: 0 8px 20px rgba(179, 112, 68, 0.25);
}

.podium-user {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.podium-name {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-metric {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.leaderboard-item {
    display: grid;
    grid-template-columns: 32px auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-rank {
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-metric {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: right;
}

.leaderboard-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.leaderboard-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.leaderboard-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.podium-avatar, .leaderboard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 0;
    flex-shrink: 0;
    background-color: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.podium-avatar img, .leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.podium-avatar svg, .leaderboard-avatar svg,
.podium-avatar .avatar-fallback svg, .leaderboard-avatar .avatar-fallback svg {
    width: 60%;
    height: 60%;
    fill: #333;
    display: block;
}


.profile-header {
    padding: 40px 40px 25px 40px; 
    margin-bottom: 24px;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; position: relative; overflow: hidden;
}

/* Статус онлайна в правом верхнем углу */
.profile-online-status {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1.5px solid #22c55e;
    color: #22c55e;
    background: transparent;
    letter-spacing: 0.3px;
    margin-top: 4px;
    transition: all 0.3s ease;
}

.profile-online-status.offline {
    border-color: #9ca3af;
    color: #9ca3af;
}

.online-dot {
    display: none;
}

/* Аватар в профиле */
.profile-avatar-wrapper {
    width: 130px; height: 130px; border-radius: 50%;
    background: #151515; border: 3px solid rgba(255, 255, 255, 0.15);
    margin: 0 auto 20px auto; position: relative;
    display: flex; justify-content: center; align-items: center;
    overflow: visible; box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

/* Внутренний слой для круглого обреза содержимого */
.profile-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.default-avatar-icon { font-size: 50px; color: #333 !important; z-index: 1; }
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 2; }

/* Индикатор онлайн статуса на углу аватарки */
.profile-avatar-status {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 3px solid #0b0b0b;
    top: 14px;
    right: 14px;
    z-index: 40;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    transition: all 0.2s ease;
    pointer-events: none;
}

.profile-avatar-status.offline {
    background: #9ca3af;
    border-color: #0b0b0b;
    box-shadow: 0 0 6px rgba(156, 163, 175, 0.35);
}

/* Универсальные стили для всех SVG заглушек аватаров */
.avatar-container svg,
.avatar-fallback svg {
    fill: #333 !important;
}

/* Имена в профиле */
.profile-names-container {
    text-align: center;
    margin-bottom: 12px;
}

.profile-displayname {
    font-size: 1.8rem; 
    font-weight: 700; 
    color: var(--text-primary); 
    line-height: 1.2;
    display: block;
}

.profile-username-handle {
    font-size: 1rem; 
    color: var(--text-muted); 
    font-weight: 500; 
    margin-top: 4px;
    display: block;
}

/* Кнопка действия */
.profile-actions {
    margin-bottom: 24px; display: flex; justify-content: center; width: 100%;
}

/* Статистика */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 12px;
}

.stat-item {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 8px;
    transition: var(--transition);
}

.stat-item.clickable-stat {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.stat-item.clickable-stat:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.stat-item.clickable-stat * {
    pointer-events: none;
}

.stat-item:hover { 
    transform: scale(1.05); 
    background-color: rgba(255, 255, 255, 0.03);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    text-align: center;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 0.65rem;
    margin-bottom: 2px;
    pointer-events: none;
    user-select: none;
}

.stat-badge.experience {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border: 1px solid #6D28D9;
    color: white;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}

/* --- НОВЫЙ ОТДЕЛЬНЫЙ БЛОК BIO --- */
.profile-bio-card {
    width: 100%;
    margin-top: 0; 
    margin-bottom: 24px; 
    padding: 24px 32px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    animation: fadeIn 0.4s ease-out forwards;
}

.profile-bio {
    color: var(--text-secondary); 
    font-size: 0.95rem; 
    line-height: 1.6; 
    white-space: pre-wrap; 
    max-width: 100%;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Свернутое состояние */
.profile-bio.collapsed {
    max-height: 54px; 
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Развернутое состояние */
.profile-bio.expanded {
    max-height: 1000px;
    mask-image: none;
    -webkit-mask-image: none;
}

/* Кнопка стрелочки */
.bio-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 10px; 
    font-size: 1.1rem;
    transition: transform 0.3s ease, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    opacity: 0.7;
}

.bio-toggle-btn:hover {
    color: var(--text-primary);
    opacity: 1;
}

.bio-toggle-btn.rotated {
    transform: rotate(180deg);
}

/* --- ВКЛАДКИ ПРОФИЛЯ --- */
.profile-tabs {
    display: flex;
    padding: 10px 15px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0;
    margin-bottom: 0;
}

.profile-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.profile-tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.profile-tab-content {
    width: 100%;
    margin-top: 24px;
}

/* --- СТЕНА ПРОФИЛЯ --- */
.wall-container {
    width: 100%;
    padding: 20px;
    animation: fadeIn 0.4s ease-out forwards;
    margin-bottom: 24px;
}


.wall-privacy-inline {
    margin-left: 4px;
    flex-shrink: 0;
}

.wall-privacy-inline .btn-icon-small {
    width: 44px;
    height: 44px;
}

.wall-form-wrapper {
    display: flex;
    gap: 14px;
    margin-bottom: 0;
    align-items: center;
}

.wall-form-avatar {
    flex-shrink: 0;
}

.wall-form-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.wall-form-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.wall-form-avatar-container .default-avatar-icon {
    font-size: 20px;
    color: #333;
    z-index: 1;
}

.wall-form-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wall-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.wall-comment-input {
    flex: 1 1 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    resize: none;
    height: 44px;
    min-height: 44px;
    max-height: 120px;
    line-height: 20px;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.wall-comment-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.wall-form-media {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wall-media-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.wall-media-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.wall-media-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.wall-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wall-media-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: var(--transition);
}

.wall-media-remove:hover {
    background: rgba(207, 53, 53, 0.9);
}

.wall-submit-btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #fff;
    color: #000;
    border: 1px solid #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.wall-submit-btn i {
    font-size: 1rem;
}

.wall-submit-btn:hover {
    background: #f2f2f2;
    border-color: #f2f2f2;
}

.wall-comments-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wall-comment-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease-out forwards;
}

.wall-comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-wall-section {
    width: 100%;
    margin-top: 16px;
    margin-bottom: 24px;
    padding: 24px;
    animation: fadeIn 0.4s ease-out forwards;
}

.wall-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wall-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.wall-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wall-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.wall-toggle-btn.rotated {
    transform: rotate(180deg);
}

.wall-content {
    display: block;
}

.wall-content.collapsed {
    display: none;
}

.wall-form-container {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wall-post-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    resize: none;
    height: 60px;
    transition: var(--transition);
    overflow-y: auto;
}

.wall-post-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.wall-post-submit {
    align-self: flex-end;
    min-width: 120px;
}

.wall-posts-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Записи на стене - компактный стиль */
.wall-post-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease-out forwards;
}

.wall-post-item:last-child {
    border-bottom: none;
}

.wall-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.wall-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #151515;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.wall-post-avatar svg {
    width: 60%;
    height: 60%;
    fill: #333;
    display: block;
}

.wall-post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.wall-post-user-info {
    flex: 1;
    min-width: 0;
}

.wall-post-username {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 2px;
}

.wall-post-username:hover {
    text-decoration: underline;
}

.wall-post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wall-post-content {
    margin-bottom: 10px;
    white-space: pre-wrap;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 46px;
}

.wall-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 46px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wall-post-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.wall-post-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.wall-post-action.liked {
    color: var(--danger-color);
}

.wall-post-action.liked svg {
    fill: currentColor;
}

/* Комментарии на стене */
.wall-comments-section {
    padding-top: 12px;
    margin-top: 8px;
    padding-left: 46px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wall-comments-section .comment {
    margin-bottom: 0;
}

.wall-comments-section .comment-form {
    margin-bottom: 0;
}

.wall-comments-section .comment-input {
    font-size: 0.9rem;
    padding: 10px;
}

.wall-posts-container .post-card {
    margin-bottom: 16px;
}

.wall-posts-container .post-card:last-child {
    margin-bottom: 0;
}

/* --- КНОПКИ ПОДПИСКИ --- */
.btn-follow {
    background: var(--text-primary);
    color: #000;
    font-weight: 700;
    border: none;
}
.btn-follow:hover {
    background: #e0e0e0;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-unfollow {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-unfollow:hover {
    background: rgba(207, 53, 53, 0.2); 
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* ==========================================================================
   7. POSTS & FEED
   ========================================================================== */
.post-card {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px 20px 12px 20px; 
    margin-bottom: 24px;
    transition: var(--transition); animation: fadeIn 0.4s ease-out forwards;
}
.post-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.post-header { display: flex; align-items: center; margin-bottom: 12px; }

/* Аватарка в ПОСТЕ (48px) */
.post-avatar {
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    margin-right: 15px;
    flex-shrink: 0;

    background-color: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.post-avatar svg {
    width: 60%;
    height: 60%;
    fill: #333;
    display: block;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.post-info h4 {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 4px;
    color: var(--text-primary);
}
.post-date { font-size: 0.85rem; color: var(--text-muted); }

.post-content {
    margin-bottom: 6px; 
    white-space: pre-wrap; 
    font-size: 1rem;
    color: var(--text-secondary); 
    line-height: 1.5;
}

.post-image {
    width: 100%; 
    border-radius: 10px; 
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0.95; 
    transition: opacity 0.3s;
}
.post-image:hover { opacity: 1; }

/* --- ФУТЕР ПОСТА --- */

.post-actions {
    display: flex; 
    align-items: center; 
    gap: 24px; 
    margin-top: 14px; 
    padding-top: 12px; 
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- SKELETON LOADING --- */
.post-skeleton {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px 20px 12px 20px;
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease-out forwards;
}

.profile-container.loading .profile-header,
.profile-container.loading .profile-bio-card,
.profile-container.loading .profile-tabs,
.profile-container.loading #profilePostsTab,
.profile-container.loading #profileWallTab {
    display: none;
}

.profile-container #profileSkeleton { display: none; }
.profile-container.loading #profileSkeleton {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-skeleton-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 20px;
}

.profile-skeleton-avatar-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.skeleton-avatar-large {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    flex-shrink: 0;
}

.profile-skeleton-name-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 200px;
}

.profile-skeleton-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.profile-skeleton-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.skeleton-stat {
    height: 54px;
    border-radius: 12px;
}

.profile-skeleton-bio {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
}

.profile-skeleton-tabs {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
}

.skeleton-tab {
    flex: 1;
    height: 38px;
    border-radius: 12px;
}

.skeleton-pill { height: 14px; width: 140px; border-radius: 999px; }
.skeleton-button.pill { width: 96px; height: 34px; border-radius: 999px; }

.profile-skeleton-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-skeleton-wall {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}

.wall-skeleton {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wall-skeleton-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
}

.wall-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.wall-skeleton-line { height: 12px; width: 100%; border-radius: 6px; }
.wall-skeleton-line.short { width: 65%; }

/* Chat skeletons (lightweight for sidebar) */
.chat-skeleton {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}
.chat-skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
}
.chat-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.chat-skeleton-line {
    height: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
}
.chat-skeleton-line.short { width: 60%; }

.chat-skeleton-avatar,
.chat-skeleton-line {
    animation: shimmer 1.4s infinite;
}

.skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.skeleton-text-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-username {
    height: 16px;
    width: 120px;
    border-radius: 4px;
}

.skeleton-date {
    height: 12px;
    width: 80px;
    border-radius: 4px;
}

.skeleton-content {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 14px;
    width: 100%;
    border-radius: 4px;
}

.skeleton-line-short {
    width: 70%;
}

.skeleton-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.skeleton-button {
    width: 60px;
    height: 20px;
    border-radius: 4px;
}

/* Применяем анимацию shimmer ко всем skeleton элементам */
.skeleton-avatar,
.skeleton-text,
.skeleton-line,
.skeleton-button,
.skeleton-avatar-large,
.skeleton-pill,
.skeleton-stat,
.skeleton-tab,
.wall-skeleton-avatar,
.wall-skeleton-line {
    background: rgba(255, 255, 255, 0.05);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.post-action, .comment-action, .action-btn {
    background: transparent; 
    border: 1px solid transparent; 
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 0.95rem; 
    font-weight: 500;
    padding: 6px 10px; 
    border-radius: 6px;
    transform: scale(1);
}

.post-action:hover, .comment-action:hover, .action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.post-action:active, .comment-action:active, .action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.post-action.liked, .comment-action.liked {
    color: var(--danger-color); 
}
.post-action.liked svg, .comment-action.liked svg {
    fill: currentColor;
}

/* --- COMMENTS SECTION --- */

.comments-section {
    padding-top: 20px;
    margin-top: 0; 
    display: flex;
    flex-direction: column;
    gap: 24px; 
}

/* 1. Блок комментария */
.comment {
    display: flex;
    gap: 10px; 
    align-items: flex-start;
    animation: fadeIn 0.3s ease-out forwards;
    position: relative;
    width: 100%;
}

/* 2. Аватар в комментарии (40px) */
.comment-avatar {
    width: 40px; 
    height: 40px; 
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #151515;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.comment-avatar svg {
    width: 60%;
    height: 60%;
    fill: #333;
    display: block;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* 3. Контейнер тела комментария */
.comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 4. Верхняя строка: Имя (слева) и Время (справа) */
.comment-header-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding-left: 0; 
    margin-bottom: 2px;
    gap: 12px;
}

.comment-username {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}
.comment-username:hover { text-decoration: underline; }

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
}

/* 5. Основной ряд: Текст (Пузырь) и Лайк (справа у края) */
.comment-content-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-end; 
    gap: 12px;
    width: 100%;
}

/* Пузырь с текстом */
.comment-bubble {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    border-radius: 0 12px 12px 12px; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 90%; 
    width: fit-content;
}

.comment-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Кнопка Лайка */
.comment-like-wrapper {
    flex-shrink: 0;
    margin-bottom: 0; 
    z-index: 5;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.comment-like-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    padding: 6px; 
}

.comment-like-btn:hover { 
    color: var(--text-primary); 
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.comment-like-btn.liked { color: var(--danger-color); }
.comment-like-btn.liked svg { fill: currentColor; }
.comment-like-btn svg { width: 16px; height: 16px; stroke-width: 2px; }

/* 6. Нижний ряд: Кнопки действий */
.comment-footer-actions {
    display: flex;
    gap: 16px;
    padding-left: 0; 
    margin-top: 2px;
}

.comment-action-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    opacity: 0.7;
}

.comment-action-link:hover { opacity: 1; color: var(--text-primary); }
.comment-action-link.delete:hover { color: var(--danger-color); }

.comment-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 4px;
}

.comment-delete-btn:hover {
    color: var(--danger-color);
    background: rgba(207, 53, 53, 0.1);
}

.comment-image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-image:hover {
    opacity: 0.9;
}


/* FIX: Форма ввода */
.comment-form {
    display: flex;
    align-items: center; 
    gap: 12px;
    margin-bottom: 24px;
}

.comment-form .form-group {
    margin: 0;
    flex: 1;
    display: flex;
}

.comment-form textarea {
    width: 100%;
    margin: 0;
}

/* --- ПРЕВЬЮ ИЗОБРАЖЕНИЯ ПРИ СОЗДАНИИ ПОСТА --- */
.post-image-preview-container {
    margin-bottom: 16px;
    margin-top: 8px;
}

.post-image-preview-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.post-image-preview {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.post-image-preview-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.post-image-preview-remove:hover {
    background: rgba(207, 53, 53, 0.9);
    transform: scale(1.1);
}

/* Кнопка-Самолетик */
.send-plane-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px; 
    background: transparent;
    border: 1px solid transparent; 
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.send-plane-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.send-plane-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    margin-left: -2px; 
}

/* ==========================================================================
   8. AUTHENTICATION PAGES
   ========================================================================== */
.auth-footer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}
.auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 24px 0;
    padding-left: 0;
    padding-right: 0;
    position: relative;
    overflow: hidden;
    width: 100%;
}
.auth-section::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 20% 30%, rgba(229, 9, 20, 0.08), transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.08), transparent 55%),
                radial-gradient(circle at 50% 50%, rgba(109, 40, 217, 0.06), transparent 60%);
    filter: blur(12px);
    animation: authPulse 26s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}
@keyframes authPulse {
    0% { transform: scale(1) translate3d(0,0,0); opacity: 0.6; }
    50% { transform: scale(1.04) translate3d(8px, -6px, 0); opacity: 0.8; }
    100% { transform: scale(1.02) translate3d(-6px, 10px, 0); opacity: 0.7; }
}
.auth-layout {
    width: 100%;
    max-width: 1280px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(380px, 440px) minmax(280px, 1fr);
    gap: 24px;
    align-items: stretch;
    margin: 0 auto;
    padding: 0;
}
.auth-layout.single {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 420px;
    justify-items: center;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
}
.auth-info-block.tight { margin-bottom: 12px; }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.mini-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}
.mini-card.soft { background: rgba(255,255,255,0.015); }
.mini-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.mini-value { color: var(--text-primary); font-size: 1.35rem; font-weight: 800; line-height: 1; }
.mini-pill { background: rgba(82, 227, 255, 0.12); color: #a6e8ff; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.3px; display: inline-flex; align-items: center; width: fit-content; }
.mini-line { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 8px; overflow: hidden; }
.mini-line span { display: block; height: 100%; width: 60%; border-radius: 8px; background: linear-gradient(135deg, rgba(82,227,255,0.6), rgba(168,85,247,0.5)); animation: barPulse 2.4s ease-in-out infinite; transform-origin: left; }
.mini-line.alt span { background: linear-gradient(135deg, rgba(248,113,113,0.6), rgba(94,234,212,0.5)); animation-delay: 0.12s; }
.mini-dots { display: flex; gap: 8px; align-items: center; }
.mini-dots .dot { width: 10px; height: 10px; border-radius: 50%; filter: blur(0.25px); opacity: 0.85; animation: dotPulse 2s ease-in-out infinite; }
.mini-dots .dot-b { animation-delay: 0.12s; }
.mini-dots .dot-c { animation-delay: 0.24s; }

@keyframes barPulse { 0%, 100% { transform: scaleX(0.9); opacity: 0.75; } 50% { transform: scaleX(1.05); opacity: 1; } }
@keyframes dotPulse { 0%, 100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(-2px); opacity: 1; } }

.pulse-ribbon {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.pulse-ribbon.compact { margin-top: 8px; }
.pulse-ribbon span {
    height: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(82,227,255,0.5), rgba(168,85,247,0.45));
    animation: ribbonWave 2.8s ease-in-out infinite;
    transform-origin: center;
}
.pulse-ribbon span:nth-child(2) { animation-delay: 0.08s; height: 10px; }
.pulse-ribbon span:nth-child(3) { animation-delay: 0.16s; height: 9px; }
.pulse-ribbon span:nth-child(4) { animation-delay: 0.24s; height: 11px; }
.pulse-ribbon span:nth-child(5) { animation-delay: 0.32s; height: 8px; }
.pulse-ribbon span:nth-child(6) { animation-delay: 0.4s; height: 10px; }

.pulse-notes { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.76rem; margin-top: 6px; letter-spacing: 0.2px; }

@keyframes ribbonWave { 0%, 100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(-2px) scaleX(1.05); opacity: 1; } }

.indicator-ring {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 70%);
    box-shadow: 0 0 24px rgba(82,227,255,0.08);
}
.indicator-ring .dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.85;
    filter: blur(0.2px);
    animation: ringSpin 4s linear infinite;
}
.indicator-ring .dot-a { top: 6px; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.indicator-ring .dot-b { right: 6px; top: 50%; transform: translateY(-50%); animation-delay: 0.4s; }
.indicator-ring .dot-c { bottom: 6px; left: 50%; transform: translateX(-50%); animation-delay: 0.8s; }
.indicator-ring .dot-d { left: 6px; top: 50%; transform: translateY(-50%); animation-delay: 1.2s; }

.activity-bar {
    position: relative;
    width: 100%;
    height: 46px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 6px;
}
.activity-bar span {
    display: block;
    width: 12px;
    background: linear-gradient(180deg, rgba(82,227,255,0.8), rgba(168,85,247,0.7));
    border-radius: 8px;
    animation: barPulse 2.8s ease-in-out infinite;
}

.glow-text { color: var(--text-primary); text-shadow: 0 0 10px rgba(255,255,255,0.14); }

.abstract-viewport {
    position: relative;
    height: 170px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(20,20,20,0.6), rgba(40,40,40,0.4));
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.shape {
    position: absolute;
    filter: blur(8px);
    opacity: 0.7;
    animation: floatSoft 12s ease-in-out infinite;
}
.shape-ring {
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 18px solid rgba(168,85,247,0.2);
    top: 16px; left: 18px;
}
.shape-rect {
    width: 180px; height: 60px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(14,165,233,0.16), rgba(168,85,247,0.14));
    top: 54px; right: 12px;
}
.shape-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    bottom: 18px; left: 32px;
    animation-delay: 1.4s;
}
.shape-glow {
    width: 220px; height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,0.22), rgba(0,0,0,0));
    bottom: -60px; right: -40px;
    filter: blur(22px);
    animation-delay: 0.8s;
}
.shape-bar {
    width: 140px; height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(82,227,255,0.5), rgba(168,85,247,0.5));
    top: 26px; right: 58px;
    animation-delay: 2s;
}

.atmo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.atmo-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ring-card { justify-content: space-around; }
.atmo-label { font-size: 0.85rem; letter-spacing: 0.2px; }
.atmo-wave { display: flex; align-items: center; gap: 6px; width: 100%; }
.atmo-wave span {
    flex: 1;
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(82,227,255,0.6), rgba(168,85,247,0.55));
    animation: barPulse 2.4s ease-in-out infinite;
}
.atmo-wave span:nth-child(2) { animation-delay: 0.12s; height: 20px; }
.atmo-wave span:nth-child(3) { animation-delay: 0.24s; height: 14px; }
.atmo-wave span:nth-child(4) { animation-delay: 0.36s; height: 18px; }

.atmo-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(82,227,255,0.4), rgba(168,85,247,0.4));
    box-shadow: 0 0 18px rgba(82,227,255,0.25);
    position: relative;
    overflow: hidden;
}
.atmo-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
    animation: shimmer 3s infinite;
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.btn.ghost {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.18);
}
.glow-text.subtle { font-size: 0.82rem; color: var(--text-muted); text-shadow: 0 0 8px rgba(255,255,255,0.12); }

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes ringSpin {
    0% { transform: rotate(0deg) translateY(0); }
    100% { transform: rotate(360deg) translateY(0); }
}
@keyframes floatSoft {
    0%, 100% { transform: translate3d(0,0,0); opacity: 0.7; }
    50% { transform: translate3d(6px,-6px,0); opacity: 0.9; }
}
.auth-container {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 40px 20px;
    text-align: center;
    animation: scaleIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 540px;
    margin: 0 auto;
}
.auth-panel {
    position: relative;
    overflow: hidden;
    padding: 28px;
    backdrop-filter: blur(16px);
}
.auth-panel .auth-info-block { position: relative; z-index: 1; margin-bottom: 18px; text-align: left; }
.auth-orbs { position: absolute; inset: 0; z-index: 0; filter: blur(42px); opacity: 0.32; }
.auth-orbs .orb { position: absolute; border-radius: 50%; }
.auth-orbs .orb-a { width: 180px; height: 180px; background: radial-gradient(circle, #6d28d9 0%, transparent 70%); top: -30px; left: -20px; animation: floatA 24s ease-in-out infinite; }
.auth-orbs .orb-b { width: 220px; height: 220px; background: radial-gradient(circle, #e50914 0%, transparent 75%); bottom: -50px; right: -30px; animation: floatB 28s ease-in-out infinite; }
.auth-orbs .orb-c { width: 200px; height: 200px; background: radial-gradient(circle, #0ea5e9 0%, transparent 75%); bottom: -40px; left: 30%; animation: floatB 26s ease-in-out infinite; }
@keyframes floatA { 0% { transform: translate(0,0);} 50% { transform: translate(8px, -6px);} 100% { transform: translate(0,0);} }
@keyframes floatB { 0% { transform: translate(0,0);} 50% { transform: translate(-10px, 10px);} 100% { transform: translate(0,0);} }
.auth-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--text-primary); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.4px; text-transform: uppercase; }
.auth-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.auth-stat { padding: 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; background: rgba(255,255,255,0.02); }
.auth-stat-value { display: block; font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.auth-stat-label { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase; }
.auth-muted { color: var(--text-muted); font-size: 0.85rem; }
.auth-info-title { font-size: 1.2rem; font-weight: 800; margin: 10px 0 8px; color: var(--text-primary); }
.auth-info-text { color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.auth-info-list { list-style: none; color: var(--text-secondary); display: flex; flex-direction: column; gap: 8px; padding-left: 0; }
.auth-info-list li { padding-left: 0; }
.auth-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.auth-chip { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--text-primary); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.1px; }
.auth-previews { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.auth-preview-card {
    position: relative;
    padding: 12px 12px 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}
.auth-preview-card .line { display: block; background: rgba(255,255,255,0.35); border-radius: 6px; height: 7px; }
.auth-preview-card .line-long { width: 160px; opacity: 0.8; }
.auth-preview-card .line-medium { width: 120px; opacity: 0.7; }
.auth-preview-card .line-short { width: 90px; opacity: 0.6; }
.auth-preview-card .line-mini { width: 60px; opacity: 0.5; }
.auth-preview-blur {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(109,40,217,0.1), rgba(14,165,233,0.08));
    filter: blur(10px);
    opacity: 0.65;
    pointer-events: none;
}
.auth-preview-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6d28d9, #e50914);
    opacity: 0.7;
    filter: blur(1px);
    flex-shrink: 0;
}
.auth-preview-avatars {
    display: flex;
    gap: 6px;
    align-items: center;
}
.auth-preview-avatars.stacked .dot { margin-left: -6px; border: 1px solid rgba(0,0,0,0.25); }
.auth-preview-avatars.stacked.dots-large .dot { width: 16px; height: 16px; margin-left: -7px; filter: blur(0.3px); }
.auth-preview-avatars .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: 0.75;
    filter: blur(0.4px);
}
.auth-preview-avatars .dot-a { background: #22c55e; }
.auth-preview-avatars .dot-b { background: #eab308; }
.auth-preview-avatars .dot-c { background: #38bdf8; }
.auth-preview-avatars .dot-d { background: #f472b6; }
.auth-preview-avatars .dot-e { background: #a855f7; }
.auth-preview-text { position: relative; z-index: 1; }
.auth-preview-lines { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.auth-preview-lines .line { margin-left: 2px; }
.auth-preview-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    opacity: 0.6;
    filter: blur(1px);
    flex-shrink: 0;
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    animation: typingBlink 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBlink {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 0.9; transform: translateY(-1px); }
}

@media (max-width: 1100px) {
    .auth-layout { grid-template-columns: minmax(320px, 1fr) minmax(380px, 440px); max-width: 960px; }
    .auth-about { display: none; }
}

@media (max-width: 820px) {
    .auth-layout { grid-template-columns: 1fr; max-width: 640px; }
    .auth-panel { order: 2; }
    .auth-container { order: 1; }
}

@media (max-width: 520px) {
    .auth-container { padding: 40px 20px; }
    .glass {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    }
    .auth-section::before {
        filter: blur(8px);
        opacity: 0.5;
    }
    .navbar {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .auth-panel { padding: 24px; }
}
.auth-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); text-transform: uppercase; letter-spacing: 2px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 32px; }
.form-group { margin-bottom: 24px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.auth-buttons { display: flex; gap: 16px; margin-top: 32px; }
.auth-buttons .btn { flex: 1; }

/* ==========================================================================
   9. MODALS & NOTIFICATIONS
   ========================================================================== */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 2000;
    align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(5px);
    opacity: 0; /* Fix for flash before animation */
    transition: opacity 0.3s ease;
}
.modal.active { display: flex; opacity: 1; animation: fadeIn 0.3s ease-out forwards; }
.modal-content {
    width: 100%; max-width: 500px; background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
    padding: 24px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-content textarea {
    max-height: 250px;
    min-height: 100px;
    resize: none; 
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 16px;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.8rem; cursor: pointer; line-height: 1; transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); transform: rotate(90deg); }

.modal-close-absolute {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    z-index: 10;
}

.modal-close-absolute:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Модальное окно профиля */
.profile-modal-content {
    position: relative;
}

.profile-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.profile-modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    background: #151515;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.profile-modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.profile-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-modal-body {
    padding: 0;
}

.profile-modal-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

.profile-modal-meta {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state {
    padding: 80px 20px; text-align: center; color: var(--text-muted);
    border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 20px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.01);
}
.empty-state i { font-size: 3rem; margin-bottom: 20px; opacity: 0.3; }
.empty-state p { font-size: 1rem; font-weight: 500; }

.notification-container {
    position: fixed; bottom: 30px; right: 30px; z-index: 3000;
    display: flex; flex-direction: column; gap: 12px;
    align-items: flex-end;
    pointer-events: none; /* Allows clicking through the container */
}
.notification-toast {
    background: #151515; border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 24px; border-radius: 10px; color: var(--text-primary);
    min-width: 300px; max-width: 400px; border-left: 4px solid var(--text-primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); font-weight: 500;
    pointer-events: auto; /* Re-enable clicks on toasts */
}
.notification-toast.error { border-left-color: var(--danger-color); }
.notification-toast.success { border-left-color: var(--success-color); }

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-text {
    flex: 1;
    font-size: 0.95rem;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-left: 8px;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* --- NOTIFICATIONS DROPDOWN --- */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    display: none; 
    z-index: 2000;
    margin-top: 12px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.notification-dropdown.active {
    display: flex;
    flex-direction: column;
}

.notification-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.notification-header-row span:first-child {
    font-weight: 700;
    font-size: 0.95rem;
}

.mark-read-link {
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.7;
}
.mark-read-link:hover { opacity: 1; text-decoration: underline; }

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: rgba(255, 255, 255, 0.05); }

.notification-item.unread {
    background: rgba(255, 255, 255, 0.08); 
    border-left: 3px solid var(--text-primary);
}

.notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-content {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.notif-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.notif-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   10. MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .nav-links span { display: none; }
    .search-bar { display: none; }
    .nav-container { padding: 0 15px; }
    .profile-stats { gap: 16px; } 
    .profile-avatar-wrapper { width: 100px; height: 100px; }
    .profile-username { font-size: 1.4rem; }
    .auth-container { padding: 40px 20px; }
    
    .notification-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0 0 12px 12px;
        margin-top: 0;
    }
}

/* ==========================================================================
   11. CHAT LAYOUT & STYLES (MESSENGER UI)
   ========================================================================== */

/* Общий контейнер страницы чата */
.chat-container-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 100px); /* Высота экрана минус навбар и отступы */
    padding-top: 80px; /* Отступ сверху (60px навбар + 20px пространство) */
    gap: 20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    overflow: hidden; /* Чтобы скролл был внутри блоков */
    -ms-overflow-style: none; /* IE и Edge */
    scrollbar-width: none; /* Firefox */
}

/* Скрываем скроллбар на странице чатов */
.chat-container-layout::-webkit-scrollbar {
    display: none;
}

/* --- САЙДБАР (СПИСОК ЧАТОВ) --- */
.chat-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 0; /* Паддинг будет внутри элементов */
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-wrapper {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 240px;
    background: rgba(12, 12, 12, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 30;
}

.dropdown-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.dropdown-item.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.dropdown-hint {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-icon-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-icon-small:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Табы (Личные / Группы) */
.chat-tabs {
    display: flex;
    padding: 10px 15px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}

.chat-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.chat-tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Список чатов */
.chats-list-wrapper {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.chats-list-wrapper::-webkit-scrollbar {
    display: none;
}

.chats-list-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chats-list {
    display: flex;
    flex-direction: column;
}

.chat-item {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--text-primary);
}

.chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Стили для avatar-container внутри chat-item-avatar */
.chat-item-avatar .avatar-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chat-item-avatar .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-item-avatar .avatar-container svg {
    width: 60%;
    height: 60%;
    fill: #333;
}

.chat-item-avatar.group-chat {
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-item-avatar.group-chat i {
    font-size: 1.1rem;
    color: var(--text-primary);
    opacity: 0.9;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Статус онлайн на аватаре */
.chat-item-avatar.online {
    opacity: 1; /* Явно установленная полная видимость для онлайн аватарок */
}

/* Аватарка в чате - кликабельный элемент для перехода на профиль */
.chat-item-avatar {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-item-avatar:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.chat-item-content {
    flex: 1;
    min-width: 0; /* Для работы text-overflow */
}

.chat-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-item-delete-btn {
    background: rgba(207, 53, 53, 0.1);
    border: 1px solid rgba(207, 53, 53, 0.2);
    color: var(--danger-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0.7;
}

.chat-item-delete-btn:hover {
    background: rgba(207, 53, 53, 0.2);
    border-color: var(--danger-color);
    opacity: 1;
    transform: scale(1.05);
}

.chat-item-delete-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 10px;
}

.chat-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.chat-preview-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.chat-preview-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.unread-badge {
    background: var(--text-primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-left: auto;
}

.no-chats {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.no-messages {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.typing-indicator {
    padding: 8px 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 400;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease;
}

.typing-indicator.active {
    opacity: 1;
    max-height: 50px;
}

/* --- ГЛАВНОЕ ОКНО ЧАТА --- */
.chat-main-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
}

/* Хедер чата */
.chat-header {
    height: 70px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.no-chat-selected-header {
    color: var(--text-muted);
    font-weight: 500;
}

/* Область сообщений */
.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Расстояние между сообщениями */
    background: rgba(0, 0, 0, 0.2);
}

/* Плейсхолдер "Выберите чат" */
.no-chat-selected {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.5;
}

.no-chat-selected i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Сообщения */
.message {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 80%;
    margin-bottom: 8px;
    position: relative;
    animation: fadeIn 0.2s ease-out;
    padding-left: 0;
}

.message.own {
    flex-direction: row-reverse;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
    gap: 8px;
}

/* Стили для чужих сообщений */

.message-content {
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    margin-top: 0;
}

.message.own .message-content {
    align-items: flex-end;
    padding-left: 40px; /* Расширяем область hover, чтобы включить кнопку меню */
}

/* Кнопка меню для своих сообщений (три точки) */
.message-menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    opacity: 0;
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin: 0;
    pointer-events: auto; /* Всегда активна для кликов */
}

/* Кнопка позиционируется относительно пузыря сообщения */
.message-text .message-menu-btn {
    left: -28px;
}

/* Кнопка меню для чужих сообщений справа */
.message:not(.own) .message-text .message-menu-btn {
    left: auto;
    right: -28px;
}

.message.own:hover .message-menu-btn,
.message-menu-btn:hover,
.message.own .message-content:hover .message-menu-btn,
.message.own:has(.message-menu-btn:hover) .message-menu-btn {
    opacity: 1;
    pointer-events: auto;
}

.message:not(.own):hover .message-menu-btn,
.message:not(.own) .message-content:hover .message-menu-btn,
.message:not(.own):has(.message-menu-btn:hover) .message-menu-btn {
    opacity: 1;
    pointer-events: auto;
}

.message-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.05);
}

.message-menu-btn i {
    font-size: 0.75rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Кнопка ответа для чужих сообщений (стрелка) */

/* Контекстное меню */
.message-context-menu {
    position: absolute;
    top: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-glass);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: 1000;
    min-width: 120px;
    display: none;
    flex-direction: column;
    gap: 2px;
}

/* Контекстное меню для своих сообщений (слева) */
.message.own .message-context-menu {
    left: -140px;
    right: auto;
}

/* Контекстное меню для чужих сообщений (справа) */
.message:not(.own) .message-context-menu {
    left: auto;
    right: -140px;
}

.message-context-menu.active {
    display: flex;
}

.message-context-menu.menu-top {
    top: auto;
    bottom: 0;
}

.message-context-menu-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.message-context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.message-context-menu-item i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.message-context-menu-item.danger {
    color: var(--danger-color);
}

.message-context-menu-item.danger:hover {
    background: rgba(207, 53, 53, 0.15);
}

/* На мобильной версии */
@media (max-width: 768px) {
    .message.own .message-menu-btn,
    .message.own.touching .message-menu-btn,
    .message:not(.own).touching .message-menu-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.message-text {
    padding: 6px 10px;
    border-radius: 10px 10px 10px 0;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
    display: inline-block;
    text-align: left;
    width: fit-content;
    max-width: 100%;
    margin: 0;
}

.system-message {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 10px 0;
    opacity: 0.85;
}

.mention-suggestions {
    position: absolute;
    bottom: 56px;
    left: 8px;
    right: 8px;
    background: rgba(20,20,20,0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    padding: 6px 0;
}

.mention-suggestion-item {
    padding: 8px 12px;
    display: flex;
    cursor: pointer;
    transition: background 0.12s ease;
}

.mention-suggestion-item:hover {
    background: rgba(255,255,255,0.08);
}

.mention-suggestion-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #151515;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mention-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.mention-avatar svg,
.mention-avatar .avatar-fallback svg {
    width: 60%;
    height: 60%;
    color: #333;
    opacity: 1;
}

/* Аватар в списках участников/поиске — идентично message-avatar */
.search-avatar.avatar-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.search-avatar.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.search-avatar.avatar-container svg,
.search-avatar.avatar-container .avatar-fallback svg {
    width: 60%;
    height: 60%;
    fill: #333 !important;
    display: block;
    margin: 0;
    padding: 0;
}

.mention-names {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.mention-username {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.mention-display {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.mention-link {
    color: var(--accent, #4da3ff);
    text-decoration: underline;
    font-weight: 700;
}

.mention-link:hover {
    text-decoration: underline;
}


/* Свои сообщения */
.message.own {
    align-self: flex-end;
}

.message.own .message-text {
    background: var(--text-primary);
    color: #000;
    border-radius: 10px 10px 0 10px;
    line-height: 1.4;
}

/* Показываем аватарки для всех сообщений, включая свои */
.message.own .message-avatar {
    display: flex;
}

/* Аватарки в сообщениях */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #151515;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.message-avatar .avatar-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.message-avatar .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message-avatar .avatar-container svg {
    width: 60%;
    height: 60%;
    fill: #333 !important;
    display: block;
    margin: 0;
    padding: 0;
}

/* Метаданные сообщения */
.message-header {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
}

.message-user {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}

/* Для чужих сообщений: имя слева, время сразу после него */
.message:not(.own) .message-header {
    flex-direction: row;
    justify-content: flex-start;
}

/* Для своих сообщений: никнейм слева, время сразу после него */
.message.own .message-header {
    flex-direction: row;
    justify-content: flex-start;
}

/* УДАЛЕННЫЕ СООБЩЕНИЯ */
.message.deleted .message-text {
    font-style: normal;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.5;
    padding: 6px 10px;
    border-radius: 10px 10px 10px 0;
    line-height: 1.4;
    font-size: 0.95rem;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    margin: 0;
}

.message.deleted.own .message-text {
    border-radius: 10px 10px 0 10px;
}

.message.deleted .message-text.deleted-text {
    padding: 6px 10px;
}

/* Косметические рамки для аватаров и превью */
.avatar-container.cosmetic-frame-frame_none,
.profile-avatar-inner.cosmetic-frame-frame_none,
#previewAvatarFrame.cosmetic-frame-frame_none {
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

/* Легендарный сет (ур. 100) */

/* Если применена кастомная рамка, убираем базовую обводку у message-avatar */
.message-avatar .avatar-container[class*='cosmetic-frame-'] {
    border: none;
}

/* Косметические бабблы сообщений */
.message-text.cosmetic-bubble-bubble_default,
#previewMessageBubble.cosmetic-bubble-bubble_default {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.message.own .message-text.cosmetic-bubble-bubble_default {
    background: var(--text-primary);
    color: #000;
}

.message-input-area {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    flex-shrink: 0;
}

.message-input-area .input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-input-wrapper {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.message-input-wrapper textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: none;
    padding: 0;
    margin: 0;
    height: 24px;
    min-height: 24px;
    max-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    vertical-align: middle;
    outline: none;
}

.message-input-wrapper textarea:focus {
    box-shadow: none;
    background: transparent;
    outline: none;
}

.message-input-wrapper textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.btn-send, .btn-attach {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 1rem;
}

.btn-attach {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.btn-attach:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: scale(1.05);
}

.btn-attach:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.btn-attach i {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-send {
    background: var(--text-primary);
    color: #000;
    border: 1px solid var(--text-primary);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.btn-send:hover {
    background: #e0e0e0;
    border-color: #e0e0e0;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-send:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
    transition: transform 0.1s ease;
}

.btn-send i {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-send svg, .btn-attach svg {
    width: 20px;
    height: 20px;
}

/* Превью медиа перед отправкой */
.media-preview {
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-width: 100%;
    width: 100%;
    display: block;
    flex-shrink: 0;
    order: -1;
}

.media-preview-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.media-preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.media-preview-file {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.media-preview-file i {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.media-preview-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: rgba(207, 53, 53, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: var(--transition);
}

.media-preview-close:hover {
    background: rgba(207, 53, 53, 1);
    transform: scale(1.1);
}

/* Стильный статус в сети */
/* Статус в сети в шапке чата - компактный, без кружка */
.chat-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: transparent;
}

.chat-status-inline .online-status-badge,
.chat-status-inline .offline-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: inherit;
    padding: 0;
    border-radius: 0;
    background: transparent;
    margin: 0;
}

.chat-status-inline .online-status-badge {
    color: var(--success-color);
    font-weight: 500;
}

.chat-status-inline .offline-status-badge {
    color: var(--text-muted);
    font-weight: 500;
}

.chat-status-inline i,
.chat-status-inline .fa-circle,
.chat-status-inline .far.fa-circle {
    font-size: 0.55rem;
    display: inline-block !important;
}

/* Общие стили для статусов (если используются отдельно) */
.online-status-badge,
.offline-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: inherit;
    padding: 0;
    border-radius: 0;
    background: transparent;
    margin: 0;
}

.online-status-badge {
    color: var(--success-color);
}

.online-status-badge {
    color: var(--success-color);
    font-weight: 500;
}

.offline-status-badge {
    color: var(--text-muted);
    font-weight: 400;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* --- PREVIEW REPLY --- */
.reply-preview {
    background: rgba(20, 20, 20, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.reply-content {
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--text-primary);
    padding-left: 10px;
}
.reply-content span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}
.close-reply {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.edit-indicator {
    background: rgba(20, 20, 20, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.edit-indicator-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-indicator i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.edit-indicator-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.85rem;
    margin-left: auto;
}

.edit-indicator-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.edit-indicator-close i {
    font-size: 0.85rem;
    color: inherit;
}

/* --- ADMIN BUTTONS IN HEADER --- */
.btn-admin-chat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.btn-admin-chat:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: scale(1.05);
}

.btn-admin-chat:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Стили для кнопок удаления и выхода - единый стиль с icon-btn */
.icon-btn.btn-delete-chat:hover {
    background: rgba(207, 53, 53, 0.15);
    color: var(--danger-color);
    border-color: rgba(207, 53, 53, 0.3);
}

.icon-btn.btn-leave-chat:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Кнопка удаления сообщения всегда видна на мобильных */
@media (max-width: 768px) {
    .message-delete-btn {
        opacity: 1;
    }
}

/* --- MOBILE RESPONSIVE FOR CHAT --- */
@media (max-width: 768px) {
    .chat-container-layout {
        padding: 0;
        margin-top: 60px;
        height: calc(100vh - 60px);
    }
    
    .chat-sidebar {
        width: 100%;
        border-right: none;
    }
    
    .chat-sidebar.active {
        display: flex;
    }
    
    /* Когда открыт чат, скрываем сайдбар на мобильном */
    .chat-sidebar.hidden-mobile {
        display: none;
    }

    .chat-main-window {
        display: none;
        width: 100%;
    }
    
    .chat-main-window.active-mobile {
        display: flex;
    }
    
    /* Кнопка "Назад" в мобильном хедере */
    .menu-toggle {
        display: block !important; /* Убеждаемся что она видна */
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.2rem;
        margin-right: 10px;
    }
}

/* ==========================================================================
   LEVEL & EXPERIENCE SYSTEM
   ========================================================================== */

:root {
    /* Интервалы оттенков */
    --level-tier-0: linear-gradient(135deg, #38404a, #2a2f36); /* 1-9 темно-серый чуть светлее для контраста */
    --level-tier-1: linear-gradient(135deg, #2f5fa8, #1e3e75); /* 10-19 Сапфир */
    --level-tier-2: linear-gradient(135deg, #1f7a52, #125138); /* 20-29 Изумруд */
    --level-tier-3: linear-gradient(135deg, #9b1f2f, #5b101c); /* 30-39 Рубин */
    --level-tier-4: linear-gradient(135deg, #593a8c, #35245f); /* 40-49 Аметист */
    --level-tier-5: linear-gradient(135deg, #c4861f, #8a5813); /* 50-59 Янтарный */
    --level-tier-6: linear-gradient(135deg, #1f8b8c, #166366); /* 60-69 Бирюзовый */
    --level-tier-7: linear-gradient(135deg, #2d3e82, #1f295c); /* 70-79 Индиго */
    --level-tier-8: linear-gradient(135deg, #5a1f2f, #36111c); /* 80-89 Бордо */
    --level-tier-9: linear-gradient(135deg, #86542a, #5a381c); /* 90-99 Медь */
    --level-tier-100: linear-gradient(135deg, #0c0c0f, #101015); /* 100 матовый центр */

    --level-border-base: rgba(255, 255, 255, 0.16);
    --level-surface: rgba(255, 255, 255, 0.045);
    --level-badge-size: 26px;
}

.level-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.level-badge {
    --accent: var(--level-tier-0);
    position: relative;
    width: var(--level-badge-size);
    height: var(--level-badge-size);
    display: grid;
    place-items: center;
    transform: rotate(45deg);
    border-radius: 6px;
    background: var(--level-surface);
    border: 1px solid var(--level-border-base);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.16),
        inset 0 -2px 6px rgba(0, 0, 0, 0.45),
        0 6px 14px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.level-badge::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 4px;
    background: var(--accent);
    opacity: 1;
}

.level-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0));
    mix-blend-mode: screen;
}

.level-digit {
    position: relative;
    z-index: 2;
    transform: rotate(-45deg);
    color: #f7f7f9;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.35px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.32);
}

/* Десятки */
.level-badge.level-01, .level-badge.level-02, .level-badge.level-03, .level-badge.level-04, .level-badge.level-05, .level-badge.level-06, .level-badge.level-07, .level-badge.level-08, .level-badge.level-09 { --accent: var(--level-tier-0); }
.level-badge.level-10, .level-badge.level-11, .level-badge.level-12, .level-badge.level-13, .level-badge.level-14, .level-badge.level-15, .level-badge.level-16, .level-badge.level-17, .level-badge.level-18, .level-badge.level-19 { --accent: var(--level-tier-1); }
.level-badge.level-20, .level-badge.level-21, .level-badge.level-22, .level-badge.level-23, .level-badge.level-24, .level-badge.level-25, .level-badge.level-26, .level-badge.level-27, .level-badge.level-28, .level-badge.level-29 { --accent: var(--level-tier-2); }
.level-badge.level-30, .level-badge.level-31, .level-badge.level-32, .level-badge.level-33, .level-badge.level-34, .level-badge.level-35, .level-badge.level-36, .level-badge.level-37, .level-badge.level-38, .level-badge.level-39 { --accent: var(--level-tier-3); }
.level-badge.level-40, .level-badge.level-41, .level-badge.level-42, .level-badge.level-43, .level-badge.level-44, .level-badge.level-45, .level-badge.level-46, .level-badge.level-47, .level-badge.level-48, .level-badge.level-49 { --accent: var(--level-tier-4); }
.level-badge.level-50, .level-badge.level-51, .level-badge.level-52, .level-badge.level-53, .level-badge.level-54, .level-badge.level-55, .level-badge.level-56, .level-badge.level-57, .level-badge.level-58, .level-badge.level-59 { --accent: var(--level-tier-5); }
.level-badge.level-60, .level-badge.level-61, .level-badge.level-62, .level-badge.level-63, .level-badge.level-64, .level-badge.level-65, .level-badge.level-66, .level-badge.level-67, .level-badge.level-68, .level-badge.level-69 { --accent: var(--level-tier-6); }
.level-badge.level-70, .level-badge.level-71, .level-badge.level-72, .level-badge.level-73, .level-badge.level-74, .level-badge.level-75, .level-badge.level-76, .level-badge.level-77, .level-badge.level-78, .level-badge.level-79 { --accent: var(--level-tier-7); }
.level-badge.level-80, .level-badge.level-81, .level-badge.level-82, .level-badge.level-83, .level-badge.level-84, .level-badge.level-85, .level-badge.level-86, .level-badge.level-87, .level-badge.level-88, .level-badge.level-89 { --accent: var(--level-tier-8); }
.level-badge.level-90, .level-badge.level-91, .level-badge.level-92, .level-badge.level-93, .level-badge.level-94, .level-badge.level-95, .level-badge.level-96, .level-badge.level-97, .level-badge.level-98, .level-badge.level-99 { --accent: var(--level-tier-9); }

.level-badge.level-100 {
    --accent: var(--level-tier-100);
    border: 1px solid #ff2b2b;
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.14),
        inset 0 -3px 8px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 43, 43, 0.6),
        0 0 14px rgba(255, 43, 43, 0.45);
}

.level-badge.level-100::before {
    background: var(--level-tier-100);
}

.level-badge.level-100::after {
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
}

.level-badge.level-100 .level-digit {
    text-shadow: 0 1px 6px rgba(255, 43, 43, 0.35);
}


/* Инвентарь рамок и бабблов в модалке профиля */
.cosmetics-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.cosmetics-group-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cosmetics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.cosmetic-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cosmetic-card .cosmetic-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.cosmetic-card .cosmetic-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.cosmetic-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.cosmetic-card.active {
    border-color: #7cc6ff;
    box-shadow: 0 0 0 1px rgba(124, 198, 255, 0.5), 0 8px 18px rgba(0, 0, 0, 0.28);
}
/* Уровни: Сапфир (70-79) - Тёмно-синий */
.level-badge.sapphire {
    background: linear-gradient(135deg, #003388 0%, #002266 50%, #001144 100%);
    border: 1px solid #000033;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 8px rgba(0, 51, 136, 0.4), inset 0 1px 0 rgba(150, 200, 255, 0.1);
}

/* Уровни: Малиновый (80-89) - Бордо */
.level-badge.crimson {
    background: linear-gradient(135deg, #990033 0%, #770022 50%, #550011 100%);
    border: 1px solid #330000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(153, 0, 51, 0.4), inset 0 1px 0 rgba(255, 150, 200, 0.12);
}

/* Уровни: Обсидиан (90-99) - Черный с фиолетом */
.level-badge.obsidian {
    background: linear-gradient(135deg, #1a0033 0%, #2d1a4d 50%, #0a0015 100%);
    border: 1px solid #000000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 10px rgba(45, 26, 77, 0.5), inset 0 1px 0 rgba(180, 120, 255, 0.1);
}

/* Уровни: Легенда (100) - Черно-красный премиум */
.level-badge.legend {
    background: linear-gradient(135deg, #1a0000 0%, #660000 50%, #CC0000 100%);
    border: 1px solid #800000;
    box-shadow: 0 2px 10px rgba(204, 0, 0, 0.5), inset 0 1px 0 rgba(255, 100, 100, 0.15);
}

.level-text {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.level-number {
    font-weight: 700;
    color: var(--text-primary);
}

/* Прогресс-бар к следующему уровню */
.level-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    border: none;
}

.level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), rgba(255, 255, 255, 0.4));
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Эксперимент поп-ап при уровне апе */
.level-up-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FF6B9D 0%, #FF1493 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 107, 157, 0.4);
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 10000;
    animation: slideInUp 0.4s ease, slideOutDown 0.4s ease 3.6s;
}

.level-up-notification .level-number {
    display: block;
    font-size: 1.2rem;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* Экран со статистикой */
.level-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: var(--border-glass);
}

.level-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.level-stat-label {
    color: var(--text-secondary);
}

.level-stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Experience stats (рядом с постами) */
.experience-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    flex-direction: column;
}

.experience-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
    border: 2px solid #5B21B6;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    pointer-events: none;
    user-select: none;
}

.experience-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.experience-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
}