/* ============================================================
   ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
    --primary: #4a6bff;
    --primary-dark: #3a56d4;
    --secondary: #7c5cff;
    --accent: #00d4aa;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #fafbff;
    --border: #e8ebf2;
    --border-strong: #d7dce8;

    --text: #1a1f2e;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #4a6bff 0%, #7c5cff 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-hero: linear-gradient(135deg, #4a6bff 0%, #7c5cff 50%, #a855f7 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(74, 107, 255, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(124, 92, 255, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    padding: 16px 0 60px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 1180px; padding: 0 16px; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: rgba(74, 107, 255, 0.2); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ
   ============================================================ */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    z-index: 1040;
    font-size: 0.95rem;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.08);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: relative;
    background: var(--gradient-hero);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    overflow: visible;
    isolation: isolate;
    z-index: 50;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1), transparent 40%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 0.88rem;
    opacity: 0.95;
    margin: 0;
}

/* ============================================================
   КНОПКИ АВТОРИЗАЦИИ В ШАПКЕ
   ============================================================ */
.header-auth {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.header-auth-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    overflow: hidden;
    isolation: isolate;
    font-family: inherit;
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.3) 50%, transparent 80%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.auth-btn:hover::before { transform: translateX(100%); }
.auth-btn:hover { transform: translateY(-3px); text-decoration: none; }
.auth-btn:active { transform: translateY(-1px); }

.auth-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.auth-btn:hover .auth-btn-icon { transform: scale(1.2); }
.auth-btn-label { display: inline-block; }

.auth-btn-login {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-btn-login:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.auth-btn-register {
    background: #ffffff;
    border-color: #ffffff;
    color: #4a6bff;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-btn-register .auth-btn-icon { color: #4a6bff; }

.auth-btn-register:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #3a56d4;
    box-shadow: 0 14px 40px rgba(255, 255, 255, 0.6), 0 0 0 6px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.auth-btn-register:hover .auth-btn-icon { color: #3a56d4; }

.auth-btn-register::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    opacity: 0;
    animation: authPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes authPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.06); }
}

/* ============================================================
   КНОПКА-ПРОФИЛЬ + КАСТОМНЫЙ DROPDOWN
   ============================================================ */
.profile-dropdown { position: relative; width: auto; }

.auth-btn-user {
    width: 100%;
    padding: 9px 18px 9px 9px;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
    justify-content: flex-start;
    text-align: left;
    gap: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-btn-user:hover,
.auth-btn-user:focus {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.auth-btn-user .auth-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ffffff 0%, #e8ecff 100%);
    color: #4a6bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.auth-btn-user .auth-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
}

.auth-btn-user .auth-name {
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.auth-btn-user .auth-role {
    font-size: 0.72rem;
    opacity: 0.92;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
}

.auth-btn-user .auth-chevron {
    font-size: 0.78rem;
    opacity: 0.9;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.auth-btn-user[aria-expanded="true"] .auth-chevron { transform: rotate(180deg); }

/* МЕНЮ ПРОФИЛЯ — СУЖЕНО */
.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    min-width: 200px;
    max-width: 260px;
    width: max-content;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1100;
}

.profile-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1f2e;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.profile-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.profile-menu-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-item:hover {
    background: rgba(74, 107, 255, 0.08);
    color: #4a6bff;
    text-decoration: none;
}

.profile-menu-item:hover i { color: #4a6bff; }

.profile-menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 5px 8px;
}

.profile-menu-danger { color: #ef4444; }
.profile-menu-danger i { color: #ef4444; }
.profile-menu-danger:hover { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
.profile-menu-danger:hover i { color: #dc2626; }

/* Бейдж в меню профиля */
.profile-menu-badge {
    background: #f59e0b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}

/* ============================================================
   ИНФО-БЛОК
   ============================================================ */
.info-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.06) 0%, rgba(124, 92, 255, 0.04) 100%);
    border: 1px solid rgba(74, 107, 255, 0.15);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(74, 107, 255, 0.25);
}

.info-text p {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.info-text strong { color: var(--text); font-weight: 600; }

/* ============================================================
   СТАТИСТИКА
   ============================================================ */
.stats {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-item { display: flex; align-items: center; gap: 12px; padding: 4px 0; }

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
    flex-shrink: 0;
}

.stat-icon.primary { background: rgba(74, 107, 255, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.info    { background: rgba(6, 182, 212, 0.1); color: var(--info); }

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin: 0;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ============================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ
   ============================================================ */
.controls {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.search-box { position: relative; }

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 13px;
    pointer-events: none;
    z-index: 2;
}

.search-box input {
    padding-left: 38px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.88rem;
    transition: var(--transition);
}

.search-box input::placeholder { color: var(--text-soft); }

.search-box input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.1);
    outline: none;
}

.form-select {
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background-color: var(--surface-2);
    color: var(--text);
    font-size: 0.88rem;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.1);
    outline: none;
}

/* ============================================================
   ЗАГОЛОВОК СЕКЦИИ
   ============================================================ */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.section-title h3 i { color: var(--primary); font-size: 0.95rem; }

.quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.quick-actions .btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.quick-actions .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ============================================================
   КАРТОЧКА ФАЙЛА — КОМПАКТНАЯ
   ============================================================ */
.file-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.file-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.file-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: rgba(74, 107, 255, 0.25);
}

.file-card:hover::before { opacity: 1; }

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 8px 10px;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 15px;
    flex-shrink: 0;
    transition: var(--transition);
}

.file-card:hover .file-icon { background: rgba(74, 107, 255, 0.08); }

.file-info { padding: 8px 10px 8px 0; min-width: 0; }

.file-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 3px;
    word-break: break-word;
    line-height: 1.3;
}

.file-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.file-type {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
}

.file-size {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(74, 107, 255, 0.08);
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 600;
}

.last-modified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text-soft);
    font-size: 0.68rem;
}

/* Компактный рейтинг в карточке */
.file-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    font-size: 0.72rem;
    line-height: 1;
}

.file-rating-value {
    font-weight: 700;
    color: #f59e0b;
    font-size: 0.72rem;
}

.file-rating-count {
    color: var(--text-muted);
    font-size: 0.66rem;
}

.file-rating-empty {
    color: var(--text-muted);
    font-size: 0.66rem;
    gap: 3px;
    margin-bottom: 3px;
}

.file-rating-empty i {
    color: #d1d5db;
    font-size: 0.68rem;
}

/* Компактные звёзды внутри карточек файлов */
.file-card .stars i,
.file-rating .stars i {
    font-size: 0.62rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #fff;
    background: var(--gradient-primary);
    border: none;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(74, 107, 255, 0.22);
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.btn-download:hover, .btn-download:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(74, 107, 255, 0.35);
}

.btn-download i {
    font-size: 0.7rem;
}

