:root {
    --bg-color: #0f141c;
    --card-bg: #1a2230;
    --accent: #e5a93c;
    --accent-hover: #ffbe4d;
    --text: #e1e7ec;
    --text-muted: #8b9bb4;
    --danger: #e74c3c;
    --success: #2ecc71;
    --border: #2a374a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

header {
    background-color: #141b26;
    border-bottom: 2px solid var(--border);
    padding: 15px 0;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

nav a {
    color: var(--text);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--accent);
    color: #000;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #000;
}

.hero {
    text-align: center;
    padding: 50px 0 30px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.plugin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.plugin-card h3 {
    color: var(--accent);
    margin-bottom: 8px;
}

.plugin-badge {
    display: inline-block;
    background: #111722;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.plugin-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.plugin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.auth-box {
    max-width: 400px;
    margin: 60px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.auth-box h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    background: #121824;
    border: 1px solid var(--border);
    color: #fff;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
}

.alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--danger);
    color: #ff8e82;
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--success);
    color: #72f1a6;
}

footer {
    margin-top: auto;
    background: #141b26;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
/* --- СТИЛИ СЧЁТЧИКА В ШАПКЕ --- */
.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(18, 24, 36, 0.75);
    border: 1px solid rgba(229, 169, 60, 0.25);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    user-select: none;
}

.stats-live {
    width: 7px;
    height: 7px;
    background-color: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71;
    animation: statsPulse 2s infinite ease-in-out;
}

@keyframes statsPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 12px #2ecc71;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.stats-item svg {
    width: 14px;
    height: 14px;
    fill: var(--text-muted);
}

.stats-val {
    color: #fff;
    font-weight: 700;
}

.stats-val.accent {
    color: var(--accent);
}

.stats-divider {
    width: 1px;
    height: 12px;
    background-color: var(--border);
}
/* Профиль и Army Ranks */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.profile-avatar-wrap {
    text-align: center;
    width: 170px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 15px rgba(229, 169, 60, 0.3);
}

.rank-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2b394e, #1a2230);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-status {
    color: #2ecc71;
    font-size: 0.9rem;
    font-style: italic;
    background: rgba(46, 204, 113, 0.1);
    border-left: 3px solid #2ecc71;
    padding: 5px 10px;
    margin: 10px 0 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.info-block {
    background: #141b26;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

.info-block h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Достижения и награды */
.achieve-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #121824;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 4px;
}

.achieve-badge.unlocked {
    border-color: #2ecc71;
    color: #72f1a6;
}

.achieve-badge.locked {
    opacity: 0.4;
    border-style: dashed;
}

.award-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #182232;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(229, 169, 60, 0.2);
}

.award-icon {
    font-size: 1.6rem;
}

.server-item {
    display: flex;
    align-items: center;
    background: #111722;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-family: monospace;
    color: #ffbe4d;
}
/* Статус онлайн / оффлайн */
.user-network-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-network-state.online {
    color: #2ecc71;
}

.user-network-state.recent {
    color: #e5a93c;
}

.user-network-state.offline {
    color: var(--text-muted);
}

.state-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.user-network-state.online .state-dot {
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
}

.user-network-state.recent .state-dot {
    background: #e5a93c;
}

.user-network-state.offline .state-dot {
    background: #7f8c8d;
}

/* Карточка сервера */
.server-monitoring-card {
    background: #111722;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.server-monitoring-card:hover {
    border-color: rgba(229, 169, 60, 0.4);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.server-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.server-online-badge {
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}

.server-online-badge.up {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.server-online-badge.down {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.server-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.steam-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #121824;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #64b5f6;
    margin-top: 4px;
}
/* Вертикальные карточки плагинов */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.plugin-card {
    background: linear-gradient(180deg, #182232 0%, #131a26 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent); /* Вертикальная рамка-акцент */
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-left-color 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.plugin-card:hover {
    transform: translateY(-4px);
    border-left-color: #ffbe4d;
    box-shadow: 0 8px 25px rgba(229, 169, 60, 0.2);
}

.plugin-card-media {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #0d121a;
}

.plugin-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.plugin-card:hover .plugin-card-media img {
    transform: scale(1.05);
}

.plugin-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 20, 28, 0.85);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.plugin-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.plugin-card-body h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.plugin-card-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Метаданные: кто предложил и кто одобрил */
.plugin-authors-meta {
    background: rgba(17, 23, 34, 0.6);
    border: 1px solid rgba(42, 55, 74, 0.7);
    border-left: 2px solid #2ecc71;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.author-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-row .label {
    color: var(--text-muted);
}

.author-row a {
    color: #ffbe4d;
    text-decoration: none;
    font-weight: 600;
}

.author-row a:hover {
    text-decoration: underline;
}

.author-row .admin-tag {
    color: #2ecc71;
}

.plugin-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    background: rgba(17, 23, 34, 0.4);
}
/* Категории и фильтры */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0 30px;
    justify-content: center;
}

.category-chip {
    background: #141b26;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.category-chip:hover, .category-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

/* Оценки и рейтинг */
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f1c40f;
    font-size: 0.95rem;
}

.rate-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #111722;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.rate-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #f1c40f;
    transition: transform 0.15s ease;
    padding: 0 2px;
}

