* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
}

/* blur background when alert (winner / try again) is shown */
.blur-active .background img,
.blur-active .slot-frame-around-tiger,
.blur-active .spin,
.blur-active .playButton,
.blur-active .text,
.blur-active .logo,
.blur-active .modelphone,
.blur-active .najamodel {
  filter: blur(4px) brightness(0.7);
  transition: filter 0.2s ease-out;
}

.background {
  position: relative;
  width: 550px;
  height: 100vh;
  overflow: hidden;
}

.background img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.main-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.logo {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 100%;
  max-width: 200px;
  height: 100%;
  object-fit: cover;
}

.effect {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.effect img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text img {
  width: 100%;
  max-width: 400px;
  height: 100%;
  object-fit: cover;
}

.slot-frame-around-tiger {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.slot-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 8px;
  max-width: 355px;
  width: 100%;
  z-index: 10;
}
.button-spin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-item {
  width: 100%;
  display: block;
}

.slot-empty {
  visibility: hidden;
}

/* highlight for the active spinning item */
.active-slot {
  position: relative;
  outline: 4px solid #ffffff;
  border-radius: 14px;
  box-shadow:
    0 0 32px rgba(255, 255, 255, 0.9),
    0 0 62px rgba(255, 255, 255, 0.7),
    0 0 84px rgba(255, 255, 255, 0.5),
    0 0 100px rgba(255, 255, 255, 0.35);
  transition:
    box-shadow 0.15s ease-out,
    outline-width 0.15s ease-out;
}

.frame {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.frame-spin-run {
  position: absolute;
  top: 10%;
  left: 42%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  overflow: hidden;
}

.frame-spin-run img {
  width: 100%;
  max-width: 220px;
  height: 100%;
  object-fit: cover;
}

.frame img {
  width: 100%;
  max-width: 450px;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.spin {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.spin img {
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
}

.playButton {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.playButton img {
  width: 100%;
  max-width: 250px;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* Ensure spin wheel rotates around center and shows pointer */
.spin img {
  transform-origin: 50% 50%;
  cursor: pointer;
  pointer-events: auto;
}

.modelphone {
  position: absolute;
  top: 84%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modelphone img {
  width: 100%;
  max-width: 550px;
  height: 100%;
  object-fit: cover;
}

.najamodel {
  position: absolute;
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.najamodel img {
  width: 100%;
  max-width: 300px;
  height: 100%;
  object-fit: cover;
}

.popout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

.popout-content {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.popout-text {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popout-text img {
  width: 100%;
  max-width: 480px;
  /* match main popout image size */
  height: auto;
  object-fit: contain;
}
.popout-button {
  position: absolute;
  margin-top: 5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 30px;
  z-index: 99999;
}
.popout-button img {
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: cover;
}

.popout-tryagain {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
}

.popout-content-tryagain {
  position: absolute;
  top: 55%;
  left: 70%;
  transform: translate(-50%, -50%);
  width: 70%;
}

.popout-content-tryagain img {
  width: 100%;
  max-width: 400px;
  height: auto;
  object-fit: cover;
}

.button-tryagain {
  position: absolute;
  margin-top: 10%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 30px;
  z-index: 99999;
}
.button-tryagain img {
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: cover;
}

@media (max-width: 768px) {
  .text {
    top: 23%;
    width: 70%;
  }

  .frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }
  .slot-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    max-width: 300px;
    width: 100%;
    z-index: 10;
  }
  .spin {
    top: 45%;
  }

  .spin img {
    max-width: 300px;
  }

  .effect {
    top: 43%;
  }

  .effect img {
    max-width: 40px;
  }

  .popout-tryagain {
    position: absolute;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 100%;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
  }
  .popout-tryagain img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }

  .popout-content-tryagain {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
  }

  .button-tryagain {
    position: absolute;
    margin-top: 10%;
    left: 40%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 30px;
    z-index: 99999;
  }
  .button-tryagain img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
  }

  .popout-button {
    margin-top: 10%;
  }
  .popout-text {
    top: 5%;
    width: 100%;
  }
  .popout-text img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }

  .popout-button img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 35px;
  }
}

@media (max-width: 440px) {
  .text {
    top: 25%;
    width: 85%;
  }

  .frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }
  .slot-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    max-width: 300px;
    width: 100%;
    z-index: 10;
  }
  .spin {
    top: 45%;
  }

  .spin img {
    max-width: 300px;
  }

  .effect {
    top: 43%;
  }

  .effect img {
    max-width: 40px;
  }

  .popout-tryagain {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
  }
  .popout-tryagain img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }

  .popout-content-tryagain {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
  }

  .button-tryagain {
    position: absolute;
    margin-top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 30px;
    z-index: 99999;
  }
  .button-tryagain img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
  }

  .popout-button {
    margin-top: 26%;
  }
  .popout-text {
    top: 5%;
    width: 100%;
  }
  .popout-text img {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
  }

  .popout-button img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 35px;
  }
}