/* ============================================================
   ПАГИНАЦИЯ
   ============================================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination { gap: 4px; margin: 0; }

.pagination .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin: 0;
    text-decoration: none;
}

.pagination .page-link:hover {
    background: rgba(74, 107, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 8px rgba(74, 107, 255, 0.3);
}

.pagination .page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }

.pagination-container .text-muted {
    font-size: 0.75rem;
    margin-top: 10px;
    color: var(--text-muted) !important;
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА (общие)
   ============================================================ */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
}

.modal-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.modal-title i { color: var(--primary); }
.modal-body { padding: 18px; font-size: 0.88rem; }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px 18px;
    background: var(--surface-2);
    gap: 8px;
}

.modal-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    background: var(--surface-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.modal-file-icon i { font-size: 32px !important; }

#modalFileName {
    font-size: 1rem;
    font-weight: 700;
    word-break: break-word;
    color: var(--text);
}

.file-description {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.file-path {
    background: var(--surface-2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 12px;
    word-break: break-all;
    border: 1px dashed var(--border-strong);
}

.modal-file-details {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 4px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.detail-item:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; flex-shrink: 0; }

.detail-value {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}

.modal-download-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--gradient-success);
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transition: var(--transition);
    text-decoration: none;
}

.modal-download-btn:hover, .modal-download-btn:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.45);
}

.preview-container {
    max-height: 260px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    margin-bottom: 14px;
}

.preview-image { max-width: 100%; border-radius: var(--radius-sm); display: block; margin: 0 auto; }

.preview-text {
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text);
}

/* ============================================================
   БЛОКИ ВЕРСИЙ
   ============================================================ */
.version-item {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 14px !important;
    margin-bottom: 10px !important;
    transition: var(--transition);
}

.version-item:hover {
    border-color: rgba(74, 107, 255, 0.3) !important;
    box-shadow: var(--shadow-sm);
}

.version-item:last-child { margin-bottom: 0 !important; }
.version-item h6 { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.version-item small { color: var(--text-muted); }

.version-item .badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.version-item .btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */
#notificationContainer {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    min-width: 260px;
    max-width: 360px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: auto;
    animation: notifSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(8px);
}

