:root {
  --games-divider-image: none;
  --games-divider-height: 30px;

  /* Hover tint overlay for non-sports cards */
  --games-card-hover-tint: radial-gradient(
    120% 120% at 50% 30%,
    rgba(236, 134, 248, 0.22) 0%,
    rgba(162, 7, 98, 0.7) 80%,
    rgba(10, 0, 24, 0.68) 100%
  );
  --promotions-card-hover-tint: radial-gradient(
    120% 120% at 50% 30%,
    rgba(236, 134, 248, 0.22) 0%,
    rgba(162, 7, 98, 0.7) 80%,
    rgba(10, 0, 24, 0.68) 100%
  );
}

/* The clipper prevents page-wide horizontal scroll */
.games-carousel-clip {
  overflow: hidden;
  position: relative;
}

/* Keep Swiper’s overflow INSIDE the clipper */
.games-carousel-clip .swiper {
  overflow: visible; /* slides can peek, but are clipped by parent */
}

.swiper-wrapper {
  justify-content: flex-start;
}

/* Slides stay fluid on small screens */
.games-category .swiper .swiper-slide {
  width: clamp(160px, 33vw, 240px);
}

/* Desktop: Swiper controls width via slidesPerView */
@media (min-width: 1024px) {
  .games-category .swiper .swiper-slide {
    width: auto;
  }
}

.games-category {
  margin-top: 1.5rem;
  background-color: var(--e-global-color-primary);
  border-radius: 8px;
  padding: 8px 30px;
}

