/* Keep the fixed rails at the edges; the middle column uses the remaining space. */
#pageContainer {
    width: 100%;
    min-width: 0;
    max-width: none;
}

@media (min-width: 1024px) {
    #headerInclude header { left: 0 !important; padding-right: 0 !important; }

    /* The signed-in wallet is taller than the logo and price rail. */
    .desktop-header-row {
        display: flex;
        align-items: center;
        width: 100%;
        padding-top: 6px;
    }

    .desktop-header-brand { flex: 0 0 192px; min-width: 0; }
    .desktop-header-brand #menuPanel {
        width: calc(100% - 16px) !important;
        margin-left: 8px;
        flex: none;
        height: 68px;
        padding: 0;
        background: transparent;
    }
    .desktop-header-brand .header-original-wordmark {
        display: block;
        width: 168px;
        height: 66px;
        object-fit: contain;
    }
    .desktop-header-middle {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        min-width: 0;
        padding: 0 8px;
    }
    .desktop-header-middle .crypto-ticker { margin: 0 8px; }
    .desktop-header-actions { display: flex; flex: none; align-items: center; gap: 8px; }
    .header-invite-link { white-space: nowrap; }
    .desktop-header-controls {
        flex: none;
        justify-content: flex-end;
        align-items: center;
        width: 320px;
        min-width: 0;
        margin-right: 8px;
    }
    .desktop-header-controls:not(:has(.account-session--signed-in)) {
        gap: 12px;
    }
    .desktop-header-controls:not(:has(.account-session--signed-in)) .loginsession {
        display: grid;
        flex: 1 1 auto;
        min-width: 0;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        gap: 12px;
    }
    .desktop-header-controls:not(:has(.account-session--signed-in)) .loginsession > button {
        width: 100%;
        padding-right: 8px;
        padding-left: 8px;
    }
    /* Wallet, referral code and VIP profile share one header card. */
    .desktop-header-controls:has(.account-session--signed-in) {
        gap: 0;
        height: 74px;
        border: 1px solid #13425b;
        border-radius: 12px;
        background: #031d30;
    }
    .desktop-header-controls .account-session--signed-in {
        flex: 1 1 auto;
        min-width: 0;
        height: 72px;
        margin: 0;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
    .desktop-header-controls .balance-wrap { width: 100% !important; }
    .desktop-header-controls:has(.account-session--signed-in) #userAvatarBox {
        display: flex;
        flex: 0 0 60px;
        align-self: stretch;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #13425b;
    }
    .desktop-header-controls:has(.account-session--signed-in) #userAvatarBox > button {
        background: transparent;
    }
}

@media (min-width: 1280px) {
    .desktop-header-row {
        --header-menu-width: 256px;
        /* Match #pageContainer's 3cqw gutter; its center is 8px narrower. */
        --header-promo-gutter: clamp(24px, calc(3vw - 18.84px), 64px);
        /* The banner is centered once its section reaches the 2048px cap. */
        --header-banner-inset: max(0px, calc(50vw - 1489px - var(--header-promo-gutter)));
        display: grid !important;
        grid-template-columns: var(--header-menu-width) minmax(0, 1fr) 364px;
    }
    #headerInclude header.is-menu-collapsed .desktop-header-row {
        --header-menu-width: 80px;
        --header-promo-gutter: clamp(24px, calc(3vw - 13.56px), 64px);
        --header-banner-inset: max(0px, calc(50vw - 1401px - var(--header-promo-gutter)));
    }
    .desktop-header-brand { width: 100%; }
    .desktop-header-middle {
        padding-left: calc(4px + var(--header-promo-gutter) + var(--header-banner-inset));
        padding-right: calc(4px + var(--header-promo-gutter));
    }
    .desktop-header-middle .crypto-ticker { margin: 0 8px 0 0; }
    .desktop-header-controls {
        width: 364px;
        margin: 0 4px 0 -4px;
        justify-self: stretch;
    }

    .wrapper {
        --browse-menu-width: 256px;
        --browse-chat-width: 364px;
        display: grid;
        /* Keep the center width stable while the right rail changes content. */
        grid-template-columns: var(--browse-menu-width) minmax(0, 1fr) var(--browse-chat-width) !important;
    }

    /* The menu begins immediately below the actual desktop header. */
    #leftMenuPanel {
        top: 74px;
        margin-top: 0;
        height: calc(100vh - 74px);
    }

    body:has(#headerInclude .account-session--signed-in) #leftMenuPanel {
        top: 80px;
        height: calc(100vh - 80px);
    }

    #chatInclude .chatbox {
        top: 88px;
        height: calc(100vh - 88px) !important;
    }

    #chatInclude .chatbox > div:first-child {
        height: 100% !important;
    }

    #pageContainer #homePromoEpicLayout {
        margin-top: 5.25rem;
    }

    .wrapper:has(#leftMenuPanel.w-20) {
        --browse-menu-width: 80px;
    }

    #leftMenuPanel.w-20 {
        width: 80px !important;
    }
}

