/* Fleep Casino — шапка (единый стиль с sidebar / footer) */

body.fleep-ui {
    --fleep-header-h: 72px;
    --fleep-header-inner-h: 48px;
    --fleep-header-pad-y: 12px;
    --fleep-header-guest: var(--fleep-header-h);
    --fleep-header-auth: var(--fleep-header-h);
    --fleep-header-catalog: var(--fleep-header-h);
}

/* --- Shell: сброс Dune grid / pill dock --- */
body.fleep-ui .casino-header.fleep-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    grid-template-columns: unset !important;
    column-gap: 16px !important;
    width: auto !important;
    min-height: var(--fleep-header-h) !important;
    height: var(--fleep-header-h) !important;
    padding: var(--fleep-header-pad-y) var(--fleep-content-pad) !important;
    margin: 0 !important;
    background: var(--fleep-bg) !important;
    border: none !important;
    border-bottom: 1px solid var(--fleep-divider, #383C41) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: fixed !important;
    top: 0 !important;
    left: var(--fleep-sidebar-w) !important;
    right: 0 !important;
    z-index: 50 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    isolation: auto !important;
}

body.fleep-ui .casino-header.fleep-header.casino-header--scrolled {
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--fleep-divider, #383C41) !important;
    background: var(--fleep-bg) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: visible !important;
}

body.fleep-ui.fleep-sidebar-collapsed .casino-header.fleep-header,
body.fleep-ui.sidebar-collapsed .casino-header.fleep-header {
    left: var(--fleep-sidebar-collapsed, 72px) !important;
}

body.fleep-ui .fleep-header__start,
body.fleep-ui .fleep-header .header-left {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
}

body.fleep-ui .fleep-header__end,
body.fleep-ui .fleep-header .header-center {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
    max-width: none !important;
}

