/* =========================================================
   games-archive.css — стили архива игр и страниц конкурсов.

   Шаблоны: taxonomy-festival.php, archive-games.php.
   Подключается из header.php только на этих страницах.

   ВАЖНО: все селекторы префиксованы через
   body.tax-festival / body.post-type-archive-games, чтобы пробить
   admin-theme.css `html body.admin-theme-dark *[class]` правила
   с одинаковой и большей специфичностью.

   Зависимости: переменные --igp-* из css/home/home.css.
   ========================================================= */

/* ---------- Шапка-плашка конкурса ---------- */
body.tax-festival .lozung,
body.post-type-archive-games .lozung {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    background: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    color: var(--igp-on-accent);
    border-radius: 14px;
    padding: 18px 28px;
    margin: 0px 0 28px;
    text-align: left;
    text-transform: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body.tax-festival .lozung h1,
body.tax-festival .lozung h2,
body.post-type-archive-games .lozung h1,
body.post-type-archive-games .lozung h2 {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 22px;
    line-height: 120%;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--igp-on-accent);
    flex: 1 1 auto;
}
body.tax-festival .lozung h1 strong,
body.tax-festival .lozung h2 strong,
body.post-type-archive-games .lozung h1 strong,
body.post-type-archive-games .lozung h2 strong {
    font-family: inherit;
    font-weight: 700;
    font-size: inherit;
    color: inherit;
    text-transform: inherit;
}
body.tax-festival .lozung .games-count,
body.post-type-archive-games .lozung .games-count {
    position: static !important;
    top: auto;
    right: auto;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--igp-on-accent);
    background: rgba(255, 255, 255, 0.18) !important;
    background-color: rgba(255, 255, 255, 0.18) !important;
    padding: 8px 14px;
    border-radius: 999px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ---------- Двухколоночная раскладка ---------- */
body.tax-festival .sidebar-page,
body.post-type-archive-games .sidebar-page {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    padding: 0 0 60px;
}
body.tax-festival .sidebar-page .games-sidebar,
body.post-type-archive-games .sidebar-page .games-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    background: transparent !important;
    background-color: transparent !important;
}

/* ---------- Сетка карточек ---------- */
body.tax-festival .sidebar-page .games-grid,
body.post-type-archive-games .sidebar-page .games-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
}
body.tax-festival .sidebar-page .games-grid .game-item,
body.post-type-archive-games .sidebar-page .games-grid .game-item {
    flex: 0 1 calc((100% - 24px) / 2);
    max-width: calc((100% - 24px) / 2);
    width: auto;
}

/* ---------- Карточка игры ----------
   Префикс `#main` обязателен: admin-theme.css имеет правило
   `html body.admin-theme-dark div[class]:not(...)` с 15+ :not()-аргументами,
   что даёт специфичность ~ (0,0,18,3) и transparent !important.
   ID `#main` поднимает нашу специфичность до (0,1,4,1) — гарантированно бьёт. */
