/* =========================================================
   HEADER.CSS — ШАПКА И НАВИГАЦИЯ (ЧЕТКИЙ СТАНДАРТ ЦВЕТОВ И ХОВЕРОВ)
   ========================================================= */

.site-header {
    background: #12151c;
    border-bottom: 1px solid var(--accent-cyan-glow-low);
    padding: 8px 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled,
.site-header--scrolled {
    background: rgba(18, 21, 28, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: var(--accent-cyan-glow-med);
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.15);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Логотип */
a.logo-group,
.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 1; /* Позволяем блоку сжиматься на узких экранах */
    min-width: 0; /* Защита от выталкивания flex-элементов */
    transition: filter 0.3s ease;
}

.logo-group:hover {
    filter: drop-shadow(0 0 12px var(--accent-cyan-glow-high));
    text-decoration: none;
}

.logo-group img {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo-group:hover img {
    transform: scale(1.05);
}

.site-title {
    font-family: 'Press Start 2P', 'Russo One', sans-serif;
    font-size: 18px;
    color: var(--accent-hover);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: none;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-group:hover .site-title {
    color: var(--accent-hover);
}

/* Поиск в шапке */
.header-search-form {
    display: flex;
    align-items: center;
    background: #1a1e29;
    border: 1px solid var(--accent-cyan-glow-low);
    border-radius: 20px;
    padding: 2px 8px;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search-form:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.header-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--accent-hover);
    font-size: 13px;
    padding: 4px 6px;
    width: 150px;
    transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-search-input:focus {
    width: 240px;
}

.header-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0 4px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   ВЫПАДАЮЩИЙ ОВЕРЛЕЙ ЖИВОГО ПОИСКА
   ========================================================= */
.sk-live-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 360px;
    max-width: 90vw;
    background: rgba(17, 21, 31, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 210, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 210, 255, 0.15);
    padding: 8px 0;
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    max-height: 460px;
    overflow-y: auto;
    box-sizing: border-box;
}

.sk-live-search-results.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sk-search-section-title {
    padding: 8px 14px 4px 14px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.sk-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.sk-search-item:hover,
.sk-search-item.is-selected {
    background: rgba(0, 210, 255, 0.1);
    border-left-color: var(--accent-cyan);
}

.sk-search-thumb {
    width: 36px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background: #090c12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sk-search-post .sk-search-thumb {
    width: 48px;
    height: 36px;
}

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

.sk-search-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sk-search-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sk-search-item:hover .sk-search-title {
    color: var(--accent-cyan);
}

.sk-search-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.sk-search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.sk-search-footer {
    padding: 8px 14px 4px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 4px;
}

.sk-search-view-all {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.sk-search-view-all:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* =========================================================
   ПАНЕЛЬ ДЕЙСТВИЙ (СТАНДАРТ HUD КНОПОК 36X36PX)
   ========================================================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* 1. БАЗОВАЯ ГЕОМЕТРИЯ И ГОЛУБОЙ ЦВЕТ ПО УМОЛЧАНИЮ ДЛЯ ВСЕХ КНОПОК */
.site-header .header-actions a.header-action-btn,
.site-header .header-actions button.header-action-btn,
.site-header .header-actions div.header-action-btn,
.site-header .header-action-btn {
    box-sizing: border-box !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(0, 210, 255, 0.08) !important;
    border: 1px solid rgba(0, 210, 255, 0.3) !important;
    color: var(--accent-cyan, #00d2ff) !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    cursor: pointer !important;
    font-size: 15px !important;
    line-height: 1 !important;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease !important;
    z-index: 10;
}

.site-header .header-action-btn i {
    font-size: 15px !important;
    line-height: 1 !important;
    color: var(--accent-cyan, #00d2ff) !important;
    pointer-events: none !important;
    transition: color 0.25s ease, filter 0.25s ease !important;
    filter: none !important;
    text-shadow: none !important;
}

/* 2. НАВЕДЕНИЕ ПО УМОЛЧАНИЮ — ГОЛУБОЕ, ИКОНКА БЕЛЕЕТ */
.site-header .header-actions a.header-action-btn:hover,
.site-header .header-actions button.header-action-btn:hover,
.site-header .header-actions div.header-action-btn:hover,
.site-header .header-action-btn:hover {
    transform: translateY(-2px) !important;
    background: rgba(0, 210, 255, 0.2) !important;
    border-color: var(--accent-cyan, #00d2ff) !important;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.45) !important;
}

.site-header .header-action-btn:hover i {
    color: #ffffff !important;
    filter: drop-shadow(0 0 4px rgba(0, 210, 255, 0.5)) !important;
}

.site-header .header-action-btn:active {
    transform: translateY(0) !important;
}

/* 3. КНОПКА СТРИКА КОГДА БОНУС УЖЕ ЗАБРАН — ОНА ГОЛУБАЯ */
.site-header .header-actions .header-action-btn.btn-streak.is-claimed {
    background: rgba(0, 210, 255, 0.08) !important;
    border-color: rgba(0, 210, 255, 0.3) !important;
    color: var(--accent-cyan, #00d2ff) !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.site-header .header-actions .header-action-btn.btn-streak.is-claimed .sk-streak-flame {
    color: var(--accent-cyan, #00d2ff) !important;
    filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.6)) !important;
    text-shadow: none !important;
    animation: none !important;
    display: inline-block;
    line-height: 1;
    transition: color 0.25s ease, filter 0.25s ease;
}

/* Ховер забранного стрика */
.site-header .header-actions .header-action-btn.btn-streak.is-claimed:hover {
    transform: translateY(-2px) !important;
    background: rgba(0, 210, 255, 0.2) !important;
    border-color: var(--accent-cyan, #00d2ff) !important;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.45) !important;
    color: #ffffff !important;
}

.site-header .header-actions .header-action-btn.btn-streak.is-claimed:hover .sk-streak-flame {
    color: #ffffff !important;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.9)) !important;
}

/* 4. КНОПКИ С УВЕДОМЛЕНИЯМИ И ДОСТУПНЫЙ БОНУС — СТАНОВЯТСЯ ОРАНЖЕВЫМИ */
.site-header .header-actions .header-action-btn.has-unread,
.site-header .header-actions .header-action-btn.btn-streak.is-available {
    background: rgba(255, 123, 0, 0.1) !important;
    border-color: rgba(255, 123, 0, 0.5) !important;
    color: var(--accent-orange, #ff7b00) !important;
    cursor: pointer !important;
}

.site-header .header-actions .header-action-btn.btn-streak.is-available .sk-streak-flame {
    color: var(--accent-orange, #ff7b00) !important;
    filter: drop-shadow(0 0 5px rgba(255, 123, 0, 0.7)) !important;
    text-shadow: none !important;
    animation: none !important;
    display: inline-block;
    line-height: 1;
    transition: color 0.25s ease, filter 0.25s ease;
}

.site-header .header-actions .header-action-btn.has-unread i {
    color: var(--accent-orange, #ff7b00) !important;
    filter: drop-shadow(0 0 5px rgba(255, 123, 0, 0.7)) !important;
}

/* Ховер доступного стрика */
.site-header .header-actions .header-action-btn.has-unread:hover,
.site-header .header-actions .header-action-btn.btn-streak.is-available:hover {
    transform: translateY(-2px) !important;
    background: rgba(255, 123, 0, 0.22) !important;
    border-color: var(--accent-orange, #ff7b00) !important;
    box-shadow: 0 0 14px rgba(255, 123, 0, 0.5) !important;
    color: #ffffff !important;
}

.site-header .header-actions .header-action-btn.has-unread:hover i,
.site-header .header-actions .header-action-btn.btn-streak.is-available:hover .sk-streak-flame {
    color: #ffffff !important;
    filter: drop-shadow(0 0 8px rgba(255, 123, 0, 0.9)) !important;
}

/* =========================================================
   5. ЖЕСТКИЙ ПЕРЕХВАТ ДЛЯ СТРАНИЦЫ СООБЩЕНИЙ (BETTER MESSAGES FIX)
   ========================================================= */
body.page-template-page-messages .site-header .header-actions .btn-messages,
body.page-template-page-messages-php .site-header .header-actions .btn-messages {
    background: rgba(0, 210, 255, 0.08) !important;
    border-color: rgba(0, 210, 255, 0.3) !important;
    color: var(--accent-cyan, #00d2ff) !important;
    box-shadow: none !important;
}

body.page-template-page-messages .site-header .header-actions .btn-messages i,
body.page-template-page-messages-php .site-header .header-actions .btn-messages i {
    color: var(--accent-cyan, #00d2ff) !important;
    filter: none !important;
}

body.page-template-page-messages .site-header .header-actions .btn-messages:hover,
body.page-template-page-messages-php .site-header .header-actions .btn-messages:hover {
    background: rgba(0, 210, 255, 0.2) !important;
    border-color: var(--accent-cyan, #00d2ff) !important;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.45) !important;
}

body.page-template-page-messages .site-header .header-actions .btn-messages:hover i,
body.page-template-page-messages-php .site-header .header-actions .btn-messages:hover i {
    color: #ffffff !important;
    filter: drop-shadow(0 0 4px rgba(0, 210, 255, 0.5)) !important;
}

body.page-template-page-messages .site-header .header-actions .btn-messages .bp-messages-unread-count,
body.page-template-page-messages-php .site-header .header-actions .btn-messages .bp-messages-unread-count {
    display: none !important;
}

/* =========================================================
   ЕДИНЫЙ СТАНДАРТ БЕЙДЖЕЙ (ISLAND CUTOUT EFFECT)
   ========================================================= */
.header-action-btn .notifications-badge,
.header-action-btn .sk-notif-badge,
.header-action-btn .bp-messages-unread-count,
.header-action-btn .sk-streak-count {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    left: auto !important;
    bottom: auto !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 4px !important;
    border-radius: 9px !important;
    background: #ff7b00 !important;
    border: 1.5px solid #12151c !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-shadow: 0 0 8px rgba(255, 123, 0, 0.7) !important;
    z-index: 3 !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
}

/* КОГДА СТРИК ЗАБРАН — БЕЙДЖ СТАНОВИТСЯ НЕОНОВО-ГОЛУБЫМ */
.header-action-btn.is-claimed .sk-streak-count {
    background: #00d2ff !important;
    color: #080b11 !important;
    border-color: #12151c !important;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.6) !important;
}

.header-action-btn .bp-messages-unread-count.is-zero,
.header-action-btn .bp-messages-unread-count.bp-hide,
.header-action-btn .bp-messages-unread-count[data-count="0"],
.header-action-btn .bp-messages-unread-count:empty,
.header-action-btn .notifications-badge:empty {
    display: none !important;
}

/* Точка внимания (Бонус готов) */
.bonus-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #00ff66;
    border: 1.5px solid #12151c;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff66;
    z-index: 4;
}

.sk-xp-float-header {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff66;
    font-weight: 900;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.8);
    pointer-events: none;
    animation: floatDownFade 1.6s ease-out forwards;
    z-index: 10;
    white-space: nowrap;
}

@keyframes floatDownFade {
    0% { opacity: 1; transform: translate(-50%, 0) scale(0.5); }
    20% { transform: translate(-50%, 15px) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, 40px) scale(1); }
}

/* =========================================================
   ОПТИМИЗАЦИЯ ВОЗДУХА: НОВЫЙ РАЗДЕЛИТЕЛЬ
   ========================================================= */
.header-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(0, 210, 255, 0.3), transparent);
    margin: 0 2px;
}

/* =========================================================
   БЕЙДЖ И ВЫПАДАЮЩЕЕ МЕНЮ ПОЛЬЗОВАТЕЛЯ
   ========================================================= */
.header-user-menu-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
}

.header-actions a.header-user-badge,
.header-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px 0 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--user-color, rgba(0, 210, 255, 0.3));
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-sizing: border-box;
    line-height: 1;
}

.header-actions a.header-user-badge:hover,
.header-user-badge:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--user-color, var(--accent-cyan));
    box-shadow: 0 0 12px var(--user-color, rgba(0, 210, 255, 0.35));
    text-decoration: none;
}

.header-username {
    color: var(--accent-hover, #ffffff);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.header-lvl {
    color: var(--user-color, var(--accent-cyan));
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0;
}

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

.header-user-caret {
    color: var(--user-color, var(--accent-cyan));
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -2px;
    transition: transform 0.3s ease;
}

.header-user-menu-wrap.is-open .header-user-caret,
.header-user-menu-wrap--open .header-user-caret {
    transform: rotate(180deg);
}

/* Выпадающее меню */
.header-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(22, 26, 35, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: var(--radius-lg, 10px);
    padding: 8px;
    width: 210px;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 210, 255, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
}

.header-user-menu-wrap.is-open .header-user-dropdown,
.header-user-menu-wrap--open .header-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md, 6px);
    color: var(--text-main, #e6edf3);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-icon {
    font-size: 14px;
    color: var(--accent-cyan, #00d2ff);
    transition: color 0.2s ease;
    width: 16px;
    text-align: center;
}

.dropdown-item:hover {
    background: rgba(0, 210, 255, 0.08);
    color: #ffffff;
}

.dropdown-item:hover .dropdown-icon {
    color: var(--accent-cyan, #00d2ff);
}

.dropdown-item-logout { color: #ff5555 !important; }
.dropdown-item-logout .dropdown-icon { color: #ff5555 !important; }
.dropdown-item-logout:hover {
    background: rgba(255, 85, 85, 0.1) !important;
    color: #ff7777 !important;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

/* =========================================================
   КНОПКИ ГОСТЕЙ
   ========================================================= */
.header-auth-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-auth-group a.btn-login,
.header-auth-group a.btn-register,
.btn-login,
.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

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

.header-auth-group a.btn-login:hover,
.btn-login:hover {
    background: var(--accent-cyan);
    color: var(--bg-main);
    box-shadow: 0 0 20px var(--accent-cyan-glow-med);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-register {
    background: rgba(255, 123, 0, 0.08);
    color: var(--accent-hover);
    border: 1px solid var(--accent-orange);
}

.header-auth-group a.btn-register:hover,
.btn-register:hover {
    background: var(--accent-orange);
    color: var(--bg-main);
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Навигация десктопа */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-navigation ul,
.header-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.main-navigation a,
.header-nav-list li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color var(--transition);
}

.main-navigation a:hover,
.header-nav-list li a:hover {
    color: var(--accent-cyan);
    text-decoration: none;
}

/* Прячем разделитель на мобильных экранах */
@media (max-width: 768px) {
    .header-divider {
        display: none !important;
    }
}

/* =========================================================
   АДАПТИВНОСТЬ ШАПКИ (УЛЬТРА-УЗКИЕ ЭКРАНЫ < 390px)
   ========================================================= */
@media (max-width: 390px) {
    .header-container {
        padding: 0 10px;
        gap: 8px;
    }
    .logo-group {
        gap: 5px;
    }
    .site-title {
        display: none !important; /* Скрываем текст, оставляем только шлем */
    }
    .header-actions {
        gap: 8px !important;
    }
    .site-header .header-action-btn {
        width: 32px !important;
        height: 32px !important;
        flex: 0 0 32px !important;
    }
}