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

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

/* Background */
.background {
  position: relative;
  width: 100%;
  max-width: 500px; /* keeps design centered like mobile app */
  height: 100vh;
}

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

/* Main content */
.main-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 500px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.text img {
  width: 70%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
}

/* Scratch card */
.grid-wrapper {
  position: absolute;
  top: 45%;
  left: 15%;
  transform: translate(-50%, -50%);
}

.grid-frame {
  align-items: flex-end;
  width: 100%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
}

/* Popout */
.popout {
  position: fixed;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s ease-in;
  z-index: 100;
  pointer-events: none;
}

.popout.show {
  opacity: 1;
  pointer-events: auto;
}

.popout img {
  width: 90%;
  max-width: 400px;
  height: auto;
  cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .text img {
    width: 80%;
  }

  .grid-frame {
    width: 45%;
  }

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

  .grid-frame {
    width: 45%;
  }

  .popout img {
    max-width: 400px;
  }
  .grid-wrapper {
    position: absolute;
    top: 45%;
    left: 22%;
    transform: translate(-50%, -50%);
  }
  .grid-frame {
    align-items: flex-end;
    width: 70%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
  }
}
@media (max-width: 430px) {
  .text img {
    width: 80%;
  }

  .grid-frame {
    /* width: 100%; */
    max-width: 220px;
  }

  .popout img {
    max-width: 400px;
  }
  .grid-wrapper {
    width: 100%;
    position: absolute;
    top: 45.6%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .grid-frame {
    align-items: flex-end;
    width: 74%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
  }
}

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

  .grid-frame {
    width: 45%;
  }

  .popout img {
    max-width: 400px;
  }
  .grid-wrapper {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .grid-frame {
    align-items: flex-end;
    width: 74%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
  }
}
@media (max-width: 414px) {
  .text img {
    width: 80%;
  }

  .grid-frame {
    width: 45%;
  }

  .popout img {
    max-width: 700px;
  }
  .grid-wrapper {
    position: absolute;
    top: 45.6%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .grid-frame {
    align-items: flex-end;
    width: 74%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
  }
}

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

  .grid-frame {
    /* width: 100%; */
    max-width: 250px;
  }

  .popout img {
    max-width: 400px;
  }
  .grid-wrapper {
    width: 100%;
    position: absolute;
    top: 45.6%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .grid-frame {
    align-items: flex-end;
    width: 74%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
  }
}