/* Epic splash — almost-white surface with a faint grayscale hero glimpse */

:root {
    --epic-loading-surface: #fcfcfc;
    /* ~88% white wash: near-white with only a faint hero glimpse */
    --epic-loading-veil: rgba(255, 255, 255, 0.88);
    --epic-loading-hero-filter: blur(1.25rem) grayscale(100%) brightness(1.48) contrast(0.65) saturate(0);
    --epic-mobile-safe-top: 24px;
    --epic-mobile-safe-top: calc(24px + env(safe-area-inset-top, 0px));
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--epic-loading-surface);
}

/* Stable rem during splash + overlay (avoids size jump when root scale runs) */
html:has(.epic-splash),
html:has(.signup-flow-overlay),
html:has(.gaming-ndrp-status) {
    font-size: 16px !important;
}

#app {
    min-height: 0;
    background: var(--epic-loading-surface);
}

@media (min-width: 48rem) {
    #app {
        min-height: 100svh;
    }
}

.epic-splash {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    isolation: isolate;
    opacity: 1;
    font-family: "Montserrat", sans-serif;
    color: #0d0d0d;
    transition: opacity 0.45s ease;
}

.epic-splash--dismissed {
    opacity: 0;
    pointer-events: none;
}

.epic-splash__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--epic-loading-surface) url("images/hero-newport.jpg") center 42% / cover no-repeat;
    transform: scale(1.06);
    filter: var(--epic-loading-hero-filter);
}

.epic-splash__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--epic-loading-veil);
}

.epic-splash__content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
    padding: max(2rem, env(safe-area-inset-top, 0px) + 1.25rem) 1.5rem
        max(2rem, env(safe-area-inset-bottom, 0px) + 1rem);
    box-sizing: border-box;
    text-align: center;
    pointer-events: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.epic-splash__header,
.signup-flow-overlay__header {
    display: grid;
    justify-items: center;
    width: min(72vw, 11.5rem);
    min-height: 2.625rem;
}

.epic-splash__logo,
.signup-flow-overlay__logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 2.625rem;
    object-fit: contain;
}

.epic-splash__main,
.signup-flow-overlay__main {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.75rem;
    width: min(88vw, 24rem);
}

.epic-splash__title,
.signup-flow-overlay__title {
    margin: 0.25rem 0 0;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: none;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d0d0d;
    background: transparent;
}

.epic-splash__title:focus,
.epic-splash__title:focus-visible,
.signup-flow-overlay__title:focus,
.signup-flow-overlay__title:focus-visible {
    outline: none;
    box-shadow: none;
}

.epic-splash__title::selection,
.epic-splash__subtitle::selection,
.signup-flow-overlay__title::selection,
.signup-flow-overlay__subtitle::selection {
    background: transparent;
    color: inherit;
}

.epic-splash__subtitle,
.signup-flow-overlay__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: #666666;
}

.epic-splash__footer,
.signup-flow-overlay__footer {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    width: min(72vw, 14rem);
}

.epic-splash__progress,
.signup-flow-overlay__progress {
    width: 100%;
    height: 0.125rem;
    border-radius: 9999px;
    background: #e8e4de;
    overflow: hidden;
}

.epic-splash__progress-bar {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #b07a3a;
    transition: width 0.35s ease;
}

.signup-flow-overlay__progress-bar {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #b07a3a;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.signup-flow-overlay--exit-up {
    animation: signup-flow-overlay-exit-up 0.72s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes signup-flow-overlay-exit-up {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-16%);
    }
}

.epic-splash__note,
.signup-flow-overlay__note {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #8a8a8a;
}

@keyframes epic-splash-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 48rem) {
    .epic-splash__header,
    .signup-flow-overlay__header {
        width: min(40vw, 13rem);
        min-height: 3rem;
    }

    .epic-splash__logo,
    .signup-flow-overlay__logo {
        max-height: 3rem;
    }

    .epic-splash__title,
    .signup-flow-overlay__title {
        font-size: 1.5rem;
    }

    .epic-splash__subtitle,
    .signup-flow-overlay__subtitle {
        font-size: 0.625rem;
    }

    .epic-splash__footer,
    .signup-flow-overlay__footer {
        width: min(32vw, 15rem);
    }
}

