/* =========================================================
   RESPONSIVE.CSS — ПОЛНЫЙ МОБИЛЬНЫЙ АДАПТИВ (ЧИСТЫЙ ТОП-БАР)
   ========================================================= */

/* Защита от горизонтального скролла */
html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
    max-width: 100%;
}

/* Кнопка бургера скрыта на ПК */
.sk-burger-btn {
    display: none;
}

/* ---------------------------------------------------------
   ПЛАНШЕТЫ (<= 992px)
   --------------------------------------------------------- */
@media (max-width: 992px) {
    .site-container {
        flex-direction: column;
        padding: 0 15px;
    }

    .left-sidebar,
    .sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* ---------------------------------------------------------
   МОБИЛЬНЫЕ УСТРОЙСТВА (<= 768px)
   --------------------------------------------------------- */
@media (max-width: 768px) {

    /* 1. КОМПАКТНЫЙ ВЕРХНИЙ МОБИЛЬНЫЙ ТОП-БАР */
    .site-header {
        display: block !important;
        padding: 8px 0;
        background: rgba(18, 21, 28, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--accent-cyan-glow-low);
    }

    .header-container {
        padding: 0 14px;
        gap: 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Адаптивный логотип */
    a.logo-group,
    .logo-group {
        min-width: 0;
        flex-shrink: 1;
        gap: 8px;
    }

    .logo-group img {
        height: 28px;
        width: auto;
        flex-shrink: 0;
    }

    .site-title {
        font-size: 14px;
        letter-spacing: 0.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ЖЕСТКО СКРЫВАЕМ ДЕСКТОПНЫЕ И ЛИШНИЕ КНОПКИ (МАКСИМАЛЬНАЯ СПЕЦИФИЧНОСТЬ) */
    .site-header .main-navigation,
    .site-header .header-search-form,
    .site-header .header-actions a.btn-add-post,
    .site-header .header-actions a.btn-messages,
    .site-header .header-actions .btn-add-post,
    .site-header .header-actions .btn-messages,
    .site-header .header-user-menu-wrap,
    .site-header .header-auth-group {
        display: none !important;
    }

    /* Мобильный блок кнопок: строго 3 кнопки (Стрик + Колокольчик + Бургер) */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-shrink: 0 !important;
    }

    /* Компактный размер кнопок 34x34px */
    .header-actions a.header-action-btn,
    .header-actions button.header-action-btn,
    .header-actions div.header-action-btn,
    .header-action-btn {
        width: 34px !important;
        height: 34px !important;
        flex: 0 0 34px !important;
        font-size: 14px !important;
    }

    .header-action-btn i {
        font-size: 14px !important;
    }

    .header-action-btn.btn-streak .sk-streak-flame {
        font-size: 14px !important;
    }

    .header-action-btn .notifications-badge,
    .header-action-btn .sk-notif-badge,
    .header-action-btn .sk-streak-count {
        min-width: 17px !important;
        height: 17px !important;
        font-size: 9.5px !important;
        top: -3px !important;
        right: -3px !important;
        padding: 0 3px !important;
    }

    .bonus-dot {
        width: 7px;
        height: 7px;
        bottom: -1px;
        right: -1px;
    }

    /* Кнопка мобильного бургера */
    .sk-burger-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        background: rgba(0, 210, 255, 0.08);
        border: 1px solid rgba(0, 210, 255, 0.3);
        border-radius: 50%;
        cursor: pointer;
        padding: 0;
        transition: all 0.25s ease;
    }

    .sk-burger-btn:active {
        transform: scale(0.92);
        background: rgba(0, 210, 255, 0.2);
    }

    .sk-burger-btn * {
        pointer-events: none;
    }

    .burger-line {
        width: 16px;
        height: 2px;
        background: var(--accent-cyan);
        border-radius: 2px;
        transition: transform 0.25s ease;
        pointer-events: none;
    }

    /* Выпадающая шторка уведомлений на весь экран */
    .header-notifications-dropdown {
        position: fixed !important;
        top: 52px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 20px var(--accent-cyan-glow-low);
    }

    /* 2. БАЗОВЫЕ ОТСТУПЫ */
    body {
        padding: 0;
        padding-top: 10px !important;
        padding-bottom: 25px !important;
    }

    .site-container {
        margin: 0 auto;
        padding: 0 10px;
        gap: 15px;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .sidebar,
    .left-sidebar {
        order: 2;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px;
    }

    /* СКРЫВАЕМ ДУБЛИРУЮЩИЙСЯ ТЕРМИНАЛ В САЙДБАРЕ НА МОБИЛКАХ (он живет строго в шторке) */
    .sidebar .sk-terminal-widget {
        display: none !important;
    }

    /* 3. КАРТОЧКИ ПОСТОВ */
    .sk-news-card {
        flex-direction: column;
        gap: 14px;
        padding: 14px;
        margin-bottom: 16px;
        border-radius: var(--radius-md, 8px);
    }

    .sk-card-thumb-wrap {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 180px;
        border-radius: var(--radius-sm, 6px);
    }

    .sk-card-title {
        font-size: 17px;
        line-height: 1.35;
    }

    .sk-card-excerpt {
        font-size: 13px;
        line-height: 1.5;
    }

    .sk-card-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 8px;
    }

    .sk-card-stats-pill {
        padding: 4px 10px;
        font-size: 11px;
    }

    .sk-card-readmore-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* 4. ВЛОЖЕННЫЕ КОММЕНТАРИИ */
    .comment-list .children {
        margin-left: 8px !important;
        padding-left: 8px !important;
        border-left-width: 1.5px !important;
    }

    .comment-list .children .children .children {
        margin-left: 0 !important;
        padding-left: 4px !important;
        border-left-color: rgba(0, 210, 255, 0.15) !important;
    }

    /* 5. КНОПКА «НАВЕРХ» НА МОБИЛЬНЫХ */
    .sk-back-to-top {
        bottom: 25px !important;
        right: 18px !important;
        width: 44px;
        height: 44px;
        z-index: 890;
    }
}

/* ---------------------------------------------------------
   УЛЬТРА-КОМПАКТНЫЕ ЭКРАНЫ (<= 380px)
   --------------------------------------------------------- */
@media (max-width: 380px) {
    .header-container {
        padding: 0 8px;
    }

    .site-title {
        display: none !important;
    }

    .header-actions {
        gap: 8px !important;
    }

    /* Мягкий перенос строки активности профиля */
    .sk-hud-stats-strip {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    .sk-stat-pipe {
        display: none !important; /* Скрываем разделители, чтобы они не ломали перенос */
    }
}

/* =========================================================
   БОКОВАЯ МОБИЛЬНАЯ ШТОРКА (OFF-CANVAS DRAWER)
   ========================================================= */
.sk-drawer-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sk-drawer-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sk-mobile-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #11151e;
    border-left: 1px solid rgba(0, 210, 255, 0.25);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 210, 255, 0.1);
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sk-mobile-drawer.is-open {
    transform: translateX(0);
}

.sk-drawer-inner {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}

.sk-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.sk-drawer-title {
    color: var(--accent-cyan);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sk-drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sk-drawer-close:hover {
    color: #ff5555;
    transform: scale(1.15);
}

/* Карточка пользователя в шторке */
.sk-drawer-user-section {
    margin-bottom: 18px;
}

.sk-drawer-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 210, 255, 0.04);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
}