body.tax-festival #main .game-item,
body.post-type-archive-games #main .game-item {
    position: relative;
    display: flex !important;
    flex-direction: column;
    background: var(--igp-bg-card, #ffffff) !important;
    background-color: var(--igp-bg-card, #ffffff) !important;
    color: var(--igp-text, #1a1a1a);
    border: 1px solid var(--igp-border-primary, #ececec);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
body.tax-festival #main .game-item:hover,
body.post-type-archive-games #main .game-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--igp-shadow-color);
    border-color: var(--igp-accent, #c23016);
}

/* Ссылка-обёртка вокруг обложки/заголовка/excerpt */
body.tax-festival #main .game-item > a,
body.post-type-archive-games #main .game-item > a {
    display: flex !important;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    flex: 1 1 auto;
}

/* ---------- Обложка ---------- */
body.tax-festival #main .game-item .game-item-thumb,
body.post-type-archive-games #main .game-item .game-item-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    background-color: var(--igp-bg-tertiary, #f3f3f3) !important;
    border-radius: 0;
    overflow: hidden;
    flex: 0 0 auto;
}
/* Иконка-плейсхолдер изображения по центру */
body.tax-festival #main .game-item .game-item-thumb::before,
body.post-type-archive-games #main .game-item .game-item-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 48px;
    height: 48px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c0c0c0'><path d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2zM8.5 13.5l2.5 3 3.5-4.5L19 18H5l3.5-4.5zM7 9.5A1.5 1.5 0 1 1 8.5 11 1.5 1.5 0 0 1 7 9.5z'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .6;
    transition: opacity .2s ease;
    pointer-events: none;
}
/* Shimmer */
body.tax-festival #main .game-item .game-item-thumb::after,
body.post-type-archive-games #main .game-item .game-item-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%);
    transform: translateX(-100%);
    animation: gameThumbShimmer 1.4s infinite;
    pointer-events: none;
}
@keyframes gameThumbShimmer {
    100% { transform: translateX(100%); }
}
/* Картинка поверх скелетона */
body.tax-festival #main .game-item .game-item-thumb__img,
body.post-type-archive-games #main .game-item .game-item-thumb__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 1;
}
body.tax-festival #main .game-item .game-item-thumb.is-loaded::before,
body.tax-festival #main .game-item .game-item-thumb.is-loaded::after,
body.post-type-archive-games #main .game-item .game-item-thumb.is-loaded::before,
body.post-type-archive-games #main .game-item .game-item-thumb.is-loaded::after {
    display: none;
}
body.tax-festival #main .game-item .game-item-thumb.is-loaded .game-item-thumb__img,
body.post-type-archive-games #main .game-item .game-item-thumb.is-loaded .game-item-thumb__img {
    opacity: 1;
}

/* ---------- Заголовок и описание ---------- */
body.tax-festival #main .game-item .game-item-title,
body.post-type-archive-games #main .game-item .game-item-title {
    margin: 0;
    padding: 16px 18px 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--igp-text, #1a1a1a);
    letter-spacing: 0.01em;
    text-shadow: none !important;
}

body.tax-festival #main .game-item .game-item-excerpt,
body.post-type-archive-games #main .game-item .game-item-excerpt {
    margin: 0;
    padding: 0 18px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--igp-text-muted, #595959);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
    height: calc(1.45em * 3);
    max-height: calc(1.45em * 3);
    word-break: break-word;
    text-shadow: none !important;
}

/* ---------- Ряд кнопок (трейлер / геймплей) ---------- */
body.tax-festival #main .game-item .flex-row,
body.post-type-archive-games #main .game-item .flex-row {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    height: auto;
    margin: 14px 0 0 0;
    padding: 0 18px 18px;
    flex: 0 0 auto;
    background: transparent !important;
    background-color: transparent !important;
}
body.tax-festival #main .game-item .flex-row:empty,
body.post-type-archive-games #main .game-item .flex-row:empty {
    display: none !important;
}

/* ---------- Pill-кнопки трейлер / геймплей ---------- */
body.tax-festival #main .game-item .trailer-btn,
body.tax-festival #main .game-item .gameplay-btn,
body.post-type-archive-games #main .game-item .trailer-btn,
body.post-type-archive-games #main .game-item .gameplay-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: auto !important;
    padding: 9px 16px 9px 13px !important;
    background: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    background-image: none !important;
    color: var(--igp-on-accent) !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background .18s ease, transform .15s ease !important;
    box-shadow: 0 2px 6px var(--igp-shadow-color) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}
