/* ==========================================================================
   Featured Games carousel (WB Games Support)
   ========================================================================== */
.wb-fg {
  --wb-fg-height: clamp(240px, 31.5vw, 390px); /* 25% shorter than original */
  --wb-fg-radius: var(--border-radius-lg, 12px);
}
.wb-fg__heading { margin-bottom: 1.125rem; }
.wb-fg__viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--wb-fg-radius);
  background: #0b0f1a;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  touch-action: pan-y;
}
.wb-fg__track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.wb-fg__slide {
  position: relative;
  flex: 0 0 100%;
  min-height: var(--wb-fg-height);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.wb-fg__art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 6s ease-out;
}
.wb-fg__slide.is-active .wb-fg__art { transform: scale(1.08); }
.wb-fg__slide::after {
  /* Legibility scrim over the key art */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 16, 0.85) 0%, rgba(5, 8, 16, 0.55) 40%, rgba(5, 8, 16, 0) 75%),
    linear-gradient(0deg, rgba(5, 8, 16, 0.7) 0%, rgba(5, 8, 16, 0) 50%);
  pointer-events: none;
}
.wb-fg__content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  padding-bottom: clamp(3.25rem, 4.5vw, 3.75rem);
  color: #fff;
}
.wb-fg__eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.wb-fg__title {
  margin: 0 0 0.5rem;
  color: #fff;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.wb-fg__text {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}
.wb-fg__cta {
  /* Colors follow Customize design > Colors:
     Primary color (brand_color) and Primary inverse color (brand_text_color),
     with the same darker hover/pressed shades the theme uses for its primary buttons. */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: var(--button-border-width, 2px) solid transparent;
  border-radius: var(--button-border-radius, var(--border-radius-base, 8px));
  background-color: var(--color-brand-primary);
  color: var(--color-brand-primary-inverse);
  font-weight: var(--button-font-weight, 600);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.wb-fg__cta::after {
  /* Extends the link's click area */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.wb-fg__cta:hover,
.wb-fg__cta:focus,
.wb-fg__cta:focus-visible {
  background-color: var(--color-brand-primary-hover);
  color: var(--color-brand-primary-inverse);
  text-decoration: none;
}
.wb-fg__cta:active {
  background-color: var(--color-brand-primary-pressed);
  color: var(--color-brand-primary-inverse);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.wb-fg__cta:focus-visible {
  /* White ring stays visible against dark key art */
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.wb-fg__cta svg { width: 1rem; height: 1rem; transition: transform 0.2s ease; }
.wb-fg__cta:hover svg { transform: translateX(3px); }

/* Controls */
.wb-fg__controls {
  position: absolute;
  z-index: 2;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wb-fg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(5, 8, 16, 0.45);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.wb-fg__btn:hover { background: rgba(255, 255, 255, 0.2); border-color: #fff; }
.wb-fg__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.wb-fg__btn svg { width: 1.1rem; height: 1.1rem; }

/* Play/pause toggle state
   Playing: a ring around the button fills up until the next slide.
   Held (pointer or keyboard focus inside the carousel): the ring freezes in place.
   Paused: the button turns solid white with a play icon and the ring is hidden. */
.wb-fg__toggle { position: relative; border-color: transparent; }
.wb-fg__btn .wb-fg__progress {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg); /* start the ring at 12 o'clock */
  pointer-events: none;
  overflow: visible;
}
.wb-fg__progress circle { fill: none; stroke-width: 2.5; }
.wb-fg__progress-track { stroke: rgba(255, 255, 255, 0.35); }
.wb-fg__progress-bar {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.wb-fg__progress.is-running .wb-fg__progress-bar {
  animation: wb-fg-progress var(--wb-fg-interval, 6s) linear forwards;
}
.wb-fg.is-holding .wb-fg__progress-bar { animation-play-state: paused; }
@keyframes wb-fg-progress {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
.wb-fg.is-paused .wb-fg__progress { display: none; }
.wb-fg.is-paused .wb-fg__toggle,
.wb-fg.is-paused .wb-fg__toggle:hover {
  background: #fff;
  border-color: #fff;
  color: #0b0f1a;
}
.wb-fg.is-paused .wb-fg__toggle svg { margin-left: 2px; } /* optically center the play triangle */

.wb-fg__dots {
  display: flex;
  gap: 0.4rem;
  margin: 0 0.5rem;
  padding: 0;
  list-style: none;
}
.wb-fg__dot {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.wb-fg__dot[aria-current="true"] { width: 1.75rem; background: #fff; }
.wb-fg__dot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.wb-fg [hidden] { display: none !important; }

/* Single slide: no controls needed */
.wb-fg--single .wb-fg__controls { display: none; }

/* Right-to-left languages (e.g. Arabic): text sits on the right, so the
   legibility scrim and the arrow icons are mirrored. Slide movement is handled in the script. */
[dir="rtl"] .wb-fg__slide::after {
  background:
    linear-gradient(270deg, rgba(5, 8, 16, 0.85) 0%, rgba(5, 8, 16, 0.55) 40%, rgba(5, 8, 16, 0) 75%),
    linear-gradient(0deg, rgba(5, 8, 16, 0.7) 0%, rgba(5, 8, 16, 0) 50%);
}
[dir="rtl"] .wb-fg__btn[data-fg-prev] svg,
[dir="rtl"] .wb-fg__btn[data-fg-next] svg,
[dir="rtl"] .wb-fg__cta svg { transform: scaleX(-1); }
[dir="rtl"] .wb-fg__cta:hover svg { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .wb-fg.is-paused .wb-fg__toggle svg { margin-left: 0; }
[dir="rtl"] .wb-fg.is-paused .wb-fg__toggle [data-fg-icon-play] { margin-left: 2px; }
/* Keep the rounded corners clipping the moving track in every browser */
.wb-fg__viewport { isolation: isolate; }

@media (max-width: 640px) {
  .wb-fg__slide::after {
    background: linear-gradient(0deg, rgba(5, 8, 16, 0.92) 0%, rgba(5, 8, 16, 0.55) 55%, rgba(5, 8, 16, 0.15) 100%);
  }
  .wb-fg__controls { left: 0; right: 0; justify-content: center; }
  .wb-fg__content { padding-bottom: 3.75rem; }

  /* Mobile: hide the "Get support" button.
     The link stays in place (invisible) so tapping the slide text still opens the game's support page,
     and screen readers still announce it. Delete this block to show the button on mobile again. */
  .wb-fg__cta {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 0;
    gap: 0;
  }
  .wb-fg__cta svg { display: none; }
  .wb-fg__cta:focus-visible { outline: none; }
  .wb-fg__content:focus-within { outline: 3px solid #fff; outline-offset: -3px; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-fg__track,
  .wb-fg__art,
  .wb-fg__dot { transition: none !important; }
  /* No animated ring; the icon and solid paused style still show the state */
  .wb-fg__progress-bar { animation: none !important; stroke-dashoffset: 0; }
  .wb-fg__slide.is-active .wb-fg__art { transform: scale(1.02); }
}
