

body.shell-telegram .app-container,
body.shell-web-mobile .app-container,
body.shell-web-desktop .app-container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}


body.shell-telegram #bottom-nav-component,
body.shell-telegram #bottom-nav-component .bottom-nav {
    display: flex !important;
}

body.shell-telegram .header {
    --header-edge-start: max(
        8px,
        env(safe-area-inset-left, 0px),
        var(--tg-safe-area-inset-left, 0px),
        var(--tg-content-safe-area-inset-left, 0px)
    );
    --header-edge-end: max(
        8px,
        env(safe-area-inset-right, 0px),
        var(--tg-safe-area-inset-right, 0px),
        var(--tg-content-safe-area-inset-right, 0px)
    );
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 56px;
    box-sizing: border-box;
    padding-top: var(--tg-miniapp-header-offset, 80px);
    padding-left: var(--header-edge-start);
    padding-right: var(--header-edge-end);
    padding-bottom: 8px;
    z-index: var(--z-header, 100);
    overflow: visible;
}


body.shell-telegram .header .header-container,
body.shell-telegram .header .header-container--mobile-tri {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 0;
    margin: 0;
}

body.shell-telegram .header .header-side--start {
    justify-self: start;
    justify-content: flex-start;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: min(34vw, 128px);
    margin-left: 0;
    padding-left: 0;
    overflow: hidden;
    z-index: 1;
}

body.shell-telegram .header .header-side--end {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    z-index: 2;
}


body.shell-telegram .header .logo {
    flex: 0 0 auto;
    position: relative;
    margin: 0 !important;
    margin-right: auto !important;
    width: min(30vw, 112px);
    max-width: 112px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    z-index: 1;
    justify-self: start;
}

body.shell-telegram .header .logo-img {
    position: static;
    height: 100px !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    pointer-events: auto;
    transform: none;
}

body.shell-telegram .header .logo:hover .logo-img {
    transform: scale(1.03);
}

body.shell-telegram .header .header-center {
    grid-column: 2;
    flex: none !important;
    width: auto;
    min-width: 0;
    max-width: min(52vw, 240px);
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 0;
    justify-self: center;
    position: relative;
    z-index: 3;
}

body.shell-telegram .header .header-balance-row {
    max-width: 100%;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

body.shell-telegram .header .header-balance-wrap .balance-display,
body.shell-telegram .header .balance-display {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

body.shell-telegram .header .balance-currency-code {
    font-family: var(--font-secondary), system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(180, 190, 210, 0.9);
    text-transform: uppercase;
}

body.shell-telegram .header .balance-amount-line {
    font-family: var(--font-secondary), system-ui, sans-serif !important;
    font-size: clamp(0.95rem, 3.6vw, 1.05rem) !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    text-shadow: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34vw;
    color: #fff !important;
}

body.shell-telegram .header-deposit-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-secondary), system-ui, sans-serif;
    border-radius: 10px;
    flex-shrink: 0;
    background: #0088ff;
    box-shadow: none;
}

body.shell-telegram .header .header-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(230, 235, 245, 0.95);
}

body.shell-telegram .header .header-nav {
    display: none !important;
}

body.shell-telegram .main-content {
    padding-top: calc(60px + var(--tg-miniapp-header-offset, 80px) + 8px) !important;
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 10px)) !important;
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
    flex: 1;
    min-height: 0;
}


body.shell-telegram.tg-desktop .bottom-nav {
    bottom: 48px !important;
}

body.shell-telegram.tg-desktop .main-content {
    padding-bottom: calc(88px + 48px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (max-width: 390px) {
    body.shell-telegram .header .header-side--start {
        max-width: min(32vw, 108px);
    }
    body.shell-telegram .header .logo {
        max-width: 100px;
        width: min(28vw, 100px);
        height: 36px;
    }
    body.shell-telegram .header .logo-img {
        height: 90px !important;
        max-width: 100% !important;
    }
    body.shell-telegram .header-deposit-btn {
        padding: 7px 11px;
        font-size: 12px;
    }
    body.shell-telegram .header .balance-amount-line {
        max-width: 26vw;
        font-size: 0.9rem !important;
    }
}


body.shell-web-mobile #bottom-nav-component,
body.shell-web-mobile #bottom-nav-component .bottom-nav {
    display: flex !important;
}

body.shell-web-mobile .main-content {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
}

body.shell-web-mobile #app-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

body.shell-web-mobile #header-component {
    display: block;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: var(--z-header, 100);
}

body.shell-web-mobile .web-topbar,
body.shell-web-mobile .web-topbar.header-container--mobile-tri {
    --header-edge-start: max(8px, env(safe-area-inset-left, 0px));
    --header-edge-end: max(8px, env(safe-area-inset-right, 0px));
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) var(--header-edge-end) 8px var(--header-edge-start);
    min-height: 56px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    overflow: visible;
}

