@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #061b12;
  font-family: "Montserrat", sans-serif;
}

.treasure-game {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: #fff;
  background: #061b12;
}

.treasure-game__start {
  position: absolute;
  inset: 0;
  background: url("../img/bg.png") center / cover no-repeat;
  overflow: hidden;
}

.treasure-game__logo {
  /* position: absolute; */
  top: 5%;
  left: 2.5%;
  z-index: 6;
  flex: 0 0 19%;
}

.treasure-game__logo img {
  display: block;
  width: 100%;
  height: auto;
}
.treasure-game__logo a {
  width: 100%;
  display: block;
}
.treasure-game__logo a:first-child {
  margin-bottom: 30px;
}
.right {
  margin-left: 126px;
  margin-right: auto;
  margin-top: 29px;
}
.treasure-game__logo img + img {
  margin-top: 20px;
}

.treasure-game__title {
  /* position: absolute; */
  top: 7.5%;
  right: 6%;
  z-index: 6;
  min-width: clamp(250px, 36vw, 520px);
  max-width: 893px;
  padding: 20px 30px;
  text-align: center;
  border: 6px solid #ffe603;
}

.treasure-game__title span {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: 64.4337px;
  line-height: 79px;

  color: #ffffff;
}

.treasure-game__title h1 {
  margin: 0;
  font-style: normal;
  font-weight: 800;
  font-size: 92.1312px;
  line-height: 112px;

  color: #ffe603;
}

