:root{
  --cg-category-container: min(calc(100% - 40px), var(--cg-container));
}

.cg-category-page{
  width: 100%;
}

.cg-category-hero{
  padding: 22px 0 18px;
}

.cg-category-hero__inner{
  width: var(--cg-category-container);
  margin: 0 auto;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--cg-link-active) 18%, transparent), transparent 30%),
    linear-gradient(180deg, var(--cg-surface-card) 0%, var(--cg-surface-card-2) 100%);
  border: 1px solid var(--cg-border-color);
  box-shadow: 0 16px 40px rgba(0,0,0,.16);
}

.cg-category-hero__breadcrumb{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: color-mix(in srgb, var(--cg-text-main) 64%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.cg-category-hero__breadcrumb a{
  color: color-mix(in srgb, var(--cg-text-main) 78%, transparent);
  text-decoration: none;
}

.cg-category-hero__title{
  margin: 0 0 12px;
  color: var(--cg-text-main);
  font-size: 48px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.cg-category-hero__text{
  max-width: 820px;
  margin: 0;
  color: color-mix(in srgb, var(--cg-text-main) 82%, transparent);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 700;
}

.cg-category-hero__meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.cg-category-hero__meta-pill{
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cg-text-main) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--cg-text-main) 6%, transparent);
  color: var(--cg-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.cg-category-toolbar{
  padding: 8px 0 18px;
}

.cg-category-toolbar__inner{
  width: var(--cg-category-container);
  margin: 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.cg-category-toolbar__title{
  margin: 0 0 4px;
  color: var(--cg-text-main);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
}

.cg-category-toolbar__count{
  margin: 0;
  color: color-mix(in srgb, var(--cg-text-main) 68%, transparent);
  font-size: 14px;
  font-weight: 700;
}

.cg-category-sort{
  display: flex;
  align-items: center;
  gap: 10px;
}

.cg-category-sort__label{
  color: color-mix(in srgb, var(--cg-text-main) 72%, transparent);
  font-size: 14px;
  font-weight: 800;
}

.cg-category-sort__select{
  min-width: 180px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--cg-input-border);
  background: var(--cg-input-bg);
  color: var(--cg-input-text);
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.cg-category-grid-section{
  padding: 0 0 24px;
}

.cg-category-grid-section__inner{
  width: var(--cg-category-container);
  margin: 0 auto;
}

.cg-category-grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

/* same card style as home/single */
.cg-square-game-card{
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--cg-surface-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .22s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  border: 2px solid transparent;
}

.cg-square-game-card:hover{
  transform: scale(1.02);
  border-color: var(--cg-link-active);
  z-index: 3;
}

.cg-square-game-card__link{
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.cg-square-game-card__media{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--cg-surface-card-2);
}

.cg-square-game-card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cg-square-game-card__overlay{
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.18), transparent);
  opacity: 0;
  transition: opacity .18s ease;
}

.cg-square-game-card:hover .cg-square-game-card__overlay{
  opacity: 1;
}

.cg-square-game-card__title{
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.cg-category-card__meta{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  margin-top: 6px;
}

.cg-game-card-badge{
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f0c755;
  color: #171a28;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.cg-category-pagination{
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.cg-category-pagination__inner{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.cg-category-page-btn{
  min-width: 54px;
  height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--cg-surface-card);
  border: 1px solid color-mix(in srgb, var(--cg-text-main) 6%, transparent);
  color: var(--cg-text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.cg-category-page-btn span{
  color: inherit;
  transition: color .18s ease;
}

.cg-category-page-btn:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cg-link-active) 75%, transparent);
  background: color-mix(in srgb, var(--cg-link-active) 10%, transparent);
  color: var(--cg-link-active);
}

.cg-category-page-btn.is-current{
  background: linear-gradient(90deg, #79a8ff 0%, #6891ff 100%);
  color: #f7f1ca;
}

.cg-category-page-btn--nav{
  padding-left: 20px;
  padding-right: 20px;
}

.cg-category-page-btn__icon{
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  background: transparent !important;
  filter: brightness(0) saturate(100%) invert(100%);
  transition: filter .18s ease, opacity .18s ease;
}

.cg-category-page-btn:hover .cg-category-page-btn__icon{
  filter: brightness(0) saturate(100%) invert(28%) sepia(92%) saturate(1824%) hue-rotate(235deg) brightness(94%) contrast(94%);
}

.cg-category-empty{
  padding: 60px 24px;
  border-radius: 24px;
  background: var(--cg-surface-card);
  border: 1px solid var(--cg-border-color);
  text-align: center;
}

.cg-category-empty__title{
  margin: 0 0 10px;
  color: var(--cg-text-main);
  font-size: 28px;
  font-weight: 900;
}

.cg-category-empty__text{
  margin: 0;
  color: color-mix(in srgb, var(--cg-text-main) 72%, transparent);
  font-size: 16px;
  font-weight: 700;
}

.cg-category-seo{
  padding: 0 0 36px;
}

.cg-category-seo__inner{
  width: var(--cg-category-container);
  margin: 0 auto;
}

.cg-category-seo__box{
  padding: 24px;
  border-radius: 24px;
  background: var(--cg-surface-card);
  border: 1px solid var(--cg-border-color);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

.cg-category-seo__title{
  margin: 0 0 16px;
  color: var(--cg-text-main);
  font-size: 32px;
  line-height: 1.08;
  font-weight: 900;
}

.cg-category-seo__content{
  color: color-mix(in srgb, var(--cg-text-main) 84%, transparent);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 700;
  max-height: 140px;
  overflow: hidden;
  transition: max-height .24s ease;
}

.cg-category-seo__content.is-expanded{
  max-height: 1200px;
}

.cg-category-seo__content p{
  margin: 0 0 16px;
}

.cg-category-seo__toggle{
  margin-top: 16px;
  min-width: 140px;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #79a8ff 0%, #6891ff 100%);
  color: #f7f1ca !important;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cg-category-list-home-style{
  margin-top: 22px;
  padding: 22px;
  border-radius: 24px;
  background: var(--cg-surface-card);
  border: 1px solid var(--cg-border-color);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

.cg-category-list-home-style__head{
  margin-bottom: 14px;
}

.cg-category-list-home-style__title{
  margin: 0;
  color: var(--cg-text-main);
  font-size: 26px;
  line-height: 1.08;
  font-weight: 900;
}

.cg-category-list-home-style__grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.cg-category-list-home-style__item{
  min-height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cg-text-main) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--cg-text-main) 6%, transparent);
  color: var(--cg-text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.cg-category-list-home-style__item:hover,
.cg-category-list-home-style__item.is-active{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cg-link-active) 80%, transparent);
  background: color-mix(in srgb, var(--cg-link-active) 12%, transparent);
  color: var(--cg-link-active);
}

.cg-category-list-home-style__item:hover .cg-category-list-home-style__name,
.cg-category-list-home-style__item:hover .cg-category-list-home-style__count,
.cg-category-list-home-style__item.is-active .cg-category-list-home-style__name,
.cg-category-list-home-style__item.is-active .cg-category-list-home-style__count{
  color: var(--cg-link-active);
}

.cg-category-list-home-style__name{
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: inherit;
}

.cg-category-list-home-style__count{
  color: color-mix(in srgb, var(--cg-text-main) 72%, transparent);
  font-size: 12px;
  font-weight: 900;
}

.cg-category-results-loading{
  opacity: .55;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* GeneratePress / global safety overrides - Category only                    */
/* -------------------------------------------------------------------------- */
.cg-category-page button,
.cg-category-page button:hover,
.cg-category-page button:focus,
.cg-category-page button:active,
.cg-category-page a.button,
.cg-category-page a.button:hover,
.cg-category-page a.button:focus,
.cg-category-page a.button:active{
  box-shadow: none;
}

.cg-category-page .cg-category-seo__toggle:hover,
.cg-category-page .cg-category-seo__toggle:focus,
.cg-category-page .cg-category-seo__toggle:active{
  background: linear-gradient(90deg, #79a8ff 0%, #6891ff 100%) !important;
  color: #f7f1ca !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.cg-category-page .cg-category-page-btn:hover,
.cg-category-page .cg-category-page-btn:focus,
.cg-category-page .cg-category-page-btn:active{
  box-shadow: none !important;
  outline: none !important;
}

@media (max-width: 1480px){
  .cg-category-grid{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .cg-category-list-home-style__grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px){
  :root{
    --cg-category-container: min(calc(100% - 24px), var(--cg-container));
  }

  .cg-category-hero__title{
    font-size: 40px;
  }

  .cg-category-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cg-category-list-home-style__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px){
  .cg-category-pagination__inner{
    gap: 10px;
  }

  .cg-category-page-btn{
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 16px;
    gap: 8px;
  }

  .cg-category-page-btn--nav{
    padding-left: 16px;
    padding-right: 16px;
  }

  .cg-category-page-btn__icon{
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 767px){
  :root{
    --cg-category-container: min(calc(100% - 16px), var(--cg-container));
  }

  .cg-category-hero{
    padding-top: 16px;
  }

  .cg-category-hero__inner,
  .cg-category-seo__box,
  .cg-category-list-home-style{
    padding: 18px;
    border-radius: 20px;
  }

  .cg-category-hero__title{
    font-size: 30px;
  }

  .cg-category-hero__text{
    font-size: 15px;
    line-height: 1.75;
  }

  .cg-category-toolbar__title{
    font-size: 24px;
  }

  .cg-category-sort{
    width: 100%;
    justify-content: space-between;
  }

  .cg-category-sort__select{
    min-width: 160px;
    width: 100%;
  }

  .cg-category-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cg-square-game-card{
    border-radius: 16px;
  }

  .cg-square-game-card__overlay{
    padding: 18px 8px 8px;
    opacity: 1;
  }

  .cg-square-game-card__title{
    font-size: 12px;
  }

  .cg-category-card__meta{
    font-size: 10px;
  }

  .cg-category-pagination{
    margin-top: 20px;
  }

  .cg-category-pagination__inner{
    gap: 8px;
  }

  .cg-category-page-btn{
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    gap: 6px;
  }

  .cg-category-page-btn--nav{
    padding-left: 12px;
    padding-right: 12px;
  }

  .cg-category-page-btn__icon{
    width: 14px;
    height: 14px;
  }

  .cg-category-seo__title,
  .cg-category-list-home-style__title{
    font-size: 24px;
  }

  .cg-category-seo__content{
    font-size: 15px;
    line-height: 1.75;
  }

  .cg-category-list-home-style__grid{
    grid-template-columns: 1fr;
  }
}