/* In-app loading overlay (global — must fully cover routed page behind) */
.signup-flow-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: block;
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background-color: var(--epic-loading-surface);
    font-family: "Montserrat", sans-serif;
    color: #0d0d0d;
}

.signup-flow-overlay__scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--epic-loading-surface);
}

.signup-flow-overlay__scrim::before {
    content: "";
    position: absolute;
    inset: -4%;
    z-index: 0;
    background: url("images/hero-newport.jpg") center 42% / cover no-repeat;
    transform: scale(1.06);
    filter: var(--epic-loading-hero-filter);
}

.signup-flow-overlay__scrim::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--epic-loading-veil);
}

.signup-flow-overlay__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
    padding: max(2rem, env(safe-area-inset-top, 0px) + 1.25rem) 1.5rem
        max(2rem, env(safe-area-inset-bottom, 0px) + 1rem);
    box-sizing: border-box;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.signup-flow-spinner,
.epic-splash__spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: 0.125rem solid rgba(176, 122, 58, 0.22);
    border-top-color: #b07a3a;
    border-radius: 50%;
    animation: epic-splash-spin 0.85s linear infinite;
}

.epic-splash__note,
.signup-flow-overlay__note {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #8a8a8a;
}

/* Gaming shell — child card typography (scoped ::deep does not reach @ChildContent) */
html body #app .gaming-details .gaming-details__header {
    text-align: center;
}

html body #app .gaming-details .gaming-details__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
}

html body #app .gaming-details .gaming-details__title:focus,
html body #app .gaming-details .gaming-details__title:focus-visible {
    outline: none;
}

html body #app .gaming-details .gaming-details__lead {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--epic-surface-text-muted, #666);
}

html body #app .gaming-details .gaming-details__error {
    margin: 0.75rem 0 0;
    padding: 0.625rem 0.75rem;
    border: 0.0625rem solid rgba(220, 38, 38, 0.35);
    border-radius: 0.375rem;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
}

/* NDRP status — child content (scoped ::deep misses MidContent / FooterContent) */
html body #app .gaming-ndrp-status .gaming-ndrp-status__icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0.25rem;
    border: 0.0625rem solid #b58e61;
    border-radius: 9999px;
    box-sizing: border-box;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__icon-fill {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: #efe4d4;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__icon-core {
    display: grid;
    place-items: center;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 9999px;
    background: #b58e61;
    color: #fff;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__icon-core svg {
    width: 1.25rem;
    height: 1.25rem;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__title {
    margin: 0.25rem 0 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d0d0d;
}

html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__title {
    max-width: 100%;
    letter-spacing: 0.05em;
}

@media (max-width: 47.999rem) {
    html body #app .gaming-ndrp-status__main,
    html body #app .gaming-ndrp-status__footer {
        width: 100% !important;
        max-width: none !important;
        justify-self: center !important;
    }

    html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__title {
        font-size: 1.125rem !important;
        white-space: normal;
    }

    html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__notice {
        max-width: none;
    }
}

@media (min-width: 48rem) {
    html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__title {
        white-space: normal;
    }
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__lead {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: #666;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__notice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 0.0625rem solid #e8e8e8;
    border-radius: 0.25rem;
    background: #fff;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__notice-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    color: #b58e61;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__notice-icon svg {
    display: block;
    width: 1.375rem;
    height: 1.375rem;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__notice-text {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #b58e61;
}

html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__notice {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    width: 100%;
    max-width: 24rem;
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    box-sizing: border-box;
}

html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__notice-text {
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: left;
}

html body #app .gaming-ndrp-status .gaming-ndrp-status__link {
    color: #0d0d0d;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
    cursor: pointer;
}

@media (min-width: 48rem) {
    html body #app .gaming-ndrp-status .gaming-ndrp-status__title {
        font-size: 1.5rem;
    }

    html body #app .gaming-ndrp-status--review .gaming-ndrp-status--verify .gaming-ndrp-status__title {
        font-size: 1.25rem;
    }

    html body #app .gaming-ndrp-status .gaming-ndrp-status__lead {
        font-size: 0.875rem;
    }
}

/* Gaming shell — footer gap (scoped CSS misses @ChildContent on all viewports) */
html body #app .gaming-details .gaming-details__footer {
    margin-top: var(--epic-gaming-footer-gap, 2rem) !important;
    padding-top: 0 !important;
}

