/* Download Page Styles */

/* Page Container */
.download-page {
    min-height: 100svh;
    position: relative;
    overflow: hidden;
    background: #000;
    padding-top: clamp(96px, 12vw, 120px);
    margin-top: clamp(-120px, -12vw, -96px);
    display: flex;
    align-items: center;
}

/* Hero Background (same as homepage) */
.download-page .hero-bg {
    position: absolute;
    top: -160px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.download-page .hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: all 2s ease-in-out;
    animation: backgroundSlide 20s infinite;
}

.download-page .hero-bg-image:nth-child(1) {
    background-image: var(--art-court);
    animation-delay: 0s;
}

.download-page .hero-bg-image:nth-child(2) {
    background-image: var(--art-club-cash);
    animation-delay: 6.66s;
}

.download-page .hero-bg-image:nth-child(3) {
    background-image: var(--art-trophies);
    animation-delay: 13.33s;
}

@keyframes backgroundSlide {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    25% {
        opacity: 1;
        transform: scale(1.06);
    }
    40% {
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

.download-page .hero-overlay {
    position: absolute;
    top: -200px;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.015) 2px,
            rgba(255,255,255,0.015) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.015) 2px,
            rgba(255,255,255,0.015) 4px
        ),
        linear-gradient(135deg, rgba(255, 120, 45, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%),
        linear-gradient(45deg, rgba(255, 215, 0, 0.15) 0%, rgba(220, 20, 60, 0.1) 100%);
    z-index: 1;
}

/* Container Wrapper */
.download-container-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4rem) 2rem 0;
    min-height: calc(100svh - clamp(96px, 12vw, 120px));
    display: flex;
    flex-direction: column;
}

/* Header: Logo + Headline + Subheadline (centered, full width above split) */
.download-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* Logo — larger */
.download-logo {
    width: clamp(220px, 38vw, 400px);
    height: auto;
    display: block;
    margin: 0 auto clamp(0.75rem, 1.5vw, 1.25rem);
}

/* Headline */
.download-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 clamp(0.5rem, 1vw, 0.75rem) 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Subheadline */
.download-subheadline {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

/* 50/50 Split */
.download-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
    margin-bottom: 2rem;
}

/* Left Side: Phone + Benefits */
.download-content {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    align-items: center;
    text-align: center;
}

/* Ready. Bet. Go. title image */
.download-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* Headline: the shared .home-hero-title text block, centred and sized like
   the old Text-Hero image was. The block keeps the image's aspect ratio so
   the type scales with the width via container units. */
.download-title-img {
    width: clamp(260px, 50vw, 720px);
    margin: 0 auto;
    justify-content: center;
    text-align: center;
}

/* Phone Mockup (small, centered within left side).
   Width is constrained to the phone-mockup width itself so the decor
   layer anchored inside .download-phone (.phone-decor) hugs the phone
   instead of sprawling across the column. */
.download-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: clamp(0.5rem, 1.5vw, 1rem) auto;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    position: relative;
    width: 100%;
    max-width: clamp(220px, 30vw, 320px);
    /* The shared .phone-stage class clips with overflow: hidden so the
       pinstripe accents stay inside a rounded box. We need decor items
       to peek out past those edges, so unclip here. The decor items
       remain clipped by .download-page's overflow: hidden. */
    overflow: visible;
}

.download-phone.phone-stage { overflow: visible; }

/* Give the decor a bit more breathing room than the shared default so
   items peek out past the phone instead of crowding against it. */
.download-phone .phone-decor {
    inset: -8% -22% -8% -22%;
}

@media (max-width: 900px) {
    .download-phone .phone-decor {
        inset: -4% -10% -4% -10%;
    }
}

.download-phone .phone-mockup {
    width: 100%;
    animation: phoneFloat 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
    position: relative;
    z-index: 1;
}

