/* ฟอนต์น่ารักจาก Google Fonts */
body {
  font-family: 'Itim', sans-serif;
  margin: 0;
  padding: 0;
  color: white;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* พื้นหลังแต่ละหน้า */
.index-bg {
  background-image: url('assets/index.png');
}

.question-bg {
  background-image: url('assets/BG_Qt.png');
}

.intro-bg {
  background-color: #000;
}

.result-bg {
  background-color: #111;
}

/* กล่องเนื้อหากลาง */
.center {
  width: 90%;
  max-width: 600px;
  margin: auto;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  z-index: 2;
}

/* ปุ่มและ input */
input, button, textarea {
  font-size: 1.2rem;
  padding: 10px;
  max-width: 100%;
  margin: 10px auto;
  border-radius: 8px;
  border: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

button {
  background-color: #ff8c00;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #ffa733;
}

/* ภาพเมฆ */
img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

/* ข้อความ */
h1, h2 {
  margin-bottom: 20px;
}

/* ตัวเลือกคำตอบแบบ 2 คอลัมน์ */
#options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

#options button {
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  background-color: #ff8c00;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#options button:hover {
  background-color: #ffa733;
}

/* Progress Bar */
#progress-container {
  margin-bottom: 20px;
  text-align: left;
}

#progress-label {
  font-size: 1rem;
  margin-bottom: 5px;
  color: #fff;
}

#progress-bar {
  width: 100%;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #ff8c00, #ffa733);
  transition: width 0.5s ease;
  border-radius: 6px;
}

/* Animation ตรงกลาง */
#animation {
  margin: 20px 0;
}

/* เอฟเฟกต์สุ่ม */
.effect-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.effect-item {
  position: absolute;
  top: -50px;
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* แดดออก */
.sunny::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,223,0,0.5) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulse 5s infinite;
  z-index: 0;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
}

/* Responsive */
@media screen and (max-width: 480px) {
  .center {
    padding: 15px;
  }

  input, button, textarea {
    font-size: 1rem;
    padding: 8px;
  }

  h1, h2 {
    font-size: 1.4rem;
  }

  img {
    max-width: 90%;
  }
  
  
}

.spinner {
  margin: 20px auto;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top: 6px solid #ff8c00;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}