/* ============================================================
   MOOD CATALOG — единый владелец визуала страницы каталога (#pageGames)
   Построен с нуля на токенах mood-theme.css.
   ============================================================ */

#pageGames { padding: 0; }

/* — Hero каталога — */
.games-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-6);
    padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 40px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background:
        radial-gradient(100% 140% at 0% 0%, var(--accent-dim) 0%, transparent 55%),
        radial-gradient(100% 140% at 100% 100%, rgba(200,136,166,0.12) 0%, transparent 55%),
        var(--bg-elevated);
}
.games-hero__bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(120% 100% at 0% 0%, #000 25%, transparent 80%);
    -webkit-mask-image: radial-gradient(120% 100% at 0% 0%, #000 25%, transparent 80%);
    pointer-events: none;
}
.games-hero__inner { position: relative; z-index: 1; max-width: 640px; }
.games-hero__title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.games-hero__lead {
    margin: 0;
    font-size: clamp(0.92rem, 1.6vw, 1.05rem);
    line-height: 1.6;
    color: var(--text-muted);
}
.lobby-catalog-banners { margin-top: var(--space-5); }
.lobby-catalog-banners[hidden] { display: none; }

/* — Панель инструментов: поиск/провайдеры + табы — */
.games-toolbar-panel {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    margin-bottom: var(--space-5);
    padding: var(--space-4) clamp(16px, 4vw, 40px);
    border-radius: var(--radius-lg);
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}
.games-toolbar-actions-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}
/* Поиск и провайдеры — один сегментированный контрол на общей подложке,
   а не две отдельные обведённые пилюли. */
.games-toolbar {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.games-search-btn,
.games-provider-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.games-search-btn:hover,
.games-provider-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}
.games-search-btn-icon,
.games-provider-icon {
    display: inline-flex;
    align-items: center;
    flex: none;
    color: var(--accent);
}
.games-search-btn-icon svg,
.games-provider-icon svg { width: 16px; height: 16px; }
/* Подсказка горячей клавиши поиска — как в рельсе слева */
.games-toolbar-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
}
@media (max-width: 560px) {
    .games-toolbar-kbd { display: none; }
    .games-search-btn,
    .games-provider-btn { padding: 0 11px; }
}
.provider-filter-tags:not(.hidden) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}
/* Выбранные провайдеры: компактные чипсы с логотипом и крестиком */
.provider-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 6px 0 7px;
    border-radius: 9px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.provider-filter-tag:hover { background: var(--accent-glow); border-color: var(--accent); }
.provider-filter-tag-logo,
.provider-filter-tag-logo-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--surface);
    object-fit: contain;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-muted);
}
.provider-filter-tag-logo--broken { display: none; }
.provider-filter-tag-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-filter-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
}
.provider-filter-tag:hover .provider-filter-tag-remove { color: var(--accent); }

/* — Каталог-табы: на широких экранах переносятся по строкам, на узких —
     горизонтальный свайп с затуханием краёв — */
.catalog-tabs-scroll { scrollbar-width: none; }
.catalog-tabs-scroll::-webkit-scrollbar { display: none; }
.catalog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 1023px) {
    .catalog-tabs-scroll {
        overflow-x: auto;
        padding-bottom: 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    }
    .catalog-tabs { flex-wrap: nowrap; }
    .catalog-tabs .catalog-tab { scroll-snap-align: start; }
}
/* Пилюля категории: мягкий прямоугольник без обводки, активная — заливка
   бренд-градиентом. Сознательно не «серая обведённая таблетка». */
.catalog-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition),
                box-shadow var(--transition), transform var(--dur-1) var(--ease-out);
}
.catalog-tab--sm { height: 34px; padding: 0 14px; font-size: 0.82rem; }
.catalog-tab:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
.catalog-tab:active { transform: translateY(1px); }
.catalog-tab.active {
    background: var(--grad-brand);
    border-color: transparent;
    color: var(--btn-primary-text);
    box-shadow: var(--shadow-cta);
}
.catalog-tab.active:hover { filter: brightness(1.05); }