/* Mobile notch / island — unlayered, loads before scoped CSS */
.epic-mobile-safe-area {
    display: none;
}

@media (max-width: 47.999rem) {
    /* By Jayber — splash + in-app loader: lock document (iOS/Android pinch + rubber-band). */
    html:has(.epic-splash),
    html:has(.epic-splash) body,
    html:has(.signup-flow-overlay),
    html:has(.signup-flow-overlay) body,
    html:has(.signup-flow-overlay) #app {
        height: 100svh !important;
        max-height: 100svh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html:has(.epic-splash) body,
    html:has(.signup-flow-overlay) body {
        position: fixed;
        inset: 0;
        width: 100%;
        background: var(--epic-loading-surface, #fcfcfc);
    }

    html:has(.epic-splash) #app {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Splash + in-app overlay: spacer row + drop duplicate top padding */
    .epic-mobile-safe-area {
        display: block;
        width: 100%;
        min-height: 1.5rem;
        height: 1.5rem;
        height: calc(1.5rem + env(safe-area-inset-top, 0px));
        flex-shrink: 0;
        pointer-events: none;
    }

    .epic-splash__content,
    .signup-flow-overlay__content,
    html body #app .gaming-ndrp-status__content {
        grid-template-rows: auto auto 1fr auto;
        padding-top: 0 !important;
    }

    /* Lifestyle shell — safe-area only (spacing below logo lives in *.razor.css) */
    html body #app .lifestyle-signup__panel {
        padding-top: 1.5rem !important;
        padding-top: calc(1.5rem + env(safe-area-inset-top, 0px)) !important;
    }

    /* Gaming verification shells — safe-area top padding */
    html body #app .gaming-details__shell {
        padding-top: 1.5rem !important;
        padding-top: calc(1.5rem + env(safe-area-inset-top, 0px)) !important;
    }

    /* By Jayber — success: safe-area only (logo spacing lives in GamingVerificationSuccess.razor.css). */
    html body #app .gaming-success__shell {
        padding-top: env(safe-area-inset-top, 0px) !important;
    }

    html body #app .gaming-consent__block--header {
        padding-top: 1.5rem !important;
        padding-top: calc(1.5rem + env(safe-area-inset-top, 0px)) !important;
    }

    html body #app .gaming-details__logo {
        margin-bottom: 1.5rem !important;
    }
}

/* Gaming verification shell — shared layout for What you need / Sumsub / Questions / Review / ID */
@media (min-width: 48rem) {
    html body #app .gaming-details.gaming-what-you-need .gaming-details__shell,
    html body #app .gaming-details.gaming-compliance .gaming-details__shell,
    html body #app .gaming-details.gaming-review .gaming-details__shell,
    html body #app .gaming-details.gaming-id-upload .gaming-details__shell,
    html body #app .gaming-details__shell {
        align-items: start !important;
        padding-top: var(--epic-gaming-shell-pad-top, 1.5rem) !important;
        padding-bottom: 2rem !important;
    }

    html body #app .gaming-details.gaming-what-you-need .gaming-details__stack,
    html body #app .gaming-details.gaming-compliance .gaming-details__stack,
    html body #app .gaming-details.gaming-review .gaming-details__stack,
    html body #app .gaming-details.gaming-id-upload .gaming-details__stack,
    html body #app .gaming-details__stack {
        max-width: var(--epic-gaming-stack-max-desktop, 39rem) !important;
        padding-top: 0 !important;
    }

    html body #app .gaming-details.gaming-what-you-need .gaming-details__logo,
    html body #app .gaming-details.gaming-compliance .gaming-details__logo,
    html body #app .gaming-details.gaming-review .gaming-details__logo,
    html body #app .gaming-details.gaming-id-upload .gaming-details__logo,
    html body #app .gaming-details__logo {
        margin-bottom: var(--epic-gaming-logo-gap, 3.5rem) !important;
    }

    html body #app .gaming-details.gaming-what-you-need .gaming-details__card,
    html body #app .gaming-details.gaming-what-you-need .gaming-what-you-need__card--sumsub,
    html body #app .gaming-details.gaming-compliance .gaming-details__card,
    html body #app .gaming-details.gaming-review .gaming-details__card,
    html body #app .gaming-details.gaming-id-upload .gaming-details__card,
    html body #app .gaming-details .gaming-details__card {
        display: flex;
        flex-direction: column;
        width: 100%;
        box-sizing: border-box;
        padding: 2.5rem;
        border: 0.0625rem solid #c9b08f;
        background: #fff;
    }

    html body #app .gaming-details .gaming-verification-progress {
        width: 100%;
    }
}