#leftMenuPanel {
    scrollbar-width: thin;
    scrollbar-color: #3b6174 #082332;
}

#leftMenuPanel::-webkit-scrollbar { width: 8px; }
#leftMenuPanel::-webkit-scrollbar-track { background: #082332; border-radius: 8px; }
#leftMenuPanel::-webkit-scrollbar-thumb { background: #3b6174; border: 2px solid #082332; border-radius: 8px; }
#leftMenuPanel::-webkit-scrollbar-thumb:hover { background: #6a91a5; }

@media (min-width: 1280px) {
    #chatInclude .chatbox {
        transition: transform .26s ease, opacity .2s ease, visibility 0s .26s;
    }

    #chatInclude .chat-new-slots {
        position: fixed;
        z-index: 10;
        top: 88px;
        right: 4px;
        width: var(--browse-chat-width, 364px);
        height: calc(100vh - 88px);
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow: hidden;
        border-radius: 10px;
        background: #062333;
        color: #fff;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(calc(100% + 8px));
        transition: transform .26s ease, opacity .2s ease, visibility 0s .26s;
    }

    #chatInclude.is-chat-collapsed .chatbox {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(calc(100% + 8px));
    }

    #chatInclude.is-chat-collapsed .chat-new-slots {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
        transition-delay: 0s;
    }

    #chatInclude .chat-new-slots-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex: none;
        padding: 10px 12px;
        border-bottom: 1px solid #173e50;
        font-size: 15px;
    }

    #chatInclude .chat-new-slots-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 12px;
        color: #9bc0d0;
        font-size: 13px;
        scrollbar-width: thin;
        scrollbar-color: #3b6174 #082332;
    }

    #chatInclude .chat-new-slots-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #chatInclude .chat-slot-card { display: block; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #22485b; border-radius: 10px; background: #092c3e; color: #fff; text-align: left; cursor: pointer; }
    #chatInclude .chat-slot-card:hover { border-color: #9ed94a; }
    #chatInclude .chat-slot-card img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
    #chatInclude .chat-slot-caption { display: block; overflow: hidden; padding: 8px; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
    #chatInclude .chat-new-slots-more { flex: none; align-self: center; padding: 10px 12px; color: #b0ff43; font-size: 13px; font-weight: 700; }
}

#chatInclude .chat-rail-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #23475a;
    border-radius: 8px;
    background: #0c3042;
    color: #d9edf4;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

