.bonusGameSwitcher,
.bonusGameSwitcher * {
  box-sizing: border-box;
}

.bonusGameSwitcher {
  width: min(976px, 100%);
  padding: 2px;
  margin: 30px auto 0;
  overflow: visible;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(29, 9, 13, 0) 0%, #754451 100%);
}

.bonusGameSwitcher__frame {
  position: relative;
  display: flow-root;
  width: 100%;
  margin: 0;
  padding: 9px;
  overflow: visible;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #2c0c13 0%, #170708 100%);
}

.bonusGameSwitcher[data-active-tab="sheriff"] {
  background: linear-gradient(180deg, rgba(14, 27, 75, 0) 0%, #94a5e5 100%);
}

.bonusGameSwitcher[data-active-tab="sheriff"] .bonusGameSwitcher__frame {
  background-color: #000;
  background-image: linear-gradient(180deg, #0e1c4d 0%, rgba(0, 0, 0, 0) 100%);
}

/* Use the server-rendered default until the switcher initializes. */
.bonusGameSwitcher[data-active-tab="wheel"] ~ .switch__container--fsbank,
.bonusGameSwitcher:not([data-active-tab]):not([data-default-tab="sheriff"])
  ~ .switch__container--fsbank {
  display: none;
}

.bonusGameSwitcher__frame::after {
  content: none;
}

.bonusGameSwitcher__tabs {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.bonusGameSwitcher__tab {
  position: relative;
  width: 222px;
  height: 56px;
  min-width: 0;
  min-height: 0;
  padding: 8px 4px 8px 12px;
  display: flex;
  flex: 0 0 222px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #2e2a22;
  border-radius: 12px;
  cursor: pointer;
  color: #aaa394;
  text-align: left;
  background: #1f1c17;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    filter 0.2s ease;
}

.bonusGameSwitcher__tab:hover {
  filter: brightness(1.08);
}

.bonusGameSwitcher__tab:focus-visible {
  outline: 2px solid #fff3c9;
  outline-offset: 3px;
}

.bonusGameSwitcher__tab.is-active {
  border-color: #e6c36e;
  color: #fff;
  background: linear-gradient(270deg, #2e2a22 0%, #b0832a 100%);
  box-shadow: none;
}

.bonusGameSwitcher__tabs--single .bonusGameSwitcher__tab {
  grid-column: 1 / -1;
}

.bonusGameSwitcher__tabCopy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bonusGameSwitcher__tabKicker {
  overflow: hidden;
  font-family: "AdjaraRegular", sans-serif;
  font-size: 10px;
  line-height: 15px;
  color: currentColor;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonusGameSwitcher__tabTitle {
  font-family: "AdjaraBold", sans-serif;
  font-size: 14px;
  line-height: 1;
  font-feature-settings: "case" on;
  color: currentColor;
  text-transform: uppercase;
}

.bonusGameSwitcher__tabIcon {
  width: 39px;
  height: 22px;
  flex: 0 0 39px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.bonusGameSwitcher__tabIcon--wheel {
  background-image: url("../img/swich-icon-1.svg");
}

.bonusGameSwitcher__tabIcon--sheriff {
  background-image: url("../img/sherif/sherif-icon-new.svg");
  width: 24px;
  height: 24px;
}

.bonusGameSwitcher__sheriffBadge {
  position: absolute;
  top: -18px;
  right: -20px;
  z-index: 1;
  display: block;
  width: 36px;
  height: 35px;
  background: url("../img/bounce-icon.svg") center top / contain no-repeat;
  color: #faf0d6;
  font-family: "AdjaraBold", sans-serif;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  animation: bonusSheriffBadgePulse 1.5s ease-in-out infinite;
}

@keyframes bonusSheriffBadgePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.bonusGameSwitcher__sheriffBadge.is-empty {
  display: none;
}

.bonusGameSwitcher__sheriffBadge.is-double-digit {
  font-size: 15px;
}

.bonusGameSwitcher__sheriffCount {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* Center the count in the SVG's 26px-high bubble, above its tail. */
  height: 26px;
}

.bonusGameSwitcher__sheriffCount::before {
  content: "+";
}

.bonusGameSwitcher__panel[hidden] {
  display: none !important;
}

.bonusGameSwitcher__panel {
  width: 100%;
}

.bonusGameSwitcher__panel--wheel > .key__action:first-child {
  margin-top: 24px;
}

@media screen and (min-width: 941px) {
  .bonusGameSwitcher {
    --bonus-tabs-frame-color: #2c0c13;
    --bonus-tabs-rim-color: #99252c;
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-bonusgame-clicked-en.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-bonusgame-en.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-sherif-clicked-en.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-sherif-en.webp");
    /* 469px + 467px tabs, plus the component's 2px outer padding. */
    width: min(940px, 100%);
    margin-top: 116px;
    border-radius: 0 0 16px 16px;
  }

  .bonusGameSwitcher[data-active-tab="sheriff"] {
    --bonus-tabs-frame-color: #0e1c4d;
    --bonus-tabs-rim-color: #506ba3;
  }

  html:lang(ka) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-bonusgame-clicked-ge.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-bonusgame-ge.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-sherif-clicked-ge.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-sherif-ge.webp");
  }

  html:lang(en) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-bonusgame-clicked-en.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-bonusgame-en.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-sherif-clicked-en.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-sherif-en.webp");
  }

  html:lang(ru) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-bonusgame-clicked-ru.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-bonusgame-ru.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/desc-sherif-clicked-ru.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/desc-deactive-sherif-ru.webp");
  }

  .bonusGameSwitcher__frame {
    padding: 0 0 12px;
    border-radius: 0 0 14px 14px;
  }

  .bonusGameSwitcher__panel {
    /* Preserve the content inset while the tabs span the whole frame. */
    padding: 0 18px;
  }

  .bonusGameSwitcher__tabs {
    height: 90px;
    margin: -86px auto 0;
    align-items: flex-end;
    gap: 0;
  }

  .bonusGameSwitcher__tab,
  .bonusGameSwitcher__tab.is-active {
    isolation: isolate;
    width: 467px;
    height: 76px;
    padding: 0;
    flex: 467 1 0;
    gap: 0;
    border: 0;
    border-radius: 28px 28px 0 0;
    background: var(--bonus-tabs-frame-color);
    box-shadow: inset 0 4px 0 var(--bonus-tabs-rim-color);
    transition: height 0.2s ease;
  }

  .bonusGameSwitcher__tab[data-bonus-tab="wheel"] {
    --bonus-tab-active-art: var(--bonus-wheel-active-art);
    --bonus-tab-inactive-art: var(--bonus-wheel-inactive-art);
  }

  .bonusGameSwitcher__tab[data-bonus-tab="sheriff"] {
    --bonus-tab-active-art: var(--bonus-sheriff-active-art);
    --bonus-tab-inactive-art: var(--bonus-sheriff-inactive-art);
  }

  .bonusGameSwitcher__tab::before {
    content: "";
    position: absolute;
    /* 459 x 85px active artwork; 457 x 71px inactive artwork. */
    inset: 5px 5px 0;
    z-index: -1;
    pointer-events: none;
    --bonus-tab-art: var(--bonus-tab-inactive-art);
    background: var(--bonus-tab-art) center / 100% 100% no-repeat;
  }

  .bonusGameSwitcher__tab.is-active {
    width: 469px;
    height: 90px;
    flex-grow: 469;
    z-index: 1;
  }

  .bonusGameSwitcher__tab.is-active::before {
    --bonus-tab-art: var(--bonus-tab-active-art);
  }

  .bonusGameSwitcher__tab:hover {
    filter: none;
  }

  .bonusGameSwitcher__tab:not(.is-active)::before,
  .bonusGameSwitcher__tab:not(.is-active) .bonusGameSwitcher__tabIcon {
    opacity: 0.65;
  }

  .bonusGameSwitcher__tabCopy {
    /* Artwork supplies visible text; keep the translated accessible name. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .bonusGameSwitcher__tabIcon {
    position: absolute;
    top: calc(50% + 2.5px);
    right: 24px;
    flex: none;
    transform: translateY(-50%);
  }

  .bonusGameSwitcher__tabIcon--wheel {
    width: 58px;
    height: 60px;
    /* GIF VERSION */
    /* background-image: url("../img/swichtabImgMob/swichTabGifs/bonusgame.gif"); */
  }

  .bonusGameSwitcher__tabIcon--sheriff {
    width: 60px;
    height: 62px;
    /* GIF VERSION */
    /* background-image: url("../img/swichtabImgMob/swichTabGifs/sherif.gif"); */
  }

  /* GIF VERSION: selected-tab stills (uncomment together with GIF backgrounds). */
  /*
  .bonusGameSwitcher__tab.is-active .bonusGameSwitcher__tabIcon--wheel {
    background-image: url("../img/swichtabImgMob/swichTabGifs/bonusgame-no-animation.svg");
  }

  .bonusGameSwitcher__tab.is-active .bonusGameSwitcher__tabIcon--sheriff {
    background-image: url("../img/swichtabImgMob/swichTabGifs/sherif-no-animation.svg");
  }
  */

  .bonusGameSwitcher__sheriffBadge {
    /* Keep the badge inside the viewport at the 941px breakpoint. */
    top: -12px;
    right: 0;
    width: 42px;
    height: 41px;
    font-size: 18px;
  }

  .bonusGameSwitcher__sheriffBadge.is-double-digit {
    font-size: 17px;
  }

  .bonusGameSwitcher__sheriffCount {
    height: 30.3333px;
  }
}

@media screen and (max-width: 940px) and (min-width: 320px) {
  .bonusGameSwitcher {
    --bonus-tabs-frame-color: #2c0c13;
    --bonus-tabs-rim-color: #99252c;
    /* Scale the 168px active + 167px passive design to the inner frame width. */
    --bonus-tab-unit: calc((95vw - 1.0666vw) / 335);
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-bonusgame-clicked-en.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-bonusgame-en.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-sherif-clicked-en.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-sherif-en.webp");
    width: 95vw;
    padding: 0.5333vw;
    /* Reserve the raised tab row plus the original gap above the component. */
    margin-top: 25.6vw;
    border-radius: 0 0 4.2667vw 4.2667vw;
  }

  .bonusGameSwitcher[data-active-tab="sheriff"] {
    --bonus-tabs-frame-color: #0e1c4d;
    --bonus-tabs-rim-color: #506ba3;
  }

  html:lang(ka) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-bonusgame-clicked-ge.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-bonusgame-ge.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-sherif-clicked-ge.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-sherif-ge.webp");
  }

  html:lang(en) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-bonusgame-clicked-en.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-bonusgame-en.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-sherif-clicked-en.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-sherif-en.webp");
  }

  html:lang(ru) .bonusGameSwitcher {
    --bonus-wheel-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-bonusgame-clicked-ru.webp");
    --bonus-wheel-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-bonusgame-ru.webp");
    --bonus-sheriff-active-art: url("../img/swichtabImgMob/swichTabClicked/mob-sherif-clicked-ru.webp");
    --bonus-sheriff-inactive-art: url("../img/swichtabImgMob/swichTabPassive/mob-deactive-sherif-ru.webp");
  }

  .bonusGameSwitcher__frame {
    width: 100%;
    padding: 0;
    border-radius: 0 0 3.7333vw 3.7333vw;
  }

  .bonusGameSwitcher__frame::after {
    content: none;
  }

  .bonusGameSwitcher__tabs {
    width: 100%;
    height: calc(var(--bonus-tab-unit) * 69);
    /* Overlap the frame slightly so the tab bases flow into the panel. */
    margin: calc(1vw - var(--bonus-tab-unit) * 69) auto 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
  }

  .bonusGameSwitcher__tab,
  .bonusGameSwitcher__tab.is-active {
    position: relative;
    isolation: isolate;
    width: auto;
    height: calc(var(--bonus-tab-unit) * 55);
    min-height: 0;
    padding: 0;
    flex: 167 1 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    border: 0;
    border-radius: 5.3333vw 5.3333vw 0 0;
    background: var(--bonus-tabs-frame-color);
    box-shadow: inset 0 calc(var(--bonus-tab-unit) * 2) 0
      var(--bonus-tabs-rim-color);
    transition: height 0.2s ease;
  }

  .bonusGameSwitcher__tab[data-bonus-tab="wheel"] {
    --bonus-tab-active-art: var(--bonus-wheel-active-art);
    --bonus-tab-inactive-art: var(--bonus-wheel-inactive-art);
  }

  .bonusGameSwitcher__tab[data-bonus-tab="sheriff"] {
    --bonus-tab-active-art: var(--bonus-sheriff-active-art);
    --bonus-tab-inactive-art: var(--bonus-sheriff-inactive-art);
  }

  .bonusGameSwitcher__tab::before {
    content: "";
    position: absolute;
    /* Leave the outer rim visible above and beside the mobile artwork. */
    inset: calc(var(--bonus-tab-unit) * 3) calc(var(--bonus-tab-unit) * 3) 0;
    z-index: -1;
    pointer-events: none;
    --bonus-tab-art: var(--bonus-tab-inactive-art);
    /* The localized artwork includes its text and complete rounded border. */
    background-image: var(--bonus-tab-art);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }

  .bonusGameSwitcher__tab.is-active {
    height: calc(var(--bonus-tab-unit) * 69);
    flex-grow: 168;
    z-index: 1;
  }

  .bonusGameSwitcher__tab.is-active::before {
    --bonus-tab-art: var(--bonus-tab-active-art);
  }

  .bonusGameSwitcher__tab:hover {
    /* A brightness filter would also brighten the join with the frame. */
    filter: none;
  }

  .bonusGameSwitcher__tab:not(.is-active)::before,
  .bonusGameSwitcher__tab:not(.is-active) .bonusGameSwitcher__tabIcon {
    opacity: 0.65;
  }

  .bonusGameSwitcher__tabCopy {
    /* Keep desktop copy and screen-reader labels without duplicating image text. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .bonusGameSwitcher__tabIcon {
    position: absolute;
    top: calc(50% + var(--bonus-tab-unit) * 1.5);
    right: calc(var(--bonus-tab-unit) * 7);
    flex: none;
    transform: translateY(-50%);
  }

  .bonusGameSwitcher__tabIcon--wheel {
    width: calc(var(--bonus-tab-unit) * 42);
    height: calc(var(--bonus-tab-unit) * 44);
    right: calc(var(--bonus-tab-unit) * 12);
    /* GIF VERSION */
    /* background-image: url("../img/swichtabImgMob/swichTabGifs/bonusgame.gif"); */
  }

  .bonusGameSwitcher__tabIcon--sheriff {
    /* 42 x 44px at the 375px mobile design width. */
    width: 11.2vw;
    height: 11.7333vw;
    right: calc(var(--bonus-tab-unit) * 12);
    /* GIF VERSION */
    /* background-image: url("../img/swichtabImgMob/swichTabGifs/sherif.gif"); */
  }

  /* GIF VERSION: selected-tab stills (uncomment together with GIF backgrounds). */
  /*
  .bonusGameSwitcher__tab.is-active .bonusGameSwitcher__tabIcon--wheel {
    background-image: url("../img/swichtabImgMob/swichTabGifs/bonusgame-no-animation.svg");
  }

  .bonusGameSwitcher__tab.is-active .bonusGameSwitcher__tabIcon--sheriff {
    background-image: url("../img/swichtabImgMob/swichTabGifs/sherif-no-animation.svg");
  }
  */

  .bonusGameSwitcher__sheriffBadge {
    top: -2.2vw;
    right: -0.9333vw;
    width: 9.6vw;
    height: 9.3333vw;
    font-size: 4.2667vw;
  }

  .bonusGameSwitcher__sheriffBadge.is-double-digit {
    font-size: 4vw;
  }

  .bonusGameSwitcher__sheriffCount {
    height: 6.9333vw;
  }

  .bonusGameSwitcher__panel--wheel > .key__action:first-child {
    margin-top: 2vw;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bonusGameSwitcher__tab,
  .bonusGameSwitcher__tab.is-active {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bonusGameSwitcher__sheriffBadge {
    animation: none;
  }
}

/* SPRITE VERSION START
   To compare the GIF version: disable this block through SPRITE VERSION END,
   then restore the commented GIF VERSION backgrounds and selected-tab stills
   in the desktop and mobile sections above. No image files have been removed.
   Both sheets are 150 x 13650px: 91 vertical frames, 150 x 150px each.
*/
.bonusGameSwitcher__tabIcon {
  --bonus-sprite-duration: 3.64s;
  background-image: none;
}

.bonusGameSwitcher__tabIcon--wheel {
  --bonus-sprite-image: url("../img/swichtabImgMob/swichTabGifs/sprite-bonusg.webp");
}

.bonusGameSwitcher__tabIcon--sheriff {
  --bonus-sprite-image: url("../img/swichtabImgMob/swichTabGifs/sprite-sherif.webp");
}

/* Keep square sprite frames centered inside the existing rectangular icon box. */
.bonusGameSwitcher__tabIcon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  transform: translateY(-50%);
  pointer-events: none;
  background-image: var(--bonus-sprite-image);
  background-repeat: no-repeat;
  background-size: 100% 9100%;
  background-position: center 0%;
  animation: bonusTabSprite var(--bonus-sprite-duration) steps(91) infinite;
}

.bonusGameSwitcher__tab.is-active .bonusGameSwitcher__tabIcon::before {
  animation-play-state: paused;
}

@keyframes bonusTabSprite {
  from {
    background-position: center 0%;
  }
  to {
    /* One frame beyond the strip: steps(91) displays frames 0–90 before looping. */
    background-position: center calc(100% * 91 / 90);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bonusGameSwitcher__tabIcon::before {
    animation-play-state: paused;
  }
}
/* SPRITE VERSION END */

.container[data-after-end-before-redeem="1"] .sherifWager,
.container[data-after-end-before-redeem="1"] .bonusGameSwitcher__tabs,
.container[data-after-end-before-redeem="1"] .sherifFluidBg,
.container[data-after-end-before-redeem="1"] .sherifFluidWrapper {
  display: none;
}

/* The hidden tabs no longer need their raised-row space above the frame. */
.container[data-after-end-before-redeem="1"] .bonusGameSwitcher {
  margin-top: 30px;
}

/* Adjustable hero spacing for the end state only. */
.container[data-after-end-before-redeem="1"] .container__padding {
  height: 21vw;
  padding-top: 0;
}

.container[data-after-end-before-redeem="1"] .bonusGameSwitcher__frame {
  border-radius: 14px;
}

@media screen and (max-width: 940px) and (min-width: 320px) {
  .container[data-after-end-before-redeem="1"] .container__padding {
    height: 62vw;
  }

  .container[data-after-end-before-redeem="1"] .bonusGameSwitcher {
    margin-top: 8vw;
  }
}
