/* ========================================
   MOBILE STYLES - CONSOLIDATED
   All mobile styles in ONE place
   ======================================== */

#mobileModeSelectorOnlyShowOnMobile,
#sportsSportsbookVsExchange {
    display: none !important;
}

@media (max-width: 768px) {
    /* HIDE DESKTOP */
    .desktop-header,
    .desktop-sidebar {
        display: none !important;
    }
       /* Casino/Sports Mode Selector - Force no scroll */
    body:has(#mobileModeSelectorOnlyShowOnMobile:not(.hidden)) {
        overflow: hidden !important;
    }
    
    #mobileModeSelectorOnlyShowOnMobile {
        position: fixed !important;
        top: 60px !important;
        bottom: 65px !important;
        left: 0 !important;
        right: 0 !important;
        padding: 20px !important;
        gap: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow: hidden !important;
        margin: 0 !important;
        max-width: none !important;
        z-index: 100 !important;
    }
    /* Sports Sub-Selector - Same layout as Casino/Sports */
    #sportsSportsbookVsExchange {
        position: fixed !important;
        top: 60px !important;
        bottom: 65px !important;
        left: 0 !important;
        right: 0 !important;
        padding: 20px !important;
        gap: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        margin: 0 !important;
        max-width: none !important;
        z-index: 10000 !important;
        background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%) !important;
    }
    
    #sportsSportsbookVsExchange .mode-box {
        flex: 1 !important;
        max-height: calc((100vh - 125px - 40px - 20px) / 2) !important;
        min-height: 0 !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 / 1 !important;
        width: 100% !important;
    }
    /* Hide bottom nav game buttons when on Casino/Sports selector */
    body:has(#mobileModeSelectorOnlyShowOnMobile:not(.hidden)) .casino-nav,
    body:has(#mobileModeSelectorOnlyShowOnMobile:not(.hidden)) .sports-nav {
        display: none !important;
    }
    .mode-box {
        flex: 1 !important;
        max-height: none !important;
        min-height: 0 !important;
    }
    
    .mode-box {
        padding: 30px 15px !important;
        min-height: auto !important;
    }
    
    .mode-icon {
        font-size: 3rem !important;
        margin-bottom: 10px !important;
    }
    
    .mode-title {
        font-size: 1.5rem !important;
        letter-spacing: 2px !important;
    }
    
    .mobile-header {
        display: grid;
        grid-template-columns: 60px 1fr 100px;
        align-items: center;
        height: 100%;
        padding: 0 15px;
        gap: 10px;
        border-bottom: none !important;
    }
    .mobile-header::after,
    header::after {
        display: none !important;
    }
    .mobile-logo {
        font-size: 1.2rem;
        font-weight: bold;
        color: #d4af37;
    }
    
    .mobile-daily-btn {
        background: rgba(26, 26, 36, 0.9);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        color: #d4af37;
        font-size: 1.5rem;
        padding: 8px;
        cursor: pointer;
        max-width: 60px;
    }
    
    .mobile-auth-btns {
        display: flex;
        gap: 8px;
    }
    
    .mobile-auth-btn {
        padding: 6px 12px;
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 6px;
        background: rgba(26, 26, 36, 0.9);
        color: #d4af37;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
    }
    
    .mobile-auth-btn.signup {
        background: linear-gradient(145deg, #c9963a, #b8964f);
        border-color: #d4a574;
        color: #0a0a0a;
    }
  /* Mobile Mode Selector (2-box landing) */
    #mobileModeSelectorOnlyShowOnMobile {
        display: flex !important;
        flex-direction: column;
        gap: 20px;
        padding: 5px 20px 40px 20px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    #mobileModeSelectorOnlyShowOnMobile.hidden {
        display: none !important;
    }
    
    .mode-box {
        position: relative;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border: 2px solid #d4af37;
        border-radius: 16px;
        padding: 40px 20px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .casino-box {
        background-image: url('../images/casino-mode.webp');
    }
    
    .sports-box {
        background-image: url('../images/sports-mode.webp');
    }
    .sportsbook-box {
        background-image: url('../images/sportsbook-mode.webp');
        filter: brightness(1.3);
    }
    
    .exchange-box {
        background-image: url('../images/exchange-mode.webp');
        filter: brightness(1.3);
    }
    
    .mode-box:active {
        transform: scale(0.98);
    }
    
    .mode-icon {
        font-size: 4rem;
        margin-bottom: 15px;
        position: relative;
        z-index: 2;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    }
    
    .mode-title {
        font-size: 1.8rem;
        font-weight: 900;
        letter-spacing: 3px;
        color: #d4af37;
        text-transform: uppercase;
        position: relative;
        z-index: 2;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    }
    
     /* Sports Sub-Selector */
    #sportsSportsbookVsExchange {
        display: flex !important;
        flex-direction: column;
        gap: 20px;
        padding: 5px 20px 40px 20px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    #sportsSportsbookVsExchange:not(.active) {
        display: none !important;
    }
    
    .coming-soon {
        margin-top: 10px;
        font-size: 0.9rem;
        color: rgba(212, 175, 55, 0.6);
        font-style: italic;
    }
    
    /* Hide mode selector when in casino/sports mode */
    .mobile-mode-selector.hidden,
    .sports-sub-selector.hidden {
        display: none !important;
    }
    
    /* Make logo clickable */
    .mobile-logo {
        cursor: pointer;
        user-select: none;
    }
    /* Mobile Carousel */
    .mobile-carousel {
        position: relative;
        height: 60px;
        overflow: visible;
        perspective: 1000px;
    }
    
    .carousel-track {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        transform-style: preserve-3d;
    }
    
    .carousel-item {
        position: absolute;
        width: 50px;
        height: 50px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        border-radius: 50%;
        overflow: hidden;
    }
    
    .carousel-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Left item */
    .carousel-item[data-category="clans"] {
        left: 15%;
        transform: scale(0.65) translateZ(-100px);
        opacity: 0.5;
        z-index: 1;
    }
    
    /* Center active item */
    .carousel-item.active {
        left: 50%;
        transform: translateX(-50%) scale(1) translateZ(0);
        opacity: 1;
        z-index: 3;
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
    }
    
    /* Right item */
    .carousel-item[data-category="pvp"] {
        right: 15%;
        transform: scale(0.65) translateZ(-100px);
        opacity: 0.5;
        z-index: 1;
    }
    
    #mobileBalance {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: rgba(26, 26, 36, 0.9);
        border: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 8px;
        color: #d4af37;
        font-weight: 700;
    }
    
    /* BOTTOM NAV */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(212, 175, 55, 0.2);
        z-index: 9999;
    }
    
    .mobile-bottom-nav .nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: rgba(212, 175, 55, 0.9);
        background: none;
        border: none;
        padding: 8px 4px;
        min-height: 44px;
    }
    
    .mobile-bottom-nav .nav-btn.active {
        color: #fbbf24;
        background: rgba(212, 175, 55, 0.2);
    }
    
    .mobile-bottom-nav .nav-btn span:first-child {
        font-size: 1.4rem;
    }
    
    .mobile-bottom-nav .nav-label {
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
    }
    
   /* HERO SECTION */
    .hero-section {
        display: none !important;
    }
    
    .hero-title {
        font-size: 28px !important;
    }
    
    .hero-cards {
        display: none !important;
    }
    
    .hero-register-btn {
        width: 100%;
        max-width: 250px;
    }
    
    /* GAME ROWS */
    .game-rows-container {
        padding: 20px 0 80px 0;
    }
    
    .row-title {
        display: none;
    }
    
    .game-row.active .row-title {
        display: block;
        font-size: 18px;
        letter-spacing: 2px;
        text-align: center;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 100;
        background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
        padding: 15px 0;
        margin: 0;
    }
    
    .horizontal-scroller .game-card-stake {
        width: 140px;
        min-width: 140px;
    }
    
    /* LAYOUT */
    body {
        padding-top: 60px;
        padding-bottom: 65px;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-bottom: 80px;
    }
    
    .header-tabs {
        display: none;
    }
    
    /* RONIN'S ARMORY - Video optimization */