/* Иконка внутри пилюли: и SVG из svgIcon(), и emoji-картинка из админки */
.catalog-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 16px;
    height: 16px;
    opacity: 0.75;
}
.catalog-tab-icon svg { width: 15px; height: 15px; }
.catalog-tab-icon img { width: 15px; height: 15px; object-fit: contain; }
.catalog-tab:hover .catalog-tab-icon { opacity: 1; }
.catalog-tab.active .catalog-tab-icon { opacity: 1; }

/* Бейдж «?» с пояснением категории */
.catalog-tab-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 16px;
    height: 16px;
    margin-left: 1px;
    border-radius: 50%;
    background: var(--border-strong);
    color: var(--text);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    transition: background var(--transition), color var(--transition);
}
.catalog-tab-info:hover { background: var(--accent); color: var(--btn-primary-text); }
.catalog-tab.active .catalog-tab-info {
    background: rgba(0, 0, 0, 0.18);
    color: var(--btn-primary-text);
}
.catalog-tab-info-popover {
    position: absolute;
    z-index: var(--z-toast);
    padding: 10px 13px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

/* — Тематические полосы — */
.games-thematic-strips:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

/* — Сетка каталога — */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}
@media (max-width: 540px) {
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}

/* Скелетон в сетке каталога — слоты участвуют в grid родителя */
.games-grid > .skeleton-grid {
    display: contents;
}

.games-grid .skeleton-slot {
    aspect-ratio: 427 / 575;
    min-height: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
    background-size: 220% 100%;
    animation: mood-home-shimmer 1.25s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .games-grid .skeleton-slot { animation: none; }
}

#gamesCatalogHint { margin: var(--space-6) 0; }

/* — Пустое избранное (Mood engage-card) — */
.games-grid--favorites-empty {
    display: block !important;
}

.mood-favorites-empty {
    position: relative;
    margin: clamp(8px, 2vw, 20px) auto;
    max-width: 640px;
    padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 32px) clamp(22px, 3.5vw, 30px);
    border-radius: 20px;
    border: 1px dashed rgba(68, 235, 213, 0.22);
    background:
        radial-gradient(ellipse 92% 85% at 0% 100%, rgba(68, 235, 213, 0.14) 0%, transparent 56%),
        radial-gradient(ellipse 78% 68% at 100% 0%, rgba(243, 83, 107, 0.1) 0%, transparent 52%),
        linear-gradient(155deg, var(--surface-2) 0%, var(--surface) 100%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    text-align: center;
    overflow: hidden;
}

.mood-favorites-empty__glow {
    position: absolute;
    width: 200px;
    height: 200px;
    left: -64px;
    bottom: -80px;
    border-radius: 50%;
    border: 2px solid rgba(68, 235, 213, 0.18);
    box-shadow: 0 0 0 22px rgba(68, 235, 213, 0.05);
    pointer-events: none;
}

.mood-favorites-empty__visual {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.mood-favorites-empty__face {
    display: block;
    width: 72px;
    height: 72px;
}

.mood-favorites-empty__face svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mood-favorites-empty__heart-ring {
    position: absolute;
    right: -6px;
    bottom: -2px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #f3536b;
    background: rgba(243, 83, 107, 0.16);
    border: 1px solid rgba(243, 83, 107, 0.35);
    box-shadow: 0 4px 14px rgba(243, 83, 107, 0.25);
    animation: mood-fav-heart-pulse 2.4s ease-in-out infinite;
}

.mood-favorites-empty__heart-ring svg {
    width: 15px;
    height: 15px;
}

@keyframes mood-fav-heart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.mood-favorites-empty__badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font: 700 0.62rem/1 var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-mint, #44ebd5);
    background: rgba(68, 235, 213, 0.1);
    border: 1px solid rgba(68, 235, 213, 0.28);
}

.mood-favorites-empty__title {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    font: 700 clamp(1.25rem, 3vw, 1.55rem)/1.2 var(--font-sans);
    color: var(--text);
}