#chatInclude .chat-rail-toggle:hover { background: #17455b; }
#chatInclude .chat-rail-expand span { font-size: 12px; font-weight: 700; }
@media (max-width: 1279px) { #chatInclude .chat-new-slots { display: none; } }
@media (prefers-reduced-motion: reduce) {
    #chatInclude .chatbox,
    #chatInclude .chat-new-slots { transition: none; }
}

/* Reading and account pages keep their existing inner width limits. */
@media (min-width: 768px) {
    #pageContainer {
        container: browse / inline-size;
        --browse-gutter: clamp(24px, 3cqw, 64px);
        --browse-max-width: 2048px;
    }

    #pageContainer:has(#homeNewGames, #gameList, .slots-directory) #pageContent .container-center,
    #pageContainer:has(#homeNewGames, #gameList, .slots-directory) #footerInclude .container-center {
        width: 100%;
        max-width: var(--browse-max-width);
        padding-inline: var(--browse-gutter);
    }

    #pageContainer #gameList,
    #pageContainer .slots-directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 12px;
    }

    #pageContainer .home-new-track {
        gap: 12px;
    }

    #pageContainer .home-new-track .open-slot {
        flex-basis: 148px;
        width: 148px;
    }

    #pageContainer #searchInput,
    #pageContainer .search-input {
        min-width: 0;
    }

    /* Match the section edges and preserve banner artwork proportions. */
    #pageContainer .main-banner-section {
        width: 100%;
        max-width: var(--browse-max-width);
        margin-inline: auto;
        padding-inline: var(--browse-gutter);
        min-height: 0;
    }

    #pageContainer .main-banner-slider {
        min-height: 0;
    }

    #pageContainer .main-banner-slide {
        flex: 0 0 calc((100% - 14px) / 2);
        width: calc((100% - 14px) / 2);
        height: auto;
        aspect-ratio: 10 / 7;
    }

    #pageContainer .main-banner-track {
        gap: 14px;
    }

    #pageContainer .main-banner-prev { left: 12px; }
    #pageContainer .main-banner-next { right: 12px; }
}

@container browse (max-width: 600px) {
    #pageContainer .main-banner-slide {
        flex-basis: 100%;
        width: 100%;
    }
}

@container browse (max-width: 720px) {
    #pageContainer #gameList,
    #pageContainer .slots-directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

@container browse (max-width: 1000px) {
    #pageContainer [data-main-section="slots"] div:has(> div > #searchInput) {
        flex-wrap: wrap;
    }

    #pageContainer [data-main-section="slots"] div:has(> #searchInput) {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    #pageContainer [data-main-section="slots"] div:has(> #searchInput) + div {
        width: 100%;
        justify-content: space-between;
    }

    #pageContainer [data-main-section="slots"] .custom-select.vendor,
    #pageContainer [data-main-section="slots"] [data-i18n="provider"] {
        white-space: nowrap;
    }
}

@container browse (min-width: 1000px) {
    #pageContainer .main-banner-slide {
        flex-basis: calc((100% - 28px) / 3);
        width: calc((100% - 28px) / 3);
    }
}

@container browse (min-width: 1560px) {
    #pageContainer .main-banner-slide {
        flex-basis: calc((100% - 42px) / 4);
        width: calc((100% - 42px) / 4);
    }
}

/* The new-game rail remains scrollable by drag and touch without a visible scrollbar. */
#pageContainer .home-new-track {
    scrollbar-width: none;
}

#pageContainer .home-new-track::-webkit-scrollbar { display: none; }

/* Match the Live Casino rail to the main slot cards at desktop and mobile widths. */
#pageContainer .livegames .lc-track .open-slot {
    flex: 0 0 149px;
    width: 149px;
    aspect-ratio: 5 / 8;
    overflow: hidden;
}

#pageContainer .livegames .lc-track .open-slot > div {
    width: 100%;
    height: 100% !important;
}

#pageContainer .livegames .lc-track .open-slot > div > img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
}

@media (max-width: 767px) {
    #pageContainer .livegames .lc-track .open-slot {
        flex-basis: 125px;
        width: 125px;
    }
}

