*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

/* Account is already available from the shared shell; hide redundant page-level back links. */
body.site-shell-enabled .site-content a[href="/account"]:first-child,
body.site-shell-enabled .site-content > main > a[href="/account"] {
    display: none !important;
}

body.gift-page.site-shell-enabled .site-content {
    width: calc(100% - var(--site-sidebar-width, 0px));
    max-width: none;
    margin-left: var(--site-sidebar-width, 0px);
    padding: var(--site-header-height, 70px) 0 0 !important;
}

body.gift-page.site-shell-enabled .site-content > .shell {
    width: 100%;
    min-height: 100vh;
    padding: 0 !important;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

table {
    max-width: 100%;
}

@media (max-width: 768px) {
    body.gift-page.site-shell-enabled .site-content,
    body.gift-page.site-shell-enabled.site-sidebar-collapsed .site-content {
        width: 100%;
        margin-left: 0;
        padding: var(--site-header-height, 58px) 0 0 !important;
    }
    main,
    form,
    section,
    article {
        min-width: 0;
    }

    .main-container,
    .container,
    .page-container,
    .content-container,
    .admin-container,
    .dashboard-container,
    .form-container {
        width: 100% !important;
        max-width: 1200px;
        min-width: 0;
        margin-left: auto;
        margin-right: auto;
        padding-left: clamp(12px, 3vw, 24px);
        padding-right: clamp(12px, 3vw, 24px);
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    pre,
    code {
        max-width: 100%;
        overflow-x: auto;
    }

    input,
    select,
    textarea {
        min-width: 0;
    }

    [class*="grid"] {
        min-width: 0;
    }

    [class*="grid"] > *,
    [class*="row"] > *,
    [class*="header"] > *,
    [class*="summary"] > *,
    [class*="actions"] > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {
    .quick-action.refer {
        display: none !important;
    }

    [class*="toolbar"],
    [class*="summary"],
    [class*="actions-row"],
    [class*="form-row"] {
        flex-wrap: wrap;
    }

    [class*="modal"],
    [class*="dialog"],
    [class*="overlay"] > [class*="card"] {
        max-width: calc(100vw - 24px);
    }

    button,
    input,
    select,
    textarea {
        font-size: max(16px, 1em);
    }
}

/* Shared phone layout: keep every page usable without horizontal scrolling. */
@media (max-width: 480px) {
    body { font-size: 14px; }
    h1 { font-size: clamp(24px, 8vw, 32px); }
    h2 { font-size: clamp(19px, 6vw, 25px); }
    main { width: 100% !important; }
    header:not(.site-topbar),
    .topbar,
    .top,
    .wallet-head,
    .history-head,
    .heading-seeMore-section {
        gap: 12px;
        flex-wrap: wrap;
    }
    .topbar nav,
    .links,
    .actions,
    .quick-actions,
    .wallet-footer .actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .topbar nav a,
    .links a,
    .actions a,
    .actions button,
    .wallet-footer .action { width: 100%; text-align: center; }
    .banner,
    body.site-shell-enabled .site-content .banner { height: 210px; min-height: 210px; }
    .game-card { min-width: 0 !important; }
    .games-row { gap: 8px !important; }
    .panel, .card, .hero, .wallet { border-radius: 12px; }
    .grid, .cards, .panel-grid, .levels { grid-template-columns: 1fr !important; }
    .balance-grid { grid-template-columns: 1fr !important; }
    .balance-item { border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,.08); }
    .balance-item:last-child { border-bottom: 0; }
    .form-row, .field-row, .status-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
    form button, form input[type="submit"], form .button { width: 100%; min-height: 44px; }
    .modal, .dialog, .guest-promo-card { width: calc(100vw - 24px) !important; max-width: none !important; }
    table { font-size: 12px; }
    th, td { padding: 9px 7px; }
}

.site-bottom-nav {
    display: none;
}

.site-topbar__right .mailbox-notification-link {
    position: relative;
}

.mailbox-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    min-width: 17px;
    height: 17px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--bg-main, #1A2C38);
    border-radius: 999px;
    background: var(--accent-blue, #1475E1);
    color: var(--text-primary, #FFFFFF);
    font-size: 9px;
    font-weight: 800;
}

.mailbox-notification-badge[hidden] {
    display: none !important;
}

.site-shell-enabled .site-content .payout-add-trigger {
    border-color: #68717b !important;
    background: #505963 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.site-shell-enabled .site-content .payout-add-trigger:hover,
.site-shell-enabled .site-content .payout-add-trigger:focus-visible {
    border-color: #7a848f !important;
    background: #5b6570 !important;
}

@media (max-width: 760px) {
    .site-topbar__right .site-search,
    .site-topbar__right #siteSearchToggle {
        display: none !important;
    }

    .site-shell-enabled.site-drawer-open .site-drawer-backdrop {
        border: 0 !important;
        background: rgb(0 0 0 / 55%) !important;
        box-shadow: none !important;
    }

    .site-bottom-nav {
        position: fixed;
        z-index: 1200;
        inset: auto 0 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 62px;
        padding: 5px 8px max(5px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-subtle, #2F4553);
        background: var(--bg-secondary, #0F212E);
        box-shadow: 0 -4px 12px rgb(0 0 0 / 20%);
    }

    .site-bottom-nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        padding: 4px 2px;
        color: var(--text-secondary, #B1BAD3);
        font-size: 10px;
        font-weight: 600;
        text-decoration: none;
    }

    .site-bottom-nav__link[aria-current="page"],
    .site-bottom-nav__link:hover {
        color: var(--text-primary, #FFFFFF);
    }

    .site-bottom-nav__link svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

    body.site-shell-enabled .site-content,
    body.site-shell-enabled.site-sidebar-collapsed .site-content {
        padding-bottom: max(88px, calc(62px + env(safe-area-inset-bottom) + 18px));
    }
}
body:has(form#claim) .grid .card:nth-child(2)>p.muted{display:none!important}
