@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;800&family=Inter:wght@400;600&display=swap');

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  /* GAMBAR KARTUN DITAMPILKAN DI ATAS GRADASI ORANYE */
  /* Lapisan pertama adalah gambar, lapisan kedua adalah gradasi */
  background-image: url('bekgrond.png'), linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed;
  background-repeat: no-repeat; /* Mencegah gambar/gradasi berulang */
  color: #5c4033; /* Warna teks default diubah menjadi coklat gelap */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 12px;
  box-sizing: border-box;
  transition: background 0.5s;
}

/* --- STYLING LOGO --- */
.logo-container {
    margin-bottom: 40px; 
    animation: float-in 1s ease-out forwards;
}

.logo {
    max-width: 280px; 
    height: auto;
    transition: transform 0.3s ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.logo:hover {
    transform: scale(1.1) rotate(3deg);
}

@keyframes float-in {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* --- AKHIR STYLING LOGO --- */


h2 {
  font-family: 'Baloo 2', sans-serif;
  color: #5c4033; /* Warna judul disamakan dengan teks utama */
  text-shadow: 0 1px 2px rgba(255,255,255,0.2);
}

#main-menu, .menu-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
  padding: 32px 0 0 0;
}

#operation-selection, #difficulty-selection, #mode-selection {
  gap: 16px !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* Tombol utama diubah ke warna oranye */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 28px;
  font-size: clamp(18px, 4vw, 22px);
  cursor: pointer;
  background: #ff8c42; /* Oranye utama */
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: background 0.2s, transform 0.18s, box-shadow 0.18s;
  outline: none;
  letter-spacing: 1px;
  min-width: 120px;
}

.btn:hover {
  background: #ffa931; /* Oranye lebih terang saat disentuh */
  color: #fff;
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}


/* Tombol operasi disesuaikan dengan tema oranye */
.op-btn {
  font-size: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.7); 
  color: #d95f18; /* Warna teks oranye gelap */
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.13s;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  min-width: 140px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.op-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #ff8c42;
  transform: scale(1.09);
}

.op-btn .op-icon {
  width: 28px;
  height: 28px;
  margin-right: 6px;
  display: inline-block;
  /* Filter diubah untuk menghasilkan warna oranye */
  filter: invert(56%) sepia(54%) saturate(1417%) hue-rotate(349deg) brightness(100%) contrast(101%);
}

.fallback-icon {
  font-size: 24px;
  font-weight: bold;
  color: #d95f18;
}

/* === PERBAIKAN TOTAL PADA AREA PERMAINAN === */

/* Latar belakang kotak permainan diubah menjadi lebih terang */
.game-box, #result-container {
  background: rgba(255, 255, 255, 0.4); 
  backdrop-filter: blur(12px); 
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: clamp(18px, 5vw, 36px);
  border-radius: 32px;
  text-align: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  flex: 1;
  min-width: 220px;
  max-width: 400px;
  position: relative;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tulisan Player dibuat lebih jelas */
.game-box h2 {
    color: #5c4033; /* Warna teks Player digelapkan */
    text-shadow: none; /* Dihilangkan karena background sudah terang */
}

#game-container, #result-container {
  gap: 32px;
  width: 100%;
}

#game-container {
    display: none;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 0;
}

#result-container {
    display: none;
    max-width: 800px;
}

@media (min-width: 700px) {
  #game-container {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 48px;
  }
}

.progress-bar-container {
  width: 100%;
  height: 16px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
  width: 100%;
  height: 100%;
  /* Progress bar diubah ke gradasi oranye */
  background: linear-gradient(90deg, #ff8c42 0%, #ffa931 100%);
  border-radius: 10px;
  transition: width 0.2s linear;
}

.question {
  background: #ff8c42; /* Warna soal disesuaikan */
  color: #ffffff;
  font-size: clamp(24px, 6vw, 36px);
  margin-top: 10px;
  margin-bottom: 20px;
  padding: 14px 28px;
  border-radius: 16px;
  display: inline-block;
  min-height: 44px;
  line-height: 1.5;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-family: 'Baloo 2', 'Inter', sans-serif;
  font-weight: 700;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

/* Tombol pilihan jawaban diubah agar terbaca */
.options button.option-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 12px 0;
  font-size: clamp(16px, 4vw, 20px);
  color: #d95f18; /* Warna teks oranye gelap */
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.13s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-family: 'Baloo 2', 'Inter', sans-serif;
  font-weight: 700;
  width: 100%;
  letter-spacing: 1px;
}

.options button.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
  color: #d95f18;
  transform: scale(1.09);
}

.options button.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.options button.option-btn.correct {
  background: #28a745 !important;
  color: #ffffff !important;
  border-color: #28a745 !important;
  animation: pop-correct 0.5s;
}

.options button.option-btn.wrong {
  background: #dc3545 !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
  animation: shake-wrong 0.5s;
}

@keyframes pop-correct {
  0% { transform: scale(1); }
  60% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

@keyframes shake-wrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.divider {
  font-size: clamp(26px, 7vw, 44px);
  font-weight: bold;
  color: #ff8c42;
  margin: 0 24px;
  align-self: center;
  text-shadow: 0 0 10px rgba(255,255,255,0.7);
}

#answer-preview-wrapper {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  margin-bottom: 18px;
}

#answer-preview-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(14px, 2.5vw, 16px);
  color: #5c4033;
}

#answer-preview-wrapper th, 
#answer-preview-wrapper td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid rgba(92, 64, 51, 0.2);
}

#answer-preview-wrapper th {
  background-color: rgba(92, 64, 51, 0.1);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

#answer-preview-wrapper tbody tr:last-child td {
    border-bottom: none;
}

#answer-preview-wrapper tbody tr:nth-child(even) {
  background-color: rgba(92, 64, 51, 0.05);
}

#answer-preview-wrapper .correct-text {
  color: #28a745;
  font-weight: 600;
}

#answer-preview-wrapper .wrong-text {
  color: #dc3545;
  font-weight: 600;
  text-decoration: line-through;
}

.blurred-content > *:not(.progress-bar-container) {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s;
}