/* Sumsub — iOS/Android: shell scroll, no horizontal bleed, no focus zoom in iframe */
@media (max-width: 47.999rem) {
    html:has(.gaming-what-you-need__card--sumsub),
    html:has(.gaming-what-you-need__card--sumsub) body,
    html:has(.gaming-what-you-need__card--sumsub) #app {
        overflow-x: clip;
        max-width: 100%;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html body #app .gaming-details:has(.gaming-what-you-need__card--sumsub) .gaming-details__shell {
        padding-inline: 0 !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
        overflow-x: clip;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    html body #app .gaming-details:has(.gaming-what-you-need__card--sumsub) .gaming-details__stack {
        overflow-x: clip;
        overflow-y: visible;
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: auto;
    }

    html body #app .gaming-details:has(.gaming-what-you-need__card--sumsub) .gaming-details__logo,
    html body #app .gaming-details:has(.gaming-what-you-need__card--sumsub) .gaming-verification-progress {
        padding-inline: 1.25rem;
        box-sizing: border-box;
    }

    html body #app .gaming-details.gaming-what-you-need .gaming-what-you-need__card--sumsub {
        padding: 0 !important;
        border-inline: none !important;
        border-radius: 0 !important;
        overflow-x: clip;
        overflow-y: visible;
        height: auto;
        min-height: auto;
    }

    html body #app .gaming-details.gaming-what-you-need .gaming-what-you-need__footer--sumsub {
        padding-inline: 1.25rem;
        box-sizing: border-box;
    }
}

/* Sumsub — desktop: native page scroll; compliance/review keep shell scroll */
@media (min-width: 48rem) {
    html:has(.gaming-what-you-need__sumsub),
    html:has(.gaming-what-you-need__sumsub) body,
    html:has(.gaming-what-you-need__sumsub) #app {
        height: auto !important;
        min-height: 100svh;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    html body #app .signup-page-shell:has(.gaming-what-you-need__sumsub) {
        display: block !important;
        height: auto !important;
        min-height: 100svh;
        max-height: none !important;
        overflow: visible !important;
    }

    html body #app .gaming-details.gaming-what-you-need:has(.gaming-what-you-need__sumsub) {
        display: block !important;
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html body #app .gaming-details:has(.gaming-what-you-need__sumsub) .gaming-details__shell {
        display: block !important;
        position: relative !important;
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html body #app .gaming-details:has(.gaming-what-you-need__sumsub) .gaming-details__stack {
        min-width: 0;
    }

    html body #app .gaming-details.gaming-compliance .gaming-details__shell,
    html body #app .gaming-details.gaming-review .gaming-details__shell {
        overflow-x: clip;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
}

/* Gaming ID upload / review — native document scroll for long forms (desktop only) */
@media (min-width: 48rem) {
    html:has(.gaming-details.gaming-id-upload),
    html:has(.gaming-details.gaming-id-upload) body,
    html:has(.gaming-details.gaming-id-upload) #app,
    html:has(.gaming-details.gaming-review),
    html:has(.gaming-details.gaming-review) body,
    html:has(.gaming-details.gaming-review) #app {
        height: auto !important;
        min-height: 100svh;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    html body #app .signup-page-shell:has(.gaming-details.gaming-id-upload),
    html body #app .signup-page-shell:has(.gaming-details.gaming-review) {
        display: block !important;
        height: auto !important;
        min-height: 100svh;
        max-height: none !important;
        overflow: visible !important;
    }

    html body #app .gaming-details.gaming-id-upload,
    html body #app .gaming-details.gaming-review {
        display: block !important;
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html body #app .gaming-details.gaming-id-upload .gaming-details__shell,
    html body #app .gaming-details.gaming-review .gaming-details__shell {
        display: block !important;
        position: relative !important;
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Home — match hero tone so iOS rubber-band never flashes white */
html:has(.lhome-page),
html:has(.lhome-page) body,
html:has(.lhome-page) #app,
html:has(.lhome-page) .signup-page-shell {
    background: #161616;
}

