* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --kuning: #ffb703; --oranye: #fb8500; --biru: #219ebc; --biru-tua: #023047;
  --hijau: #2a9d8f; --merah: #e63946; --latar: #fff8e7;
}
html, body { margin: 0; height: 100%; }
body {
  font-family: "Comic Sans MS", "Segoe UI", Roboto, sans-serif;
  background: var(--latar); color: var(--biru-tua);
  user-select: none;
}
.layar { display: none; min-height: 100%; padding: 16px; max-width: 900px; margin: 0 auto; }
.layar.aktif { display: block; }
.kartu { background: #fff; border-radius: 24px; padding: 24px; box-shadow: 0 6px 0 #f1d9a6; }
.tengah { text-align: center; max-width: 480px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.logo { font-size: 72px; }
h1 { margin: 0; font-size: 34px; color: var(--oranye); }
h2 { text-align: center; font-size: 26px; }
.sub { margin: 0; font-size: 20px; }
label { font-size: 22px; }
input {
  font: inherit; font-size: 26px; padding: 12px; text-align: center;
  border: 3px solid var(--kuning); border-radius: 16px; outline: none;
}
.btn {
  font: inherit; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--kuning); color: var(--biru-tua);
  box-shadow: 0 5px 0 #c98f00; transition: transform .05s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c98f00; }
.btn.besar { font-size: 26px; padding: 16px; }
.btn.kecil { font-size: 16px; padding: 8px 14px; box-shadow: 0 3px 0 #c98f00; }
.btn.sekunder { background: #8ecae6; box-shadow: 0 5px 0 #4b9cbf; }
.atas { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 20px; }

.grid-modul { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.modul {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; font-size: 20px; background: #fff; box-shadow: 0 5px 0 #f1d9a6;
  border: 3px solid transparent;
}
.modul .ikon { font-size: 46px; }
.modul small { font-size: 14px; opacity: .7; }
.pilih-level { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 6px 0 20px; font-size: 20px; }
.btn.level { font-size: 18px; padding: 10px 16px; background: #eee; box-shadow: 0 4px 0 #bbb; }
.btn.level.aktif { background: var(--kuning); box-shadow: 0 4px 0 #c98f00; }

.progres { flex: 1; height: 16px; background: #eee; border-radius: 8px; overflow: hidden; }
#bar-progres { height: 100%; width: 0; background: var(--hijau); transition: width .3s; }
.soal { position: relative; margin: 18px 0; min-height: 200px; display: flex; align-items: center; justify-content: center; text-align: center; }
#teks-soal { font-size: 34px; line-height: 1.4; }
#teks-soal .angka { font-size: 64px; font-weight: bold; color: var(--biru); }
#teks-soal .benda { font-size: 40px; letter-spacing: 4px; line-height: 1.3; display: block; margin: 6px 0; }
#teks-soal .cerita { font-size: 26px; display: block; }
#teks-soal .kotak { display: inline-block; min-width: 70px; border: 4px dashed var(--oranye); border-radius: 12px; color: var(--oranye); }
#teks-soal svg { width: 200px; height: 200px; }
.btn.suara { position: absolute; top: 10px; right: 10px; font-size: 24px; padding: 6px 10px; background: #8ecae6; box-shadow: 0 3px 0 #4b9cbf; }

.grid-pilihan { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-pilihan .btn { font-size: 40px; padding: 22px 8px; min-height: 96px; }
.grid-pilihan .btn.teks { font-size: 26px; }
.grid-pilihan .btn.benar { background: #80ed99; box-shadow: 0 5px 0 #38b000; }
.grid-pilihan .btn.salah { background: #ffadad; box-shadow: 0 5px 0 var(--merah); animation: goyang .4s; }
.grid-pilihan.kunci .btn { pointer-events: none; }
.umpan { text-align: center; font-size: 28px; min-height: 48px; margin-top: 14px; }

.bintang { font-size: 64px; }
.skor { font-size: 24px; margin: 0; }

@keyframes goyang { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

@media (max-width: 480px) {
  #teks-soal { font-size: 28px; }
  #teks-soal .angka { font-size: 52px; }
  .grid-pilihan .btn { font-size: 34px; }
}
.grid-pilihan.tiga { grid-template-columns: repeat(3, 1fr); }

/* login */
a.btn { text-decoration: none; display: inline-block; }
[hidden] { display: none !important; }

/* lencana nilai 0-100 */
.lencana { width: 170px; height: 170px; margin: 0 auto; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.15); border: 8px solid #fff;
  outline: 4px solid currentColor; }
.lencana span { font-size: 72px; font-weight: bold; line-height: 1; color: #fff; }
.lencana small { font-size: 16px; letter-spacing: 3px; font-weight: bold; color: #fff; opacity: .9; }
.lencana.bagus { background: var(--hijau); outline-color: var(--hijau); }
.lencana.sedang { background: var(--oranye); outline-color: var(--oranye); }
.lencana.kurang { background: var(--merah); outline-color: var(--merah); }
.skor { font-size: 18px; opacity: .8; }

/* pilihan pelajaran */
.pilih-mapel { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 14px; }
.btn.mapel { font-size: 20px; padding: 12px 18px; background: #fff; box-shadow: 0 4px 0 #f1d9a6; border: 3px solid transparent; }
.btn.mapel.aktif { background: var(--biru); color: #fff; box-shadow: 0 4px 0 #126782; }
/* soal bahasa */
#teks-soal .gambar { font-size: 96px; display: block; line-height: 1.2; }
#teks-soal .kata { font-size: 48px; font-weight: bold; color: var(--biru); display: block; margin: 4px 0; }
#teks-soal .bacaan { display: block; font-size: 24px; line-height: 1.6; text-align: left; background: #fff8e7;
  border-left: 6px solid var(--kuning); border-radius: 12px; padding: 12px 16px; margin: 40px 0 12px; }
#teks-soal .tanya { display: block; font-size: 26px; font-weight: bold; color: var(--biru); }
@media (max-width: 480px) {
  #teks-soal .bacaan { font-size: 20px; }
  #teks-soal .kata { font-size: 40px; }
  .btn.mapel { font-size: 16px; padding: 10px 10px; }
  .pilih-mapel { gap: 6px; }
}

/* materi Al Uswah */
.info-mapel { text-align: center; margin: -4px 0 12px; font-size: 16px; color: var(--hijau); }
#teks-soal .grup-wadah { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 40px 0 10px; }
#teks-soal .grup { display: flex; flex-direction: column; align-items: center; border: 2px solid #f1d9a6; border-radius: 12px; padding: 6px; width: 112px; }
#teks-soal .grup .benda { font-size: 18px; letter-spacing: 0; line-height: 1.25; margin: 0; word-break: break-all; line-break: anywhere; }
#teks-soal .grup small { font-size: 16px; font-weight: bold; }

/* mode ujian */
.kotak-ujian { text-align: center; margin: 0 0 16px; }
.btn.ujian { width: 100%; max-width: 520px; background: linear-gradient(135deg, #e63946, #fb8500); color: #fff;
  box-shadow: 0 5px 0 #9d0208; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.btn.ujian small { font-size: 15px; opacity: .9; }
.info-hadiah { font-size: 15px; margin: 8px 0 0; }
.timer { font-weight: bold; background: #fff; border-radius: 10px; padding: 4px 10px; box-shadow: 0 2px 0 #f1d9a6; }
.timer.habis { background: var(--merah); color: #fff; animation: denyut 1s infinite; }
@keyframes denyut { 50% { transform: scale(1.1); } }
.grid-pilihan .btn.dipilih { background: #8ecae6; box-shadow: 0 5px 0 #4b9cbf; }
.hadiah { border-radius: 18px; padding: 14px; background: #f1f6fa; display: flex; flex-direction: column; gap: 6px; }
.hadiah.dapat { background: linear-gradient(135deg, #fff3b0, #ffd6a5); animation: muncul .6s ease-out; }
.hadiah.sempurna { background: linear-gradient(135deg, #caffbf, #9bf6ff, #ffc6ff); }
.hadiah-judul { font-size: 26px; font-weight: bold; }
.hadiah-item { font-size: 30px; font-weight: bold; background: #fff; border-radius: 14px; padding: 10px; }
.hadiah small { font-size: 15px; }
.hadiah .simpan { opacity: .7; }
@keyframes muncul { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.konfeti { position: fixed; top: -10px; width: 10px; height: 14px; border-radius: 2px; z-index: 99; pointer-events: none;
  animation: jatuh 2.6s linear forwards; }
@keyframes jatuh { to { top: 105vh; } }

/* foto hadiah */
.deret-hadiah { display: flex; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.kartu-hadiah { background: #fff; border-radius: 16px; padding: 8px; width: 150px; box-shadow: 0 4px 0 #f1d9a6;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; }
.kartu-hadiah img { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; }
.kartu-hadiah .tanpa-gambar { font-size: 72px; line-height: 120px; }
.kartu-hadiah small { color: var(--oranye); font-weight: bold; }
.hadiah-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hadiah-item img { width: 100%; max-width: 280px; max-height: 280px; object-fit: contain; border-radius: 14px;
  animation: goyang-hadiah 1.2s ease-in-out 2; }
@keyframes goyang-hadiah { 25% { transform: rotate(-4deg) scale(1.03); } 75% { transform: rotate(4deg) scale(1.03); } }