/* Phone decor rules now live in style.css (.phone-decor, .decor-*) so the
   same treatment can be reused on any page that puts the markup inside a
   .phone-stage. The .download-phone.phone-stage gets `overflow: visible`
   above so the decor isn't clipped by the shared .phone-stage rule. */

@keyframes phoneFloat {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Benefits List */
.download-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 480px;
    text-align: left;
}

.download-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.benefit-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--bma-green-bright, #ff782d);
    filter: drop-shadow(0 0 6px rgba(255, 120, 45, 0.5));
}

/* Right Side: QR Code (large, full side) */
.download-qr {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Full lockup above the QR code. */
.qr-logo {
    display: block;
    width: min(82%, 340px);
    height: auto;
    margin: 0 auto clamp(1rem, 2vw, 1.5rem);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}
.qr-code-container {
    text-align: center;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(46, 139, 87, 0.3);
    border-radius: 30px;
    padding: clamp(1.75rem, 3vw, 2.25rem) clamp(1.75rem, 3.5vw, 2.5rem) clamp(1.75rem, 3vw, 2.25rem);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(46, 139, 87, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    width: 100%;
    max-width: 560px;
}

.qr-code-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(46, 139, 87, 0.4), rgba(255, 215, 0, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.qr-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 clamp(1.25rem, 3vw, 2rem) 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.qr-code-placeholder {
    width: clamp(280px, 55vw, 400px);
    height: clamp(280px, 55vw, 400px);
    margin: 0 auto clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: clamp(0.75rem, 2.5vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-instruction {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.85);
    margin: clamp(1rem, 2vw, 1.5rem) 0 0;
    font-weight: 600;
}

/* Mobile CTA — hidden on desktop, shown on mobile */
.download-mobile-cta {
    display: none;
}

/* Mobile CTA uses .hero-pill and .hero-pill-cta from style.css */

/* Store badge (Apple's black badge, sized to the block it sits in) */
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: clamp(44px, 5vw, 56px); width: auto; display: block; }
.qr-code-container .store-badge { margin-top: clamp(0.75rem, 1.5vw, 1rem); }
.store-badge-mobile { margin-bottom: 1rem; }
.store-badge-mobile img { height: 52px; }

/* Fine Print Footer — pinned to bottom */
.download-footer {
    text-align: center;
    margin-top: auto;
    padding: 0.5rem 0;
}

.download-fine-print {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    line-height: 1.5;
}

/* ==================== Responsive ==================== */

/* Tablet: stack vertically, QR on top */
@media (max-width: 1024px) {
    .download-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .download-qr {
        order: -1;
    }

    .download-content {
        gap: 1rem;
    }

    .download-title-img {
        width: clamp(180px, 44vw, 300px);
    }

    .download-phone .phone-mockup {
        max-width: clamp(180px, 32vw, 260px);
    }

    .qr-code-container {
        max-width: 420px;
        padding: clamp(2rem, 5vw, 3rem) clamp(2rem, 5vw, 3rem);
    }

    .qr-code-placeholder {
        width: clamp(200px, 44vw, 300px);
        height: clamp(200px, 44vw, 300px);
    }
}

/* Mobile: swap QR for App Store badge + web app button */
@media (max-width: 768px) {
    /* Keep the negative margin so the green hero background extends behind
       the floating nav (matches the hero pattern on other pages). Drop the
       vertical centering and pad the wrapper internally so the title sits
       below the floating marquee + nav. */
    .download-page {
        align-items: flex-start;
    }

    .download-container-wrapper {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        /* Marquee (48px) + nav box (~92px) + breathing room. */
        padding-top: calc(var(--hero-marquee-height) + var(--hero-header-height) + 1rem);
        min-height: 0;
    }

    .download-qr {
        display: none;
    }

    .download-mobile-cta {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .download-content {
        display: contents;
    }

    .download-split {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .download-title-img {
        order: 1;
        width: clamp(240px, 68vw, 360px);
    }

    .download-benefits {
        order: 2;
    }

    .download-mobile-cta {
        order: 3;
    }

    .download-phone {
        order: 4;
        margin-bottom: 0;
    }

    .download-phone .phone-mockup {
        max-width: clamp(200px, 55vw, 300px);
    }

    .download-page .hero-bg-image {
        animation-duration: 30s;
    }
}

@media (max-width: 480px) {
    .download-container-wrapper {
        padding-top: calc(var(--hero-marquee-height) + var(--hero-header-height) + 0.5rem);
    }

    .download-container-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .download-split {
        gap: 1.5rem;
    }

    .download-title-img {
        width: clamp(220px, 64vw, 320px);
    }

    .download-phone .phone-mockup {
        max-width: clamp(140px, 42vw, 200px);
    }

    .download-benefits li {
        font-size: 0.9rem;
    }

    .download-footer {
        margin-top: 0;
    }

    .download-fine-print {
        font-size: 0.8rem;
    }

    .download-page .hero-bg-image {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Reduce animations */
@media (prefers-reduced-motion: reduce) {
    .download-phone .phone-mockup {
        animation: none;
    }

    .download-page .hero-bg-image {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
.qr-code-container .store-badges { margin-top: 1.25rem; }
.download-mobile-cta .store-badges { margin-bottom: 1.25rem; }

.phone-decor {
    position: absolute;
    inset: -4% -10% -4% -10%;
    pointer-events: none;
    z-index: 0;
}

.decor-item {
    position: absolute;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.decor-td {
    width: clamp(40px, 9%, 78px);
    opacity: 0.9;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
}
.decor-td-1 { top: 2%;     left: 4%;    transform: rotate(-18deg); }
.decor-td-2 { top: 6%;     right: 6%;   transform: rotate(14deg); width: clamp(34px, 7%, 60px); opacity: 0.78; }
.decor-td-3 { top: 28%;    left: 1%;    transform: rotate(-28deg); }
.decor-td-4 { top: 44%;    right: 2%;   transform: rotate(22deg); }
.decor-td-5 { top: 70%;    left: 3%;    transform: rotate(-10deg); width: clamp(48px, 10%, 88px); }
.decor-td-6 { bottom: 4%;  right: 8%;   transform: rotate(26deg); }
.decor-td-7 { bottom: 18%; left: 12%;   transform: rotate(8deg); width: clamp(28px, 6%, 50px); opacity: 0.7; }

.decor-trophy {
    width: clamp(58px, 14%, 120px);
    opacity: 0.82;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
}
.decor-trophy-gold   { top: 14%;   right: 0%;  transform: rotate(10deg); }
.decor-trophy-silver { top: 56%;   left: -2%;  transform: rotate(-12deg); opacity: 0.72; }
.decor-trophy-bronze { bottom: 6%; right: 4%;  transform: rotate(6deg); width: clamp(48px, 11%, 96px); opacity: 0.7; }

.decor-x {
    width: clamp(26px, 6%, 56px);
    opacity: 0.55;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.decor-x-1 { top: 22%;    right: 16%;  transform: rotate(24deg); }
.decor-x-2 { bottom: 38%; left: 14%;   transform: rotate(-32deg); }
.decor-x-3 { bottom: 10%; right: 22%;  transform: rotate(18deg); opacity: 0.45; }

@media (max-width: 900px) {
    .phone-decor          { inset: -2% -4% -2% -4%; }
    .decor-td             { width: clamp(28px, 7%, 50px); }
    .decor-td-5           { width: clamp(34px, 8%, 56px); }
    .decor-td-7           { width: clamp(22px, 5%, 40px); }
    .decor-trophy         { width: clamp(42px, 11%, 80px); }
    .decor-trophy-bronze  { width: clamp(36px, 9%, 64px); }
    .decor-x              { width: clamp(20px, 5%, 38px); }
}

.download-qr .get-web { margin-top: 1rem; }

.download-page .hero-pill-cta { color: #19130e; }