/* Compact account summary: identity stays in the profile, referral details in Partnership. */
@media(min-width:1024px) {
  .desktop-header-controls:has(.account-session--signed-in) { height:54px; }
  .desktop-header-controls .account-session--signed-in { height:52px; }
  body:has(#headerInclude .account-session--signed-in) #leftMenuPanel { top:74px;height:calc(100vh - 74px); }
}
.help-topic-icon { display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;margin-right:12px;border:1px solid #204456;border-radius:9px;background:#0c2d3e;color:#77d5ed; }
.help-topic-heading { flex:1;min-width:0;margin-right:12px; }
.vip-tier-guide-icon { filter:drop-shadow(0 2px 4px #00141f); }
.notifications-dialog table { border-collapse:separate;border-spacing:0 8px; }
.notifications-dialog table thead th { padding:4px 12px 8px;color:#8caab9; }
.notifications-dialog .message-row td { padding:14px 10px;background:#102e3e;border-top:1px solid #204354;border-bottom:1px solid #204354; }
.notifications-dialog .message-row td:first-child { border-left:3px solid #3d667a;border-radius:9px 0 0 9px; }
.notifications-dialog .message-row td:last-child { border-right:1px solid #204354;border-radius:0 9px 9px 0; }
.notifications-dialog .message-row[data-read="0"] td { background:#153949; }
.notifications-dialog .message-row[data-read="0"] td:first-child { border-left-color:#b0ff43;font-weight:800; }
.notifications-dialog .message-row:hover td,.notifications-dialog .message-row:focus-visible td { background:#1b4154; }
.notification-item-icon { display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:30px;height:30px;margin-right:9px;border-radius:8px;background:#1b4254;color:#8ed9eb; }
.notifications-dialog .message-row td:first-child > span:last-child { vertical-align:middle;overflow-wrap:anywhere; }
.notifications-dialog .message-content { line-height:1.65; }
.notifications-dialog #readAllBtn,.notifications-dialog #removeAllBtn { border:1px solid #315263;color:#d5e5ec;background:#103040; }
.notifications-dialog #removeAllBtn { color:#f1b8b8; }
.notifications-dialog #pagination button { min-width:32px;min-height:32px;border-radius:8px; }
/* Epic Wins: 75% of the previous 452 x 236 desktop card. */
#pageContainer .home-epic-section .epic-win-card { width:339px;height:177px;grid-template-columns:122px minmax(0,1fr); }
#pageContainer .home-epic-section .epic-win-art-frame { padding:0; }
#pageContainer .home-epic-section .epic-win-domain { bottom:12px;left:8px;right:8px;padding:3px 5px;font-size:8px; }
#pageContainer .home-epic-section .epic-win-detail { padding:0 5px 6px;gap:2px; }
#pageContainer .home-epic-section .epic-win-heading { min-height:26px;margin:0 -5px 2px;font-size:8px; }
#pageContainer .home-epic-section .epic-win-game { font-size:11px; }
#pageContainer .home-epic-section .epic-win-meta { font-size:7px; }
#pageContainer .home-epic-section .epic-win-stat { padding:5px 3px;gap:2px; }
#pageContainer .home-epic-section .epic-win-stat-label { font-size:9px; }
#pageContainer .home-epic-section .epic-win-stat-value { font-size:15px; }
#pageContainer .home-epic-section .epic-win-payout { min-height:58px; }
#pageContainer .home-epic-section .epic-win-payout .epic-win-stat-value { font-size:26px; }
#pageContainer .home-epic-section .epic-win-payout .epic-win-stat-value img { width:17px;height:17px; }
@media(max-width:767px) {
  #pageContainer .home-epic-section .epic-win-card { width:min(339px,calc((100vw - 48px) * .75));height:168px;grid-template-columns:90px minmax(0,1fr); }
  #pageContainer .home-epic-section .epic-win-art-frame { padding:0; }
  #pageContainer .home-epic-section .epic-win-stat { position:relative; }
  #pageContainer .home-epic-section .epic-win-heading { min-height:22px; }
  #pageContainer .home-epic-section .epic-win-stat-value { font-size:12px;flex-wrap:nowrap;gap:1px; }
  #pageContainer .home-epic-section .epic-win-stats .epic-win-stat-label { align-self:flex-start;font-size:8px; }
  #pageContainer .home-epic-section .epic-win-stat-value small { position:absolute;right:4px;top:5px;font-size:7px; }
  #pageContainer .home-epic-section .epic-win-stat-value img { width:11px;height:11px; }
  #pageContainer .home-epic-section .epic-win-payout { min-height:52px; }
  #pageContainer .home-epic-section .epic-win-payout .epic-win-stat-label { align-self:flex-start; }
  #pageContainer .home-epic-section .epic-win-payout .epic-win-stat-value { font-size:21px;gap:2px; }
  #pageContainer .home-epic-section .epic-win-payout .epic-win-stat-value small { font-size:8px; }
  .notification-item-icon { width:24px;height:24px;margin-right:5px; }
  .notifications-dialog .message-row td { padding:11px 6px;font-size:12px; }
}

/* Tablets retain a compact navigation rail, with the existing drawer on demand. */
.tablet-menu-toggle { display: none; }
@media (min-width: 768px) and (max-width: 1279px) {
  #pageContainer { width: calc(100% - 64px); margin-left: 64px; }
  #leftMenuPanel.tablet-rail {
    display: block !important;
    position: fixed;
    left: 0 !important;
    right: auto !important;
    top: var(--tablet-menu-top, 74px) !important;
    width: 64px !important;
    height: calc(100dvh - var(--tablet-menu-top, 74px)) !important;
    margin-top: 0;
    padding: 4px;
    opacity: 1 !important;
    transform: none !important;
    border-right: 1px solid #214250;
    border-radius: 0;
  }
  #leftMenuPanel.tablet-rail.mobile-menu-open { width: 260px !important; }
  #leftMenuPanel.tablet-rail > .tablet-menu-toggle {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 44px; border-radius: 9px;
    color: #c5e2eb; background: #103343; margin-bottom: 4px;
  }
  #leftMenuPanel.tablet-rail.mobile-menu-open > .tablet-menu-toggle { justify-content: flex-start; padding-inline: 16px; }
  #leftMenuPanel.tablet-rail > div:first-of-type { height: calc(100% - 48px) !important; overflow-y: auto; padding-bottom: 12px; }
  #leftMenuPanel.tablet-rail:not(.mobile-menu-open) .menu-label { display: none !important; }
  #leftMenuPanel.tablet-rail:not(.mobile-menu-open) .menu-s,
  #leftMenuPanel.tablet-rail:not(.mobile-menu-open) .beforlogin { padding: 4px; margin-top: 4px; }
  #leftMenuPanel.tablet-rail:not(.mobile-menu-open) :is(a,button,[data-modal],#openChatBot > div) {
    position: relative; justify-content: center; min-height: 44px;
    padding: 8px 0; gap: 0;
  }
  #leftMenuPanel.tablet-rail:not(.mobile-menu-open) :is(.notification-count,.bonus-notification-count) {
    position: absolute; top: 0; right: 0; margin: 0; font-size: 9px;
  }
  #leftMenuPanel.tablet-rail :is(a,button,[data-modal]):focus-visible { outline: 2px solid #a9ee54; outline-offset: -2px; }
}
@media (min-width: 768px) and (max-width: 1279px) {
  #leftMenuPanel.tablet-rail.mobile-menu-open :is(a,button,[data-modal],#openChatBot > div) {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  }
}

/* Header actions share one button treatment; keep localized invitation text accessible. */
.header-invite-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.desktop-header-actions > button { flex: 0 0 48px; }
.desktop-header-actions > button:focus-visible { outline: 2px solid #b0ff43; outline-offset: 3px; }
@media (min-width: 1024px) and (max-width: 1279px) {
    /* Same 3% center-column gutter as the banner, plus its outer 4px inset. */
    .desktop-header-controls {
        margin-right: calc(4px + clamp(24px, calc(3vw - 2.16px), 64px));
    }
}
