/* css/mobile-optimization.css - High performance mobile UX improvements */

@media (max-width: 1024px) {
    /* 1. Global Spacing Reductions - Aggressive to eliminate "empty" feel */
    section {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
        position: relative;
    }

    /* Remove the large 120px visual gaps between sections */
    section::after {
        height: 30px !important; 
        background: linear-gradient(to top, transparent, rgba(13, 27, 42, 0.1)) !important;
    }

    /* Target headers to be tighter */
    .modern-header {
        margin-bottom: 20px !important;
    }

    .modern-title {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
        line-height: 1.2 !important;
    }

    .modern-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    /* 2. Hero Section Optimization - INFINITE MARQUEE DESIGN (Mobile Only) */
    .hero-split-screen {
        padding-top: 60px !important;
        height: auto !important;
        min-height: 520px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
        background: #0d1b2a !important;
        margin-bottom: 60px !important; /* Safe separation from ranking section */
    }

    .hero-inner-container {
        height: auto !important;
        min-height: auto !important;
        flex-direction: column !important;
        width: 100% !important;
        position: relative !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important;
    }

    /* Hide Orbital System on Mobile and replace with Marquee */
    .hero-visual-area {
        display: none !important;
    }

    /* New Marquee Atmosphere - 4 Layer Cascade */
    .hero-mobile-marquee-bg {
        position: absolute !important;
        top: 45% !important; /* Slightly lower to accommodate more rows */
        left: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        z-index: 1 !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
        mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent) !important;
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent) !important;
    }

    .marquee-track {
        display: flex !important;
        gap: 12px !important;
        width: max-content !important;
        animation: marqueeScroll 12s linear infinite !important;
    }

    /* Cascade Opacity & Speed Variation */
    .marquee-track:nth-child(1) img { opacity: 0.6 !important; filter: blur(0px) !important; }
    .marquee-track:nth-child(2) img { opacity: 0.4 !important; filter: blur(0.5px) !important; }
    .marquee-track:nth-child(3) img { opacity: 0.25 !important; filter: blur(1px) !important; }
    .marquee-track:nth-child(4) img { opacity: 0.15 !important; filter: blur(1.5px) !important; }

    .marquee-track:nth-child(2) { animation-duration: 16s !important; }
    .marquee-track:nth-child(3) { animation-duration: 14s !important; }
    .marquee-track:nth-child(4) { animation-duration: 19s !important; }

    .marquee-track.reverse {
        animation-direction: reverse !important;
    }

    .marquee-group {
        display: flex !important;
        gap: 12px !important;
    }

    .marquee-group img {
        height: 60px !important;
        width: auto !important;
        border-radius: 8px !important;
        transition: opacity 0.3s ease !important;
    }

    @keyframes marqueeScroll {
        from { transform: translateX(0); }
        to { transform: translateX(-50%); }
    }

    /* Floating Typographic Content (No Card) */
    .hero-content {
        position: relative !important;
        z-index: 10 !important;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 25px !important;
        margin-top: 20px !important;
        width: 100% !important;
        box-shadow: none !important;
        text-align: center !important;
    }

    .hero-main-logo {
        max-width: 130px !important;
        margin-bottom: 20px !important;
        filter: drop-shadow(0 0 15px rgba(0, 255, 157, 0.2)) !important;
    }

    .hero-title.main-punch-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        margin-bottom: 15px !important;
    }

    .hero-number {
        font-size: 3.8rem !important; /* Smaller for compactness */
        line-height: 1 !important;
        font-weight: 900 !important;
        color: var(--color-original) !important;
        text-shadow: 0 5px 20px rgba(0, 255, 157, 0.3) !important;
        letter-spacing: -1px !important;
    }

    .hero-label {
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        line-height: 1 !important;
        letter-spacing: 1px !important;
        margin-bottom: 10px !important;
    }

    .hero-subtitle {
        font-size: 1.05rem !important;
        font-weight: 700 !important; /* Extra robusto como solicitado */
        opacity: 1 !important; /* Totalmente visible */
        margin-bottom: 20px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        display: block !important;
    }

    /* Ultra-Slim & Separated Ranking Selector */
    .ranking-track {
        height: 58px !important; /* Extreme slim profile */
        margin-top: 45px !important; /* Wide gap to avoid card overlap */
        background: rgba(10, 25, 41, 0.95) !important;
        border-radius: 30px !important;
        padding: 0 15px !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        display: flex !important;
        align-items: center !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    }

    .ranking-item {
        font-size: 1.3rem !important;
        opacity: 0.35 !important;
        transform: scale(0.8) !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .ranking-item.active {
        opacity: 1 !important;
        transform: scale(1.05) translateY(-1px) !important;
        color: var(--color-original) !important;
        text-shadow: 0 0 12px rgba(0, 255, 157, 0.4) !important;
    }

    .ranking-item .ranking-game-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .hero-description {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        opacity: 0.7 !important;
        margin-bottom: 25px !important;
        padding: 0 15px !important;
        max-width: 300px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-actions {
        width: 100% !important;
        gap: 12px !important;
        margin-bottom: 40px !important; /* Breathable footer area */
    }

    /* Force separation of the ranking showcase */
    #top-games, .top-games-section {
        margin-top: 40px !important;
        position: relative !important;
        z-index: 5 !important;
    }

    .hero-actions .btn-neon {
        margin: 0 !important;
        padding: 14px !important;
        font-size: 0.9rem !important;
        letter-spacing: 1px !important;
    }

    .hero-footer-text {
        font-size: 0.75rem !important;
        margin-top: 20px !important;
        opacity: 0.5 !important;
    }

    /* Cinematic Orbit Animations */
    .orbit-back { animation: orbitRotate 120s linear infinite !important; }
    .orbit-mid { animation: orbitRotate 90s linear infinite reverse !important; }
    .orbit-front { animation: orbitRotate 60s linear infinite !important; }

    @keyframes orbitRotate {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    /* Ensure icons don't rotate with the parent */
    .orbit-item {
        animation: orbitCounterRotate 120s linear infinite !important;
    }

    .orbit-mid .orbit-item { animation-duration: 90s !important; animation-direction: reverse !important; }
    .orbit-front .orbit-item { animation-duration: 60s !important; }

    @keyframes orbitCounterRotate {
        from { transform: translate(-50%, -50%) rotate(0deg); }
        to { transform: translate(-50%, -50%) rotate(-360deg); }
    }

    .orbit-game-image {
        width: 45px !important; /* Smaller for mobile atmosphere */
        height: 45px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    }

    .navbar {
        z-index: 100 !important; /* Above immersive hero */
        background: rgba(10, 25, 41, 0.8) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    /* 3. Top Games Optimization (Horizontal Scroll Thumbs) */
    .top-games-highlight {
        padding-top: 20px !important;
        padding-bottom: 10px !important;
    }

    /* 3. Top Games Featured Showcase - PREMIUM STREAMING POSTER REDESIGN */
    .top-games-shell {
        padding: 0 5px !important;
        margin-bottom: 30px !important;
    }

    .top-game-showcase {
        display: block !important;
        position: relative !important;
        aspect-ratio: 9 / 16 !important; /* Cinematic Vertical Poster Format */
        height: auto !important;
        min-height: 520px !important;
        border-radius: 32px !important;
        overflow: hidden !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        background: #000 !important;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6) !important;
    }

    /* Video fills the whole card as an immersive background */
    .showcase-media {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1 !important;
        border: none !important;
    }

    /* Video hidden on mobile to prioritize vertical art as requested */
    .showcase-video {
        display: none !important;
    }

    /* Vertical Poster Art as background */
    .showcase-poster {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Rank chip floats over the video */
    .showcase-rank-chip {
        top: 20px !important;
        left: 20px !important;
        transform: scale(0.9) !important;
        z-index: 5 !important;
        background: rgba(0,0,0,0.5) !important;
        backdrop-filter: blur(10px) !important;
    }

    /* Content floats on top with a tactical gradient for readability */
    .showcase-content {
        position: absolute !important;
        inset: 0 !important;
        z-index: 3 !important;
        padding: 40px 20px 35px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        text-align: center !important;
        align-items: center !important;
        background: linear-gradient(
            to bottom, 
            rgba(0, 0, 0, 0.6) 0%, 
            transparent 30%, 
            transparent 55%, 
            rgba(0, 0, 0, 0.95) 100% /* Deepened for maximum contrast */
        ) !important;
    }

    /* Logo at the VERY TOP like a movie poster */
    .showcase-title-img {
        width: 80% !important;
        max-width: 200px !important;
        height: auto !important;
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8)) !important;
    }

    /* Description and Button pushed to the BOTTOM */
    .showcase-tagline {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        color: rgba(255, 255, 255, 0.85) !important;
        margin-bottom: 12px !important;
        max-width: 100% !important;
        text-shadow: 0 1px 10px rgba(0,0,0,0.8) !important;
    }

    .showcase-meta {
        margin-bottom: 20px !important;
        gap: 8px !important;
        display: flex !important;
        flex-direction: column !important; /* Stacked for better centering control */
        align-items: center !important;
        width: 100% !important;
    }

    .meta-pill {
        width: fit-content !important;
        padding: 6px 15px !important;
        font-size: 0.75rem !important;
        background: rgba(0, 0, 0, 0.6) !important; /* Darker wrapper for data */
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        backdrop-filter: blur(10px) !important;
        color: #fff !important;
        border-radius: 30px !important;
    }

    #top-game-cta {
        width: 100% !important;
        max-width: 240px !important;
        padding: 14px 20px !important;
        background: var(--color-original) !important;
        color: #000 !important;
        border-radius: 50px !important;
        font-size: 0.9rem !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        box-shadow: 0 10px 25px rgba(0, 255, 157, 0.4) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
    }

    /* The 'Ranking Track' - Clear indication of sequence and scrollability */
    .top-games-thumbs {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding: 30px 20px 40px !important;
        gap: 25px !important;
        scroll-snap-type: x mandatory !important;
        scroll-padding-left: 20px !important; /* Ensures the first item isn't glued to the edge */
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        margin: -40px -20px 0 !important;
        background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.4) 20%, rgba(15, 23, 42, 0.6) 100%) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: blur(10px) !important;
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent) !important;
        -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent) !important;
    }

    .top-game-thumb {
        flex: 0 0 90px !important;
        height: 90px !important;
        position: relative !important;
        scroll-snap-align: start !important; /* Changed from center to ensure list starts at 1 */
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Large Background Numbers for Affordance */
    .top-game-thumb::before {
        content: attr(data-rank) !important;
        position: absolute !important;
        font-size: 5rem !important;
        font-weight: 900 !important;
        color: transparent !important;
        -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.15) !important;
        left: -15px !important;
        bottom: -5px !important;
        z-index: 1 !important;
        line-height: 1 !important;
        font-family: 'Outfit', sans-serif !important;
        transition: all 0.4s ease !important;
    }

    .top-game-thumb.active::before {
        -webkit-text-stroke: 1.5px var(--color-original) !important;
        opacity: 0.8 !important;
        transform: scale(1.1) translateX(5px) !important;
    }

    .top-game-thumb img {
        width: 75px !important;
        height: 75px !important;
        object-fit: contain !important;
        position: relative !important;
        z-index: 2 !important; /* Above the number */
        filter: brightness(0.7) drop-shadow(0 5px 15px rgba(0,0,0,0.5)) !important;
        transition: all 0.4s ease !important;
    }

    .top-game-thumb.active img {
        filter: brightness(1.2) drop-shadow(0 0 15px rgba(0, 255, 157, 0.4)) !important;
        transform: scale(1.2) !important;
    }

    /* Small dot indicators for the track */
    .top-games-thumbs::-webkit-scrollbar {
        display: none !important;
    }

    /* 4. Stats Section Optimization - FIXED: Simplified (No more cards inside cards) */
    .stats-bar-container {
        padding: 10px 0 !important;
        margin: 10px 0 !important;
        background: none !important; /* Remove outer card background */
        border: none !important;     /* Remove outer card border */
        box-shadow: none !important;  /* Remove outer card shadow */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 15px !important;
    }

    .stat-item {
        width: 100% !important;
        min-width: 0 !important;
        padding: 18px 10px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border-radius: 20px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    }

    .stat-icon {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }

    .stat-count {
        font-size: 1.2rem !important;
        margin-bottom: 2px !important;
    }

    .stat-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.5px !important;
        line-height: 1.2 !important;
        opacity: 0.8 !important;
    }

    /* Special case for the 5th item to center it if 2-col */
    .stat-item:last-child:nth-child(odd) {
        grid-column: span 2 !important;
        max-width: 60% !important;
        margin: 0 auto !important;
    }

    /* 5. Services Section Optimization */
    .services-section {
        padding-top: 20px !important;
    }

    .customization-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-top: 15px !important;
    }

    .customization-item {
        padding: 12px !important;
        min-height: 100px !important;
    }

    .customization-icon {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }

    /* 6. Discovery Section Optimization - FIXED: Seamless integration */
    .discovery-integrated-section {
        padding: 5px 20px 30px !important; /* Minimal gap with previous section */
        margin-top: -15px !important; /* Pull up to touch Top Games */
    }

    .discovery-card-master {
        padding: 0 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    .discovery-master-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        text-align: center !important;
    }

    /* RE-ARRANGE: Clean flow - Info top, Button, then Logos bottom */
    .discovery-master-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        order: 1 !important; 
    }

    /* Target the actual CTA button within the info section */
    .btn-discovery-master {
        width: 100% !important;
        max-width: 260px !important;
        background: #ffffff !important;
        color: #0c161d !important;
        padding: 14px 24px !important; /* Perfected proportion */
        border-radius: 12px !important; /* Elegant modern radius */
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        margin: 15px auto 5px !important; /* Reduced bottom margin to pull logos up */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
        border: none !important;
    }

    .discovery-master-visual {
        order: 2 !important; 
        height: 220px !important; /* Increased height for larger logos */
        margin: 10px auto 0 !important;
        opacity: 1 !important; 
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: relative !important;
    }

    .discovery-master-spotlight {
        height: 100% !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
    }

    /* FIX: Prevent clipped/cut-off glow on mobile */
    .discovery-master-spotlight::after {
        width: 180px !important; /* Scaled up to match larger logos */
        height: 180px !important;
        background: radial-gradient(circle at center, rgba(0, 255, 157, 0.15) 0%, transparent 75%) !important;
        opacity: 0.8 !important;
    }

    /* RESTORE DESKTOP ANIMATION: Absolute positioning + Opacity for smooth swaps */
    .spotlight-img {
        position: absolute !important;
        max-height: 140px !important; /* Increased max-height for larger logos */
        max-width: 90% !important;
        opacity: 0 !important;
        transform: scale(0.85) translateY(10px) !important;
        transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
    }

    .spotlight-img.current {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        z-index: 2 !important;
    }

    .spotlight-img.prev {
        opacity: 0 !important;
        transform: scale(1.1) translateY(-10px) !important;
        z-index: 1 !important;
    }

    /* 7. Bento Improvements - Total Mobile Redesign - FIXED IMAGE VISIBILITY */
    .bento-solutions-track {
        padding: 5px 20px 25px !important;
        gap: 15px !important;
    }

    .bento-card {
        flex: 0 0 calc(88vw) !important;
        height: auto !important;
        min-height: 480px !important;
        border-radius: 28px !important;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(10, 25, 32, 1)) !important;
        padding: 18px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        position: relative;
    }

    /* Inner Visual Container (The Premium Frame) */
    .bento-card .cell-visual {
        display: none; /* Hide all by default */
        height: 200px !important;
        background: #000 !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 24px !important;
        margin-bottom: 20px !important;
        justify-content: center !important;
        align-items: center !important;
        order: -1 !important; 
        padding: 0 !important; /* NO PADDING to allow full fill */
        overflow: hidden !important;
        position: relative;
        box-shadow: inset 0 0 20px rgba(0,0,0,0.4), 0 10px 30px rgba(0,0,0,0.5) !important;
    }

    /* Subtle glow effect for the frame */
    .bento-card .cell-visual::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 24px;
        background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
        pointer-events: none;
    }

    /* Show ONLY the primary visual for each card */
    .bento-card.bento-layout-1 .cell-visual:first-child,
    .bento-card.bento-layout-2 .cell-visual:first-child,
    .bento-card.bento-layout-3 .cell-visual:last-child {
        display: flex !important;
    }

    .bento-image-context {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* FULL FILL as requested */
        transition: transform 0.5s ease-out !important;
    }

    /* Simplify content cells for mobile */
    .bento-cell {
        background: none !important;
        border: none !important;
        padding: 5px 0 !important;
        min-height: auto !important;
    }

    .bento-title {
        font-size: 1.3rem !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
        color: #fff !important;
    }

    .bento-description {
        font-size: 0.85rem !important;
        color: rgba(255, 255, 255, 0.6) !important;
        margin-bottom: 15px !important;
    }

    /* Features list tightening */
    .bento-features {
        gap: 8px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .bento-feature-item {
        font-size: 0.8rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
        padding: 10px 12px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        display: flex !important;
        align-items: center !important;
    }

    /* IMPORTANT: Force-hide noise */
    .bento-cell-windows,
    .bento-card .cell-visual:not(:first-child):not(:last-child) {
        display: none !important;
    }

    /* FIX: Eliminate the bluish background artifact (Section Shadow) */
    section::after {
        display: none !important;
        opacity: 0 !important;
        height: 0 !important;
        pointer-events: none !important;
    }
}
