/* CONSOLIDATED MOBILE STYLES - COMPREHENSIVE FIXES */
@media only screen and (max-width: 768px) {
    
    /* ARENA SECTION - STANDARDIZED SPACING */
    .arena-section {
        padding: 96px 0 96px !important;
        margin-top: 0 !important;
    }
    
    .arena-section .section-title {
        margin-bottom: 20px !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
    
    .arena-content {
        position: relative !important;
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        border: none !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        display: block !important;
        margin-bottom: 3rem;
    }
    
    /* Remove any pseudo-elements that might add lines */
    .arena-content::after,
    .arena-content::before {
        display: none !important;
    }
    
    .arena-content img.arena-banner,
    .arena-banner {
        width: auto !important;
        min-width: 100% !important;
        height: 300px !important;
        object-fit: contain !important;
        object-position: center !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        display: block !important;
        position: relative !important;
        top: 0 !important;
    }
    
    /* Arena wrapper for proper scrolling */
    .arena-image-wrapper {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        scroll-behavior: smooth !important;
        display: contents !important;
        box-shadow: none !important;
    }
    
    .arena-image-wrapper img {
        width: auto !important;
        min-width: 100% !important;
        height: 300px !important;
        max-width: none !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    /* Arena text - PROPERLY SEPARATED */
    .arena-text,
    p.arena-text {
        margin: 20px 20px 0 20px !important;
        text-align: center !important;
        padding: 0 !important;
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        color: #f4f1eb !important;  /* Match parchment color used in other sections */
        font-size: 1.1rem !important;  /* Match other mobile text sections */
        line-height: 1.6 !important;  /* Consistent with other sections */
    }
    
    /* CASTER CARDS - Single Horizontal Row */
    .casters-section,
    #casters {
        overflow: visible !important;
    }
    
    .casters-grid {
        position: relative !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        scroll-padding-right: 7.5vw !important; /* Ensure proper snap alignment for last card */
        padding: 20px 0 50px !important;
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
        white-space: nowrap !important;
    }
    
    /* Flatten the two-row structure into single row */
    .casters-row,
    .casters-row.bottom {
        display: contents !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }
    
    /* Make cards uniform size and properly spaced */
    .caster-card,
    .caster-card.small,
    .caster-card.large {
        flex: 0 0 85vw !important;
        width: 85vw !important;
        min-width: 85vw !important;
        max-width: 85vw !important;
        height: auto !important;
        aspect-ratio: 3/4 !important;
        margin: 0 2.5vw !important;
        scroll-snap-align: center !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
        pointer-events: auto !important;
        display: block !important;
    }
    
    /* Center first and last cards properly */
    .casters-grid .caster-card:first-child {
        margin-left: 7.5vw !important;
    }
    
    /* Targeted fix for 7th card (Devaedra) only - from bottom row needs extra margin */
    .casters-grid .caster-card:nth-child(7) {
        margin-right: 12.5vw !important; /* Extra margin for proper centering of last card from bottom row */
    }
    
    /* Default margin for last card - but 7th card rule above will override this */
    .casters-grid .caster-card:last-child:not(:nth-child(7)) {
        margin-right: 7.5vw !important; /* Standard margin for other last cards */
    }
    
    /* Fix text on back of card - LARGER SIZES */
    .caster-card .card-back {
        padding: 20px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .caster-card .card-back h3 {
        font-size: 28px !important;
        margin-bottom: 8px !important;
        word-wrap: break-word !important;
        color: #d4af37 !important;
    }
    
    .caster-card .card-back h4 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
        color: #a8c5ff !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
    }
    
    .caster-card .card-back p {
        margin-bottom: 10px !important;
        word-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* Add swipe indicator */
    .casters-grid::after {
        content: '← Swipe for more →' !important;
        position: absolute !important;
        bottom: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        color: #d4af37 !important;
        font-size: 16px !important;
        font-weight: bold !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
        z-index: 10 !important;
        animation: pulse 2s infinite !important;
        pointer-events: none !important;
        white-space: nowrap !important;
    }
    
    /* WHAT'S IN THE BOX - STANDARDIZED SPACING */
    .components-section,
    #components {
        background-image: url('assets/Divine_v3.png') !important;
        background-size: 500% auto !important;
        background-position: center 10% !important;
        background-repeat: no-repeat !important;
        background-attachment: scroll !important;
        padding: 96px 0 96px !important;
    }
    
    .components-section h2,
    #components h2 {
        margin-bottom: 20px !important;
        padding-bottom: 0 !important;
    }
    
    .components-hero {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .components-overlay {
        position: static !important;
        margin: 0 auto 20px !important;
        width: 90% !important;
        max-width: none !important;
        background: rgba(26, 26, 46, 0.95) !important;
        border-radius: 10px !important;
        padding: 20px !important;
        order: 1 !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        transition: all 0.3s ease !important;
    }
    
    .components-overlay h3 {
        margin-top: 0 !important;
        margin-bottom: 15px !important;
    }
    
    .components-overlay .overlay-content {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Fix gap when collapsed */
    .components-overlay.collapsed {
        margin-bottom: 10px !important;
        padding: 10px 20px !important;
    }
    
    .components-overlay.collapsed .overlay-content {
        display: none !important;
    }
    
    .components-showcase {
        order: 2 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        padding: 20px 0 !important;
        scroll-behavior: smooth !important;
    }
    
    .setup-image-large {
        width: auto !important;
        min-width: 100% !important;
        height: auto !important;
        max-width: none !important;
        display: block !important;
        margin: 0 !important;
        transform: scale(1.5) !important;
        transform-origin: center center !important;
    }
    
    /* Fix game components image */
    .components-overlay img,
    .components-showcase img {
        width: auto !important;
        height: 250px !important;
        max-width: none !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
    
    /* VIP BENEFITS - Center artifact */
    .vip-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .vip-left {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 30px !important;
    }
    
    .artifact-card {
        max-width: 250px !important;
        margin: 0 auto !important;
    }
    
    /* WHO WE ARE - Clickable Images */
    .about-visual img, 
    .creator-photo {
        cursor: pointer !important;
        transition: transform 0.3s ease !important;
    }
    
    .about-visual img:hover,
    .creator-photo:hover {
        transform: scale(1.05) !important;
    }
    
    /* Animation keyframes */
    @keyframes pulse {
        0%, 100% { opacity: 0.8; }
        50% { opacity: 0.4; }
    }
    
    .modal-overlay.active .form-input,
    .modal-overlay.active #mc_embed_signup input[type="text"],
    .modal-overlay.active #mc_embed_signup input[type="email"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .modal-form .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .modal-form .form-input {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .footer-form-group {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        gap: 1rem !important;
    }
    
    .footer-form-group .form-input,
    .footer-form-group .footer-submit-btn {
        width: 100% !important;
        grid-column: auto !important;
        grid-row: auto !important;
    }
}