body.shell-web-mobile .header-side--start {
    justify-self: start;
    justify-content: flex-start;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: min(34vw, 128px);
    margin-left: 0;
    padding-left: 0;
    overflow: hidden;
    z-index: 1;
}

body.shell-web-mobile .header-side--end,
body.shell-web-mobile .web-topbar-end {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 8px;
    min-width: 0;
    z-index: 2;
}

body.shell-web-mobile .web-topbar .logo--web-topbar {
    position: relative !important;
    width: min(36vw, 136px) !important;
    min-width: 0;
    max-width: 136px;
    height: 48px !important;
    margin: 0 !important;
    margin-right: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    z-index: 1;
    justify-self: start;
}

body.shell-web-mobile .web-topbar .logo--web-topbar .logo-img {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    height: 120px !important;
    min-height: 0;
    min-width: 0;
    max-width: 100% !important;
    width: auto !important;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    pointer-events: auto;
}

body.shell-web-mobile .web-topbar .header-center {
    grid-column: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: min(52vw, 240px);
    padding: 0;
    position: relative;
    z-index: 3;
}

body.shell-web-mobile .web-topbar-center {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

body.shell-web-mobile .header-balance-wrap .balance-display,
body.shell-web-mobile .balance-display {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.shell-web-mobile .header .balance-amount-line,
body.shell-web-mobile .balance-amount-line {
    font-family: var(--font-secondary), system-ui, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    letter-spacing: -0.02em !important;
}

body.shell-web-mobile .header-deposit-btn {
    display: inline-flex !important;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
    background: #0088ff;
    box-shadow: none;
}

body.shell-web-mobile .header-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

body.shell-web-mobile .header-web-auth {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

body.shell-web-mobile .header-auth-btn {
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    min-height: 36px;
    min-width: 0;
    backdrop-filter: none;
}

body.shell-web-mobile .header-auth-btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(130, 148, 176, 0.35);
    color: var(--text-primary, #f1f5f9);
}

body.shell-web-mobile .header-auth-btn--primary {
    background: linear-gradient(135deg, rgba(0, 140, 255, 0.95), rgba(0, 212, 255, 0.88));
    color: #fff;
    border-color: rgba(0, 212, 255, 0.45);
}

body.shell-web-mobile #main-content.main-content {
    padding-top: 0 !important;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}


body.shell-web-mobile.web-guest #main-content.main-content {
    background: transparent;
}

@media (max-width: 380px) {
    body.shell-web-mobile .header-side--start {
        max-width: min(32vw, 108px);
    }
    body.shell-web-mobile .web-topbar .logo--web-topbar {
        max-width: 120px !important;
        width: min(34vw, 120px) !important;
        height: 44px !important;
    }
    body.shell-web-mobile .web-topbar .logo--web-topbar .logo-img {
        max-width: 100% !important;
        height: 110px !important;
    }
    body.shell-web-mobile .header-auth-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}


body.shell-web-desktop #bottom-nav-component,
body.shell-web-desktop #bottom-nav-component .bottom-nav {
    display: none !important;
}

body.shell-web-desktop #main-content.main-content {
    padding-bottom: 48px !important;
    overflow-x: hidden;
}


body.shell-telegram .main-content,
body.shell-web-mobile .main-content,
body.shell-web-desktop .main-content {
    max-width: 100%;
}

body.shell-telegram .slots-page,
body.shell-web-mobile .slots-page,
body.shell-telegram .profile-page,
body.shell-web-mobile .profile-page {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}


body.shell-telegram .connection-warning {
    top: calc(var(--tg-miniapp-header-offset, 80px) + 56px + 8px);
}


body.shell-telegram .auth-gate,
body.shell-web-mobile .auth-gate,
body.shell-web-desktop .auth-gate,
body.tg-miniapp .auth-gate,
body.web-browser .auth-gate {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
body.shell-telegram .auth-gate.auth-gate--active,
body.shell-web-mobile .auth-gate.auth-gate--active,
body.shell-web-desktop .auth-gate.auth-gate--active,
body.tg-miniapp .auth-gate.auth-gate--active,
body.web-browser .auth-gate.auth-gate--active {
    display: flex !important;
}
body.shell-telegram .auth-gate-form[aria-hidden="true"],
body.shell-web-mobile .auth-gate-form[aria-hidden="true"],
body.shell-web-desktop .auth-gate-form[aria-hidden="true"],
body.tg-miniapp .auth-gate-form[aria-hidden="true"],
body.web-browser .auth-gate-form[aria-hidden="true"] {
    display: none !important;
}
body.shell-telegram .auth-gate-loading,
body.shell-web-mobile .auth-gate-loading,
body.shell-web-desktop .auth-gate-loading {
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    text-align: center;
}
body.shell-telegram .auth-gate-loading__brand,
body.shell-web-mobile .auth-gate-loading__brand,
body.shell-web-desktop .auth-gate-loading__brand {
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