body.tax-festival #main .game-item .trailer-btn:hover,
body.tax-festival #main .game-item .gameplay-btn:hover,
body.post-type-archive-games #main .game-item .trailer-btn:hover,
body.post-type-archive-games #main .game-item .gameplay-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    color: var(--igp-on-accent) !important;
    text-decoration: none !important;
}
body.tax-festival #main .game-item .trailer-btn::before,
body.tax-festival #main .game-item .gameplay-btn::before,
body.post-type-archive-games #main .game-item .trailer-btn::before,
body.post-type-archive-games #main .game-item .gameplay-btn::before {
    content: '' !important;
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    flex: 0 0 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
}
body.tax-festival #main .game-item .trailer-btn::before,
body.post-type-archive-games #main .game-item .trailer-btn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path fill='%23ffffff' stroke='none' d='M10 8.5v7l6-3.5z'/></svg>") !important;
}
body.tax-festival #main .game-item .gameplay-btn::before,
body.post-type-archive-games #main .game-item .gameplay-btn::before {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 12h4M8 10v4'/><circle cx='15' cy='13' r='1' fill='%23ffffff'/><circle cx='17.5' cy='11' r='1' fill='%23ffffff'/><path d='M17.32 5H6.68a4 4 0 0 0-3.978 3.59l-.92 9A2 2 0 0 0 3.766 20a2 2 0 0 0 1.71-.962L7.83 15.5h8.34l2.354 3.538A2 2 0 0 0 20.234 20a2 2 0 0 0 1.984-2.41l-.92-9A4 4 0 0 0 17.32 5z'/></svg>") !important;
}

/* Бейдж «оценено» */
body.tax-festival #main .game-item.rated::after,
body.post-type-archive-games #main .game-item.rated::after {
    content: 'оценено';
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.65) !important;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 10px;
    border-radius: 999px;
    pointer-events: none;
}

/* Грид во время загрузки */
body.tax-festival .games-grid.is-loading,
body.post-type-archive-games .games-grid.is-loading {
    opacity: .6;
    transition: opacity .15s ease;
}

/* ---------- Тёмная тема: карточка ---------- */
body.tax-festival.admin-theme-dark #main .game-item,
body.post-type-archive-games.admin-theme-dark #main .game-item,
html[data-theme="dark"] body.tax-festival #main .game-item,
html[data-theme="dark"] body.post-type-archive-games #main .game-item {
    background: var(--igp-bg-card, #242424) !important;
    background-color: var(--igp-bg-card, #242424) !important;
    border-color: var(--igp-border-primary, #3a3a3a) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
body.tax-festival.admin-theme-dark #main .game-item:hover,
body.post-type-archive-games.admin-theme-dark #main .game-item:hover,
html[data-theme="dark"] body.tax-festival #main .game-item:hover,
html[data-theme="dark"] body.post-type-archive-games #main .game-item:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    border-color: var(--igp-accent, #c23016) !important;
}
body.tax-festival.admin-theme-dark #main .game-item .game-item-title,
body.post-type-archive-games.admin-theme-dark #main .game-item .game-item-title,
html[data-theme="dark"] body.tax-festival #main .game-item .game-item-title,
html[data-theme="dark"] body.post-type-archive-games #main .game-item .game-item-title {
    color: var(--igp-text-primary, #f3f3f3) !important;
}
body.tax-festival.admin-theme-dark #main .game-item .game-item-excerpt,
body.post-type-archive-games.admin-theme-dark #main .game-item .game-item-excerpt,
html[data-theme="dark"] body.tax-festival #main .game-item .game-item-excerpt,
html[data-theme="dark"] body.post-type-archive-games #main .game-item .game-item-excerpt {
    color: var(--igp-text-muted, #aaaaaa) !important;
}
body.tax-festival.admin-theme-dark #main .game-item .game-item-thumb,
body.post-type-archive-games.admin-theme-dark #main .game-item .game-item-thumb,
html[data-theme="dark"] body.tax-festival #main .game-item .game-item-thumb,
html[data-theme="dark"] body.post-type-archive-games #main .game-item .game-item-thumb {
    background-color: var(--igp-bg-tertiary, #2a2a2a) !important;
}
body.tax-festival.admin-theme-dark #main .game-item .game-item-thumb::before,
body.post-type-archive-games.admin-theme-dark #main .game-item .game-item-thumb::before,
html[data-theme="dark"] body.tax-festival #main .game-item .game-item-thumb::before,
html[data-theme="dark"] body.post-type-archive-games #main .game-item .game-item-thumb::before {
    opacity: .35;
}
body.tax-festival.admin-theme-dark #main .game-item .game-item-thumb::after,
body.post-type-archive-games.admin-theme-dark #main .game-item .game-item-thumb::after,
html[data-theme="dark"] body.tax-festival #main .game-item .game-item-thumb::after,
html[data-theme="dark"] body.post-type-archive-games #main .game-item .game-item-thumb::after {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0) 100%) !important;
}