.rate-btn:hover {
    transform: scale(1.3);
}

/* Комментарии */
.comments-box {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding-top: 25px;
}

.comment-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.comment-meta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
}

.comment-body {
    color: #e1e7ec;
    font-size: 0.95rem;
    line-height: 1.45;
}
/* Аватары в комментариях */
.comment-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.comment-content {
    flex-grow: 1;
}

/* ========================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (RESPONSIVE DESIGN)
======================================================== */

/* Базовые параметры резинового контейнера */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Медиа-запрос для планшетов и смартфонов (до 768px) */
@media (max-width: 768px) {
    /* 1. Шапка сайта */
    .nav-wrap {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 10px 0;
    }

    .nav-wrap > div:first-child {
        justify-content: space-between;
        width: 100%;
    }

    /* Счётчик посетителей компактнее */
    .stats-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
        gap: 6px;
    }

    .stats-item svg {
        display: none; /* скрываем иконки, чтобы не перегружать */
    }

    /* Навигационное меню в ряд со скроллом или перенос */
    header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px !important;
        width: 100%;
    }

    header nav a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    /* 2. Hero-секция */
    .hero {
        padding: 30px 15px;
        text-align: center;
    }

    .hero h1 {
        font-size: 1.5rem !important;
        line-height: 1.25;
    }

    .hero p {
        font-size: 0.9rem;
    }

    /* 3. Фильтр категорий */
    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .category-chip {
        flex-shrink: 0;
        font-size: 0.8rem;
    }

    /* 4. Сетка плагинов (одна колонка на мобильном) */
    .plugins-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        margin: 20px 0 !important;
    }

    .plugin-card-media {
        height: 160px;
    }

    /* 5. Карточка профиля */
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
        gap: 15px;
    }

    .profile-card div[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* 6. Формы и модальные окна */
    .auth-box {
        padding: 20px 15px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 7. Страница материала (plugin.php) */
    .plugin-meta-wrap {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .comment-card {
        padding: 10px !important;
        gap: 10px !important;
    }

    .comment-avatar {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Медиа-запрос для узких смартфонов (до 480px) */
@media (max-width: 480px) {
    header .logo {
        font-size: 1.3rem;
    }

    /* Если счетчик слишком широкий — прячем часть данных */
    .stats-badge .stats-item:first-child,
    .stats-badge .stats-divider:first-of-type {
        display: none;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
    }
}
/* Бейджи совместимости */
.tag-badge {
    display: inline-block;
    background: rgba(100, 181, 246, 0.15);
    color: #64b5f6;
    border: 1px solid rgba(100, 181, 246, 0.4);
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

/* Бейджи анти-бэкдор сканера */
.sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.sec-clean { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid #2ecc71; }
.sec-warning { background: rgba(231, 76, 60, 0.2); color: #ff6b6b; border: 1px solid #e74c3c; }

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 35px 0 20px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.pagination a:hover, .pagination span.current {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: bold;
}

/* Вложенные комментарии (ответы) */
.comment-reply {
    margin-left: 45px;
    border-left: 3px solid #ffbe4d !important;
    background: rgba(255, 190, 77, 0.04) !important;
}
@media (max-width: 768px) {
    .comment-reply { margin-left: 20px; }
}
/* Шапка и баннер профиля */
.profile-banner {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 8px 8px 0 0;
    position: relative;
    border: 1px solid var(--border);
    border-bottom: none;
}
.profile-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 16, 23, 0.2) 0%, rgba(12, 16, 23, 0.85) 100%);
    border-radius: 8px 8px 0 0;
}
.profile-card.with-banner {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

/* Прогресс-бар армейского звания */
.rank-progress-wrap {
    margin-top: 10px;
    background: #111722;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
}
.rank-progress-bar-bg {
    width: 100%;
    height: 7px;
    background: #1a2332;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}
.rank-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e5a93c, #2ecc71);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Социальные контакты и донат */
.profile-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #111722;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #d0d7de;
    text-decoration: none;
}
.contact-chip:hover {
    border-color: var(--accent);
    color: #fff;
}

/* Вкладки переключения профиля */
.profile-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
    margin: 30px 0 20px;
    overflow-x: auto;
}
.profile-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}
.profile-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
