@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");
*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Rubik", sans-serif;
  background: none;
  outline: none;
  border: none;
}
html {
  touch-action: pan-x pan-y;
}
body {
  background-color: #fddb7e;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.wrapper {
  position: relative;
  overflow-y: hidden;
}
.header-logo {
  margin: 24px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.logo {
  width: auto;
  height: 80px;
}

@media (max-width: 1280px) {
  .logo {
    height: 65px;
  }
}

@media (max-width: 954px) {
  .logo {
    height: 45px;
  }
}

.shadow-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 30%;
  width: 100%;
  background: #000000;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: 3;
}

.game-container {
  display: flex;
  align-items: center;
  height: 100vh;
}

/* Start */
.start-img {
  display: block;
  height: 100vh;
  width: 475px;
  object-fit: cover;
}
/* Finish */
.finish-img {
  display: block;
  height: 100vh;
  width: 1000px;
  object-fit: cover;
}

/* Tracks */
.tracks-container {
  gap: 8px;
  display: flex;
  align-items: center;
  background-image: url("../img/track-items/tracks-location.png");
  background-size: contain;
}

.track {
  position: relative;
}

.track-img {
  object-fit: cover;
  height: 100vh;
  width: auto;
  width: 275px;
}

/* Track Items */
.track-goal {
  position: absolute;
  width: 210px;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.track-carrot {
  position: absolute;
  width: 110px;
  z-index: 10;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 140px);
}

.track-table {
  position: absolute;
  width: 144px;
  z-index: 10;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 300px);
}

.track-score {
  position: absolute;
  z-index: 10;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 257.5px);
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke-color: #000;
  -webkit-text-stroke-width: 2.5px;
}

.character {
  position: absolute;
  width: 250px;
  bottom: 50%;
  left: 20%;
  transform: translate(-150px, 140px);
  z-index: 11;
  transition: all 0.5s ease-in-out;
}

.character-person {
  width: 100%;
}

/* Popup */
.popup.active {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #00000068;
  z-index: 999;
}

@keyframes rotateModal {
  0%, 10%, 90%, to {
    transform: translate(-50%, -50%) rotate(7deg) scale(1);
  }
  40%, 60% {
    transform: translate(-50%, -50%) rotate(-7deg) scale(1);
  }
}

.popup__container {
  visibility: hidden;
  width: 95%;
  max-width: 500px;
  height: 225px;
  border: 2px solid #6ac96a;
  background-color: #465a48;
  border-radius: 24px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  opacity: 0;
}

.popup.active .popup__container {
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: rotateModal 2s ease-in-out infinite;
    text-align: center;
}

.popup__container h2 {
  font-size: 32px;
  color: #fff;
  background: #ffcb29;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 24px;
  position: absolute;
  left: 50%;
  top: -31px;
  transform: translateX(-50%);
}

.popup__container p {
  gap: 4px;
  display: flex;
  align-items: center;
  font-size: 62px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0.1em 0 #014715;
}

.popup__container a {
  width: 80%;
  border-radius: 24px;
  background-color: #fff;
  text-align: center;
  font-size: 34px;
  color: #000;
  text-align: center;
  padding: 12px;
  text-decoration: none;
  font-weight: 800;
  position: absolute;
  left: 50%;
  bottom: -30px;
  transform: translateX(-50%);
}

@media screen and (max-width: 1440px) {
  .start-img {
    width: 355px;
  }

  .finish-img {
    width: 750px;
  }
  .track-img {
    width: 205px;
  }
  .track-goal {
    width: 150px;
  }
  .track-carrot {
    width: 90px;
    transform: translate(-50%, 130px);
  }
  .character {
    width: 200px;
    transform: translate(-140px, 130px);
  }

  .track-table {
    width: 122px;
    transform: translate(-50%, 260px);
  }
  .track-score {
    transform: translate(-50%, 220px);
    font-size: 28px;
  }
}

@media screen and (max-width: 1024px) {
  .start-img {
    width: 255px;
  }

  .finish-img {
    width: 535px;
  }

  .track-img {
    width: 150px;
  }

  .track-goal {
    width: 115px;
  }

  .track-carrot {
    width: 70px;
    transform: translate(-50%, 90px);
  }

  .character {
    width: 150px;
    transform: translate(-140px, 90px);
  }

  .track-table {
    width: 92px;
    transform: translate(-50%, 200px);
  }

  .track-score {
    transform: translate(-50%, 172.5px);
    font-size: 24px;
    -webkit-text-stroke-width: 2px;
  }
}

@media screen and (max-width: 768px) {
  .start-img {
    width: 190px;
  }
  .finish-img {
    width: 400px;
    /* object-fit: fill; */
  }
  .character {
    width: 125px;
    transform: translate(-70px, 70px);
  }
}
@media screen and (max-width: 539px) {
  .finish-img {
    width: auto !important;
  }
}

@media screen and (max-width: 425px) {
  .start-img {
    width: auto;
  }

  .finish-img {
    width: auto;
  }

  .track-img {
    width: 120px;
  }

  .track-goal {
    width: 95px;
  }

  .track-carrot {
    width: 50px;
    transform: translate(-50%, 70px);
  }

  .character {
    width: 125px;
    transform: translate(-50px, 70px);
  }

  .track-table {
    width: 72px;
    transform: translate(-50%, 160px);
  }

  .track-score {
    transform: translate(-50%, 138px);
    font-size: 18px;
    -webkit-text-stroke-color: #000;
    -webkit-text-stroke-width: 1px;
  }
}

@media screen and (max-width: 375px) {
  /* .character {
    width: 100px;
  } */
  .track-table {
    transform: translate(-50%, 150px);
  }
  .track-score {
    transform: translate(-50%, 128px);
  }
}