.reward-video,
.item-reveal-video {
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    object-fit: contain !important;
}

/* Item videos only - NOT door opening videos */
video[src*="cloudinary"]:not([src*="armory-opening"]) {
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    object-fit: contain !important;
}

/* Door opening videos need full height for proper centering */
video[src*="armory-opening"] {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}
    
}
/* Mobile game grid when category selected */
@media (max-width: 768px) {
    /* Hide hero when game section active */
    .hero-section.hide-on-mobile {
        display: none;
    }
    
    /* Hide scroll arrows on mobile */
    .scroll-controls {
        display: none;
    }
    
   /* Convert horizontal scroller to grid on active row */
    .game-row.active .horizontal-scroller {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
        overflow-x: visible;
        width: 100%;
        margin-top: -80px;
        box-sizing: border-box;
    }
    
    /* Make game cards fill grid cell and double height */
    .game-row.active .horizontal-scroller .game-card-stake {
        width: 100%;
        min-width: 100%;
        max-width: none;
        height: 240px;
    }
    
    .game-row.active .horizontal-scroller .game-card-stake .game-image-stake {
        height: 100%;
        object-fit: cover;
    }
}
/* ========================================
   LOOTBOX MOBILE SPACING FIX
   ======================================== */

@media (max-width: 768px) {
    /* Move subtitle up to center it between title and doors */
    #lootboxModal p {
        margin-top: -15px !important;
    }
}
/* ========================================
   MOBILE MENU STYLING
   ======================================== */

