@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;
}

.treasure-game__logo img {
  display: block;
  width: clamp(90px, 11vw, 298px);
  height: auto;
}

.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);
  padding: 18px 30px;
  text-align: center;
  border: 4.98621px solid #51d7be;
}

.treasure-game__title span {
  display: block;
  font-weight: 500;
  font-size: clamp(20px, 2.7vw, 54px);
  line-height: 1.1;
}

.treasure-game__title h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(34px, 4.5vw, 87px);
  line-height: 1.05;
}

.treasure-game__tries {
  margin-left: auto;
  width: 324px;
  height: 155px;
  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: 34px;
}

.treasure-game__tries strong {
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 43px);
  line-height: 1;
  color: #51d7be;
}

.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: 5px;
  display: block;
}

.treasure-game__terms a:hover {
  color: #51d7be;
}

/* невидимі клікабельні зони */
.chest-zone {
  position: absolute;
  z-index: 10;
  border: 0;
  padding: 0;
  background: rgba(255, 0, 0, 0);
  cursor: pointer;
}

/* для перевірки можна тимчасово включити:
.chest-zone { background: rgba(255, 0, 0, 0.25); }
*/

.chest-zone--1 {
  left: 18%;
  top: 45%;
  width: 22%;
  height: 24%;
}

.chest-zone--2 {
  left: 34%;
  top: 21%;
  width: 18%;
  height: 22%;
}

.chest-zone--3 {
  left: 51%;
  top: 31%;
  width: 20%;
  height: 22%;
}

.chest-zone--4 {
  left: 58%;
  top: 49%;
  width: 22%;
  height: 25%;
}

.chest-zone--5 {
  left: 38%;
  top: 67%;
  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: 527px;
  min-height: 285px;
    margin-top: -46px;
  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;
}

.treasure-popup__board span {
  font-weight: 600;
  font-size: 24.0571px;
  line-height: 29px;
  text-align: center;
  color: #ffffff;
  margin-top: 122px;
}

.treasure-popup__board strong {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-size: 51.9722px;
  line-height: 48px;
  letter-spacing: 0.1rem;
  color: #51d7be;
}

.treasure-popup__chest {
  display: block;
    width: clamp(250px, 29vw, 366px);
  height: auto;
  margin-bottom: 40px;
  margin-top: 32px;
  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, 34vw, 575px);
}
.treasure-popup.treasure-popup--win .treasure-popup__board span {
  margin-top: 150px;
}
.treasure-popup.treasure-popup--win .treasure-popup__chest.treasure-popup__chest--win{
    width: clamp(290px, 27vw, 514px);
    max-height: 362px;
}
.treasure-popup.treasure-popup--win .treasure-popup__board {
    width: 543px;
    min-height: 264px;
  }
@media (max-width: 1600px) {
  .treasure-game__tries {
    right: 2.5%;
  }
  .treasure-game__title {
    right: 2%;
  }
}

@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;
  }

  .treasure-game__title h1 {
    font-size: clamp(34px, 2.5vw, 87px);
  }
  .treasure-game__tries {
    width: 267px;
    height: 113px;
  }
  .chest-zone--1 {
    left: 6%;
    top: 45%;
    width: 26%;
    height: 23%;
  }
  .chest-zone--2 {
    left: 27%;
    top: 21%;
    width: 22%;
    height: 22%;
  }
  .chest-zone--3 {
    left: 51%;
    top: 31%;
    width: 28%;
    height: 22%;
  }
  .chest-zone--4 {
    left: 67%;
    top: 49%;
    width: 27%;
    height: 25%;
  }
  .chest-zone--5 {
    left: 35%;
    top: 67%;
    width: 33%;
    height: 26%;
  }
}
@media (max-width: 900px) {
  .header {
    padding: 20px 20px 0 20px;
  }
  .treasure-game__title {
    padding: 11px 13px;
  }
  .chest-zone--1 {
    left: 0;
    top: 45%;
    width: 26%;
    height: 23%;
  }
  .chest-zone--4 {
    left: 72%;
    top: 49%;
    width: 27%;
    height: 25%;
  }
  .chest-zone--3 {
    left: 55%;
    top: 31%;
    width: 28%;
    height: 22%;
  }
  .chest-zone--5 {
    left: 32%;
    top: 67%;
    width: 38%;
    height: 26%;
  }
  .treasure-game__title span {
    font-size: clamp(13px, 2.7vw, 54px);
  }
  .treasure-game__title h1 {
    font-size: clamp(27px, 2.5vw, 87px);
  }
  .treasure-game__tries {
    width: 217px;
    height: 90px;
    margin-right: 0;
  }
  .treasure-game__tries span {
    margin-top: 23px;
  }
}
@media (max-width: 600px) {
  .treasure-game__logo {
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .chest-zone--1 {
    left: 0;
    top: 64%;
    width: 40%;
    height: 27%;
  }
  .chest-zone--2 {
    left: 21%;
    top: 36%;
    width: 34%;
    height: 23%;
  }
  .chest-zone--3 {
    left: 51%;
    top: 48%;
    width: 38%;
    height: 22%;
  }
  .chest-zone--4 {
    left: 68%;
    top: 66%;
    width: 38%;
    height: 25%;
  }
  .chest-zone--5 {
    left: 26%;
    top: 74%;
    width: 45%;
    height: 26%;
  }
  .treasure-game__start {
    position: absolute;
    inset: 0;
    background: url(../img/bg-mob.png) center / cover no-repeat;
    overflow: hidden;
  }
  .treasure-game__title {
    width: 80%;
    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__tries {
    width: 212px;
    height: 80px;
    margin-left: auto;
    margin-right: auto;
  }
  .treasure-game__tries span {
    font-size: 17.4308px;
    margin-top: 23px;
  }
  .treasure-game__tries strong {
    font-size: clamp(17px, 2.2vw, 43px);
  }
  .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: clamp(28px, 4.5vw, 87px);
  }
  .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;
}
.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-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;
  }
}
@media (max-width: 450px) {
  .treasure-popup__board {
    background: url(../img/popup.png) top / contain no-repeat;
  }
  .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;
  }
}