@media (max-width: 47.999rem) {
    html:has(.lhome-page),
    html:has(.lhome-page) body,
    html:has(.lhome-page) #app {
        height: 100svh !important;
        max-height: 100svh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html:has(.lhome-page),
    html:has(.lhome-page) body {
        position: fixed;
        inset: 0;
        width: 100%;
        touch-action: none;
    }

    html:has(.lhome-page) #app {
        min-height: 0 !important;
        height: 100svh !important;
        max-height: 100svh !important;
        overflow: hidden !important;
    }

    .signup-page-shell:has(.lhome-page) {
        height: 100svh;
        min-height: 0;
        max-height: 100svh;
        overflow: hidden;
    }

    html:has(.lifestyle-signup),
    html:has(.lifestyle-signup) body,
    html:has(.lifestyle-signup) #app {
        height: 100svh !important;
        max-height: 100svh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html:has(.lifestyle-signup) body {
        position: fixed;
        inset: 0;
        width: 100%;
        background: #faf9f7;
    }

    html:has(.lifestyle-signup) #app {
        min-height: 0 !important;
    }

    .signup-page-shell:has(.lifestyle-signup) {
        height: 100svh;
        min-height: 0;
        max-height: 100svh;
        overflow: hidden;
    }
}

/* Gaming consent / PAGCOR — grey behind modal so iOS rubber-band never flashes white */
html:has(.gaming-consent--pagcor-pending),
html:has(.gaming-consent--pagcor-pending) body,
html:has(.gaming-consent--pagcor-pending) #app,
html:has(.gaming-pagcor-dialog),
html:has(.gaming-pagcor-dialog) body,
html:has(.gaming-pagcor-dialog) #app {
    background: #595959 !important;
}

@media (max-width: 47.999rem) {
    html:has(.gaming-consent),
    html:has(.gaming-consent) body,
    html:has(.gaming-consent) #app {
        min-height: 0 !important;
        height: 100svh !important;
        max-height: 100svh !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    html:has(.gaming-consent) body,
    html:has(.gaming-consent--pagcor-pending) body,
    html:has(.gaming-pagcor-dialog) body {
        position: fixed;
        inset: 0;
        width: 100%;
    }

    html:has(.membership-terms-dialog) body {
        position: fixed;
        inset: 0;
        width: 100%;
    }

    html:has(.membership-terms-dialog) #app {
        min-height: 0 !important;
        height: 100svh !important;
        max-height: 100svh !important;
        overflow: hidden !important;
    }

    /* By Jayber — loader overlay + error pages: lock document (iOS/Android white gap). */
    html:has(.epic-splash),
    html:has(.epic-splash) body,
    html:has(.signup-flow-overlay),
    html:has(.signup-flow-overlay) body,
    html:has(.signup-flow-overlay) #app,
    html:has(.gaming-ndrp-status),
    html:has(.gaming-ndrp-status) body,
    html:has(.gaming-ndrp-status) #app {
        height: 100svh !important;
        max-height: 100svh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html:has(.epic-splash) body,
    html:has(.signup-flow-overlay) body,
    html:has(.gaming-ndrp-status) body {
        position: fixed;
        inset: 0;
        width: 100%;
        background: var(--epic-loading-surface, #fcfcfc);
    }

    html:has(.epic-splash) #app {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .signup-page-shell:has(.gaming-ndrp-status) {
        height: 100svh;
        min-height: 0;
        max-height: 100svh;
        overflow: hidden;
    }

    html body #app .gaming-ndrp-status {
        height: 100svh;
        max-height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    html body #app .gaming-ndrp-status__content {
        height: 100svh;
        max-height: 100svh;
        min-height: 0;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px) + 0.75rem);
    }

    html body #app .gaming-ndrp-status__footer :is(
        .btn-primary,
        .btn-decline,
        .session-error-page__start-over,
        .something-went-wrong-page__start-over,
        .verification-failed-page__return-home
    ) {
        font-size: max(16px, 0.75rem);
        touch-action: manipulation;
    }
}