.sk-drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--accent-cyan);
}

.sk-drawer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sk-drawer-user-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sk-drawer-username {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sk-drawer-user-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sk-drawer-badge-lvl {
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 700;
}

.sk-drawer-badge-streak {
    color: var(--accent-orange);
    font-size: 11px;
    font-weight: 800;
}

.sk-drawer-badge-xp {
    color: #ffcc00;
    font-size: 11px;
    font-weight: 600;
}

/* Кнопки входа для гостя */
.sk-drawer-auth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sk-btn-drawer-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.sk-btn-drawer-auth.btn-login {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.sk-btn-drawer-auth.btn-reg {
    background: rgba(255, 123, 0, 0.1);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
}

/* Поиск в шторке */
.sk-drawer-search {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 10px;
    margin-bottom: 20px;
}

.sk-drawer-search:focus-within {
    border-color: var(--accent-cyan);
}

.sk-drawer-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
    padding: 6px;
    flex: 1;
}

.sk-drawer-search-btn {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    font-size: 14px;
}

.sk-drawer-heading {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sk-drawer-nav-section {
    margin-bottom: 18px;
}

.sk-drawer-menu-list,
.sk-drawer-action-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sk-drawer-menu-list li a,
.sk-drawer-action-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sk-drawer-menu-list li a:hover,
.sk-drawer-action-list li a:hover {
    background: rgba(0, 210, 255, 0.08);
    color: var(--accent-cyan);
}

.action-icon {
    font-size: 15px;
    line-height: 1;
    width: 20px;
    text-align: center;
}

.sk-drawer-badge-count {
    margin-left: auto;
    background: #ff7b00;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1;
}

.sk-drawer-badge-count.is-zero,
.sk-drawer-badge-count:empty {
    display: none !important;
}

/* Кнопка Выйти внизу шторки */
.sk-drawer-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sk-drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 20px;
    color: #ff5555;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.sk-drawer-logout-btn:hover {
    background: #ff4b4b;
    color: #ffffff;
    border-color: #ff4b4b;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.4);
}

@media (max-width: 480px) {
    .site-container { padding: 0 6px; }
    .card { padding: 14px; }
    .sk-modal-box { padding: 20px 16px !important; max-width: 95vw !important; }
}

/* === 2.098 global: кнопка «наверх» и шторка === */
.sk-back-to-top {
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    opacity: 0;
}
.sk-back-to-top.is-show { opacity: .85; }
.sk-back-to-top.is-show:hover { opacity: 1; }
.sk-back-to-top .sk-back-to-top-svg {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}
.sk-back-to-top .sk-progress-bg { fill: rgba(18, 21, 28, .78); filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55)); }
.sk-back-to-top .sk-progress-circle { filter: none; }
.sk-back-to-top .sk-back-to-top-icon { font-size: 13px; }
@media (max-width: 768px) {
    .sk-back-to-top { width: 38px !important; height: 38px !important; bottom: 18px !important; right: 14px !important; }
}

.sk-drawer-menu-list .sk-drawer-badge-count {
    min-width: 42px;
    padding: 3px 7px;
    font-size: 9.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    border-radius: 6px;
    line-height: 1.1;
}
