
    html {
        scrollbar-gutter: stable;
    }

    :root {
        --header-height: 70px;
        --main-orange: #ff9b05;
        --bg-header: rgba(22, 27, 34, 0.95);
        --border-color: #30363d;
    }

    /* ОСНОВНЫЕ СТИЛИ ХЕДЕРА */
    .main-header {
        position: fixed; 
        top: 0; left: 0; right: 0;
        height: var(--header-height); 
        background: var(--bg-header); 
        border-bottom: 1px solid var(--border-color);
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        padding: 0 30px; 
        box-sizing: border-box;
        z-index: 2000; 
    }

    .main-header * { box-sizing: border-box; }

    /* ЛОГОТИП */
    .header-logo {
        font-family: 'Inter', sans-serif; 
        font-size: 22px; 
        font-weight: 700;
        color: #fff; 
        text-decoration: none; 
        letter-spacing: 1px;
        justify-self: start;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .header-logo span { color: var(--main-orange); }

    /* НАВИГАЦИЯ (ПК) */
    .header-nav {
        display: flex; 
        gap: 8px;
        justify-self: center;
    }
    .nav-link {
        padding: 8px 16px; 
        text-decoration: none; 
        color: #8b949e;
        border-radius: 10px; 
        transition: color 0.2s ease, background-color 0.2s ease; 
        font-weight: 600;
        font-size: 13px; 
        display: flex; 
        align-items: center; 
        gap: 8px;
        border: 1px solid transparent;
        font-family: 'Inter', sans-serif;
    }
    .nav-link svg { stroke: currentColor; fill: none; }
    .nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
    .nav-link.active { 
        background: rgba(255, 155, 5, 0.1); 
        color: var(--main-orange); 
        border-color: rgba(255, 155, 5, 0.25); 
    }
    
    .nav-link.admin-link { 
        color: #8b949e; 
    }
    .nav-link.admin-link:hover { 
        color: #fff; 
        background: rgba(255, 255, 255, 0.05); 
    }
    .nav-link.admin-link.active { 
        background: rgba(248, 81, 73, 0.1); 
        color: #f85149; 
        border-color: rgba(248, 81, 73, 0.25); 
    }

    /* ПРАВАЯ ЧАСТЬ (ПК) */
    .header-user-area {
        display: flex; 
        align-items: center; 
        gap: 12px;
        justify-self: end;
    }

    .user-card-wrapper {
        display: flex; 
        align-items: center;
        background: rgba(48, 54, 61, 0.35); 
        padding: 4px 6px 4px 14px;
        border-radius: 10px; 
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .user-info-brief {
        display: flex; 
        align-items: center; 
        gap: 10px;
        padding-right: 12px; 
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        margin-right: 8px; 
        height: 24px;
    }

    .username-text { 
        font-weight: 700; 
        font-size: 13px; 
        color: #e6edf3; 
        white-space: nowrap; 
        font-family: 'Inter', sans-serif;
    }

    .vip-badge-sm {
        display: inline-flex; 
        align-items: center; 
        justify-content: center;
        font-family: 'Inter', sans-serif; 
        font-size: 10px; 
        font-weight: 800;
        padding: 2px 8px; 
        border-radius: 6px; 
        border: 1px solid;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* КНОПКИ */
    .btn-header-exit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(248, 81, 73, 0.15);
        border: 1px solid rgba(248, 81, 73, 0.4);
        border-radius: 8px; 
        color: #ff6b6b; 
        transition: background 0.2s ease;
        text-decoration: none;
    }
    .btn-header-exit:hover { 
        background: #f85149; 
        border-color: #f85149;
        color: #ffffff; 
    }

    .btn-header-login {
        display: inline-flex; 
        align-items: center; 
        justify-content: center;
        background: var(--main-orange); 
        color: #000; 
        height: 36px; 
        padding: 0 14px;
        border-radius: 8px; 
        font-weight: 700; 
        font-size: 13px; 
        text-decoration: none;
        text-transform: uppercase; 
        letter-spacing: 0.5px;
        transition: background 0.2s ease, transform 0.1s ease;
        font-family: 'Inter', sans-serif;
    }
    .btn-header-login:hover { 
        background: #e08800; 
    }
    .btn-header-login:active { 
        transform: scale(0.97); 
    }

    .btn-admin-auth {
        background: transparent; 
        border: 1px solid #f85149; 
        color: #f85149;
        padding: 6px 12px; 
        border-radius: 8px; 
        font-size: 11px; 
        font-weight: 700;
        cursor: pointer; 
        transition: background 0.2s ease, color 0.2s ease; 
        text-transform: uppercase;
        font-family: 'Inter', sans-serif;
    }

    /* ОБЩИЙ МОДАЛЬНЫЙ ОВЕРЛЕЙ */
    .core-modal-overlay {
        position: fixed; 
        inset: 0; 
        background: rgba(10, 13, 18, 0.85);
        display: none; 
        align-items: center; 
        justify-content: center; 
        z-index: 10000; 
        padding: 20px;
        transform: translateZ(0);
    }

    /* КАРТОЧКА МОДАЛЬНОГО ОКНА */
    .core-modal-card {
        background: #161b22; 
        border: 1px solid rgba(255, 155, 5, 0.25); 
        border-radius: 20px; 
        padding: 24px; 
        width: 100%; 
        max-width: 340px; 
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 155, 5, 0.08);
        position: relative;
        box-sizing: border-box;
        font-family: 'Inter', sans-serif;
    }

    .core-modal-title { color: #e6edf3; font-size: 20px; font-weight: 700; margin: 0 0 5px 0; text-align: center; }
    .core-modal-desc { color: #8b949e; font-size: 13px; margin-bottom: 20px; text-align: center; }
    .core-input-group { margin-bottom: 15px; text-align: left; }
    .core-input-group label { display: block; color: #adbac7; font-size: 12px; margin-bottom: 5px; }
    .core-input {
        width: 100%; padding: 12px; background: #0d1117; border: 1px solid #30363d;
        border-radius: 8px; color: #e6edf3; box-sizing: border-box; outline: none; font-size: 14px;
    }
    .core-submit-btn {
        width: 100%; padding: 12px; background: #f85149; border: none; color: #fff;
        border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; text-transform: uppercase; margin-top: 10px;
    }
    .core-modal-close {
        position: absolute; top: 0px; right: 10px; font-size: 22px; color: #8b949e; cursor: pointer; line-height: 1;
        transition: color 0.15s ease;
    }
    .core-modal-close:hover { color: #fff; }

    /* ШАПКА ПРОФИЛЯ В МОДАЛКЕ МОБИЛЬНОГО */
    .m-profile-header {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(22, 27, 34, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.06);
        padding: 12px 14px;
        border-radius: 14px;
        margin-bottom: 16px;
        box-sizing: border-box;
    }

    .m-profile-avatar {
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #ff9b05 0%, #ff5500 100%);
        border-radius: 12px;
        color: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 18px;
        box-shadow: 0 4px 12px rgba(255, 155, 5, 0.3);
        flex-shrink: 0;
    }

    .m-profile-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        text-align: left;
    }

    .m-profile-name {
        color: #fff;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.2;
    }

    .btn-m-admin {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        background: rgba(248, 81, 73, 0.12);
        border: 1px solid rgba(248, 81, 73, 0.4);
        color: #ff6b6b;
        border-radius: 12px;
        font-weight: 700;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        margin-bottom: 10px;
        transition: background 0.15s ease;
    }
    .btn-m-admin:active { background: rgba(248, 81, 73, 0.25); }

    .btn-m-logout {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        background: linear-gradient(135deg, #f85149 0%, #da3633 100%);
        border: none;
        color: #fff;
        border-radius: 12px;
        font-weight: 700;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-decoration: none;
        box-shadow: 0 4px 15px rgba(248, 81, 73, 0.3);
        transition: transform 0.1s ease;
    }
    .btn-m-logout:active { transform: scale(0.98); }

    /* УВЕДОМЛЕНИЯ — ИСПРАВЛЕННОЕ ЦЕНТРИРОВАНИЕ И Z-INDEX */
    .custom-toast {
        position: fixed; 
        top: 25px; 
        left: 50%; 
        transform: translate(-50%, -20px);
        background: #1f3a2b; 
        border: 1px solid #2ea043; 
        color: #ffffff !important; 
        padding: 12px 24px;
        border-radius: 12px; 
        display: flex; 
        align-items: center; 
        gap: 10px; 
        font-family: 'Roboto', sans-serif;
        font-weight: 700; 
        font-size: 14px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.8); 
        z-index: 999999 !important; /* Гарантирует поверх всех оверлеев */
        opacity: 0; 
        transition: opacity 0.25s ease, transform 0.25s ease; 
        pointer-events: none;
        white-space: nowrap;
        max-width: calc(100vw - 32px);
        box-sizing: border-box;
        width: max-content;
    }

    .custom-toast span {
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    }

    .custom-toast svg {
        stroke: #3fb950;
        flex-shrink: 0;
    }

    .custom-toast.show { 
        opacity: 1; 
        transform: translate(-50%, 0); 
    }

    /* Скрываем мобильные элементы на ПК */
    .mobile-nav, .mobile-user-trigger, .mobile-login-btn { display: none !important; }

    @media (max-width: 992px) {
        body { padding-bottom: 80px !important; }

        .header-nav, .desktop-user-wrapper { display: none !important; }
        
        .main-header { 
            display: flex;
            justify-content: space-between;
            padding: 0 16px; 
            height: 60px;
        }
        
        .header-logo { font-size: 18px; }

        /* Включаем отображение мобильных триггеров на смартфонах */
        .mobile-user-trigger {
            display: flex !important;
            align-items: center;
            gap: 6px;
            background: rgba(48, 54, 61, 0.5);
            padding: 4px 8px;
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            cursor: pointer;
        }

        .mobile-login-btn {
            display: inline-flex !important;
        }

        .mobile-user-avatar {
            width: 24px;
            height: 24px;
            background: var(--main-orange);
            border-radius: 50%;
            color: #000;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 11px;
            font-family: 'Inter', sans-serif;
        }

        /* Нижнее навигационное меню */
        .mobile-nav {
            display: flex !important; 
            position: fixed; 
            bottom: 0; left: 0; right: 0; 
            height: 60px;
            background: rgba(18, 22, 28, 0.98); 
            border-top: 1px solid var(--border-color); 
            z-index: 2000;
            justify-content: space-around; 
            align-items: center; 
            padding-bottom: env(safe-area-inset-bottom);
        }
        .mobile-nav-link {
            text-decoration: none; 
            color: #8b949e; 
            font-size: 11px;
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            gap: 3px; 
            font-weight: 600;
            font-family: 'Inter', sans-serif;
        }
        .mobile-nav-link svg { stroke: currentColor; fill: none; }
        .mobile-nav-link.active { color: var(--main-orange); }
        .mobile-nav-link.active-admin { color: #f85149; }
    }


/* Extracted from legacy inline style attributes. */
.inline-9f3091e7{display:flex; align-items:center; gap: 8px;}
.inline-0cd28ce9{display:inline;}
.inline-e050eb4f{padding:0; cursor:pointer;}
.inline-bd65b469{padding: 0 12px; height: 30px; font-size: 11px;}
.js-vip-color{color:var(--vip-color)!important;border-color:var(--vip-color)!important}
.js-vip-color-bg{background:rgba(0,0,0,.3)!important}

/* CSP-safe dynamic classes */
.vip-badge-sm.vip-gray{--vip-color:#8b949e}.vip-badge-sm.vip-blue{--vip-color:#58a6ff}.vip-badge-sm.vip-purple{--vip-color:#bc8cff}.vip-badge-sm.vip-orange{--vip-color:#ff9b05}.vip-badge-sm.vip-red{--vip-color:#f85149}
.vip-badge-sm{color:var(--vip-color)}
.js-vip-color-bg{background:color-mix(in srgb, var(--vip-color) 15%, transparent);border-color:color-mix(in srgb, var(--vip-color) 35%, transparent)}

/* CSP-safe modal state */
.core-modal-overlay.is-open{display:flex !important}
.custom-toast.show{display:flex !important}


.password-field-core {
    position: relative;
    width: 100%;
}

.password-field-core .core-input {
    padding-right: 48px !important;
}

.password-field-core .password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8b949e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.password-field-core .password-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.password-field-core .password-toggle:focus-visible {
    outline: 2px solid #ff9b05;
    outline-offset: 2px;
}

/* Password eye in the core/admin modal. Keep this self-contained because
   roulette.php does not load home.css. */
.password-field-core .password-eye {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.password-field-core .password-eye-open {
    display: block;
}

.password-field-core .password-eye-closed {
    display: none;
}

.password-field-core .password-toggle.is-visible .password-eye-open {
    display: none;
}

.password-field-core .password-toggle.is-visible .password-eye-closed {
    display: block;
}