@media (max-width: 428px) {
  .text {
    width: 70%;
  }

  .modelphone {
    top: 82%;
  }

  .najamodel {
    top: 88%;
  }

  .najamodel img {
    max-width: 250px;
  }

  .frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  .slot-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    max-width: 300px;
    width: 100%;
    z-index: 10;
  }

  .spin {
    top: 45%;
  }

  .spin img {
    max-width: 280px;
  }

  .effect {
    top: 43%;
  }

  .effect img {
    max-width: 40px;
  }

  .popout-button-tryagain {
    margin-top: 40%;
    width: 30%;
  }

  .popout-model-tryagain {
    top: 35%;
  }

  .popout-model-tryagain img {
    max-width: 400px;
  }

  .popout-button-tryagain {
    margin-top: 50%;
    width: 50%;
  }
  .button-tryagain {
    position: absolute;
    margin-top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    z-index: 99999;
  }
  .popout-text {
    top: 5%;
    width: 100%;
  }
  .popout-text img {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
  }
  .popout-button {
    margin-top: 28%;
  }

  .popout-button img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 35px;
  }
}

@media (max-width: 390px) {
  .text {
    width: 80%;
  }

  .modelphone {
    top: 82%;
  }

  .najamodel {
    top: 88%;
  }

  .najamodel img {
    max-width: 250px;
  }

  .frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  .slot-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    max-width: 260px;
    width: 100%;
    z-index: 10;
  }

  .spin {
    top: 45%;
  }

  .spin img {
    max-width: 280px;
  }

  .effect {
    top: 43%;
  }

  .effect img {
    max-width: 40px;
  }

  .popout-button-tryagain {
    margin-top: 40%;
    width: 30%;
  }

  .popout-model-tryagain {
    top: 35%;
  }

  .popout-model-tryagain img {
    max-width: 400px;
  }

  .popout-button-tryagain {
    margin-top: 50%;
    width: 50%;
  }
  .button-tryagain {
    position: absolute;
    margin-top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    z-index: 99999;
  }
  .popout-text {
    top: 5%;
    width: 100%;
  }
  .popout-text img {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
  }
  .popout-button {
    margin-top: 28%;
  }

  .popout-button img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 35px;
  }
}

@media (max-width: 360px) {
  .text {
    width: 60%;
  }

  .modelphone {
    top: 82%;
  }

  .najamodel {
    top: 88%;
  }

  .najamodel img {
    max-width: 250px;
  }

  .frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  .slot-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    max-width: 260px;
    width: 100%;
    z-index: 10;
  }

  .spin {
    top: 45%;
  }

  .spin img {
    max-width: 280px;
  }

  .effect {
    top: 43%;
  }

  .effect img {
    max-width: 40px;
  }

  .popout-model-tryagain {
    top: 30%;
  }

  .popout-model-tryagain img {
    max-width: 400px;
  }

  .popout-button-tryagain {
    margin-top: 50%;
    width: 50%;
  }
  .button-tryagain {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    z-index: 99999;
  }
  .popout-text {
    top: 5%;
    width: 100%;
  }
  .popout-text img {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
  }
  .popout-button {
    margin-top: 28%;
  }

  .popout-button img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 35px;
  }
}