.treasure-game__tries {
  margin-left: auto;
  margin-right: auto;
  margin-top: -42px;
  width: 419px;
  height: 172px;
  background: url(../img/popup.png) center / contain no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.header {
  position: absolute;
  width: 100%;
  padding: 50px 50px 0 50px;
  display: flex;
  justify-content: space-between;
}

.treasure-game__tries span {
  font-weight: 600;
  font-size: clamp(11px, 1.1vw, 22px);
  line-height: 1;
  font-style: normal;
  font-weight: 600;
  font-size: 22.4308px;
  line-height: 27px;
  text-align: center;
  color: #ffffff;
  margin-top: -20px !important;
}

.treasure-game__tries strong {
  font-weight: 800;
  font-size: 48.6731px;
  line-height: 59px;

  color: #ffe603;
}

.treasure-game__terms {
  position: absolute;
  right: 3%;
  bottom: 5%;
  z-index: 30;
  margin: 0;
  max-width: 453px;
  text-align: right;
  font-size: clamp(8px, 0.8vw, 15px);
  line-height: 1.25;
  color: #fff;
  pointer-events: auto;
}

.treasure-game__terms a {
  position: relative;
  z-index: 31;
  color: #fff;
  text-decoration: underline;
  pointer-events: auto;
  margin-bottom: -6px;
  display: block;
}

.treasure-game__terms a:hover {
  color: #ffe603;
}

.chest-zone {
  position: absolute;
  z-index: 10;
  border: 0;
  padding: 0;
  background: rgba(255, 0, 0, 0);
  cursor: pointer;
}

.chest-zone--1 {
  left: 15%;
  top: 61%;
  width: 22%;
  height: 24%;
}

.chest-zone--2 {
  left: 34%;
  top: 51%;
  width: 18%;
  height: 22%;
}

.chest-zone--3 {
  left: 51%;
  top: 58%;
  width: 20%;
  height: 22%;
}

.chest-zone--4 {
  left: 58%;
  top: 76%;
  width: 22%;
  height: 25%;
}

.chest-zone--5 {
  left: 35%;
  top: 70%;
  width: 25%;
  height: 26%;
}

/* .chest-zone:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 13px;
} */

.chest-zone.is-disabled {
  pointer-events: none;
}

.treasure-popup {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(circle at center, rgba(0, 255, 170, 0.35), transparent 30%),
    rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.treasure-game.is-lose .treasure-popup--lose,
.treasure-game.is-win .treasure-popup--win {
  display: flex;
  justify-content: flex-start;
}

.treasure-popup__board {
  width: 770px;
  min-height: 335px;
  /* margin-top: 20px; */
  top: 0;
  background: url(../img/popup.png) top / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  animation: boardDrop 0.45s ease forwards;
  z-index: 99;
}
.treasure-popup.treasure-popup--win .treasure-popup__board{
  width: 647px;
    min-height: 286px;
}
.treasure-popup__board span {
  font-weight: 600;
  font-size: 28.7242px;
  line-height: 35px;
  text-align: center;
  color: #ffffff;
  margin-top: 72px;
}
.treasure-popup.treasure-popup--win .treasure-popup__board span{
      margin-top: 74px;
}
.treasure-popup__board strong {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-size: 62.0551px;
  line-height: 55px;
  color: #ffe603;
}

.treasure-popup__chest {
  display: block;
  width: clamp(250px, 29vw, 290px);
  margin-top: -157px;
  animation: chestPop 0.5s ease forwards;
}

.treasure-popup__chest--win {
  width: clamp(290px, 34vw, 550px);
}

.treasure-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 421px;
  height: 86px;
  padding: 20px;
  margin-bottom: 40px;

  font-style: normal;
  font-weight: 800;
  font-size: 35.9857px;
  line-height: 43px;
  text-align: center;
  text-transform: uppercase;
  color: #ffffff;

  text-shadow: 0px 4.33116px 4.33116px rgba(0, 0, 0, 0.41);

  border-radius: 17px;
  border: 2px solid #00f8be;

  position: relative;
  overflow: hidden;
  cursor: pointer;

  background: linear-gradient(
    180deg,
    #00f8be 0%,
    #00f8be 50%,
    #009371 88%,
    #00f8be 99%
  );

  box-shadow:
    0 0 10px rgba(0, 248, 190, 0.55),
    0 0 24px rgba(0, 248, 190, 0.35),
    inset 0 3px 6px rgba(255, 255, 255, 0.25),
    inset 0 -6px 10px rgba(0, 0, 0, 0.3);

  transition: 0.25s ease;
  animation: popupBtn 1s linear infinite alternate;
}

@keyframes boardDrop {
  from {
    opacity: 0;
    transform: translateY(-28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chestPop {
  from {
    opacity: 0;
    transform: scale(0.75);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
.treasure-popup.treasure-popup--win .treasure-popup__btn {
  text-decoration: none;
  width: 482px;
}
.treasure-popup.treasure-popup--win .treasure-popup__chest.treasure-popup__chest--win {
    width: clamp(290px, 27vw, 575px);
}
.treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 74px;
}
@media (max-width: 1600px) {
  .treasure-game__tries {
    right: 2.5%;
  }
  .treasure-game__title {
    right: 2%;
  }
  .right {
    margin-left: 90px;
    margin-top: 20px;
  }
  .treasure-game__title span {
    font-size: 57.4337px;
  }
  .treasure-game__title h1 {
    font-size: 72.1312px;
  }
  .treasure-game__tries strong {
    font-size: 40.6731px;
  }
  .treasure-game__logo {
    flex: 0 0 14%;
  }
  .chest-zone--1 {
    width: 16%;
    height: 16%;
  }
  .chest-zone--2 {
    left: 38%;
    top: 56%;
    width: auto;
    height: auto;
  }
  .chest-zone--3 {
    left: 58%;
    top: 58%;
    width: auto;
    height: auto;
  }
  .chest-zone--4 {
    left: 58%;
    top: 76%;
    width: auto;
    height: auto;
  }
  .chest-zone--5 {
    left: 39%;
    top: 70%;
    width: auto;
    height: auto;
  }
}
@media (max-width: 1300px) {
  .chest-zone img {
    width: 80%;
  }
  .right {
    margin-left: 70px;
    margin-top: 0;
  }
  .header {
    padding: 30px 50px 0 50px;
  }
}
@media (max-width: 1250px) {
  .treasure-game__tries {
    width: 272px;
    height: 132px;
  }
}
@media (max-width: 1050px) {
  .treasure-game__logo img {
    display: block;
    width: clamp(90px, 17vw, 298px);
    height: auto;
  }

  .treasure-game__terms {
    position: absolute;
    right: 40%;
    text-align: center;
    bottom: 2%;
  }
  .treasure-game__logo img + img {
    margin-top: 0;
  }

  .treasure-game__tries {
    width: 390px;
    height: 187px;
    margin-left: auto;
    margin-right: auto;
  }
  .header {
    padding: 30px 20px 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .treasure-game__logo {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .treasure-game__logo a:last-child img {
    margin-left: auto;
  }
  .right {
    margin-left: auto;
  }
  .chest-zone img {
    width: 65%;
  }

  .chest-zone--1 {
    top: 75%;
  }
  .chest-zone--2 {
    left: 31%;
    top: 66%;
  }
  .chest-zone--3 {
    left: 54%;
    top: 62%;
  }
  .chest-zone--4 {
    left: 58%;
    top: 78%;
  }
  .chest-zone--5 {
    left: 39%;
    top: 74%;
  }
}
@media (max-width: 900px) {
  .header {
    padding: 20px 20px 0 20px;
  }
  .treasure-game__title {
    padding: 11px 13px;
  }

  .treasure-game__title span {
    font-size: 34.4337px;
    line-height: 48px;
  }
  .treasure-game__title h1 {
    font-size: 50.1312px;
    line-height: 58px;
  }
  .treasure-game__tries span {
    margin-top: 23px;
  }
  .treasure-game__start {
    background: url(../img/bg.png) right / cover no-repeat;
  }
}
@media (max-width: 700px) {
  .chest-zone--1 {
    left: 3%;
  }
  .chest-zone--2 {
    left: 18%;
  }
  .chest-zone--3 {
    left: 49%;
  }
  .chest-zone--4 {
    left: 75%;
  }
  .chest-zone--5 {
    left: 32%;
    top: 74%;
  }
}
@media (max-width: 600px) {
  .treasure-game__logo {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .treasure-game__start {
    position: absolute;
    inset: 0;
    background: url(../img/bg-mob.png) center / cover no-repeat;
    overflow: hidden;
  }
  .treasure-game__title {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .right {
    width: 100%;
  }
  .header {
    position: absolute;
    width: 100%;
    padding: 87px 20px 0 20px;
    flex-direction: column;
    align-items: center;
    gap: 39px;
  }
  .treasure-game__terms a {
    margin-bottom: 5px;
  }
  .treasure-game__tries {
    width: 327px;
    height: 158px;
    margin-left: auto;
    margin-right: auto;
  }
  .chest-zone--1 {
    top: 80%;
  }
  .chest-zone--2 {
    top: 70%;
  }
  .chest-zone--3 {
    top: 71%;
  }
  .chest-zone--4 {
    top: 85%;
  }
  .chest-zone--4 {
    left: 58%;
    top: 85%;
  }
  .chest-zone--4 img,
  .chest-zone--5 img {
    width: 50%;
  }
  .chest-zone--5 {
    left: 31%;
    top: 82%;
  }
  .treasure-game__tries span {
    font-size: 17.4308px;
    margin-top: 23px;
  }
  .treasure-game__tries strong {
    font-size: 23.6731px;
    line-height: 30px;
  }
  .treasure-game__terms {
    line-height: 0.5;
  }
  .header {
    position: absolute;
    width: 100%;
    padding: 20px 20px 0 20px;
    flex-direction: column;
    align-items: center;
    gap: 39px;
  }

  .treasure-game__terms {
    position: absolute;
    right: auto;
    text-align: center;
    bottom: 2%;
  }
  .treasure-game__terms {
    left: 50%;
    transform: translateX(-50%);
    bottom: 2%;
    z-index: 30;

    width: 90%;
    max-width: 700px;

    margin: 0;
    text-align: center;

    font-size: clamp(9px, 0.75vw, 14px);
    /* line-height: 1.4; */
    color: #fff;

    pointer-events: auto;
  }
  .treasure-game__title h1 {
    font-size: 27.1312px;
    line-height: 58px;
  }
  .header {
    gap: 7px;
  }
  .treasure-game__title {
    padding: 10px 16px;
  }
}
.treasure-popup {
  max-height: 1400px;
  min-height: 100vh;
  overflow-y: auto;
}
.treasure-popup__btn {
  height: 86px;
  min-height: 86px;
  max-height: 86px;
  line-height: 1;
  flex-shrink: 0;
      margin-top: -21px;
}
.treasure-popup {
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .treasure-popup__board {
    width: 80%;
    min-height: auto;
    margin-top: 0;
  }
  .treasure-popup__board span {
    font-size: 19.0571px;
    line-height: 25px;
    margin-top: 103px;
  }
  .treasure-popup__board strong {
    font-size: 32.9722px;
    letter-spacing: 0rem;
  }
  .treasure-popup__btn {
    width: 320px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 123px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board {
    min-height: 246px;
  }
}
@media (max-width: 540px) {
  .treasure-popup__board span {
    margin-top: 93px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board {
    min-height: 228px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 121px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__btn {
    text-decoration: none;
    width: max-content;
  }
}
@media (max-width: 500px) {
  .treasure-popup__board strong {
    line-height: 32px;
  }
  .treasure-game__start {
    background: url(../img/bg-mob.png) right / cover no-repeat;
  }
  .treasure-game__tries {
    width: 279px;
    height: 144px;
  }
  .chest-zone img {
    width: 62%;
  }
  .chest-zone--1 {
    top: 73%;
  }
  .chest-zone--2 {
    top: 66%;
  }
  .chest-zone--3 {
    left: 66%;
  }
  .chest-zone--4 {
    left: 58%;
    top: 83%;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board {
    width: 469px;
    min-height: 286px;
}
.treasure-popup__chest {
    margin-top: -90px;
  }
  .chest-zone--5 {
    left: 21%;
    top: 78%;
  }
  .treasure-popup__board {
    min-height: 204px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__btn {
    text-decoration: none;
    width: max-content;
    font-size: 28.9857px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board {
    min-height: 205px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 110px;
  }
  .chest-zone--4 img,
  .chest-zone--5 img {
    width: 50%;
  }
  .chest-zone--1 img {
    width: 100%;
  }
}
@media (max-width: 450px) {
  .treasure-popup__board {
    background: url(../img/popup.png) top / contain no-repeat;
  }
  .treasure-game__title span {
    font-size: 25.4337px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 69px;
  }
  .treasure-popup__board span {
    font-size: 2vh;
    line-height: 25px;
    margin-top: 73px;
  }
  .treasure-popup__board strong {
    font-size: 4vh;
    letter-spacing: 0rem;
  }
  .treasure-popup__btn {
    max-height: 55px;
    min-height: 55px;
    font-size: 26.9857px;
    width: max-content;
    padding-left: 32px;
    padding-right: 32px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board {
    min-height: 147px;
  }
}
@media (max-width: 400px) {
  .treasure-popup__board span {
    margin-top: 60px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 81px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__btn {
    text-decoration: none;
    width: max-content;
    font-size: 17.9857px;
  }
}
@media (max-width: 355px) {
  .treasure-popup__board span {
    margin-top: 54px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 68px;
  }
  .treasure-popup__board strong {
    font-size: 3.5vh;
    line-height: 24px;
  }
}

@media (max-width: 750px) {
  .treasure-popup__board {
    width: 669px;
    min-height: 295px;
  }
  .treasure-popup__board span {
    font-size: 22.7242px;
    margin-top: 59px;
  }
  .treasure-popup__board strong {
    font-size: 52.0551px;
    line-height: 45px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 83px;
  }
}
@media (max-width: 600px) {
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 69px;
  }
  .treasure-popup__board {
    width: 496px;
    min-height: 261px;
  }
}
@media (max-width: 540px) {
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 58px;
  }
}
@media (max-width: 500px) {
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 55px;
  }
  .treasure-popup__board {
    width: 400px;
    min-height: 218px;
    margin-top: 25px;
  }
  .treasure-popup__board span {
    font-size: 17.7242px;
    margin-top: 46px;
  }
  .treasure-popup__board strong {
    font-size: 34.0551px;
    line-height: 31px;
  }
}
@media (max-width: 450px) {
  .treasure-popup__board {
    width: 400px;
    min-height: 214px;
    margin-top: 25px;
  }
  .treasure-popup__board span {
    font-size: 17.7242px;
    margin-top: 36px;
  }
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 33px;
  }
}
@media (max-width: 400px) {
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 27px;
  }
}
@media (max-width: 355px) {
  .treasure-popup.treasure-popup--win .treasure-popup__board span {
    margin-top: 34px;
  }
}
.treasure-popup__btn {
  transition: transform 0.3s ease;
}

.treasure-popup__btn:hover {
  transform: scale(1.03);
}

/* анімація поплавків */
.chest-zone img {
  display: block;
  animation: waterTilt 2.8s ease-in-out infinite;
  transform-origin: center bottom;
}

.chest-zone--1 img {
  animation-delay: 0.2s;
}
.chest-zone--2 img {
  animation-delay: 0.6s;
}
.chest-zone--3 img {
  animation-delay: 1s;
}
.chest-zone--4 img {
  animation-delay: 1.4s;
}
.chest-zone--5 img {
  animation-delay: 1.8s;
}

@keyframes waterTilt {
  0%,
  100% {
    transform: rotate(-1deg);
  }

  25% {
    transform: rotate(2deg);
  }

  50% {
    transform: rotate(-2.5deg);
  }

  75% {
    transform: rotate(1.5deg);
  }
}
@keyframes waterTilt {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  25% {
    transform: translateY(-4px) rotate(2deg);
  }

  50% {
    transform: translateY(2px) rotate(-2.5deg);
  }

  75% {
    transform: translateY(-3px) rotate(1.5deg);
  }
}
.chest-zone--1 img {
  animation: float1 2.7s ease-in-out infinite;
}

.chest-zone--2 img {
  animation: float2 3.1s ease-in-out infinite;
}

.chest-zone--3 img {
  animation: float3 2.9s ease-in-out infinite;
}

.chest-zone--4 img {
  animation: float4 3.3s ease-in-out infinite;
}

.chest-zone--5 img {
  animation: float5 2.5s ease-in-out infinite;
}

@keyframes float1 {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}

@keyframes float2 {
  0%,
  100% {
    transform: translateY(0) rotate(1deg);
  }
  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

@keyframes float3 {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-6px) rotate(1.5deg);
  }
}

@keyframes float4 {
  0%,
  100% {
    transform: translateY(0) rotate(1.5deg);
  }
  50% {
    transform: translateY(-4px) rotate(-1deg);
  }
}

@keyframes float5 {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-5px) rotate(2.5deg);
  }
}
.chest-zone {
  transform-origin: center center;
}
