@import url("https://fonts.googleapis.com/css2?family=Gaegu:wght@300;400;700&display=swap");

body {
  font-family: "Inter", sans-serif;
  background-color: #ffffff;
  text-align: center;
  margin: 0;
  padding: 0;
}

h3 {
  padding: 0;
  margin: 10px 0;
  text-align: center;
}
img {
  max-width: 100%;
  height: auto;
}

.logo {
  width: 6vw;
  height: 6vh;
  position: fixed;
  top: 1vw;
  left: 1vw;
  z-index: 9999;
}
.scene {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.button-muted {
  width: 8vw;
  height: 8vh;
  position: fixed;
  top: 1vw;
  right: 1vw;
  z-index: 9999;
  cursor: pointer;
}
.button-muted img {
  width: 70%;
  height: auto;
}

.button-muted:hover {
  transform: scale(1.1);
}

.button-muted:active {
  transform: scale(0.9);
}

#scene1 {
  background-image: url("assets/background-1.webp");
}

.title-cover {
  width: 60vw;
  height: auto;
}

.button-scene1 {
  cursor: pointer;
  border-radius: 50%;
  width: 10vw;
  height: 10vw;
  position: relative;
  display: inline-block;
  transition: transform 0.5s ease;
  outline: none;
}
.button-play {
  background-color: transparent;
  background-image: url("assets/button-play.webp");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.button-scene1:hover {
  transform: scale(1.1);
}

.button-scene1:active,
.button-scene1:focus {
  transform: scale(0.9);
}

#scene2 {
  background-image: url("assets/background-1.webp");
}

.announcement-container {
  position: fixed; /* Gunakan fixed untuk selalu berada di tengah layar */
  top: 45%;
  left: 50%;
  transform: translate(
    -50%,
    -50%
  ); /* Pusatkan secara horizontal dan vertikal */
  background-image: url("assets/background-pop-up.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0vw;
  width: auto; /* Sesuaikan jika ingin agar kontainer melebar penuh */
  height: auto; /* Sesuaikan jika ingin agar kontainer memenuhi tinggi layar */
  max-height: 300px;
  overflow: hidden; /* Pastikan tidak ada konten yang keluar dari kontainer */
  box-sizing: border-box;
  z-index: 1000; /* Atur z-index jika perlu berada di atas elemen lain */
}

.announcement {
  margin: 10vw auto;
  padding: 4vw 4vw 0vw 4vw;
  width: 80vw;
  max-width: 400px;
  height: auto;
  max-height: 400px;
  border-radius: 0.5vw;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 2vw;
  align-items: center;
  font-size: 1em;
}

.announcement .text {
  font-size: 1.5vw;
  margin-bottom: 1vw;
  text-align: center;
}

.button-container {
  display: flex;
  gap: 1vw;
  justify-content: center;
  z-index: 9999;
  align-items: center;
}
.button-container.position {
  position: absolute;
  bottom: 3vw;
  left: 50%;
  transform: translate(-50%, -50%);
}

.button {
  background-image: url(assets/button-orange.svg);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  padding: 2vw 1vw;
  color: white;
  font-size: 0.7em;
  font-weight: bold;
  text-align: center;
  display: inline-block;
  clip-path: polygon(0% 0%, 100% 0%, 94% 100%, 3% 100%);
  cursor: pointer;
  transition: transform 0.5s ease;
  border: none;
  background-color: transparent;
}

#previousBtn {
  background-image: url("assets/prev-btn.webp");
}

#nextBtn {
  background-image: url("assets/next-btn.webp");
}

#previousBtn:hover,
#nextBtn:hover {
  transform: scale(1.1);
}

#previousBtn:active,
#nextBtn:active {
  transform: scale(0.9);
}

