/* ============================================
   📱 MELLSTROY MOBILE ADAPTATION
   Точная адаптация мобильной версии под Mellstroy
   Применяется для мобильных и планшетов (max-width: 1023px)
   ============================================ */

@media (max-width: 1023px) {
    
    /* ===== КАТЕГОРИИ (ЧИПСЫ) - HORIZONTAL SCROLL ПОСЛЕ SEARCH ===== */
    .home-filter-bar,
    .filter-chips-container,
    .categories-scroll {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 16px 12px 16px !important; /* ТОЧНО как у Mellstroy */
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        order: -1 !important; /* Показываем ВТОРЫМИ (после search) */
    }
    
    .home-filter-bar::-webkit-scrollbar,
    .filter-chips-container::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Чипсы категорий - ТОЧНЫЕ СТИЛИ MELLSTROY */
    .filter-chip,
    .category-button,
    .filter-btn,
    .home-filter-bar .filter-item {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important; /* Чуть больше gap */
        padding: 10px 16px !important; /* Больше padding как у Mellstroy */
        border-radius: 24px !important; /* Более круглые */
        background: rgba(43, 34, 64, 0.5) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 14px !important; /* Чуть больше шрифт */
        font-weight: 600 !important; /* Более жирный */
        color: rgba(255, 255, 255, 0.7) !important;
        transition: all 0.2s ease !important;
    }
    
    .filter-chip.active,
    .category-button.active,
    .filter-btn.active {
        background: rgba(138, 75, 185, 0.8) !important;
        border-color: rgba(138, 75, 185, 1) !important;
        color: #ffffff !important;
    }
    
    /* Иконки в чипсах */
    .filter-chip img,
    .category-button img {
        width: 16px !important;
        height: 16px !important;
        object-fit: contain !important;
    }
    
    /* ===== СЕКЦИИ СЛОТОВ ===== */
    .home-slots-section {
        padding: 0 16px 20px 16px !important; /* ТОЧНО как у Mellstroy */
        margin: 0 !important;
    }
    
    .slots-row-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
    }
    
    /* Заголовок секции */
    .home-slots-section__header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 12px !important;
        padding: 0 !important;
    }
    
    .home-slots-section__header h3,
    .home-slots-section h3 {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        margin: 0 !important;
    }
    
    /* Кнопка "View all" */
    .view-all-button,
    .section-view-all {
        font-size: 14px !important;
        font-weight: 500 !important;
        color: rgba(255, 255, 255, 0.6) !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    
    .view-all-button:after {
        content: ">" !important;
        font-size: 16px !important;
    }
    
    /* HORIZONTAL SCROLL СЛОТОВ - ТОЧНЫЕ РАЗМЕРЫ MELLSTROY */
    .home-slots-section .slots-row-wrapper .slots-row,
    .home-slots-section .slots-row,
    div.slots-row,
    .slots-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important; /* ТОЧНО как у Mellstroy */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 12px 0px !important; /* ТОЧНО как у Mellstroy */
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        grid-template-columns: none !important; /* Убираем grid */
    }
    
    .slots-row::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Карточка слота - ТОЧНЫЕ РАЗМЕРЫ MELLSTROY (3:4 пропорция) */
    .slots_game,
    a.slots_game {
        position: relative !important;
        flex: 0 0 106px !important; /* ТОЧНАЯ ширина Mellstroy */
        width: 106px !important;
        min-width: 106px !important;
        height: 141px !important; /* ТОЧНАЯ высота Mellstroy (3:4) */
        border-radius: 12px !important; /* Скругленные углы как у Mellstroy */
        overflow: hidden !important;
        background: transparent !important;
        cursor: pointer !important;
        transition: transform 0.2s ease !important;
        flex-shrink: 0 !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .slots_game:active,
    a.slots_game:active {
        transform: scale(0.95) !important;
    }
    
    /* Картинка слота - ТОЧНО как у Mellstroy */
    .slots_game img,
    a.slots_game img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        border-radius: 12px !important; /* ТОЧНО как у Mellstroy */
    }
    
    /* Название игры (если есть) */
    .game-name,
    .slot-name {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 8px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
        color: #ffffff !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    
    /* ===== КНОПКА "VIEW ALL X GAMES" - В КОНЦЕ СПИСКА ===== */
    .view-all-games-button {
        flex: 0 0 120px !important;
        width: 120px !important;
        height: 120px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px !important;
        border-radius: 10px !important;
        background: rgba(43, 34, 64, 0.4) !important;
        border: 1px dashed rgba(255, 255, 255, 0.2) !important;
        color: rgba(255, 255, 255, 0.7) !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        flex-shrink: 0 !important;
    }
    
    .view-all-games-button:hover,
    .view-all-games-button:active {
        background: rgba(53, 44, 74, 0.6) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
        color: #ffffff !important;
    }
    
    .view-all-games-button__text {
        font-size: 12px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    
    .view-all-games-button__count {
        font-size: 11px !important;
        opacity: 0.7 !important;
        margin-top: 4px !important;
    }
    
    /* ===== ОТСТУПЫ МЕЖДУ СЕКЦИЯМИ ===== */
    .home-slots-section + .home-slots-section {
        margin-top: 24px !important;
    }
    
    /* Убираем стрелки навигации на мобильных */
    .slots-nav,
    .slots-nav--prev,
    .slots-nav--next {
        display: none !important;
    }
    
    /* ===== SEARCH И PROVIDERS - ПРАВИЛЬНЫЕ КЛАССЫ ===== */
    .home-filter-bar__row {
        display: flex !important;
        gap: 8px !important;
        padding: 12px 16px 8px 16px !important; /* ТОЧНО как у Mellstroy */
        order: -2 !important; /* Показываем ПЕРВЫМИ */
    }
    
    .home-filter-bar__search {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        background: rgba(43, 34, 64, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
    }
    
    .home-filter-bar__search input {
        flex: 1 !important;
        background: transparent !important;
        border: none !important;
        color: #ffffff !important;
        font-size: 14px !important;
        outline: none !important;
    }
    
    .home-filter-bar__search input::placeholder {
        color: rgba(255, 255, 255, 0.4) !important;
    }
    
    .home-filter-bar__right button {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 10px 14px !important;
        background: rgba(43, 34, 64, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 14px !important;
        white-space: nowrap !important;
        cursor: pointer !important;
    }
    
    /* ===== JACKPOT SECTION (если есть) ===== */
    .jackpot-section {
        padding: 0 15px 20px 15px !important;
    }
    
    .jackpot-banner {
        background: linear-gradient(135deg, rgba(138, 75, 185, 0.6), rgba(88, 45, 145, 0.6)) !important;
        border-radius: 16px !important;
        padding: 20px !important;
        margin-bottom: 16px !important;
        text-align: center !important;
    }
    
    .jackpot-amount {
        font-size: 32px !important;
        font-weight: 900 !important;
        color: #FFD700 !important;
        text-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    }
    
    /* Jackpot games - horizontal scroll */
    .jackpot-games {
        display: flex !important;
        gap: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 12px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    
    .jackpot-games::-webkit-scrollbar {
        display: none !important;
    }
    
    .jackpot-game {
        flex: 0 0 140px !important;
        width: 140px !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }
    
    .jackpot-game img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* ===== ПОРЯДОК ЭЛЕМЕНТОВ ===== */
    /* Устанавливаем правильный порядок: Search → Чипсы → Слоты */
    .home-slots-sections,
    .games-sections-container {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ============================================
   LARGER SCREENS WITHIN MOBILE (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    /* На больших мобильных/планшетах - слоты чуть больше */
    .slots_game,
    a.slots_game {
        flex: 0 0 140px !important;
        width: 140px !important;
        height: 187px !important; /* Сохраняем пропорцию 3:4 */
    }
    
    .home-slots-section {
        padding: 0 20px 24px 20px !important;
    }
    
    .home-filter-bar__row {
        padding: 12px 20px 8px 20px !important;
    }
    
    .home-filter-bar {
        padding: 8px 20px 12px 20px !important;
    }
    
    /* Чипсы и кнопки чуть больше */
    .filter-chip,
    .category-button,
    .filter-btn {
        padding: 11px 18px !important;
        font-size: 15px !important;
    }
}