.mood-favorites-empty__lead {
    position: relative;
    z-index: 1;
    margin: 0 auto 18px;
    max-width: 46ch;
    font-size: clamp(0.88rem, 2vw, 0.95rem);
    line-height: 1.55;
    color: var(--text-muted, rgba(255, 255, 255, 0.62));
}

.mood-favorites-empty__lead strong {
    color: var(--c-mint, #44ebd5);
    font-weight: 700;
}

.mood-favorites-empty__steps {
    position: relative;
    z-index: 1;
    margin: 0 auto 22px;
    padding: 0;
    list-style: none;
    max-width: 38ch;
    text-align: left;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-muted, rgba(255, 255, 255, 0.58));
    counter-reset: mood-fav-step;
}

.mood-favorites-empty__steps li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
    counter-increment: mood-fav-step;
}

.mood-favorites-empty__steps li::before {
    content: counter(mood-fav-step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 0.68rem/1 var(--font-sans);
    color: var(--c-mint, #44ebd5);
    background: rgba(68, 235, 213, 0.12);
    border: 1px solid rgba(68, 235, 213, 0.28);
}

.mood-favorites-empty__heart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35em;
    padding: 0 0.2em;
    border-radius: 6px;
    font-size: 0.95em;
    color: #f3536b;
    background: rgba(243, 83, 107, 0.14);
    border: 1px solid rgba(243, 83, 107, 0.3);
    vertical-align: baseline;
}

.mood-favorites-empty__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.mood-favorites-empty__cta {
    appearance: none;
    cursor: pointer;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: 600 0.84rem/1 var(--font-sans);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.mood-favorites-empty__cta:hover {
    background: var(--surface-3);
    border-color: rgba(68, 235, 213, 0.35);
}

.mood-favorites-empty__cta--primary {
    color: #0a1a1f;
    background: linear-gradient(135deg, #44ebd5 0%, #3dd4c0 100%);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(68, 235, 213, 0.28);
}

.mood-favorites-empty__cta--primary:hover {
    background: linear-gradient(135deg, #52f0db 0%, #44ebd5 100%);
    border-color: transparent;
    transform: translateY(-1px);
}

.mood-favorites-empty--compact {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    max-width: none;
    padding: 14px 16px;
    border-radius: 14px;
    text-align: left;
    border-style: solid;
    border-color: rgba(68, 235, 213, 0.16);
}

.mood-favorites-empty__face--compact {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
}

.mood-favorites-empty__compact-text {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted, rgba(255, 255, 255, 0.62));
}

.mood-favorites-empty__compact-text strong {
    color: var(--c-mint, #44ebd5);
}

@media (prefers-reduced-motion: reduce) {
    .mood-favorites-empty__heart-ring { animation: none; }
    .mood-favorites-empty__cta--primary:hover { transform: none; }
}

/* — SEO/FAQ обёртка каталога (переиспользует home-seo/home-faq стили из mood-home.css) — */
.games-catalog-seo-wrap:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-7);
}

/* Портретный каталог слотов (427:575) — data-slot-catalog-layout из /api/casino/settings */
html[data-slot-catalog-layout="portrait"] .games-grid.games-grid--pinko,
html[data-slot-catalog-layout="portrait"] .home-slots-grid.games-grid--pinko,
html[data-slot-catalog-layout="portrait"] .games-grid.games-grid--slots.games-grid--pinko {
    grid-template-columns: repeat(var(--icons-per-row, 12), minmax(0, 1fr)) !important;
    gap: 10px !important;
}

@media (max-width: 767.98px) {
    html[data-slot-catalog-layout="portrait"] .games-grid.games-grid--pinko,
    html[data-slot-catalog-layout="portrait"] .home-slots-grid.games-grid--pinko,
    html[data-slot-catalog-layout="portrait"] .games-grid.games-grid--slots.games-grid--pinko,
    .games-grid.games-grid--pinko,
    .home-slots-grid.games-grid--pinko,
    .games-grid.games-grid--slots.games-grid--pinko {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    #gamesCatalogList.skeleton-grid,
    #gamesCatalogList .skeleton-grid,
    .games-grid .skeleton-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