#scene3 {
  background-image: url("assets/background-2.webp");
}
.title-scene3 {
  font-size: 2vw;
  font-weight: bold;
  margin-bottom: 1vw;
  text-align: center;
}
.level-list {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.container-level {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 40vw;
}

.container-loading {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2vw;
  width: 100%;
  height: 14vw;
  margin: 1vw 2vw;
  background-image: url("assets/jalan lurus.webp");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.car-loading {
  position: absolute;
  width: 14vw;
  height: 14vw;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  bottom: 0%;
  left: 0%;
  transition: transform 1s ease;
}

.car-1 {
  background-image: url("assets/mobilan_kuning.webp");
}
.car-2 {
  background-image: url("assets/mobilan_putih.webp");
}
.car-3 {
  background-image: url("assets/mobilan_merah.webp");
}

.car-loading.move-right-start {
  transition: transform 3.5s ease;
  transform: translateX(40vw);
}
.car-loading.move-right-end {
  transform: translateX(120vw);
}

.button-scene3 {
  width: 80%;
  font-size: 1.7vw;
  font-weight: bold;
  text-align: center;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.5s ease, box-shadow 0.3s ease, background 0.3s ease;
  border: none;
  border-radius: 0.5vw;
  background: linear-gradient(135deg, #32cd32, #228b22);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
}

.button-scene3:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(34, 139, 34, 0.5);
  background: linear-gradient(135deg, #3cb371, #2e8b57);
}

.button-scene3:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(34, 139, 34, 0.4);
}

.level {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.car-img {
  width: 12vw;
  height: auto;
  transform: rotate(270deg);
  transition: transform 0.5s ease-in-out;
}
.level:hover {
  transform: scale(1.1);
}

.level:active,
.level:focus {
  transform: scale(0.95);
}

.level:active .car-img,
.level:focus .car-img {
  transform: rotate(360deg);
}

#scene4 {
  background-image: url("assets/background-2.webp");
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 700px;
  padding: 10px;
}

#gameArea {
  display: flex;
  justify-content: center;
  max-height: 350px;
  width: 100%;
  gap: 10px;
}

#instructionArea-container {
  display: flex;
  justify-content: center;
  height: 342px;
  border: #296508 solid 0.5vw;
  border-radius: 1vw;
  padding: 0.5vw;
  background-image: url("assets/background-2.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#map {
  width: 490px;
  height: 350px;
  border: #296508 solid 0.5vw;
  border-radius: 1vw;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.map-level-1 {
  background-image: url("assets/TRACK 1.webp");
}

.map-level-2 {
  background-image: url("assets/TRACK 2.webp");
}

.map-level-3 {
  background-image: url("assets/TRACK 3.webp");
}

.map-level-4 {
  background-image: url("assets/TRACK 4.webp");
}

.map-level-5 {
  background-image: url("assets/TRACK 5.webp");
}

.map-level-6 {
  background-image: url("assets/TRACK 6.webp");
}

#car {
  position: absolute;
  width: 70px;
  height: 70px;
  bottom: 0px;
  left: 0px;
  transition: top 3s ease, left 3s ease, transform 3s ease;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#wall1 {
  /* width: 70px;
  height: 210px; */
  top: 0px;
  left: 5px;
}
#wall2 {
  /* width: 210px;
  height: 70px; */
  top: 70px;
  right: 0px;
}
#wall3 {
  /* width: 280px;
  height: 70px; */
  bottom: 70px;
  left: 0px;
  background-color: #1f701f;

}

/* #finish {
  position: absolute;
  width: 70px;
  height: 70px; 
  top: 0;
  right: 0;
  z-index: 1;
} */

.wall {
  position: absolute;
  /* background-color: #333; */
}

#instructionArea {
  width: 10vw;
  height: 312px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-x: hidden;
  overflow-y: overlay;
  scrollbar-width: none;
  padding-top: 0.5vw;
  padding-bottom: -1vw;
}

#instructionArea div {
  margin-top: -0.5vw;
  flex-shrink: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2vw;
  box-sizing: border-box;
}

button {
  /* chanege to vw */
  padding: 1vw;
  font-size: 1.5vw;
  cursor: pointer;
  width: 8vw;
  border-radius: 0.5vw;
}
.btn-instruction {
  background-repeat: no-repeat;
  background-size: contain;
  background-color: transparent;
  background-position: center;
  width: 8vw;
  height: 3vw;
  cursor: pointer;
}

#startBtn {
  background-image: url("assets/mulai.webp");
}

#startBtn:hover {
  transform: scale(1.1);
}

#startBtn:active {
  transform: scale(0.9);
}

#resetBtn {
  background-image: url("assets/ulangi.webp");
}

#resetBtn:hover {
  transform: scale(1.1);
}

#resetBtn:active {
  transform: scale(0.9);
}

#rightBtn {
  background-image: url("assets/btn-right.webp");
}

#forwardBtn {
  background-image: url("assets/btn-forward.webp");
}

#leftBtn {
  background-image: url("assets/btn-left.webp");
}

#scene5 {
  background-image: url("assets/background-end.webp");
  gap: 2vw;
}

.container-text-congrats {
  margin: 0 auto;
  color: #203b03;
  padding: 1vw;
  text-align: center;
  border-radius: 5vw;
}

.text-congrats-title {
  font-size: 4vw; /* Ukuran font responsif */
  font-weight: bold;
  display: block;
  margin-bottom: 1vw;
}

/* Subtitle */
.sub {
  font-size: 1.5vw; /* Ukuran font responsif */
  display: block;
  margin-bottom: 2vw;
}

