/* ==========================================
   📌 ОСНОВНЫЕ СТИЛИ ШАПКИ (HEADER)
   ========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(44, 24, 16, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(44, 24, 16, 0.4);
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
}

.site-logo a {
    color: white;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    padding: 5px;
}

.nav-main {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: #E8CFA8;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 14px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-link-admin {
    color: #fbbf24;
    font-weight: 700;
}

.nav-link-logout {
    color: #FCA5A5;
    font-weight: 600;
}

.nav-link-register {
    background: #8b5cf6;
    color: white;
    font-weight: 600;
    padding: 6px 14px;
}

.user-profile-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #E8CFA8;
}

.user-zeffyrs {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 600;
}

.avatar-link {
    text-decoration: none;
    display: block;
    position: relative;
}

.activity-stats {
    display: inline-flex;
    gap: 12px;
    margin-left: 15px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.stat-count {
    color: #22c55e;
    font-weight: 700;
}

.nav-notification-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-notification-link:hover {
    color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.15);
}

.nav-icon {
    font-size: 18px;
    line-height: 1;
}

.nav-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-has {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulse-soft 2s infinite;
}

.status-none {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.header-avatar {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0;
    overflow: visible !important;
    margin: 0 !important;
    border: 2px solid rgba(255,255,255,0.2) !important;
}

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

.header-avatar .avatar-badge-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
    bottom: -2px !important;
    right: -2px !important;
    border-width: 1px !important;
}

.header-avatar.effect-steam-spice::after {
    font-size: 16px !important;
    top: -4px !important;
    right: -4px !important;
}

.header-avatar.frame-ognennaya {
    padding: 2px !important;
    border: none !important;
}

.header-avatar.frame-brilliant {
    padding: 2px !important;
}

/* ==========================================
   📱 МОБИЛЬНОЕ МЕНЮ (МАГИЧЕСКОЕ ИСПРАВЛЕНИЕ)
   ========================================== */
@media (max-width: 960px) {
    .nav-toggle { display: block !important; }
    
    .nav-main {
        display: none;
        position: absolute; /* КЛЮЧЕВОЕ: привязываем к шапке, а не к экрану */
        top: 100%;          /* КЛЮЧЕВОЕ: всегда ровно под шапкой, какая бы высота у неё ни была */
        left: 0;
        right: 0;
        background: rgba(30, 30, 46, 0.98);
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 10px;
        z-index: 9999;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        max-height: 80vh;   /* Ограничиваем высоту, чтобы можно было скроллить */
        overflow-y: auto;   /* Включаем прокрутку внутри меню */
    }
    
    .nav-main.mobile-open { 
        display: flex !important; 
    }
    
    .nav-main .nav-link, 
    .nav-main .nav-link-admin, 
    .nav-main .nav-link-logout,
    .nav-main .nav-link-register { 
        width: 100%; 
        padding: 12px 15px !important; 
        font-size: 15px !important; 
        border-bottom: 1px solid rgba(255,255,255,0.05);
        text-align: left;
    }
    
    .user-profile-block {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 15px;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 10px 15px;
    }
    .site-logo {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 8px 12px;
    }
    .site-logo {
        font-size: 16px;
    }
}