@media (max-width:640px) {
    .btn-hamburger, .btn-search-mobile {
        display:block!important;
    }
    
     #recently-played {
        display: none !important;
    }
    
    .search-bar {
        display: none!important
    }
    
    .container {
        padding: 5px 0;
    }
    
     .games-scroll-row {
        gap: 4px; /* Reduce gap between cards */
    }
    
    .game-card {
        flex: 0 0 120px; /* Smaller width */
        height: 115px; /* Smaller height */
    }
    
    .section-title {
        padding-left:20px;
        font-size: 20px
    }
    
    .view-all {
        padding-right: 10px;
    }
    
    header {
        padding: 0 10px!important;
    }
    
    
    
    
    
    .game-title-overlay {
        font-size: 11px!important; /* Smaller font */
        padding: 5px; /* Less padding */
        
  }
    .featured-grid {
        
        grid-template-columns: repeat(3, auto)
    }
    
    .categories-scroll-container {
        gap: 3px;
    }
    
    /* Category item sizing */
    .category-item {
        flex: 0 0 110px !important;  /* Width */
        min-height: 110px !important; /* Height */
        max-width: 110px !important;
        padding: 8px !important;
    }
    
    /* Text adjustments */
    .category-item span:not(.category-icon) {
        font-size: 0.8em !important;
        line-height: 1.2;
    }
    
    /* Background image items */
    .category-item[style*="background-image"] {
        padding: 3px !important;
    }
    
    /* Icons in category items */
    .category-item .category-icon {
        font-size: 1.5rem !important;
        margin-bottom: 5px !important;
    }
    
    /* Scroll arrows */
    .scroll-arrow {
        font-size: 1.8em !important;
        opacity: 0.7;
    }
    
    
}

@media (max-width:400px) {
     .game-card {
        flex: 0 0 100px; /* Smaller width */
        height: 100px; /* Smaller height */
    }
    
    .section-header h2{
        font-size: 20px!important
    }
    
    .categories-scroll-container {
        gap: 2px;
        padding: 5px 0;
    }
    
    .section-title {
        padding-left:14px;
        font-size: 20px
    }

    /* Ultra-compact cards */
    .category-item {
        flex: 0 0 80px !important;    /* Width */
        min-height: 80px !important;  /* Height */
        max-width: 80px !important;
        padding: 4px !important;
        border-radius: 6px !important;
        outline-width: 1px !important;
    }

    /* Tiny text for category names */
    .category-item span:not(.category-icon) {
        font-size: 0.7em !important;
        line-height: 1.1;
        font-weight: 600;
    }

    /* Micro icons */
    .category-item .category-icon {
        font-size: 1.2rem !important;
        margin-bottom: 3px !important;
    }

    /* Background image adjustments */
    .category-item[style*="background-image"] {
        padding: 2px !important;
    }

    /* Smaller scroll arrows */
    .scroll-arrow {
        font-size: 1.5em !important;
        width: 25px !important;
    }
    
    
}
@media (min-width: 640px) {
    
    
    .search-modal {
        display: none;
    }   
    
}

@media (min-width: 350px) {
    .mobile-menu {
        width: 280px;

    }
}

/* Mobile styles (640px and below) */
@media (max-width: 640px) {
    .desktop-recently-played {
        display: none !important;
    }
}

@media (max-width: 320px) {
    .category-item {
        flex: 0 0 70px !important;
        min-height: 70px !important;
    }
    .category-item span:not(.category-icon) {
        font-size: 0.65em !important;
    }
}