/* Gambar */
.piala-image {
  width: 50vw; /* Atur lebar gambar responsif */
  height: 20vw; /* Pertahankan aspek rasio */
  margin-top: 3vw;
  /* Radius pada gambar */
}

/* Tablet Landscape */
@media (min-width: 933px) and (max-width: 1023px) and (orientation: landscape) {
  .container {
    width: 100%;
    max-width: 1000px;
    padding: 10px;
  }

  #instructionArea-container {
    height: 490px;
  }
  #gameArea {
    max-width: 1000px;
    max-height: 550px;
  }
  #map {
    width: 700px;
    height: 500px;
  }

  #instructionArea {
    width: 150px;
    height: 460px;
  }

  #car {
    width: 100px;
    height: 100px;
  }

  #wall1 {
    top: 0px;
    left: 5px;
  }
  #wall2 {

    top: 100px;
    right: 0px;
  }
  #wall3 {
    bottom: 100px;
    left: 0px;
  }
}


@media (min-width: 1023px) and (max-width: 1240px) and (orientation: landscape) {
  .container {
    width: 100%;
    max-width: 1000px;
    padding: 10px;
  }
}

/* Desktop Landscape */
@media (min-width: 1240px) and (orientation: landscape) {
  .container {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-width: 100vw;
    padding: 10px;
  }
  #gameArea {
    padding-top: 1vw;
    max-width: 100vw;
    max-height: 100vh;
  }
  #instructionArea-container {
    height: 780px;
  }
  #map {
    width: 1120px;
    height: 800px;
  }

  #instructionArea {
    width: 12vw;
    height: 715px;
  }

  .controls {
    gap: 1vw;
    max-height: 800px;
  }

  #car {
    width: 160px;
    height: 160px;
  }

  #wall1 {
    top: 0px;
    left: 5px;
  }
  #wall2 {
    top: 160px;
    right: 0px;
  }
  #wall3 {
    bottom: 160px;
    left: 0px;
  }

  .announcement {
    max-width: 40vw;
    font-size: 1vw;
    padding: 1vw;
  }
  .announcement-container {
    max-height: 40vw;
    width: 50vw;
  }
}

.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  left: 0;
  top: 0;
  width: 100vw; /* Full width */
  height: 100vh; /* Full height */
  overflow: hidden; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.celebrate {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw; /* Full width */
  height: 100vh; /* Full height */
  overflow: hidden; /* Enable scroll if needed */
  background-image: url("assets/celebrate.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  z-index: 1010;
  justify-content: center;
  align-items: center;
}

.modal-content {
  height: 30vw;
  width: 50%;
  margin: 15% auto; /* 15% from the top and centered */
  background-image: url("assets/background-pop-up-modal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 2vw;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  gap: 1vw;
}

.modal-content p {
  font-size: 1.5vw;
}

.modal-content .btn {
  background-image: url("assets/button-orange.svg");
  background-repeat: no-repeat;
  background-size: contain;
  background-color: transparent;
  background-position: center;
  color: white;
  align-items: center;
  text-align: center;
  cursor: pointer;
  margin-top: 15px;
  border: none;
}

.modal-content .btn.close {
  background-image: url("assets/close.png");

  font-size: 2vw;
  position: absolute;
  color: #1f701f;
  top: 0;
  right: 0;
  width: 6vw;
  height: 6vw;
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-content .btn.check:hover {
  background-image: url("assets/button-orange-hover.svg");
  transform: scale(1.1) translateX(-50%);
}

.modal-content .btn.check:active,
.modal-content .btn.check:focus {
  transform: scale(0.9) translateX(-50%);
}

.alert {
  display: none;
  position: fixed;
  top: 1%;
  left: 50%;
  transform: translate(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px;
  border-radius: 0.5vw;
  text-align: center;
  z-index: 1000;
}

.alert-text {
  margin-bottom: 10px;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.btn-alert {
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 0.3vw;
  padding: 1vw 2vw;
  text-align: center;
  display: inline-block;
  font-size: 16px;
  margin-top: 10px;
  cursor: pointer;
}

.btn-alert:hover {
  background-color: #45a049;
}

.btn-alert:focus {
  outline: none;
}

.btn-alert.no {
  background-color: #f44336;
}

.btn-alert.no:hover {
  background-color: #e53935;
}

.landscape-message {
  color: #333;
  display: none; /* Sembunyikan pesan saat potrait */
}

@media only screen and (orientation: portrait) {
  .landscape-message {
    display: flex;
    height: 100vh;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
  }
}

@media only screen and (orientation: landscape) {
  #scene1 {
    display: flex;
  }
  .landscape-message {
    display: none; /* Sembunyikan pesan saat lanskap */
  }
}