.games-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.games-category-divider {
  border: 0;
  width: 70%;
  height: var(--games-divider-height, 2px);
  background-image: var(--games-divider-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% var(--games-divider-height, 2px);
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

@media (max-width: 1024px) {
  .games-category-divider {
    border: 0;
    width: 0;
    height: 0;
    background: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 768px) {
  .games-category-divider {
    border: 0;
    width: 0;
    height: 0;
    background: none;
  }
}

.games-category-title {
  font-family: var(--e-global-typography-text-font-family) !important;
  font-size: var(--e-global-typography-text-font-size) !important;
  font-weight: var(--e-global-typography-text-font-weight) !important;
  margin: 0;
  padding: 1rem 0rem;
  color: var(--e-global-color-accent);
}

.games-category-nav {
  display: flex;
  gap: 16px;
}

.games-category-nav .swiper-button-prev,
.games-category-nav .swiper-button-next {
  margin-top: 0 !important;
  z-index: 99;
  position: static;
  background: none;
}

.games-carousel-nav .swiper-button-prev::after,
.games-category-nav .swiper-button-prev::after {
  z-index: 99;
  font-family: "Font Awesome 6 Free";
  content: "\f104";
}

.games-carousel-nav .swiper-button-next::after,
.games-category-nav .swiper-button-next::after {
  z-index: 99;
  font-family: "Font Awesome 6 Free";
  content: "\f105";
}

.games-category-nav .swiper-button-prev::after,
.games-category-nav .swiper-button-next::after {
  background-color: var(--e-global-color-secondary);
  padding: 5px 10px;
  line-height: 1.15;
  font-size: 16px;
  font-weight: 900;
  border: 1px solid var(--e-global-color-text);
  color: var(--e-global-color-text);
  border-radius: 6px;
  transition: 0.2s;
}

.games-category-nav .swiper-button-prev:where(:hover, :focus-visible)::after,
.games-category-nav .swiper-button-next:where(:hover, :focus-visible)::after {
  border: 1px solid var(--e-global-color-6b9151f);
  color: var(--e-global-color-6b9151f);
}

/* Fancy triangle next/prev buttons (override defaults) */
.games-category-nav .swiper-button-prev,
.games-category-nav .swiper-button-next {
  width: 56px;
  height: 56px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Outer glossy triangle */
.games-category-nav .swiper-button-next::before,
.games-category-nav .swiper-button-prev::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffd84a 0%, #ffb300 55%, #f48a00 100%);
  box-shadow: 0 0 0 2px #b0105c inset, 0 2px 0 0 rgba(0, 0, 0, 0.18),
    0 6px 10px rgba(0, 0, 0, 0.25);
  /* slight corner smoothing */
  filter: blur(0.55px);
}
.games-category-nav .swiper-button-next::before {
  clip-path: polygon(20% 10%, 90% 50%, 20% 90%);
}
.games-category-nav .swiper-button-prev::before {
  clip-path: polygon(80% 10%, 10% 50%, 80% 90%);
}

/* Inner inset triangle */
.games-category-nav .swiper-button-prev::after,
.games-category-nav .swiper-button-next::after {
  content: "" !important; /* override FA icon */
  position: absolute;
  width: 60%;
  height: 60%;
  margin: auto;
  inset: 0;
  border: 0 !important;
  background: radial-gradient(
      60% 60% at 50% 35%,
      rgba(255, 255, 255, 0.25) 0%,
      rgba(255, 255, 255, 0) 60%
    ),
    linear-gradient(180deg, #f0b12e 0%, #bf5a00 100%);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.15) inset,
    0 2px 0 rgba(0, 0, 0, 0.2) inset;
  /* stronger dark center + soft edges */
  filter: blur(0.65px);
}
.games-category-nav .swiper-button-next::after {
  clip-path: polygon(20% 20%, 80% 50%, 20% 80%);
}
.games-category-nav .swiper-button-prev::after {
  clip-path: polygon(80% 20%, 20% 50%, 80% 80%);
}

/* Hover/focus lift */
.games-category-nav .swiper-button-prev:where(:hover, :focus-visible)::before,
.games-category-nav .swiper-button-next:where(:hover, :focus-visible)::before {
  filter: brightness(1.06) saturate(1.06);
  transform: translateY(-1px);
}

/* Disabled state */
.games-category-nav .swiper-button-disabled::before,
.games-category-nav .swiper-button-disabled::after {
  filter: grayscale(0.4) opacity(0.55);
}

/* ========= Cards / Titles ========= */

.game-card {
  display: block;
  position: relative;
}

/* Wrappers inherit width from inner cards for natural sizing */
.game-card--games {
  width: auto;
  max-width: none;
}
.game-card--promotions {
  width: auto;
  max-width: none;
}
.game-card--sports {
  width: auto;
  max-width: none;
}

.game-card-inner {
  z-index: 8; /* base stacking context holder */
}

.game-card--games .game-card-inner {
  max-width: 195px;
  max-height: 265px;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.game-card--promotions .game-card-inner {
  max-width: 545px;
  max-height: 370px;
  /* Keep native aspect for promos */
  aspect-ratio: 545 / 370;
  width: 100%;
  height: auto; /* allow aspect-ratio to determine height */
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

/* Sports: two supported DOM patterns
   A) Disabled card markup:
      <div class="game-card game-card--sports is-disabled">
        <div class="game-card-inner">…</div>
      </div>
      -> styles apply to .game-card--sports .game-card-inner

   B) Linked card markup:
      <div class="game-card-inner">
        <a class="game-card game-card--sports">…</a>
      </div>
      -> styles apply directly to the anchor
*/
.game-card--sports .game-card-inner,
.game-card-inner > .game-card--sports {
  max-width: 220px;
  max-height: 360px;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 15px;
  border-top: 12px solid #c83277;
  border-right: 6px solid #c83277;
  border-bottom: 12px solid #c83277;
  border-left: 6px solid #c83277;
  transition: border-color 0.25s ease;
}

/* Title inside the card (games/promotions) */
.game-card .swiper-game-name {
  font-family: var(--e-global-typography-text-font-family) !important;
  line-height: 1.3;
  font-size: 16px;
  font-weight: 700;
  color: var(--e-global-color-secondary);
  position: absolute;
  top: calc(50% - 60px);
  left: 8px !important; /* equal insets for robust centering */
  right: 8px !important;
  transform: none !important;
  padding: 4px 6px;
  text-align: center !important; /* ensure centered text even under global rules */
  background: transparent;
  clip-path: none;
  z-index: 13; /* above button */
  pointer-events: none;
  opacity: 0;
  transition: 0.2s ease-in-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card:where(:hover, :focus-visible) .swiper-game-name,
.game-card.is-disabled:where(:hover, :focus-visible) .swiper-game-name {
  opacity: 1;
}

/* Sports: title below the image, always visible */
.game-card--sports .swiper-game-name {
  position: static;
  transform: none;
  width: 100%;
  max-width: 220px;
  padding: 0;
  margin-top: 8px;
  text-align: center;
  opacity: 1;
  color: var(--e-global-color-secondary);
}

/* Games: show title below image, always visible (like sports) */
.game-card--games .swiper-game-name {
  position: static;
  transform: none;
  width: 100%;
  max-width: 195px;
  padding: 0;
  margin-top: 8px;
  text-align: center;
  opacity: 1;
  color: var(--e-global-color-secondary);
}

/* Cursors for sports */
.game-card--sports,
.game-card--sports .game-card-inner,
.game-card--sports .game-card-inner img,
.game-card--sports .swiper-game-name {
  cursor: pointer !important;
}
.game-card--sports.is-disabled,
.game-card--sports.is-disabled .game-card-inner,
.game-card--sports.is-disabled .game-card-inner img,
.game-card--sports.is-disabled .swiper-game-name {
  cursor: default !important;
}

/* ========= Image & Hover Tint (no .overlay element needed) ========= */

.game-card-inner img {
  width: 100%;
  display: block;
  transition: 0.2s;
  z-index: 5; /* below the tint ::before */
  position: relative;
}

/* Promotions: ensure image fits inside container */
.game-card--promotions .game-card-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Base for tint via ::before (games) */
.game-card--games .game-card-inner {
  position: relative;
}
.game-card--games .game-card-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--games-card-hover-tint);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 7; /* above img (5), below btn (12) & title (13) */
  pointer-events: none;
}
.game-card--games .game-card-inner:where(:hover, :focus-visible)::before {
  opacity: 1;
}
/* optional: dim the image a bit */
.game-card--games .game-card-inner:where(:hover, :focus-visible) img {
  opacity: 0.6;
}

/* Base for tint via ::before (promotions) */
.game-card--promotions .game-card-inner {
  position: relative;
}
.game-card--promotions .game-card-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--promotions-card-hover-tint);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 7;
  pointer-events: none;
}
.game-card--promotions .game-card-inner:where(:hover, :focus-visible)::before {
  opacity: 1;
}
.game-card--promotions .game-card-inner:where(:hover, :focus-visible) img {
  opacity: 0.6;
}

/* Allow peeking/scrolling for promotions at >=765px */
@media (min-width: 765px) {
  .games-category .swiper.is-promotions .swiper-slide {
    width: auto !important; /* keep promo card natural width, override Swiper inline width */
  }
  .game-card--promotions .game-card-inner {
    width: 463.25px; /* 15% smaller than 545px on tablet/desktop */
  }
}

/* On mobile, keep promotions inside slide width */
@media (max-width: 764.98px) {
  /* Make each promo slide full-width on mobile */
  .games-category .swiper.is-promotions .swiper-slide {
    width: 100% !important;
  }
  .game-card--promotions .game-card-inner {
    max-width: 100%;
    width: 100%;
    height: auto;
  }
}

/* Restore wider min width only for larger screens */
@media (min-width: 1024px) {
  .game-card--promotions .game-card-inner {
    min-width: 320px;
  }
}

/* Sports hover effect (no tint) */
/* Hover scale for both patterns */
.game-card--sports:where(:hover, :focus-visible) .game-card-inner img,
.game-card--sports.is-disabled:where(:hover, :focus-visible)
  .game-card-inner
  img,
.game-card-inner > .game-card--sports:where(:hover, :focus-visible) img {
  transition: 0.5s;
  transform: scale(1.2);
}

/* Sports: change border color to yellow on hover/focus */
/* Hover border color for both patterns */
.game-card--sports:where(:hover, :focus-visible) .game-card-inner,
.game-card--sports.is-disabled:where(:hover, :focus-visible) .game-card-inner,
.game-card-inner > .game-card--sports:where(:hover, :focus-visible) {
  border-color: #ffe814;
}

/* ========= Promotions description ========= */

.promotion-description {
  font-family: var(--e-global-typography-text-font-family) !important;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 23%;
  background: #1a1a1ad1;
  z-index: 9; /* above tint (7) and image (5), below title (13) */
  padding: 5px 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--e-global-color-e465ca5);
  border-top: 1px solid var(--e-global-color-text);
}

/* ========= Play button ========= */

.slide-play-btn {
  font-family: var(
    --e-global-typography-34b1e0c-font-family,
    var(--e-global-typography-text-font-family)
  ) !important;
  font-size: var(--e-global-typography-34b1e0c-font-size, 20px) !important;
  font-weight: var(--e-global-typography-34b1e0c-font-weight, 700) !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: 0.2s ease-in-out;
  padding: 12px 30px !important;
  min-height: 48px;
  background-color: transparent !important;
  background-image: linear-gradient(180deg, #ec86f8 0%, #a20762 78%) !important;
  box-shadow: 0 0 0 1px #f09015 !important;
  border-style: solid !important;
  border-width: 2px !important;
  border-color: #c49748 !important;
  border-radius: 12px !important;
  color: #efefef !important;
  fill: #efefef !important;
  cursor: pointer;
  z-index: 12; /* over tint (7) and image (5) */
}

/* Center Play button for games and promotions */
.game-card--games .slide-play-btn,
.game-card--promotions .slide-play-btn {
  top: 75%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.slide-play-btn:where(:hover, :focus-visible) {
  box-shadow: 0 0 0 1px #f09015, 0 0 10px 0 #f09015 !important;
  filter: brightness(1.05);
}

.game-card-inner:where(:hover, :focus-visible) .slide-play-btn,
.game-card-inner.is-disabled:where(:hover, :focus-visible) .slide-play-btn {
  opacity: 1;
}

/* Sports: hide Play button; whole card is clickable */
.game-card--sports .slide-play-btn {
  display: none !important;
}

/* ========= Ribbon ========= */

.game-card--sports .ribbon,
.game-card--games .ribbon {
  display: none;
}

.ribbon {
  --f: 0.5em; /* control the folded part */
  position: absolute;
  top: 0;
  left: 0;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  line-height: 1.8;
  padding-inline: 1lh;
  padding-bottom: var(--f);
  border-image: conic-gradient(#0008 0 0) 51% / var(--f);
  clip-path: polygon(
    100% calc(100% - var(--f)),
    100% 100%,
    calc(100% - var(--f)) calc(100% - var(--f)),
    var(--f) calc(100% - var(--f)),
    0 100%,
    0 calc(100% - var(--f)),
    999px calc(100% - var(--f) - 999px),
    calc(100% - 999px) calc(100% - var(--f) - 999px)
  );
  transform: translate(calc((cos(45deg) - 1) * 100%), -100%) rotate(-45deg);
  transform-origin: 100% 100%;
  background-color: red;
  z-index: 9; /* above tint (7) */
}

/* ========= Animations ========= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 80px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fade-in-up {
  animation: fadeInUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.fade-in-up-init {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .fade-in-up-init {
    opacity: 1;
    transform: none;
  }
}

/* Hide next/prev arrows on tablet and below */
@media (max-width: 1024px) {
  .games-category-nav {
    display: none !important;
  }
}
