/* --- MOBILE RESPONSIVENESS --- */

/* Default: Hide mobile elements on Desktop */
.hamburger-menu {
    display: none;
}

.mobile-nav {
    display: none;
}

.mobile-sticky-buttons {
    display: none;
}

body.splash-on .mobile-sticky-buttons {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Mobile & Tablet Styles */
@media (max-width: 1024px) {
    body {
        overflow-x: hidden !important;
        width: 100%;
        position: relative;
    }

    html {
        overflow-x: hidden;
    }

    /* 1. Sticky Header Fixes - No Animation */
    header,
    header.scrolled {
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 70px;
        background: rgba(20, 59, 27, 0.95) !important;
        /* Force dark background always */
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        padding: 0;
        margin: 0;
        transition: none !important;
        /* Force no animation */
    }

    /* Container adjustments for alignment */
    header .container {
        height: 100%;
        padding: 0 24px;
        display: flex;
        align-items: center;
        width: 100%;
    }

    header nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
        /* Logo left, Hamburger right */
        align-items: center;
    }

    /* 2. Hide Desktop Elements */
    .desktop-only {
        display: none !important;
    }

    /* 3. Hamburger Menu */
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1002;
        padding: 0;
        margin-left: auto;
        /* Ensure it pushes to right if needed */
    }

    .hamburger-menu span {
        width: 100%;
        height: 2px;
        background-color: #f7f7f9;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Hamburger Active State (X shape) */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* 4. Mobile Navigation Overlay */
    .mobile-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 70px;
        /* Below header */
        left: 0;
        width: 100%;
        height: 0;
        /* Hidden by default */
        background: #143b1b;
        overflow: hidden;
        transition: height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1001;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-nav.open {
        height: auto;
        padding-bottom: 40px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-nav-links {
        list-style: none;
        text-align: center;
        margin-top: 20px;
        width: 100%;
        padding: 0;
    }

    .mobile-nav-links li {
        margin: 20px 0;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .mobile-nav.open .mobile-nav-links li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger animations for links */
    .mobile-nav.open .mobile-nav-links li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .mobile-nav.open .mobile-nav-links li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .mobile-nav.open .mobile-nav-links li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .mobile-nav-links a {
        color: #f7f7f9;
        font-size: 1.5rem;
        font-weight: 600;
        text-decoration: none;
    }

    .btn.mobile-btn {
        margin: 20px 0 0 0;
        opacity: 0;
        transition: all 0.3s ease 0.4s;
        /* Delayed appearance */
    }

    .mobile-nav.open .btn.mobile-btn {
        opacity: 1;
    }

    /* 5. Hide Game HUD and Hero Visuals */
    .game-hud-section,
    .hero-visual {
        display: none !important;
    }

    .logo {
        margin-right: 0;
        /* Align left properly */
        z-index: 1002;
    }

    /* Ensure hero text doesn't overlap header too much due to fixed position */
    .hero,
    section.hero {
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .hero .container,
    section.hero .container {
        padding-top: 100px;
        overflow: hidden !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-content,
    .hero .hero-content {
        flex-direction: column !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center;
        overflow: hidden !important;
        box-sizing: border-box !important;
        align-items: center !important;
        justify-content: center !important;
    }


    .hero-text,
    .hero .hero-text {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        box-sizing: border-box;
        margin: 0 auto !important;
        padding: 0 16px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .hero-title {
        white-space: normal !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* Utility */
    .style-hidden {
        display: none !important;
    }



    /* Responsive font size using clamp for hero h1 - BIGGER */
    .hero h1 {
        font-size: clamp(2rem, 7vw, 2.8rem) !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal !important;
        margin-bottom: 20px;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        line-height: 1.2 !important;
        box-sizing: border-box;
        text-align: center !important;
    }

    .hero h1 .line-wrapper {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        white-space: normal !important;
        margin-bottom: 0 !important;
    }

    /* "Stuck" wrapper + period - keep inline, fix background for mobile */
    .hero h1 .stuck-wrapper {
        display: inline !important;
        white-space: nowrap !important;
        padding: 0 3px !important;
        font-size: inherit !important;
    }

    .hero h1 .stuck-wrapper.struck {
        padding: 0 4px !important;
        border-radius: 3px !important;
    }

    /* Period after Stuck - keep inline */
    .hero h1 .period {
        display: inline !important;
    }

    /* Animated text wrapper - force new line for better readability */
    .hero h1 #rotating-text,
    .hero h1 .gradient-text.type-text {
        display: block !important;
        white-space: normal !important;
        word-break: break-word !important;
        margin-top: 4px;
    }

    /* Additional overrides for center alignment */
    .line-wrapper {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        white-space: normal !important;
    }

    /* Tablet Specific Overrides (600px - 1024px) */
    @media (min-width: 600px) and (max-width: 1024px) {
        .hero h1 {
            font-size: 3rem !important;
            padding: 0 40px;
        }

        .hero p {
            font-size: 1.2rem !important;
            max-width: 700px !important;
            margin: 0 auto 30px auto !important;
        }
    }

    /* Hero badge - responsive on mobile */
    .hero-badge {
        white-space: normal !important;
        height: auto !important;
        padding: 8px 12px !important;
        text-align: center !important;
        width: calc(100% - 32px) !important;
        max-width: 320px !important;
        display: block !important;
        margin: 0 auto 20px auto !important;
        font-size: clamp(0.7rem, 3vw, 0.85rem) !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
    }

    .stuck-wrapper {
        max-width: 100%;
        height: auto;
        display: inline-block;
    }

    .stuck-wrapper img {
        max-width: 100%;
        height: auto;
    }

    /* Ensure line wrappers don't cut text */
    .line-wrapper {
        display: block !important;
        white-space: normal !important;
        overflow: visible !important;
        width: 100% !important;
    }

    /* FIX: Hero Subheadline */
    .hero p,
    .hero-text p,
    .hero .hero-text p,
    section.hero p,
    section.hero .hero-text p,
    section.hero .hero-content .hero-text p,
    #home p,
    #home .hero-text p {
        font-size: clamp(0.85rem, 3.5vw, 1rem) !important;
        line-height: 1.6 !important;
        padding: 0 !important;
        margin: 16px auto 24px auto !important;
        width: 90% !important;
        max-width: 340px !important;
        overflow: visible !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
        text-align: center !important;
        white-space: normal !important;
    }

    /* 6. Stats Carousel - INFINITE SCROLLING */
    .hero-stats {
        display: block !important;
        width: 100%;
        overflow: hidden;
        mask-image: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
        -webkit-mask-image: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
        padding: 20px 0;
        margin-top: 20px;
        white-space: nowrap !important;
    }

    .carousel-track {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        animation: scroll-track 12s linear infinite;
        width: fit-content;
        align-items: center;
        will-change: transform;
    }

    .stat-item {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        flex-direction: column;
        align-items: center;
        min-width: max-content;
        margin-right: 50px;
        white-space: nowrap;
    }

    /* Show all items including duplicates on mobile */
    .carousel-track .stat-item:nth-child(n+4) {
        display: inline-flex !important;
    }

    .stat-number {
        font-size: 2rem !important;
    }

    /* Infinite Scroll Animation - seamless loop */
    @keyframes scroll-track {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(-50%);
        }
    }

    /* 7. Mobile Sticky Buttons */
    .mobile-sticky-buttons {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 400px;
        display: flex;
        gap: 12px;
        z-index: 9999;
        /* High Z-index */
        padding: 12px;
        background: transparent;
        /* Transparent background */
        /* Removed border, shadow, backdrop-filter for clean floating look */
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
    }

    .mobile-sticky-buttons.hidden {
        transform: translate(-50%, 150%);
        /* Slide down */
        opacity: 0;
        pointer-events: none;
    }

    .mobile-sticky-buttons .btn {
        flex: 1;
        text-align: center;
        padding: 12px 10px;
        /* Reduced side padding slightly to fit */
        font-size: 0.95rem;
        /* Slightly smaller font */
        display: flex;
        justify-content: center;
        align-items: center;
        white-space: nowrap;
        height: auto;
        min-height: 48px;
        line-height: 1.2;
    }

    /* Just for mobile: Add background to secondary sticky button */
    .mobile-sticky-buttons .btn-secondary {
        background: rgba(20, 59, 27, 0.6);
        /* Slightly darker/visible background */
        border: 1px solid rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(4px);
    }

    @media (max-width: 600px) {

        .hero .hero-text p,
        section.hero .hero-content .hero-text p {
            font-size: 0.82rem !important;
        }
    }

    @media (max-width: 450px) {

        .hero p,
        .hero-text p,
        .hero .hero-text p {
            font-size: 0.76rem !important;
        }
    }

    @media (max-width: 380px) {
        .hero .container {
            padding-left: 16px !important;
            padding-right: 16px !important;
        }

        .hero p,
        .hero-text p {
            font-size: 0.72rem !important;
        }
    }
}

/* 8. Pricing Carousel (Under 1100px) */
@media (max-width: 1100px) {
    .pricing-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 16px !important;
        padding: 20px 0 40px 0 !important;
        /* Bottom padding for shadow/dots */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
    }

    .pricing-grid::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .pricing-card {
        flex: 0 0 85% !important;
        /* Peek effect */
        min-width: 85% !important;
        max-width: 400px !important;
        margin: 0 !important;
        scroll-snap-align: center;
        /* Ensure normal height behavior */
        height: auto !important;
    }

    /* Padding wrapper for dots */
    .pricing-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: -10px;
        /* Pull up closer */
        padding-bottom: 20px;
    }

    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.3);
        background: transparent;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dot.active {
        background: linear-gradient(135deg, #d8fb68 0%, #91ecca 100%);
        border: none;
        /* Remove border for gradient fill */
        transform: scale(1.2);
    }

    /* Footer Adjustments */
    /* Footer Adjustments */
    .footer-content {
        flex-direction: column;
        gap: 0;
        /* Reduced from 40px */
        text-align: left;
    }

    .footer-links {
        flex-direction: column;
        gap: 0;
    }

    /* Force vertical stack for accordion */
    .footer-nav {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        /* override potential grid */
        gap: 0 !important;
        width: 100% !important;
    }


    .footer-col {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 16px 0;
    }

    .footer-col:last-child {
        border-bottom: none;
    }

    .footer-col h4 {
        margin-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding-right: 10px;
        position: relative;
    }

    /* Accordion Icon */
    .footer-col h4::after {
        content: '+';
        font-size: 1.5rem;
        font-weight: 300;
        transition: transform 0.3s ease;
    }

    .footer-col.active h4::after {
        content: '-';
        transform: rotate(180deg);
    }

    .footer-col ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, padding 0.3s ease;
        padding-top: 0;
        margin-top: 0;
    }

    .footer-col.active ul {
        max-height: 500px;
        padding-top: 16px;
    }

    .footer-col ul li {
        margin-bottom: 12px;
    }

    /* CTA Banner Reponsive */
    .cta-banner {
        flex-direction: column;
        padding: 40px 20px;
        text-align: center;
        gap: 30px;
        border-radius: 24px;
    }

    .cta-content {
        text-align: center;
        max-width: 100%;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    /* --- HOW GAMIRO WORKS - MOBILE CAROUSEL --- */
    /* Only apply when screen < 768px (or whatever breakpoint is active here) */

    .process-steps-wrapper {
        width: 100%;
        overflow: hidden;
        /* Prevent horizontal scroll on body */
    }

    .process-steps {
        display: flex !important;
        flex-direction: row !important;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 20px 7.5vw;
        -webkit-overflow-scrolling: touch;
        margin-top: 30px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    /* Hide Vertical Line on Mobile */
    .process-steps::before {
        display: none !important;
    }

    .process-steps::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar */
    }

    .step-card {
        flex: 0 0 85vw !important;
        width: 85vw !important;
        min-width: 85vw !important;
        max-width: 350px;
        scroll-snap-align: center;
        flex-direction: column !important;
        text-align: center;
        align-items: center;

        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 25px 20px;
        border-radius: 16px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .step-number {
        margin: 0 0 20px 0;
        /* Margin bottom */
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 1.25rem;
    }

    .step-content {
        padding-top: 0;
    }

    .step-card h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .step-card p {
        font-size: 0.95rem;
    }

    /* Show Dots on Mobile */
    .steps-dots.mobile-only {
        display: flex !important;
        justify-content: center;
        gap: 12px;
        margin-top: 20px;
    }

    .steps-dots .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .steps-dots .dot.active {
        background: #4ade80;
        /* Green */
        transform: scale(1.2);
        box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    }
}