@media (max-width: 768px) {
    .mobile-menu-overlay {
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 20000 !important;
    }
    
    .mobile-menu-header {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05)) !important;
        border-bottom: 2px solid #d4af37 !important;
        padding: 20px !important;
    }
    
    .back-btn {
        background: rgba(212, 175, 55, 0.2) !important;
        border: 1px solid #d4af37 !important;
        color: #d4af37 !important;
        padding: 12px 24px !important;
        border-radius: 8px !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
    }
    
    .mobile-menu-content {
        padding: 30px 20px !important;
    }
    
    .mobile-user-info {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05)) !important;
        border: 2px solid #d4af37 !important;
        border-radius: 12px !important;
        padding: 20px !important;
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    .user-name {
        color: #fff !important;
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        margin-bottom: 10px !important;
    }
    
    .user-balance {
        color: #fbbf24 !important;
        font-size: 1.5rem !important;
        font-weight: 800 !important;
    }
    
    .mobile-menu-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .mobile-menu-nav a,
    .mobile-logout-btn {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05)) !important;
        border: 2px solid rgba(212, 175, 55, 0.3) !important;
        border-radius: 12px !important;
        padding: 18px 20px !important;
        color: #d4af37 !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        display: block !important;
        transition: all 0.3s !important;
        text-align: left !important;
    }
    
    .mobile-menu-nav a:active,
    .mobile-logout-btn:active {
        background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.15)) !important;
        border-color: #d4af37 !important;
        transform: scale(0.98) !important;
    }
    
    .mobile-logout-btn {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1)) !important;
        border-color: rgba(239, 68, 68, 0.5) !important;
        color: #ef4444 !important;
        width: 100% !important;
        cursor: pointer !important;
        margin-top: 10px !important;
    }
}
/* ========================================
   HIDE BOTTOM NAV WHEN GAME IS OPEN
   ======================================== */
body.game-open .mobile-bottom-nav {
    display: none !important;
}