/* =========================================================
   Фильтр игр (.igp-gf).
   ========================================================= */

/* Кнопка-тогглер фильтра (только на мобильном) */
body.tax-festival .igp-gf-toggle,
body.post-type-archive-games .igp-gf-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 12px 18px;
    background: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    color: var(--igp-on-accent) !important;
    border: 0;
    border-radius: 999px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
body.tax-festival .igp-gf-toggle__icon,
body.post-type-archive-games .igp-gf-toggle__icon {
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Карточка-форма фильтра */
body.tax-festival .igp-gf,
body.post-type-archive-games .igp-gf {
    display: flex !important;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    background: var(--igp-bg-card, #ffffff) !important;
    background-color: var(--igp-bg-card, #ffffff) !important;
    border: 1px solid var(--igp-border-primary, #ececec);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--igp-text, #1a1a1a);
}
body.tax-festival .igp-gf.is-loading,
body.post-type-archive-games .igp-gf.is-loading {
    opacity: .85;
    pointer-events: none;
}

body.tax-festival .igp-gf__field,
body.post-type-archive-games .igp-gf__field {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
}
body.tax-festival .igp-gf__label,
body.post-type-archive-games .igp-gf__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding-left: 0 !important;
    text-transform: uppercase;
    color: var(--igp-text-muted, #6b6b6b);
}

/* Поле поиска */
body.tax-festival .igp-gf__search-wrap,
body.post-type-archive-games .igp-gf__search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
body.tax-festival .igp-gf__search-icon,
body.post-type-archive-games .igp-gf__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a8a8a'><path d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    background-color: transparent;
    pointer-events: none;
    z-index: 1;
}
body.tax-festival .igp-gf__input,
body.post-type-archive-games .igp-gf__input {
    width: 100% !important;
    height: 40px !important;
    padding: 0 14px 0 38px !important;
    background: var(--igp-bg-tertiary, #f5f5f5) !important;
    background-color: var(--igp-bg-tertiary, #f5f5f5) !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: var(--igp-text, #1a1a1a) !important;
    transition: border-color .15s ease, background .15s ease;
    box-shadow: none !important;
}
body.tax-festival .igp-gf__input::placeholder,
body.post-type-archive-games .igp-gf__input::placeholder {
    color: var(--igp-text-muted, #8a8a8a);
}
body.tax-festival .igp-gf__input:focus,
body.post-type-archive-games .igp-gf__input:focus {
    outline: none;
    border-color: var(--igp-accent, #c23016) !important;
    background: var(--igp-bg-card, #fff) !important;
    background-color: var(--igp-bg-card, #fff) !important;
}

/* Списки radio / checkbox */
body.tax-festival .igp-gf__radios,
body.tax-festival .igp-gf__checks,
body.post-type-archive-games .igp-gf__radios,
body.post-type-archive-games .igp-gf__checks {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    background: transparent !important;
    background-color: transparent !important;
}
body.tax-festival .igp-gf__radios li,
body.tax-festival .igp-gf__checks li,
body.post-type-archive-games .igp-gf__radios li,
body.post-type-archive-games .igp-gf__checks li {
    margin: 0;
    padding: 0;
    background: transparent !important;
}
body.tax-festival .igp-gf__radios input,
body.tax-festival .igp-gf__checks input,
body.post-type-archive-games .igp-gf__radios input,
body.post-type-archive-games .igp-gf__checks input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}
body.tax-festival .igp-gf__radios label,
body.tax-festival .igp-gf__checks label,
body.post-type-archive-games .igp-gf__radios label,
body.post-type-archive-games .igp-gf__checks label {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 8px 8px 8px 35px !important;
    position: relative;
    font-size: 14px;
    line-height: 1.3;
    color: var(--igp-text, #1a1a1a);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    background: transparent !important;
    background-color: transparent !important;
}
body.tax-festival .igp-gf__radios label:hover,
body.tax-festival .igp-gf__checks label:hover,
body.post-type-archive-games .igp-gf__radios label:hover,
body.post-type-archive-games .igp-gf__checks label:hover {
    background: var(--igp-bg-tertiary, #f5f5f5) !important;
    background-color: var(--igp-bg-tertiary, #f5f5f5) !important;
}

/* Кастомный radio */
body.tax-festival #games-sidebar .igp-gf__radios label::before,
body.post-type-archive-games #games-sidebar .igp-gf__radios label::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    right: auto;
    transform: translateY(-50%);
    width: 16px !important;
    height: 16px !important;
    border-radius: 50%;
    border: 2px solid var(--igp-border-primary, #cfcfcf);
    background: var(--igp-bg-card, #fff) !important;
    background-color: var(--igp-bg-card, #fff) !important;
    background-image: none !important;
    box-shadow: none !important;
    transition: border-color .15s ease, background .15s ease;
}
body.tax-festival #games-sidebar .igp-gf__radios input:checked + label::before,
body.post-type-archive-games #games-sidebar .igp-gf__radios input:checked + label::before {
    border-color: var(--igp-accent, #c23016) !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle, var(--igp-accent, #c23016) 0 4px, var(--igp-bg-card, #fff) 5px 100%) !important;
}

/* Кастомный checkbox */
body.tax-festival #games-sidebar .igp-gf__checks label::before,
body.post-type-archive-games #games-sidebar .igp-gf__checks label::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    right: auto;
    transform: translateY(-50%);
    width: 16px !important;
    height: 16px !important;
    border-radius: 4px;
    border: 2px solid var(--igp-border-primary, #cfcfcf);
    background: var(--igp-bg-card, #fff) !important;
    background-color: var(--igp-bg-card, #fff) !important;
    background-image: none !important;
    box-shadow: none !important;
    transition: border-color .15s ease, background .15s ease;
}
body.tax-festival #games-sidebar .igp-gf__checks input:checked + label::before,
body.post-type-archive-games #games-sidebar .igp-gf__checks input:checked + label::before {
    border-color: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") !important;
    background-position: center !important;
    background-size: 12px !important;
    background-repeat: no-repeat !important;
}

body.tax-festival .igp-gf__check-name,
body.post-type-archive-games .igp-gf__check-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Действия (сброс) */
body.tax-festival .igp-gf__actions,
body.post-type-archive-games .igp-gf__actions {
    display: flex !important;
    justify-content: flex-start;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--igp-border-primary, #ececec);
    background: transparent !important;
}
body.tax-festival .igp-gf__reset,
body.post-type-archive-games .igp-gf__reset {
    background: transparent !important;
    background-color: transparent !important;
    border: 0;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--igp-accent, #c23016) !important;
    cursor: pointer;
    transition: opacity .15s ease;
}
body.tax-festival .igp-gf__reset:hover,
body.post-type-archive-games .igp-gf__reset:hover {
    opacity: .8;
}

/* Пагинация */
body.tax-festival .igp-gf__pagination,
body.post-type-archive-games .igp-gf__pagination {
    flex-basis: 100%;
    width: 100%;
    margin: 24px 0 48px;
    display: flex !important;
    justify-content: center;
}
body.tax-festival .igp-gf__pages,
body.post-type-archive-games .igp-gf__pages {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
}
body.tax-festival .igp-gf__pages li,
body.post-type-archive-games .igp-gf__pages li {
    margin: 0;
}
body.tax-festival .igp-gf__pages a,
body.tax-festival .igp-gf__pages span,
body.post-type-archive-games .igp-gf__pages a,
body.post-type-archive-games .igp-gf__pages span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--igp-bg-card, #fff) !important;
    background-color: var(--igp-bg-card, #fff) !important;
    color: var(--igp-text, #1a1a1a) !important;
    border: 1px solid var(--igp-border-primary, #ececec) !important;
    border-radius: 8px !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
body.tax-festival .igp-gf__pages a:hover,
body.post-type-archive-games .igp-gf__pages a:hover {
    border-color: var(--igp-accent, #c23016) !important;
    color: var(--igp-accent, #c23016) !important;
}
body.tax-festival .igp-gf__pages li .current,
body.tax-festival .igp-gf__pages li.is-current a,
body.tax-festival .igp-gf__pages li.is-current span,
body.post-type-archive-games .igp-gf__pages li .current,
body.post-type-archive-games .igp-gf__pages li.is-current a,
body.post-type-archive-games .igp-gf__pages li.is-current span {
    background: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    color: var(--igp-on-accent) !important;
    border-color: var(--igp-accent, #c23016) !important;
    pointer-events: none;
}

/* Пустое состояние */
body.tax-festival .igp-gf__empty,
body.post-type-archive-games .igp-gf__empty {
    flex: 1 1 100%;
    margin: 24px 0;
    padding: 24px;
    text-align: center;
    background: var(--igp-bg-card, #fff) !important;
    background-color: var(--igp-bg-card, #fff) !important;
    border: 1px solid var(--igp-border-primary, #ececec);
    border-radius: 14px;
    font-size: 18px;
    color: var(--igp-text-muted, #6b6b6b);
}

/* ---------- Тёмная тема: фильтр ---------- */
body.tax-festival.admin-theme-dark .igp-gf,
body.post-type-archive-games.admin-theme-dark .igp-gf,
html[data-theme="dark"] body.tax-festival .igp-gf,
html[data-theme="dark"] body.post-type-archive-games .igp-gf {
    background: var(--igp-bg-card, #242424) !important;
    background-color: var(--igp-bg-card, #242424) !important;
    border-color: var(--igp-border-primary, #3a3a3a) !important;
    color: var(--igp-text-primary, #f3f3f3) !important;
}
body.tax-festival.admin-theme-dark .igp-gf__input,
body.post-type-archive-games.admin-theme-dark .igp-gf__input,
html[data-theme="dark"] body.tax-festival .igp-gf__input,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__input {
    background: var(--igp-bg-tertiary, #2a2a2a) !important;
    background-color: var(--igp-bg-tertiary, #2a2a2a) !important;
    color: var(--igp-text-primary, #f3f3f3) !important;
    border-color: transparent !important;
}
body.tax-festival.admin-theme-dark .igp-gf__input:focus,
body.post-type-archive-games.admin-theme-dark .igp-gf__input:focus,
html[data-theme="dark"] body.tax-festival .igp-gf__input:focus,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__input:focus {
    background: var(--igp-bg-secondary, #222) !important;
    background-color: var(--igp-bg-secondary, #222) !important;
    border-color: var(--igp-accent, #c23016) !important;
}
body.tax-festival.admin-theme-dark .igp-gf__radios label:hover,
body.tax-festival.admin-theme-dark .igp-gf__checks label:hover,
body.post-type-archive-games.admin-theme-dark .igp-gf__radios label:hover,
body.post-type-archive-games.admin-theme-dark .igp-gf__checks label:hover,
html[data-theme="dark"] body.tax-festival .igp-gf__radios label:hover,
html[data-theme="dark"] body.tax-festival .igp-gf__checks label:hover,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__radios label:hover,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__checks label:hover {
    background: var(--igp-bg-tertiary, #2a2a2a) !important;
    background-color: var(--igp-bg-tertiary, #2a2a2a) !important;
}
body.tax-festival.admin-theme-dark #games-sidebar .igp-gf__radios label::before,
body.tax-festival.admin-theme-dark #games-sidebar .igp-gf__checks label::before,
body.post-type-archive-games.admin-theme-dark #games-sidebar .igp-gf__radios label::before,
body.post-type-archive-games.admin-theme-dark #games-sidebar .igp-gf__checks label::before,
html[data-theme="dark"] body.tax-festival #games-sidebar .igp-gf__radios label::before,
html[data-theme="dark"] body.tax-festival #games-sidebar .igp-gf__checks label::before,
html[data-theme="dark"] body.post-type-archive-games #games-sidebar .igp-gf__radios label::before,
html[data-theme="dark"] body.post-type-archive-games #games-sidebar .igp-gf__checks label::before {
    background: var(--igp-bg-secondary, #222) !important;
    background-color: var(--igp-bg-secondary, #222) !important;
    border-color: var(--igp-border-primary, #4a4a4a) !important;
}
body.tax-festival.admin-theme-dark #games-sidebar .igp-gf__radios input:checked + label::before,
body.post-type-archive-games.admin-theme-dark #games-sidebar .igp-gf__radios input:checked + label::before,
html[data-theme="dark"] body.tax-festival #games-sidebar .igp-gf__radios input:checked + label::before,
html[data-theme="dark"] body.post-type-archive-games #games-sidebar .igp-gf__radios input:checked + label::before {
    border-color: var(--igp-accent, #c23016) !important;
    background-color: transparent !important;
    background-image: radial-gradient(circle, var(--igp-accent, #c23016) 0 4px, var(--igp-bg-secondary, #222) 5px 100%) !important;
}
body.tax-festival.admin-theme-dark #games-sidebar .igp-gf__checks input:checked + label::before,
body.post-type-archive-games.admin-theme-dark #games-sidebar .igp-gf__checks input:checked + label::before,
html[data-theme="dark"] body.tax-festival #games-sidebar .igp-gf__checks input:checked + label::before,
html[data-theme="dark"] body.post-type-archive-games #games-sidebar .igp-gf__checks input:checked + label::before {
    border-color: var(--igp-accent, #c23016) !important;
    background-color: var(--igp-accent, #c23016) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") !important;
    background-position: center !important;
    background-size: 12px !important;
    background-repeat: no-repeat !important;
}
body.tax-festival.admin-theme-dark .igp-gf__actions,
body.post-type-archive-games.admin-theme-dark .igp-gf__actions,
html[data-theme="dark"] body.tax-festival .igp-gf__actions,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__actions {
    border-top-color: var(--igp-border-primary, #3a3a3a) !important;
}
body.tax-festival.admin-theme-dark .igp-gf__empty,
body.post-type-archive-games.admin-theme-dark .igp-gf__empty,
html[data-theme="dark"] body.tax-festival .igp-gf__empty,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__empty {
    background: var(--igp-bg-card, #242424) !important;
    background-color: var(--igp-bg-card, #242424) !important;
    border-color: var(--igp-border-primary, #3a3a3a) !important;
    color: var(--igp-text-muted, #aaa) !important;
}
body.tax-festival.admin-theme-dark .igp-gf__pages a,
body.tax-festival.admin-theme-dark .igp-gf__pages span,
body.post-type-archive-games.admin-theme-dark .igp-gf__pages a,
body.post-type-archive-games.admin-theme-dark .igp-gf__pages span,
html[data-theme="dark"] body.tax-festival .igp-gf__pages a,
html[data-theme="dark"] body.tax-festival .igp-gf__pages span,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__pages a,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__pages span {
    background: var(--igp-bg-card, #242424) !important;
    background-color: var(--igp-bg-card, #242424) !important;
    color: var(--igp-text-primary, #f3f3f3) !important;
    border-color: var(--igp-border-primary, #3a3a3a) !important;
}
/* Активная страница в тёмной теме — акцент должен пробить общий dark-фон выше. */
body.tax-festival.admin-theme-dark .igp-gf__pages li .current,
body.tax-festival.admin-theme-dark .igp-gf__pages li.is-current a,
body.post-type-archive-games.admin-theme-dark .igp-gf__pages li .current,
body.post-type-archive-games.admin-theme-dark .igp-gf__pages li.is-current a,
html[data-theme="dark"] body.tax-festival .igp-gf__pages li .current,
html[data-theme="dark"] body.post-type-archive-games .igp-gf__pages li .current {
    background: var(--igp-accent, #ff4a52) !important;
    background-color: var(--igp-accent, #ff4a52) !important;
    color: var(--igp-on-accent) !important;
    border-color: var(--igp-accent, #ff4a52) !important;
}

/* ---------- Мобильная версия ---------- */
@media (max-width: 1024px) {
    body.tax-festival .sidebar-page,
    body.post-type-archive-games .sidebar-page {
        gap: 20px;
    }
    body.tax-festival .sidebar-page .games-sidebar,
    body.post-type-archive-games .sidebar-page .games-sidebar {
        flex: 0 0 240px;
        max-width: 240px;
    }
}
@media (max-width: 720px) {
    body.tax-festival .lozung,
    body.post-type-archive-games .lozung {
        /* На мобилке — в колонку и по центру (на десктопе заголовок слева,
           счётчик справа; узкому экрану центрирование читается лучше). */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 14px 18px;
        gap: 8px 16px;
    }
    body.tax-festival .lozung h1,
    body.tax-festival .lozung h2,
    body.post-type-archive-games .lozung h1,
    body.post-type-archive-games .lozung h2 {
        font-size: 18px;
        flex: 0 1 auto;
        text-align: center;
    }
    body.tax-festival .lozung .games-count,
    body.post-type-archive-games .lozung .games-count {
        font-size: 12px;
        padding: 6px 10px;
    }
    body.tax-festival .sidebar-page,
    body.post-type-archive-games .sidebar-page {
        flex-direction: column;
        gap: 14px;
    }
    body.tax-festival .sidebar-page .games-sidebar,
    body.post-type-archive-games .sidebar-page .games-sidebar {
        position: static;
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        order: 2;
        display: none;
    }
    body.tax-festival .sidebar-page .games-sidebar.is-open,
    body.post-type-archive-games .sidebar-page .games-sidebar.is-open {
        display: block !important;
    }
    body.tax-festival .sidebar-page .games-grid,
    body.post-type-archive-games .sidebar-page .games-grid {
        order: 3;
        width: 100%;
        gap: 16px;
    }
    body.tax-festival .sidebar-page .games-grid .game-item,
    body.post-type-archive-games .sidebar-page .games-grid .game-item {
        flex: 0 1 100%;
        max-width: 100%;
    }
    body.tax-festival .igp-gf-toggle,
    body.post-type-archive-games .igp-gf-toggle {
        display: inline-flex !important;
        order: 1;
        align-self: flex-start;
    }
    body.tax-festival .igp-gf,
    body.post-type-archive-games .igp-gf {
        padding: 16px;
        gap: 14px;
    }
    body.tax-festival .igp-gf__radios label,
    body.tax-festival .igp-gf__checks label,
    body.post-type-archive-games .igp-gf__radios label,
    body.post-type-archive-games .igp-gf__checks label {
        padding: 10px 10px 10px 26px !important;
        font-size: 15px;
    }
}
