body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #87ceeb;
  height: 100vh;
}

/* #game {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #87ceeb url('images/bg-container.png') no-repeat center/cover;
} */

#game {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  /* background langit + jalan bergeser */
  background: #87ceeb url("images/bg-container.png?v=1.0") repeat-x;
  background-size: cover;
  transition: background-image 1s ease-in-out;
}

#startGameBtn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* pusatkan dengan benar */
  padding: 15px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #ff7f50, #ffb347);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  animation: pulse 1.5s infinite;
}

#startGameBtn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  background: linear-gradient(135deg, #ff6347, #ff9f40);
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -50%) scale(1); }
}


#track {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  width: 2000px;          /* panjang lintasan */
  transition: transform 0.2s linear;
}

/* karakter */
#character {
  position: absolute;
  bottom: 11%;  /* dinaikkan dari 12% → sesuaikan */
  left: 0;
  width: 5vw;
  max-width: 80px;
  aspect-ratio: 4/5;
  background: url("images/character.gif?v=1.0") no-repeat center/contain;
  z-index: 5;
}

/* pos/checkpoint */
.checkpoint {
  position: absolute;
  bottom: 12%;   /* sama dengan karakter supaya sejajar */
  width: 6vw;
  max-width: 80px;
  aspect-ratio: 4/5;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 4;
  transition: transform 0.3s ease;
}

.checkpoint:hover {
  transform: scale(1.1);
}


/* kotak pertanyaan */
#questionBox {
  display: none; /* tetap hidden awalnya */
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffe29f, #ffcc70);
  padding: 20px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
  z-index: 10;
  font-size: 1.1rem;
  text-align: center;
  max-width: 90%;
  width: 320px;
  transition: all 0.3s ease;
  animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
  0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

#questionBox input {
  width: 80%;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 10px;
  border: 2px solid #ffb347;
  font-size: 1rem;
  text-align: center;
  transition: border 0.2s;
}

#questionBox input:focus {
  outline: none;
  border-color: #ff7f50;
  box-shadow: 0 0 8px rgba(255,127,80,0.5);
}

#submitBtn {
  background-color: #ff7f50;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

#submitBtn:hover {
  background-color: #ff6347;
  transform: scale(1.05);
}

#feedback {
  margin-top: 8px;
  font-weight: bold;
  min-height: 20px;
}

#track {
  transition: transform 0.2s linear;
}

/* Tablet */
@media (max-width: 850px ) {
  #game { height: 100vh; }
  #character{ 
    bottom: 27%;  /* dinaikkan dari 12% → sesuaikan */
    width: 14vw;
    max-width: 80px;
  }
  .checkpoint { 
    bottom: 28%;   /* sama dengan karakter supaya sejajar */
    width: 14vw;
    max-width: 80px;
  }
  #questionBox { font-size: 0.9rem; padding: 8px 12px; }
}

/* HP */
@media (max-width: 480px) {
  #game { height: 100vh; }
  #character{ 
    bottom: 27%;  /* dinaikkan dari 12% → sesuaikan */
    width: 14vw;
    max-width: 80px;
  }
  .checkpoint { 
    bottom: 28%;   /* sama dengan karakter supaya sejajar */
    width: 14vw;
    max-width: 80px;
  }
  #questionBox { font-size: 0.8rem; padding: 6px 10px; }
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-box {
  background: #fff8dc;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
  animation: bounceIn 0.4s ease;
}

.popup-box h2 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #ff5722;
}

.popup-box p {
  font-size: 16px;
  margin-bottom: 20px;
}

.popup-actions button {
  padding: 10px 15px;
  margin: 5px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

#popupYes {
  background: #4caf50;
  color: white;
}

#popupNo {
  background: #f44336;
  color: white;
}

@keyframes bounceIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#options {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.option-btn {
  padding: 10px;
  border: 2px solid #555;
  border-radius: 8px;
  background: #f8f8f8;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.option-btn:hover {
  background: #e0e0e0;
}

.option-btn.selected {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}