.notification-success { background: var(--gradient-success); color: #fff; }
.notification-info    { background: var(--gradient-primary); color: #fff; }
.notification-warning { background: var(--gradient-warning); color: #fff; }
.notification-error   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

.notification i { font-size: 1rem; flex-shrink: 0; }
.notification span { flex: 1; line-height: 1.35; }

.notification .btn-close-notification {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: inherit;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.notification .btn-close-notification:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notification.fade-out { opacity: 0; transform: translateX(40px); }

/* ============================================================
   ПРОГРЕСС СКАЧИВАНИЯ
   ============================================================ */
.progress-container {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1070;
}

.progress-container.show {
    display: block;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

#progressFileName {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75%;
}

#progressPercent { font-weight: 700; color: var(--primary); }

.progress {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: 999px;
    transition: width 0.25s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.6s infinite;
}

/* ============================================================
   ЧАТ
   ============================================================ */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 24px rgba(74, 107, 255, 0.4);
    z-index: 1050;
    transition: var(--transition);
}

.chat-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 28px rgba(74, 107, 255, 0.5);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.chat-window {
    position: fixed;
    bottom: 88px;
    right: 20px;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1051;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-window.show { display: flex; animation: chatIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

.chat-header {
    background: var(--gradient-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    border-radius: 50%;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.chat-header h6 {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

#chatStatus {
    font-size: 0.7rem;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.9);
}

#chatStatus::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

.btn-close-chat {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.btn-close-chat:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

.chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message { display: flex; flex-direction: column; max-width: 100%; animation: msgIn 0.25s ease; }
.message-user { align-items: flex-end; }
.message-admin { align-items: flex-start; }
.message-system { align-items: center; margin: 4px 0; }

.message-content {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.message-user .message-content {
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-admin .message-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message-system .message-content {
    background: rgba(74, 107, 255, 0.08);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.72rem;
    text-align: center;
    border: 1px solid rgba(74, 107, 255, 0.12);
}

.message-time { font-size: 0.68rem; color: var(--text-soft); margin-top: 3px; padding: 0 4px; }
.message-user .message-time { text-align: right; }

.typing-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 10px 14px !important; }

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-soft);
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.chat-input-container {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.chat-input-container .input-group { gap: 8px; }

.chat-input-container .form-control {
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    padding: 9px 16px;
    font-size: 0.85rem;
}

.chat-input-container .form-control:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.1);
    outline: none;
}

#sendMessage {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(74, 107, 255, 0.3);
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}

#sendMessage:hover { transform: scale(1.05); }

.chat-input-container small {
    font-size: 0.7rem;
    margin-top: 6px !important;
    color: var(--text-muted) !important;
}

/* ============================================================
   ПУСТОЙ РЕЗУЛЬТАТ
   ============================================================ */
.no-files-message {
    text-align: center;
    padding: 48px 20px;
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.no-files-message i {
    display: block;
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--text-soft);
    opacity: 0.5;
}

.no-files-message h4 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.no-files-message p { font-size: 0.82rem; margin: 0; }

/* ============================================================
   ФУТЕР
   ============================================================ */
.footer {
    margin-top: 28px;
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.footer p { margin-bottom: 4px; line-height: 1.6; }
.footer strong { color: var(--text); font-weight: 600; }

/* ============================================================
   АДАПТИВНОСТЬ (БАЗОВАЯ)
   ============================================================ */
@media (max-width: 992px) {
    .header-auth-buttons { justify-content: flex-start; }
    .header { padding: 22px 24px; }
}

@media (max-width: 768px) {
    body { padding: 10px 0 50px; }
    .theme-toggle { top: 10px; right: 10px; width: 36px; height: 36px; }
    .header { padding: 18px 20px; }
    .header h1 { font-size: 1.15rem; }
    .header p { font-size: 0.8rem; }
    .header-auth { justify-content: stretch; margin-top: 6px; }
    .header-auth-buttons { gap: 10px; justify-content: stretch; }
    .auth-btn { padding: 12px 18px; font-size: 0.88rem; flex: 1; justify-content: center; gap: 8px; }
    .auth-btn-user .auth-info { display: flex; }
    .auth-btn-user { padding: 8px 14px 8px 8px; }
    .auth-btn-user .auth-avatar { width: 38px; height: 38px; font-size: 0.95rem; }
    .auth-btn-user .auth-name { font-size: 0.86rem; }
    .info-block { padding: 10px 12px; }
    .info-text p { font-size: 0.78rem; }
    .stats { padding: 12px; }
    .stat-icon { width: 32px; height: 32px; font-size: 13px; }
    .stat-value { font-size: 0.9rem; }
    .controls { padding: 12px; }

    .file-card { margin-bottom: 4px; }
    .file-icon { width: 32px; height: 32px; margin: 7px 8px; font-size: 13px; border-radius: 7px; }
    .file-info { padding: 7px 8px 7px 0; }
    .file-name { font-size: 0.8rem; margin-bottom: 2px; }
    .file-details { gap: 4px; font-size: 0.66rem; }
    .btn-download { padding: 4px 10px; font-size: 0.7rem; }
    .btn-download i { font-size: 0.66rem; }
    .file-rating .stars i,
    .file-rating-empty i { font-size: 0.58rem; }

    .section-title h3 { font-size: 0.95rem; }
    .quick-actions .btn { padding: 5px 10px; font-size: 0.72rem; }
    .modal-body { padding: 14px; }
    .modal-file-icon { width: 60px; height: 60px; }
    .modal-file-icon i { font-size: 26px !important; }
    .detail-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .detail-value { text-align: left; max-width: 100%; }
    .progress-container { width: 94%; bottom: 12px; padding: 12px; }
    .notification { min-width: auto; max-width: calc(100vw - 32px); font-size: 0.8rem; padding: 10px 12px; }
    .chat-window { width: calc(100% - 24px); right: 12px; bottom: 78px; height: 440px; }
    .chat-button { width: 50px; height: 50px; font-size: 19px; bottom: 16px; right: 16px; }
}

@media (max-width: 576px) {
    .header-auth-buttons { flex-direction: column; gap: 8px; }
    .auth-btn { padding: 13px 18px; font-size: 0.9rem; width: 100%; justify-content: center; }
    .auth-btn-icon { font-size: 1rem; }
    .stats .row > div { margin-bottom: 8px; }
    .stats .row > div:last-child { margin-bottom: 0; }
    .pagination .page-link { min-width: 30px; height: 30px; font-size: 0.75rem; }
    .chat-window { height: 380px; width: calc(100% - 20px); right: 10px; bottom: 76px; }
}

/* ============================================================
   АНИМАЦИИ
   ============================================================ */
@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 30px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes notifSlide {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes chatIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50%      { transform: translateY(-4px); opacity: 1; }
}

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

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */
[data-theme="dark"] {
    --bg: #0f1117;
    --surface: #171923;
    --surface-2: #1e2130;
    --border: #2a2f42;
    --border-strong: #363b52;
    --text: #e8eaf0;
    --text-muted: #9aa0b4;
    --text-soft: #6b7280;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(at 0% 0%, rgba(74, 107, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(124, 92, 255, 0.08) 0px, transparent 50%);
}

[data-theme="dark"] .info-block {
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.08) 0%, rgba(124, 92, 255, 0.05) 100%);
    border-color: rgba(74, 107, 255, 0.2);
}

[data-theme="dark"] .file-card:hover { border-color: rgba(74, 107, 255, 0.4); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

[data-theme="dark"] .alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.25);
    color: #a5e8f5;
}
[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
    color: #a7f3d0;
}
[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}
[data-theme="dark"] .alert a { color: #93c5fd; }
[data-theme="dark"] code {
    background: rgba(124, 92, 255, 0.15);
    color: #c4b5fd;
    padding: 1px 6px;
    border-radius: 4px;
}
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .file-icon { background: rgba(255, 255, 255, 0.03); }

[data-theme="dark"] .profile-menu {
    background: #1e2130;
    border-color: #2a2f42;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .profile-menu-item { color: #e8eaf0; }
[data-theme="dark"] .profile-menu-item i { color: #9aa0b4; }
[data-theme="dark"] .profile-menu-item:hover { background: rgba(74, 107, 255, 0.15); color: #93c5fd; }
[data-theme="dark"] .profile-menu-item:hover i { color: #93c5fd; }
[data-theme="dark"] .profile-menu-divider { background: #2a2f42; }
[data-theme="dark"] .profile-menu-danger { color: #f87171; }
[data-theme="dark"] .profile-menu-danger i { color: #f87171; }
[data-theme="dark"] .profile-menu-danger:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* ============================================================
   КРАСИВЫЕ МОДАЛЬНЫЕ ОКНА (SourceMod / MetaMod / Stripper)
   ============================================================ */

.soft-modal {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25), 0 8px 24px rgba(15, 23, 42, 0.15);
}

.soft-modal-header {
    padding: 20px 24px;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.soft-modal-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.header-primary { background: linear-gradient(135deg, #4a6bff 0%, #7c5cff 100%); }
.header-success { background: linear-gradient(135deg, #22c55e 0%, #10b981 100%); }
.header-warning { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); }

.soft-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.soft-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.soft-header-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.soft-header-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.soft-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
}

.soft-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

.soft-modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
}

.soft-modal-body::-webkit-scrollbar { width: 6px; }
.soft-modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.soft-intro {
    background: var(--surface-2);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.soft-intro p { font-size: 0.88rem; line-height: 1.6; color: var(--text-muted); margin: 0; }
.soft-intro strong { color: var(--text); font-weight: 600; }

.soft-section { margin-bottom: 24px; }
.soft-section:last-child { margin-bottom: 0; }

.soft-section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.soft-section-title i { color: var(--primary); font-size: 0.85rem; }

.soft-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.soft-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.soft-feature:hover {
    background: var(--surface);
    border-color: rgba(74, 107, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.soft-feature-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.12), rgba(124, 92, 255, 0.12));
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.soft-feature-title { font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.soft-feature-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }

.soft-version {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.soft-version-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.soft-version-name { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }

.soft-version-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.soft-version-meta i { font-size: 0.68rem; opacity: 0.8; }

.soft-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    background: var(--text-soft);
    border-radius: 50%;
    margin: 0 4px;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.soft-badge-success { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.soft-badge-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }

.soft-download-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.soft-download-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.soft-download-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.soft-download-btn:hover::before { transform: translateX(100%); }

.soft-download-linux {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 14px rgba(243, 156, 18, 0.3);
}

.soft-download-linux:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(243, 156, 18, 0.45);
}

.soft-download-windows {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.3);
}

.soft-download-windows:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(52, 152, 219, 0.45);
}

.soft-download-btn > i:first-child { font-size: 1.6rem; opacity: 0.95; }

.soft-download-btn > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.soft-dl-os { font-size: 0.85rem; font-weight: 700; letter-spacing: -0.01em; }
.soft-dl-format { font-size: 0.7rem; opacity: 0.85; font-weight: 500; }

.soft-dl-icon {
    font-size: 1rem;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.soft-download-btn:hover .soft-dl-icon { transform: translateY(2px); }

.soft-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.soft-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

.soft-step-num {
    width: 26px;
    height: 26px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(74, 107, 255, 0.3);
}

.soft-steps code {
    background: rgba(74, 107, 255, 0.1);
    color: var(--primary);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.soft-games { display: flex; flex-wrap: wrap; gap: 6px; }

.soft-game-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.soft-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    line-height: 1.5;
}

.soft-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: #92400e;
}

.soft-alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.soft-alert strong { font-weight: 700; display: block; margin-bottom: 3px; }
.soft-alert-desc { font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }

.soft-docs { display: flex; flex-wrap: wrap; gap: 8px; }

.soft-doc-link {
    flex: 1;
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.soft-doc-link i:first-child { color: var(--primary); font-size: 0.9rem; }

.soft-doc-link:hover {
    border-color: var(--primary);
    background: rgba(74, 107, 255, 0.05);
    color: var(--primary);
    transform: translateY(-1px);
}

.soft-doc-link span { flex: 1; }
.soft-doc-ext { font-size: 0.65rem; opacity: 0.5; color: var(--text-muted); }
.soft-doc-link:hover .soft-doc-ext { opacity: 1; color: var(--primary); }

.soft-modal-footer {
    padding: 14px 24px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.soft-btn-close {
    padding: 9px 22px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.soft-btn-close:hover { background: var(--border); color: var(--text); }

@media (max-width: 768px) {
    .soft-modal-header { padding: 16px 18px; }
    .soft-header-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .soft-header-title { font-size: 1rem; }
    .soft-header-subtitle { font-size: 0.72rem; }
    .soft-close-btn { width: 32px; height: 32px; }
    .soft-modal-body { padding: 16px; }
    .soft-features { grid-template-columns: 1fr; }
    .soft-download-buttons { grid-template-columns: 1fr; }
    .soft-download-btn { padding: 12px 14px; }
    .soft-doc-link { min-width: 100%; }
    .soft-modal-footer { padding: 12px 16px; }
    .soft-section { margin-bottom: 18px; }
    .soft-section-title { font-size: 0.85rem; }
    .soft-version { padding: 12px; }
    .soft-steps li { font-size: 0.8rem; padding: 10px 12px; }
}

[data-theme="dark"] .soft-modal-body { background: #171923; }

[data-theme="dark"] .soft-intro,
[data-theme="dark"] .soft-feature,
[data-theme="dark"] .soft-version,
[data-theme="dark"] .soft-steps li,
[data-theme="dark"] .soft-doc-link {
    background: #1e2130;
    border-color: #2a2f42;
}

[data-theme="dark"] .soft-feature:hover {
    background: #262b3d;
    border-color: rgba(74, 107, 255, 0.4);
}

[data-theme="dark"] .soft-feature-icon { background: rgba(74, 107, 255, 0.15); }
[data-theme="dark"] .soft-badge-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

[data-theme="dark"] .soft-game-tag {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.35);
}

[data-theme="dark"] .soft-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

[data-theme="dark"] .soft-doc-link:hover { background: rgba(74, 107, 255, 0.1); }
[data-theme="dark"] .soft-steps code { background: rgba(124, 92, 255, 0.2); color: #c4b5fd; }
[data-theme="dark"] .soft-modal-footer { background: #1e2130; border-color: #2a2f42; }
[data-theme="dark"] .soft-btn-close { background: #2a2f42; border-color: #363b52; color: #9aa0b4; }
[data-theme="dark"] .soft-btn-close:hover { background: #363b52; color: #e8eaf0; }

/* ============================================================
   БАННЕРЫ / СЛАЙДЕР НА ГЛАВНОЙ
   ============================================================ */
.banner-carousel-section {
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.banner-carousel {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.banner-slide {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    padding: 40px 0;
    overflow: hidden;
    isolation: isolate;
}

.banner-slide-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.banner-slide-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.banner-slide-text { max-width: 640px; }

.banner-slide-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.banner-slide-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.95;
}

.banner-slide-desc {
    font-size: 0.88rem;
    line-height: 1.5;
    opacity: 0.88;
    margin-bottom: 16px;
    max-width: 500px;
}

.banner-slide-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.banner-slide-btn i { transition: transform 0.25s ease; font-size: 0.85rem; }
.banner-slide-btn:hover i { transform: translateX(4px); }

.banner-btn-light {
    background: #fff;
    color: #1a1f2e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.banner-btn-light:hover {
    background: #f8f9fb;
    color: #1a1f2e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.banner-btn-dark {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    backdrop-filter: blur(10px);
}

.banner-btn-dark:hover {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    transform: translateY(-2px);
}

.banner-btn-outline {
    background: transparent;
    color: inherit;
    border-color: currentColor;
}

.banner-btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    transform: translateY(-2px);
}

.banner-carousel .carousel-indicators {
    margin-bottom: 14px;
    gap: 6px;
}

.banner-carousel .carousel-indicators button {
    width: 24px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    opacity: 1;
    transition: all 0.2s;
}

.banner-carousel .carousel-indicators button.active {
    background: #fff;
    width: 40px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.banner-nav {
    width: 48px;
    opacity: 0;
    transition: opacity 0.2s;
}

.banner-carousel:hover .banner-nav { opacity: 1; }

.banner-nav-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1f2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.banner-nav:hover .banner-nav-icon {
    background: #fff;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .banner-slide { min-height: 220px; padding: 30px 0; }
    .banner-slide-title { font-size: 1.3rem; }
    .banner-slide-subtitle { font-size: 0.85rem; }
    .banner-slide-desc { font-size: 0.8rem; margin-bottom: 12px; }
    .banner-slide-btn { padding: 9px 18px; font-size: 0.82rem; }
    .banner-nav { display: none; }
    .banner-carousel .carousel-indicators button { width: 16px; }
    .banner-carousel .carousel-indicators button.active { width: 28px; }
}

[data-theme="dark"] .banner-nav-icon {
    background: rgba(30, 33, 48, 0.9);
    color: #e8eaf0;
}

[data-theme="dark"] .banner-btn-light {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1f2e;
}

/* ============================================================
   ОНЛАЙН-ПОЛЬЗОВАТЕЛИ
   ============================================================ */

/* Пульсирующая точка на иконке */
.stat-icon.online {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    position: relative;
}

.online-pulse {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--surface);
    animation: onlinePulse 2s ease-in-out infinite;
}

.online-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    animation: onlinePulseRing 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.15); opacity: 0.85; }
}

@keyframes onlinePulseRing {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Пульс в заголовке блока */
.online-pulse-big {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: onlinePulse 2s ease-in-out infinite;
    margin-right: 4px;
}

/* Блок «Сейчас на сайте» */
.online-users-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

.online-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
}

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

.online-title strong {
    color: var(--success);
    font-weight: 800;
    font-size: 1rem;
}

.online-stats-mini {
    display: flex;
    gap: 6px;
    align-items: center;
}

.online-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.online-mini-badge.admin {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.online-mini-badge.user {
    background: rgba(74, 107, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(74, 107, 255, 0.25);
}

.online-mini-badge i {
    font-size: 0.65rem;
}

/* Список юзеров */
.online-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.15s ease;
    cursor: default;
}

.online-user-item:hover {
    border-color: var(--primary);
    background: rgba(74, 107, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.online-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.online-avatar.user {
    background: linear-gradient(135deg, #4a6bff, #7c5cff);
}

.online-avatar.admin {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.online-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-admin-icon {
    font-size: 0.65rem;
    color: #ef4444;
    margin-left: 3px;
}

@media (max-width: 768px) {
    .online-users-block { padding: 12px 14px; }
    .online-title { font-size: 0.82rem; }
    .online-user-item { padding: 5px 10px 5px 5px; }
    .online-avatar { width: 24px; height: 24px; font-size: 0.68rem; }
    .online-user-name { font-size: 0.72rem; max-width: 90px; }
}

[data-theme="dark"] .online-user-item {
    background: #1e2130;
    border-color: #2a2f42;
}

[data-theme="dark"] .online-user-item:hover {
    border-color: rgba(74, 107, 255, 0.5);
    background: rgba(74, 107, 255, 0.1);
}

[data-theme="dark"] .online-dot {
    border-color: #1e2130;
}

[data-theme="dark"] .online-pulse {
    border-color: #171923;
}

[data-theme="dark"] .online-mini-badge.admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .online-mini-badge.user {
    background: rgba(74, 107, 255, 0.15);
    color: #93c5fd;
}

/* ============================================================
   РЕЙТИНГИ И ОТЗЫВЫ
   ============================================================ */

.stars { display: inline-flex; gap: 2px; align-items: center; }
.stars i { color: #f59e0b; font-size: 0.85rem; }
.stars i.far { color: #d1d5db; }
.stars-small i { font-size: 0.72rem; }
.stars-large i { font-size: 1.05rem; }
.stars i.fa-star-half-alt { color: #f59e0b; }

/* ============================================================
   БЛОК ОТЗЫВОВ НА СТРАНИЦЕ СКАЧИВАНИЯ
   ============================================================ */
.reviews-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
}

.reviews-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.reviews-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.reviews-title i { color: #f59e0b; }

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}
.reviews-avg {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f59e0b;
}
.reviews-count {
    color: var(--text-muted);
    font-size: 0.82rem;
}
.reviews-summary-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 6px;
}
.reviews-summary-empty i { color: #d1d5db; }

.review-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}
.review-alert-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #15803d;
}
.review-alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
}

.review-form-wrap {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 20px;
}
.review-form-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.rating-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.rating-star {
    cursor: pointer;
    transition: transform 0.15s;
    display: inline-flex;
    padding: 2px;
}
.rating-star i {
    font-size: 1.8rem;
    color: #d1d5db;
    transition: all 0.15s;
}
.rating-star.active i,
.rating-star.hover i {
    color: #f59e0b;
    transform: scale(1.1);
}
.rating-star:hover i {
    transform: scale(1.2);
}
.rating-star input { display: none; }

.rating-value-label {
    margin-left: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.review-form .form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    padding: 10px 14px;
    font-size: 0.88rem;
    transition: all 0.2s;
}
.review-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.1);
    outline: none;
}
.review-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.review-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 107, 255, 0.3);
}
.review-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 107, 255, 0.4);
}

.review-login-prompt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(74,107,255,.06), rgba(124,92,255,.04));
    border: 1px dashed rgba(74,107,255,.3);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.review-login-prompt i {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}
.review-login-prompt a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.review-login-prompt a:hover {
    text-decoration: underline;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.review-item:hover {
    border-color: rgba(74,107,255,.25);
    background: var(--surface);
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.review-avatar.user { background: linear-gradient(135deg, #4a6bff, #7c5cff); }
.review-avatar.admin { background: linear-gradient(135deg, #ef4444, #dc2626); }

.review-content {
    flex: 1;
    min-width: 0;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.review-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.review-admin-badge {
    font-size: 0.65rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.review-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.review-date i {
    font-size: 0.7rem;
    opacity: 0.7;
}
.review-comment {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
    padding: 8px 12px;
    background: var(--surface);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    margin-top: 6px;
}

@media (max-width: 576px) {
    .reviews-section { padding: 16px; }
    .review-item { flex-direction: column; gap: 10px; }
    .review-avatar { width: 38px; height: 38px; font-size: 0.95rem; }
    .rating-star i { font-size: 1.6rem; }
    .rating-value-label { width: 100%; margin-left: 0; margin-top: 4px; }
}

[data-theme="dark"] .review-form-wrap,
[data-theme="dark"] .review-item {
    background: #1e2130;
    border-color: #2a2f42;
}
[data-theme="dark"] .review-item:hover {
    background: #262b3d;
}
[data-theme="dark"] .review-comment {
    background: #171923;
}
[data-theme="dark"] .review-login-prompt {
    background: rgba(74, 107, 255, 0.08);
    border-color: rgba(74, 107, 255, 0.3);
}
[data-theme="dark"] .file-rating-empty i,
[data-theme="dark"] .stars i.far {
    color: #4b5563;
}
[data-theme="dark"] .rating-star i {
    color: #4b5563;
}
[data-theme="dark"] .reviews-summary-empty i {
    color: #4b5563;
}

/* ============================================================
   БАННЕР COOKIES
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 40px);
    max-width: 1100px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(15, 23, 42, 0.25),
        0 8px 24px rgba(15, 23, 42, 0.15);
    padding: 20px 24px;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.cookie-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.03), rgba(124, 92, 255, 0.02));
    border-radius: 16px;
    pointer-events: none;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.cookie-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    animation: cookieRotate 6s ease-in-out infinite;
}

@keyframes cookieRotate {
    0%, 90%, 100% { transform: rotate(0deg); }
    95% { transform: rotate(-10deg); }
}

.cookie-content {
    flex: 1;
    min-width: 250px;
}

.cookie-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.cookie-desc {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.cookie-desc a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.cookie-desc a:hover {
    color: var(--primary-dark);
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.3;
}

.cookie-btn-settings {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.cookie-btn-settings:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.cookie-btn-decline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.cookie-btn-decline:hover {
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.cookie-btn-accept {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(74, 107, 255, 0.35);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(74, 107, 255, 0.45);
    color: #fff;
}

.cookie-setting-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--surface-2);
    transition: all 0.15s;
}

.cookie-setting-item:hover {
    border-color: rgba(74, 107, 255, 0.25);
    background: var(--surface);
}

.cookie-setting-item:last-child {
    margin-bottom: 0;
}

.cookie-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.cookie-setting-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cookie-setting-title i {
    color: var(--primary);
    font-size: 0.82rem;
}

.cookie-setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 380px;
}

.cookie-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.cookie-footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (max-width: 900px) {
    .cookie-banner {
        padding: 16px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
    .cookie-banner-inner { gap: 14px; }
    .cookie-icon { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 12px; }
    .cookie-title { font-size: 0.92rem; }
    .cookie-desc { font-size: 0.78rem; }
    .cookie-actions { width: 100%; margin-top: 4px; }
    .cookie-btn { flex: 1; justify-content: center; padding: 10px 14px; }
    .cookie-btn-settings { flex: 0 0 auto; width: auto; }
}

@media (max-width: 600px) {
    .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
    .cookie-icon { display: none; }
    .cookie-actions { flex-direction: column; width: 100%; }
    .cookie-btn { width: 100%; }
    .cookie-btn-settings { order: 3; width: 100%; }
    .cookie-btn-decline { order: 2; }
    .cookie-btn-accept { order: 1; }
}

[data-theme="dark"] .cookie-banner {
    background: #1e2130;
    border-color: #2a2f42;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cookie-banner::before {
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.08), rgba(124, 92, 255, 0.05));
}

[data-theme="dark"] .cookie-btn-settings,
[data-theme="dark"] .cookie-btn-decline {
    border-color: #2a2f42;
    color: #9aa0b4;
}

[data-theme="dark"] .cookie-btn-settings:hover {
    background: #262b3d;
    color: #e8eaf0;
}

[data-theme="dark"] .cookie-setting-item {
    background: #262b3d;
    border-color: #2a2f42;
}

[data-theme="dark"] .cookie-setting-item:hover {
    background: #1e2130;
    border-color: rgba(74, 107, 255, 0.3);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s;
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-link i {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* ============================================================
   ТИПЫ ПОСЕТИТЕЛЕЙ: USER / GUEST / BOT
   ============================================================ */

.online-mini-badge.user {
    background: rgba(74, 107, 255, 0.1);
    color: #4a6bff;
    border: 1px solid rgba(74, 107, 255, 0.25);
}

.online-mini-badge.guest {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.online-mini-badge.bot {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.visitor-label {
    font-weight: 500;
    opacity: 0.85;
    margin-left: 2px;
}

.online-avatar.user {
    background: linear-gradient(135deg, #4a6bff, #7c5cff);
}

.online-avatar.guest {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.online-avatar.guest i {
    font-size: 0.85rem;
}

.online-avatar.bot {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.online-avatar.bot i {
    font-size: 0.85rem;
    color: #fff;
}

.online-dot.guest-dot {
    background: #9ca3af;
}

.online-dot.bot-dot {
    background: #f59e0b;
}

.online-user-item.visitor-bot {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.2);
}

.online-user-item.visitor-bot:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}

.online-user-item.visitor-guest {
    background: rgba(107, 114, 128, 0.03);
}

.online-user-item.visitor-guest:hover {
    background: rgba(107, 114, 128, 0.06);
    border-color: rgba(107, 114, 128, 0.3);
}

.online-user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.guest-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    font-weight: 500;
}

.bot-name {
    color: #b45309;
    font-weight: 600;
}

.visitor-source {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: #9ca3af;
    font-weight: 500;
    opacity: 0.8;
}

.visitor-source i {
    font-size: 0.6rem;
}

.online-user-item:hover .visitor-source {
    opacity: 1;
}

@media (max-width: 768px) {
    .visitor-label { display: none; }
    .visitor-source span { display: none; }
    .visitor-source { font-size: 0.6rem; }
}

[data-theme="dark"] .online-mini-badge.guest {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

[data-theme="dark"] .online-mini-badge.bot {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .online-user-item.visitor-bot {
    background: rgba(245, 158, 11, 0.08);
}

[data-theme="dark"] .online-user-item.visitor-guest {
    background: rgba(156, 163, 175, 0.03);
}

[data-theme="dark"] .guest-label {
    color: #9ca3af;
}

[data-theme="dark"] .bot-name {
    color: #fbbf24;
}

[data-theme="dark"] .visitor-source {
    color: #6b7280;
}

/* ============================================================
   РЕКОМЕНДУЕМЫЕ ФАЙЛЫ (is_featured)
   ============================================================ */
.featured-section {
    margin: 24px 0 32px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .featured-section {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

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

.featured-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.featured-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.featured-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.featured-title p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.featured-more {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4a6bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
}

.featured-more:hover {
    background: rgba(74, 107, 255, 0.08);
    transform: translateX(2px);
    color: #4a6bff;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.featured-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: var(--surface-2);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.2s, box-shadow 0.25s;
}

.featured-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899, #8b5cf6);
    background-size: 200% 200%;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    animation: featured-border-flow 6s linear infinite;
    z-index: -1;
}

@keyframes featured-border-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.18);
    color: inherit;
}

.featured-card-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
    z-index: -1;
}

.featured-card:hover .featured-card-glow {
    opacity: 1;
}

.featured-card-star {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.featured-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 24px;
    margin-top: 4px;
}

.featured-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.featured-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(74, 107, 255, 0.10);
    color: #4a6bff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

[data-theme="dark"] .featured-badge {
    background: rgba(124, 92, 255, 0.16);
    color: #9b8cff;
}

.featured-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    margin-top: auto;
    border-top: 1px dashed var(--border);
}

.featured-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 600;
}

.featured-rating-empty {
    color: var(--text-muted);
    font-weight: 500;
}

.featured-rating-count {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.74rem;
}

.featured-downloads {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.featured-downloads i {
    color: #22c55e;
}

@media (max-width: 992px) {
    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .featured-section {
        padding: 14px;
        border-radius: 14px;
    }
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .featured-card {
        padding: 14px;
    }
    .featured-card-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
    .featured-card-name {
        font-size: 0.88rem;
    }
    .featured-title h3 {
        font-size: 1rem;
    }
    .featured-more {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

.admin-table tr.row-featured {
    background: rgba(245, 158, 11, 0.06) !important;
}

.admin-table tr.row-featured td:first-child {
    border-left: 3px solid #f59e0b;
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА — ВЫПАДАЮЩИЙ
   ============================================================ */
.lang-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    min-height: 62px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.lang-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.25) 50%, transparent 80%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    z-index: -1;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: #fff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.lang-toggle:hover::before {
    transform: translateX(100%);
}

.lang-toggle:active {
    transform: translateY(0);
}

.lang-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.4);
    border-color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.lang-current-flag {
    font-size: 1.15rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.lang-current-name {
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-chevron {
    font-size: 0.7rem;
    opacity: 0.9;
    transition: transform 0.25s ease;
}

.lang-toggle[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.22),
        0 8px 16px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 0.2s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0.2s;
    z-index: 1100;
    overflow: hidden;
}

.lang-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-menu-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #f0f2f7;
    margin-bottom: 4px;
}

.lang-menu-header i {
    font-size: 0.75rem;
    color: #4a6bff;
}

.lang-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1a1f2e;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.lang-menu-item:hover {
    background: rgba(74, 107, 255, 0.08);
    color: #4a6bff;
    text-decoration: none;
    transform: translateX(2px);
}

.lang-menu-item.active {
    background: rgba(74, 107, 255, 0.1);
    color: #4a6bff;
    font-weight: 700;
}

.lang-menu-item.active:hover {
    background: rgba(74, 107, 255, 0.14);
}

.lang-item-flag {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

.lang-item-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-item-check {
    font-size: 0.85rem;
    color: #4a6bff;
    flex-shrink: 0;
    margin-left: auto;
}

@media (max-width: 768px) {
    .lang-toggle {
        padding: 7px 10px;
        gap: 6px;
        border-radius: 10px;
    }
    .lang-current-flag {
        font-size: 1rem;
    }
    .lang-current-name {
        display: none;
    }
    .lang-chevron {
        font-size: 0.6rem;
    }
    .lang-menu {
        right: auto;
        left: 0;
        transform-origin: top left;
        min-width: 200px;
    }
}

[data-theme="dark"] .lang-menu {
    background: #1e2130;
    border-color: #2a2f42;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lang-menu-header {
    color: #6b7280;
    border-bottom-color: #2a2f42;
}

[data-theme="dark"] .lang-menu-item {
    color: #e8eaf0;
}

[data-theme="dark"] .lang-menu-item:hover {
    background: rgba(74, 107, 255, 0.15);
    color: #93c5fd;
}

[data-theme="dark"] .lang-menu-item.active {
    background: rgba(74, 107, 255, 0.2);
    color: #93c5fd;
}

[data-theme="dark"] .lang-item-check {
    color: #93c5fd;
}

/* ============================================================
   COMMUNITY WIDGET
   ============================================================ */
.community-widget {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e8f0);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

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

.community-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4a6bff, #7c5cff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.community-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text, #1a1f2e);
}

.community-title p {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.community-links {
    display: flex;
    gap: 8px;
}

.community-link {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
}

.community-link:hover {
    transform: translateY(-2px);
    color: #fff;
}

.community-link-discord {
    background: #5865f2;
    box-shadow: 0 4px 10px rgba(88, 101, 242, 0.3);
}

.community-link-telegram {
    background: #229ed9;
    box-shadow: 0 4px 10px rgba(34, 158, 217, 0.3);
}

.community-messages {
    display: grid;
    gap: 12px;
}

.community-message {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2, #fafbfd);
    border: 1px solid var(--border, #e5e8f0);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.community-message:hover {
    border-color: rgba(74, 107, 255, 0.3);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.community-message-discord { border-left: 3px solid #5865f2; }
.community-message-telegram { border-left: 3px solid #229ed9; }

.community-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e5e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    overflow: visible;
}

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

.community-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: #fff;
    border: 2px solid var(--surface, #fff);
}

.community-badge-discord { background: #5865f2; }
.community-badge-telegram { background: #229ed9; }

.community-body {
    flex: 1;
    min-width: 0;
}

.community-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.community-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text, #1a1f2e);
}

.community-time {
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
}

.community-content {
    font-size: 0.85rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    margin-bottom: 6px;
}

.community-reply {
    font-size: 0.75rem;
    color: #4a6bff;
    text-decoration: none;
    font-weight: 600;
}

.community-reply:hover {
    text-decoration: underline;
}

.community-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted, #9ca3af);
}

.community-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.community-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* Тёмная тема */
[data-theme="dark"] .community-message {
    background: #1e2130;
    border-color: #2a2f42;
}

[data-theme="dark"] .community-badge {
    border-color: #1e2130;
}

[data-theme="dark"] .community-content {
    color: #bdc1c6;
}

/* ============================================================
   FEATURED CARD — внешний пунктирный контур
   ============================================================ */
.featured-card {
    outline: 2px dashed var(--border-strong);
    outline-offset: 4px;
}

.featured-card:hover {
    outline-color: #f59e0b;
}

[data-theme="dark"] .featured-card {
    outline-color: #363b52;
}

[data-theme="dark"] .featured-card:hover {
    outline-color: #f59e0b;
}

/* ============================================================
   МИНИ-ПРОФИЛЬ В ШАПКЕ — короткая строка
   ============================================================ */
.auth-btn-user .auth-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    gap: 1px;
}

/* Строка «⬇ 42 · ★ 7» */
.auth-stats {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    line-height: 1;
    white-space: nowrap;
}

.auth-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.auth-stat i {
    font-size: 0.6rem;
    opacity: 0.85;
}

.auth-stat-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.auth-stat-sep {
    opacity: 0.5;
    font-size: 0.7rem;
    line-height: 1;
    padding: 0 1px;
}

@media (max-width: 768px) {
    .auth-stats {
        font-size: 0.62rem;
        gap: 4px;
        margin-top: 1px;
    }
    .auth-stat i {
        font-size: 0.56rem;
    }
}

@media (max-width: 420px) {
    .auth-stats {
        display: none;
    }
}

/* ============================================================
   МИНИ-ПРОФИЛЬ В МЕНЮ — расширенный блок
   ============================================================ */
.profile-stats-block {
    padding: 10px 6px;
    margin: 0 0 4px;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.profile-stat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #fafbfd;
    border: 1px solid #eef0f5;
    transition: all 0.15s ease;
}

.profile-stat-item:hover {
    background: #ffffff;
    border-color: rgba(74, 107, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.profile-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
    color: #fff;
}

.profile-stat-icon.downloads {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.profile-stat-icon.reviews {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.profile-stat-icon.uploads {
    background: linear-gradient(135deg, #4a6bff, #7c5cff);
    box-shadow: 0 2px 6px rgba(74, 107, 255, 0.3);
}

.profile-stat-icon.xp {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
}

.profile-stat-body {
    min-width: 0;
    flex: 1;
    line-height: 1.15;
}

.profile-stat-value {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a1f2e;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.profile-stat-label {
    font-size: 0.66rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Тёмная тема */
[data-theme="dark"] .profile-stat-item {
    background: #262b3d;
    border-color: #2a2f42;
}

[data-theme="dark"] .profile-stat-item:hover {
    background: #2f3548;
    border-color: rgba(74, 107, 255, 0.4);
}

[data-theme="dark"] .profile-stat-value {
    color: #e8eaf0;
}

[data-theme="dark"] .profile-stat-label {
    color: #9aa0b4;
}

@media (max-width: 420px) {
    .profile-stats-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .profile-stat-item {
        padding: 6px 8px;
    }
    .profile-stat-icon {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
    .profile-stat-value {
        font-size: 0.82rem;
    }
}

/* ============================================================
   VOTE BAR — ПРИНУДИТЕЛЬНО ВИДИМЫЙ
   ============================================================ */
.vote-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 0 !important;
    margin: 8px 0 16px !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    flex-wrap: wrap !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 60px !important;
    position: relative !important;
    z-index: 10 !important;
}

.vote-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    border-radius: 999px !important;
    border: 1.5px solid var(--border-strong) !important;
    background: var(--surface) !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    line-height: 1 !important;
    min-width: 60px !important;
    min-height: 34px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.vote-btn i {
    font-size: 0.95rem !important;
    display: inline-block !important;
    visibility: visible !important;
}

.vote-btn .vote-count {
    display: inline-block !important;
    visibility: visible !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 12px !important;
    color: inherit !important;
}

.vote-like.active {
    background: linear-gradient(135deg, #22c55e, #10b981) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.vote-dislike.active {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.vote-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.vote-login-hint,
.vote-hint {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--text-muted) !important;
    font-size: 0.78rem !important;
}

.vote-login-hint { color: var(--primary) !important; }
.vote-hint i { color: #22c55e !important; }

/* ============================================================
   ДОПОЛНИТЕЛЬНАЯ АДАПТИВНОСТЬ — УЗКИЕ ЭКРАНЫ И МОБИЛЬНЫЕ
   ============================================================ */

/* Планшеты: форма поиска — компактнее */
@media (max-width: 992px) {
    .controls .row { --bs-gutter-x: 8px; --bs-gutter-y: 8px; }
    .controls .form-select,
    .controls .search-box input { height: 40px; font-size: 0.85rem; }
}

/* Мобильные: форма управления в колонку, кнопки на всю ширину */
@media (max-width: 768px) {
    .controls .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .controls .btn-outline-primary { width: 100%; justify-content: center; }

    .section-title { flex-direction: column; align-items: flex-start; gap: 8px; }
    .quick-actions { width: 100%; }
    .quick-actions .btn { flex: 1; justify-content: center; min-width: 0; }

    /* Онлайн-бейджи — компактнее */
    .online-stats-mini { width: 100%; flex-wrap: wrap; }
    .online-mini-badge { font-size: 0.68rem; padding: 2px 8px; }
    .online-mini-badge .visitor-label { display: none; }

    /* Модалки — на весь экран */
    .modal-dialog { margin: 8px; }
    .modal-body { padding: 12px !important; }
    .modal-file-details { padding: 2px 10px; }
    .detail-item { padding: 7px 0; font-size: 0.78rem; }

    /* Карточка файла — кнопка на всю ширину под именем */
    .file-card .row { --bs-gutter-x: 0; }
    .file-card .btn-download {
        width: 100%;
        justify-content: center;
        margin-top: 6px;
    }
    .file-info { padding: 8px 10px 10px 0; }
}

/* Очень узкие экраны: 380px и меньше */
@media (max-width: 380px) {
    .container { padding: 0 10px; }
    body { padding: 8px 0 40px; }

    .header { padding: 14px 14px; border-radius: 12px; }
    .header h1 { font-size: 1rem; }
    .header p { font-size: 0.72rem; }

    .auth-btn { padding: 10px 14px; font-size: 0.82rem; gap: 6px; }
    .auth-btn-user { padding: 6px 10px 6px 6px; }
    .auth-btn-user .auth-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
    .auth-btn-user .auth-name { font-size: 0.8rem; }

    .stats { padding: 10px; }
    .stat-item { gap: 8px; }
    .stat-icon { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
    .stat-value { font-size: 0.82rem; }
    .stat-label { font-size: 0.62rem; }

    .file-icon { width: 30px; height: 30px; margin: 6px 7px; font-size: 12px; }
    .file-name { font-size: 0.78rem; }
    .file-details { gap: 3px; font-size: 0.62rem; }
    .file-type, .file-size { font-size: 0.6rem; padding: 1px 5px; }
    .last-modified { font-size: 0.62rem; }
    .btn-download { padding: 5px 10px; font-size: 0.68rem; }

    .featured-grid { grid-template-columns: 1fr; gap: 10px; }
    .featured-card { padding: 12px; outline-offset: 2px; }
    .featured-card-icon { width: 40px; height: 40px; font-size: 18px; }
    .featured-card-name { font-size: 0.82rem; }
    .featured-title h3 { font-size: 0.92rem; }
    .featured-title p { font-size: 0.72rem; }

    .community-widget { padding: 14px; border-radius: 12px; }
    .community-title h3 { font-size: 0.95rem; }
    .community-title p { font-size: 0.72rem; }
    .community-message { padding: 10px; gap: 8px; }
    .community-avatar { width: 32px; height: 32px; }
    .community-content { font-size: 0.8rem; }

    .online-users-block { padding: 10px 12px; }
    .online-user-item { padding: 4px 8px 4px 4px; }
    .online-avatar { width: 22px; height: 22px; font-size: 0.62rem; }
    .online-user-name { font-size: 0.68rem; max-width: 70px; }

    .chat-window { width: calc(100% - 12px); right: 6px; bottom: 70px; height: 340px; }
    .chat-button { width: 46px; height: 46px; font-size: 17px; bottom: 12px; right: 12px; }

    .pagination .page-link { min-width: 28px; height: 28px; font-size: 0.7rem; }

    .cookie-banner { padding: 12px; bottom: 8px; }
    .cookie-title { font-size: 0.85rem; }
    .cookie-desc { font-size: 0.72rem; }
}

/* Сверх-узкие (Galaxy Fold, 280px) */
@media (max-width: 320px) {
    .container { padding: 0 8px; }
    .header-auth-buttons { gap: 6px; }
    .auth-btn { padding: 9px 10px; font-size: 0.78rem; }
    .file-icon { display: none; }
    .file-info { padding: 8px 8px; }
    .file-card .row { flex-wrap: nowrap; }
    .quick-actions { flex-direction: column; }
    .quick-actions .btn { width: 100%; }
    .online-stats-mini { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Ландшафт на телефоне — компактнее по вертикали */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-window { height: 260px; bottom: 60px; }
    .cookie-banner { padding: 10px 14px; }
    .cookie-icon { display: none; }
    .cookie-actions { gap: 6px; }
}

/* Ховер-эффекты — только на устройствах с мышью */
@media (hover: none) {
    .file-card:hover,
    .featured-card:hover,
    .auth-btn:hover,
    .btn-download:hover,
    .online-user-item:hover {
        transform: none;
    }
    .file-card:hover::before { opacity: 0; }
    .auth-btn:hover::before { transform: translateX(-100%); }
}

/* Уважение к reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .online-pulse,
    .online-pulse::before,
    .online-pulse-big,
    .cookie-icon,
    .auth-btn-register::after {
        animation: none !important;
    }
}

/* Печать */
@media print {
    .theme-toggle, .chat-button, .chat-window, .cookie-banner,
    .progress-container, #notificationContainer, .banner-carousel-section,
    .controls, .quick-actions, .footer, .online-users-block,
    .community-widget, .pagination-container { display: none !important; }
    body { background: #fff; padding: 0; }
    .header { background: #fff !important; color: #000 !important; box-shadow: none; border: 1px solid #ccc; }
    .file-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}