body.fleep-ui .fleep-header .header-center-dock {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

@media (min-width: 721px) {
    body.fleep-ui .casino-header.fleep-header {
        display: flex !important;
        grid-template-columns: unset !important;
    }

    body.fleep-ui .fleep-header .header-center,
    body.fleep-ui .header-center {
        justify-self: stretch !important;
        max-width: none !important;
    }

    body.fleep-ui .fleep-header .header-center-dock,
    body.fleep-ui .header-center-dock,
    body.fleep-ui [data-theme="dark"] .fleep-header .header-center-dock,
    body.fleep-ui [data-theme="light"] .fleep-header .header-center-dock {
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    body.fleep-ui [data-theme="dark"] .fleep-header .header-center-dock .header-balance-trigger,
    body.fleep-ui [data-theme="light"] .fleep-header .header-center-dock .header-balance-trigger {
        background: var(--fleep-panel-bg, #262628) !important;
        box-shadow: var(--fleep-shadow-btn, 0 4px 4px rgba(0, 0, 0, 0.15)) !important;
    }
}

body.fleep-ui .fleep-header .header-buttons:not(.hidden) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    min-width: 0 !important;
}

body.fleep-ui .fleep-header .header-buttons.hidden,
body.fleep-ui.fleep-is-auth #headerGuest,
body.fleep-ui.fleep-is-guest #headerAuth {
    display: none !important;
}

/* --- Logo --- */
body.fleep-ui .fleep-header__brand,
body.fleep-ui .fleep-header .header-brand-logo,
body.fleep-ui .fleep-header .logo.header-brand-logo {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    max-width: min(180px, 38vw) !important;
    width: auto !important;
    height: var(--fleep-header-inner-h) !important;
    text-decoration: none !important;
    box-shadow: none !important;
    filter: none !important;
    overflow: visible !important;
}

body.fleep-ui .fleep-header__logo-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-shrink: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

body.fleep-ui .fleep-header__logo,
body.fleep-ui .fleep-header .header-brand-logo .logo-img,
body.fleep-ui .fleep-header .logo.header-brand-logo .logo-img {
    display: block !important;
    flex-shrink: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: min(180px, 38vw) !important;
    max-height: var(--fleep-header-inner-h) !important;
    object-fit: contain !important;
    object-position: left center !important;
}

/* --- Balance --- */
body.fleep-ui .fleep-header .header-balance-slot {
    min-width: 0 !important;
    flex-shrink: 1 !important;
}

body.fleep-ui .fleep-header .header-balance-trigger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 40px !important;
    max-width: min(200px, 26vw) !important;
    padding: 0 12px !important;
    background: var(--fleep-panel-bg, #262628) !important;
    border: none !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    box-shadow: var(--fleep-shadow-btn) !important;
    color: var(--fleep-text) !important;
    font-family: var(--fleep-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

body.fleep-ui .fleep-header .header-balance-trigger:hover,
body.fleep-ui .fleep-header .header-balance-trigger--open {
    background: var(--fleep-panel-hover, #2e3034) !important;
}

body.fleep-ui .fleep-header .header-balance-trigger-icon {
    color: var(--fleep-red) !important;
    opacity: 1 !important;
}

body.fleep-ui .fleep-header .header-balance-trigger .balance-main {
    color: var(--fleep-red) !important;
    font-variant-numeric: tabular-nums;
}

body.fleep-ui .fleep-header .header-balance-trigger .header-balance-chevron {
    display: inline-flex !important;
    color: var(--fleep-text-muted) !important;
    flex-shrink: 0 !important;
}

body.fleep-ui .fleep-header .header-balance-trigger-text,
body.fleep-ui .fleep-header .header-balance-trigger .balance {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* --- Profile --- */
body.fleep-ui .fleep-header .header-btn-profile {
    min-height: 40px !important;
    padding: 0 14px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--fleep-text) !important;
    font-family: var(--fleep-font) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
}

body.fleep-ui .fleep-header .header-btn-profile:hover {
    background: var(--fleep-panel-bg, #262628) !important;
    color: var(--fleep-text) !important;
}

/* --- Deposit --- */
body.fleep-ui .fleep-header .header-btn-deposit {
    min-height: 40px !important;
    padding: 0 18px !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    background: linear-gradient(135deg, #F3372B 0%, #D91000 50%, #AB2416 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(217, 16, 0, 0.35) !important;
    color: #fff !important;
    font-family: var(--fleep-font) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

body.fleep-ui .fleep-header .header-btn-deposit:hover {
    background: linear-gradient(135deg, #FF4A3E 0%, #F3372B 50%, #D91000 100%) !important;
    box-shadow: 0 8px 24px rgba(217, 16, 0, 0.45) !important;
    transform: translateY(-1px);
}

/* --- Notifications --- */
body.fleep-ui .fleep-header .header-btn-notify {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    background: var(--fleep-panel-bg, #262628) !important;
    border: none !important;
    box-shadow: var(--fleep-shadow-btn) !important;
    color: var(--fleep-text) !important;
    flex-shrink: 0 !important;
}

body.fleep-ui .fleep-header .header-btn-notify:hover {
    background: var(--fleep-panel-hover, #2e3034) !important;
    color: var(--fleep-text) !important;
}

body.fleep-ui .fleep-header .header-notify-badge {
    box-shadow: 0 0 0 2px var(--fleep-bg) !important;
}

/* --- Guest buttons --- */
body.fleep-ui .fleep-header #headerGuest:not(.hidden) #btnOpenLogin,
body.fleep-ui .fleep-header #headerGuest:not(.hidden) .fleep-header-login {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 40px !important;
    padding: 0 16px 0 10px !important;
    background: var(--fleep-panel-bg, #262628) !important;
    border: none !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    box-shadow: var(--fleep-shadow-btn) !important;
    color: var(--fleep-red) !important;
    font-family: var(--fleep-font) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

body.fleep-ui .fleep-header #headerGuest:not(.hidden) #btnOpenRegister,
body.fleep-ui .fleep-header #headerGuest:not(.hidden) .fleep-header-signup {
    min-height: 40px !important;
    padding: 0 18px !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    background: linear-gradient(135deg, #F3372B 0%, #D91000 50%, #AB2416 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(217, 16, 0, 0.35) !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

body.fleep-ui .fleep-header .header-right--desktop-menu {
    display: none !important;
}

body.fleep-ui .fleep-header .header-boost-indicator {
    background: var(--fleep-panel-bg, #262628) !important;
    border: none !important;
    border-radius: var(--fleep-radius-ui, 10px) !important;
    box-shadow: var(--fleep-shadow-btn) !important;
}

/* --- Mobile --- */
@media (max-width: 767px) {
    body.fleep-ui {
        --fleep-header-h: 64px;
        --fleep-header-inner-h: 40px;
        --fleep-header-pad-y: 10px;
    }

    body.fleep-ui .casino-header.fleep-header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: var(--fleep-header-pad-y) 16px calc(var(--fleep-header-pad-y) + env(safe-area-inset-top, 0px)) !important;
        gap: 10px !important;
    }

    body.fleep-ui .fleep-header__start,
    body.fleep-ui .fleep-header .header-left {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        max-width: min(180px, 54vw) !important;
        overflow: visible !important;
    }

    body.fleep-ui .fleep-header__brand,
    body.fleep-ui .fleep-header .header-brand-logo,
    body.fleep-ui .fleep-header .logo.header-brand-logo {
        max-width: min(180px, 54vw) !important;
        width: auto !important;
        height: auto !important;
        min-height: 40px !important;
    }

    body.fleep-ui .fleep-header__logo-wrap {
        height: auto !important;
        max-height: none !important;
    }

    body.fleep-ui .fleep-header__logo,
    body.fleep-ui .fleep-header .header-brand-logo .logo-img,
    body.fleep-ui .fleep-header .logo.header-brand-logo .logo-img {
        max-width: min(180px, 54vw) !important;
        max-height: 40px !important;
        width: auto !important;
        height: auto !important;
        flex-shrink: 0 !important;
    }

    body.fleep-ui .fleep-header .header-balance-trigger {
        max-width: min(132px, 34vw) !important;
        min-height: 36px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
    }

    body.fleep-ui .fleep-header .header-btn-profile {
        display: none !important;
    }

    body.fleep-ui .fleep-header .header-btn-deposit {
        min-height: 36px !important;
        padding: 0 14px !important;
        font-size: 12px !important;
    }

    body.fleep-ui .fleep-header .header-btn-notify {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }

    body.fleep-ui .fleep-header #btnOpenLogin .fleep-header-login__label {
        display: none !important;
    }

    body.fleep-ui .fleep-header #btnOpenLogin {
        min-width: 36px !important;
        padding: 0 10px !important;
    }

    body.fleep-ui .fleep-header #btnOpenRegister,
    body.fleep-ui .fleep-header .fleep-header-signup {
        min-height: 36px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    body.fleep-ui .fleep-header .header-btn-profile--desktop {
        display: none !important;
    }
}

/* Fleep scroll: document is the scroll container on all breakpoints (beats casino.css flex trap) */
html body.fleep-ui:not(.play-page-active),
html body.fleep-ui:not(.play-page-active) #casinoApp {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    touch-action: auto !important;
    overscroll-behavior-y: auto !important;
}

html body.fleep-ui:not(.play-page-active) #casinoApp {
    display: block !important;
    overflow: visible !important;
    min-height: 100vh !important;
}

html body.fleep-ui:not(.play-page-active) .fleep-main-column,
html body.fleep-ui:not(.play-page-active) .casino-layout,
html body.fleep-ui:not(.play-page-active) #casinoMain,
html body.fleep-ui:not(.play-page-active) .casino-main,
html body.fleep-ui:not(.play-page-active) #pageHome,
html body.fleep-ui:not(.play-page-active) #guestView,
html body.fleep-ui:not(.play-page-active) #lobbyView {
    display: block !important;
    flex: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: auto !important;
    overscroll-behavior-y: auto !important;
}