/* Controls */
/* Game Controls - Main Container */
.game-controls {
  padding: 8px;
  color: rgb(255, 255, 255);
  border-radius: 16px;
  background: rgb(22, 23, 27);
  height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 95%;
  max-width: 1200px;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  gap: 8px;
  z-index: 99;
}

/* Game Controls Menu */
.game-controls__menu {
  display: flex;
  align-items: center;
}

.game-controls__menu-left,
.game-controls__menu-right {
  position: relative;
  width: 226px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-controls__menu-left::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-image: url("../img/controls/left.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: filter 0.2s ease;
}

.game-controls__menu-right::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-image: url("../img/controls/right.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: filter 0.2s ease;
}

.game-controls__menu-center {
  width: 111px;
  height: 111px;
  position: relative;
  cursor: pointer;
}

.game-controls__menu-center::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 123px;
  height: 123px;
  background: rgb(28, 28, 33);
  border-radius: 50%;
  z-index: -1;
}
.game-controls__menu-center:hover::before {
  filter: brightness(1.15);
  transition: filter 0.2s ease;
}

.game-controls__menu-center::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 111px;
  height: 111px;
  background-image: url("../img/controls/playBtn.png");
  background-size: cover;
  z-index: 9;
  transition: filter 0.2s ease;
}

/* Bet Controls */
.game-controls__bet {
  display: flex;
  align-items: start;
  flex-direction: column;
  justify-content: space-between;
  height: 60%;
  padding-left: 14px;
  position: relative;
  z-index: 10;
}

.game-controls__difficulty {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: space-between;
  height: 60%;
  padding-right: 14px;
  position: relative;
  z-index: 10;
}

.game-controls__bet-value {
  gap: 4px;
  display: flex;
  align-items: center;
}

.game-controls__bet-buttons {
  display: flex;
  flex-direction: column;
  padding-right: 11px;
  padding-top: 4px;
  position: relative;
  z-index: 10;
}

.game-controls__difficulty-buttons {
  display: flex;
  flex-direction: column;
  padding-left: 11px;
  padding-right: 0;
  padding-top: 4px;
  position: relative;
  z-index: 10;
}

.game-controls__difficulty-buttons .game-controls__button--down {
  margin-left: 0;
  margin-right: 2px;
}

.game-controls__difficulty-buttons .game-controls__button svg {
  transform: scale(-1);
}

.game-controls__button--down {
  margin-left: 2px;
}
.game-controls__button {
  cursor: pointer;
  transition: all 0.2s ease;
}
.game-controls__button svg:hover {
  fill: #515154;
}

.game-controls__button:disabled svg {
  fill: #2c2c30;
  cursor: not-allowed;
}

.game-controls__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  z-index: 10;
}

.game-controls__wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

/* Balance and Cashout */
.game-controls__cashout,
.game-controls__balance {
  height: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-evenly;
  width: 164px;
  border-radius: 12px;
}

.game-controls__balance {
  background: rgba(255, 255, 255, 0.05);
}

.game-controls__label {
  opacity: 0.6;
  font-weight: 600;
  text-transform: uppercase;
}

.game-controls__value {
  font-weight: 700;
  text-transform: uppercase;
}

.game-controls__balance-value {
  gap: 4px;
  display: flex;
  align-items: center;
  text-align: center;
}

.game-controls__currency-icon {
    fill: rgb(255, 255, 255);
    border-radius: 50%;
    background: #fff;
}

.game-controls__cashout--disabled {
  opacity: 0.5;
  color: rgb(255, 255, 255);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.05);
}

.game-controls__cashout--active {
  opacity: 1;
  color: #000;
  background: rgb(255, 198, 0);
}
.game-controls__cashout--active .game-controls__label {
  opacity: 1;
}
/* Mobile Menu */
.game-controls__mobile-menu {
  display: none;
}

.game-controls__mobile-balance-value {
  text-align: center;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
}

/* Base font size */
body {
  font-size: 16px;
}

/* Media Queries - Desktop First Approach */
@media (max-width: 1024px) {
  .game-controls {
    font-size: 16px;
    zoom: 0.85;
  }
}

@media (max-width: 824px) {
  .game-controls {
    zoom: 0.8;
  }
}

@media (max-width: 768px) {
  .game-controls {
    height: auto;
    width: 579px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
  }

  .game-controls__balance,
  .game-controls__cashout {
    display: none;
  }

  .game-controls__mobile-menu {
    gap: 8px;
    display: flex;
    align-items: center;
  }

  .game-controls__mobile-balance,
  .game-controls__mobile-cashout {
    width: 278px;
    height: 66px;
    padding: 12px 16px;
  }

  .game-controls__mobile-balance {
    background-image: url("../img/controls/balance-mobile.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .game-controls__mobile-cashout {
    background-image: url("../img/controls/cashout-mobile.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    display: flex;
    align-items: center;
    flex-direction: column;
  }

  .game-controls__mobile-balance .game-controls__currency-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 539px) {
  body {
    font-size: 20px;
  }

  .game-controls {
    font-size: 20px;
    zoom: 0.7;
  }
}

@media (max-width: 425px) {
  .game-controls {
    zoom: 0.65;
  }
}
@media (max-width: 400px) {
  .game-controls {
    zoom: 0.6;
  }
}

@media (max-width: 380px) {
  .game-controls {
    zoom: 0.45;
  }
}


.currency {
    background: #fff;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    border-radius: 50%;
    color: #26272b;
}

#rdrmodal {
    /*display: flex;*/
    display: none;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    z-index: 1000;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
}
