/* Mobile / tablet overrides — does not change desktop rules */

.nav-toggle {
    display: none;
}

/* Phone-only crop of the home poster. Hidden on desktop, where the full poster is the page background. */
.home-hero-art {
    display: none;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (max-width: 1100px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    /*
     * The page art (gw12 / gw13) is a 1920-wide poster. Stretching it over the
     * whole document on a tall phone zooms the logo under the copy, and on
     * iOS the percentage background size often resolves differently than Chrome.
     * Drop the full-page image and paint each band on its own.
     */
    .body-bj {
        height: auto;
        background-image: none;
        background-color: #1a0830;
        overflow: visible;
    }

    /* ---------- Header ---------- */
    .body-bj-1 .body-bj-1-0 {
        left: 0;
        right: 0;
        height: auto;
        z-index: 1000;
        background: rgba(20, 10, 40, 0.92);
        padding-top: env(safe-area-inset-top);
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 {
        height: auto;
        min-height: 64px;
        padding: 8px 12px;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-logo {
        position: static;
        left: auto;
        width: 120px;
        height: 50px;
        flex-shrink: 0;
        z-index: 2;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 2;
    }

    .nav-toggle span {
        display: block;
        width: 24px;
        height: 3px;
        background: #ffffff;
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }

    .nav-toggle.is-open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.is-open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-nav {
        display: none;
        width: 100%;
        height: auto;
        padding: 8px 10px 12px;
        background-image: none;
        background-color: rgba(22, 8, 48, 0.98);
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
        order: 3;
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-nav.is-open {
        display: block;
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-nav .header-inner {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-nav .header-inner .nav-link {
        width: 100%;
        height: 44px;
        font-size: 15px;
        background-size: cover;
    }

    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-nav .header-inner .nav-link p {
        margin: 0;
    }

    /* ---------- Shared section heights ---------- */
    .body-bj-1 {
        height: auto !important;
        min-height: 0;
        padding-top: calc(64px + env(safe-area-inset-top));
    }

    .body-bj-2 {
        height: auto !important;
    }

    .body-bj-3 {
        height: auto !important;
        min-height: 0;
        padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .body-bj-3 .body-bj-3-1 {
        width: 200px;
        height: 24px;
    }

    .body-bj-3 .body-bj-3-2 {
        margin-left: 0;
        width: 100%;
        gap: 6px;
    }

    .body-bj-3 .body-bj-3-2 .body-bj-3-2-text1,
    .body-bj-3 .body-bj-3-2 .body-bj-3-2-text2,
    .body-bj-3 .body-bj-3-2 .body-bj-3-2-text3,
    .body-bj-3 .body-bj-3-2 .body-bj-3-2-text4,
    .body-bj-3 .body-bj-3-2 .body-bj-3-2-text5 {
        font-size: 14px;
        line-height: 1.45;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* ---------- Footer / 18+ ---------- */
    /* Index nests these under .body-bj-2-2 (higher specificity); other pages do not */
    .body-bj-2 .body-bj-2-2,
    .body-bj-2 .body-bj-2-2-1,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-1,
    .body-bj-2 .body-bj-2-2-2,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 {
        height: auto !important;
    }

    .body-bj-2 .body-bj-2-2-1,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-1 {
        padding: 16px 16px 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .body-bj-2 .body-bj-2-2-1 .body-bj-2-2-1-text1,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-1 .body-bj-2-2-1-text1 {
        font-size: 28px;
    }

    .body-bj-2 .body-bj-2-2-1 .body-bj-2-2-1-text2,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-1 .body-bj-2-2-1-text2 {
        font-size: 13px;
        text-indent: 0;
        padding: 0;
        line-height: 1.5;
    }

    .body-bj-2 .body-bj-2-2-2,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 {
        padding: 12px 16px 20px;
        flex-wrap: wrap;
        gap: 10px 16px;
        justify-content: flex-start;
    }

    .body-bj-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-copyright,
    .body-bj-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link1,
    .body-bj-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link2,
    .body-bj-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link3,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-copyright,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link1,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link2,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 .body-bj-2-2-2-footer-link3 {
        font-size: 13px;
    }

    .body-bj-2 .body-bj-2-2-2 a,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 a {
        text-decoration: none;
        padding: 4px 0;
    }

    .body-bj-2 .body-bj-2-2-2 a p,
    .body-bj-2 .body-bj-2-2 .body-bj-2-2-2 a p {
        margin: 0;
    }

    /* ---------- Home page ---------- */
    .body-bj.page-home .body-bj-1 {
        padding-top: calc(72px + env(safe-area-inset-top));
        height: auto !important;
        max-height: none;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: visible;
        background-color: #30126e;
        background-image: none;
    }

    /*
     * Real <img>, not a ::before background. gw12.jpg is 1920x2333, large enough
     * that older iOS Safari drops it as a CSS background, and an empty ::before
     * sized only with aspect-ratio collapses so the art never paints.
     */
    .body-bj.page-home .body-bj-1::before {
        content: none;
        display: none;
    }

    .body-bj.page-home .home-hero-art {
        display: block;
        width: 100%;
        flex: none;
        line-height: 0;
    }

    .body-bj.page-home .home-hero-art img {
        width: 100%;
        height: auto;
        display: block;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-2 {
        height: auto !important;
        min-height: 0;
        flex: none;
        padding: 10px 16px 2px;
        align-items: flex-end;
        justify-content: center;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-2 .body-bj-1-2-button {
        width: min(260px, 70vw);
        height: 78px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-2 .body-bj-1-2-button .body-bj-1-2-button-text {
        font-size: 22px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-3 {
        height: auto !important;
        flex: none;
        padding: 0 16px 12px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-3 .body-bj-1-3-text {
        font-size: 15px;
        text-align: center;
        line-height: 1.35;
        padding: 0 8px;
    }

    .body-bj.page-home .body-bj-2 {
        background: linear-gradient(180deg, #30126e 0%, #2c1468 36%, #1a0834 100%);
    }

    .body-bj.page-home .body-bj-3 {
        background: #16082c;
    }

    .body-bj.page-home .body-bj-2 .body-bj-2-1 {
        display: flex !important;
        height: auto !important;
        padding: 8px 12px 20px;
        align-items: stretch;
        justify-content: center;
        overflow: visible;
    }

    .body-bj.page-home .body-bj-2 .body-bj-2-1 .body-bj-2-1-1 {
        width: 100%;
        max-width: 520px;
        height: auto !important;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        padding-top: 50%;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        background-position: top center !important;
    }

    .body-bj.page-home .body-bj-2 .body-bj-2-1 .body-bj-2-1-1 .body-bj-2-1-1-1 {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        gap: 8px;
        padding: 10px 0 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .body-bj.page-home .body-bj-2 .body-bj-2-1 .body-bj-2-1-1 .body-bj-2-1-1-1 .button-nav-item,
    .body-bj.page-home .body-bj-2 .body-bj-2-1 .body-bj-2-1-1 .body-bj-2-1-1-1 .button-nav-item-active {
        width: 168px !important;
        height: 72px !important;
        margin: 0 !important;
        flex: 0 0 auto;
        background-size: 100% 100% !important;
        background-position: center center !important;
    }

    .body-bj.page-home .body-bj-2 .body-bj-2-1 .body-bj-2-1-1 .body-bj-2-1-1-1 .button-nav-item [class*="-img"] {
        width: 100% !important;
        height: 100% !important;
        background-size: contain !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }

    /* ---------- About / Privacy / Terms ---------- */
    .body-bj.page-inner .body-bj-1 {
        background-color: #32166e;
    }

    .body-bj.page-inner .body-bj-1 .body-bj-1-2 {
        height: auto !important;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    /* Logo art only. Copy starts underneath, on the flat purple field. */
    .body-bj.page-inner .body-bj-1 .body-bj-1-2::before {
        content: "";
        display: block;
        width: 100%;
        aspect-ratio: 1.9 / 1;
        max-height: 360px;
        flex: none;
        background: url("../img/gw13.jpg") no-repeat center top;
        background-size: 155% auto;
    }

    .body-bj.page-inner .body-bj-2 {
        background: linear-gradient(180deg, #32166e 0%, #1c0838 72%);
    }

    .body-bj.page-inner .body-bj-3 {
        background: #16082c;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-1 {
        height: auto !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        padding: 12px 18px 36px !important;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-1 p {
        font-size: 15px;
        line-height: 1.65;
        padding: 0;
        overflow-wrap: anywhere;
    }

    /* ---------- Privacy / Terms ---------- */
    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img {
        height: auto !important;
        min-height: 0;
        padding: 0 12px 28px !important;
        background-image: none;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card {
        height: auto !important;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-card-header {
        height: auto;
        min-height: 56px;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-card-header .policy-card-header-inner {
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 12px 16px;
        font-size: 18px;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-card-header .policy-card-header-inner p {
        margin: 0;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body {
        height: auto !important;
        padding: 0 12px 16px;
        display: flex;
        flex-direction: column;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-nav {
        height: auto !important;
        padding-top: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-nav .policy-nav-item {
        margin: 0;
        font-size: 13px;
        line-height: 1.4;
        padding: 8px 4px;
        border-bottom: 1px solid #e8e0f0;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content {
        height: 420px !important;
        min-height: 320px;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content .policy-content-panel {
        height: 100%;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body,
    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content,
    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content .policy-content-panel {
        min-width: 0;
        max-width: 100%;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content iframe {
        display: block;
        width: 1px;
        min-width: 100%;
        max-width: 100%;
        height: 100%;
        border: 0;
    }
}

@media (max-width: 480px) {
    .body-bj-1 .body-bj-1-0 .body-bj-1-1 .body-bj-1-1-logo {
        width: 100px;
        height: 42px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-2 .body-bj-1-2-button {
        height: 68px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-2 .body-bj-1-2-button .body-bj-1-2-button-text {
        font-size: 18px;
    }

    .body-bj.page-home .body-bj-1 .body-bj-1-3 .body-bj-1-3-text {
        font-size: 14px;
    }

    .body-bj-1 .body-bj-1-2 .body-bj-1-2-img .policy-card .policy-body .policy-content {
        height: 360px !important;
    }
}
