/***** QASR AL-ARAB · style.css v4.0 *****/
:root {
  --teal: #0E3B43;
  --teal-2: #145462;
  --teal-3: #1C6B77;
  --teal-gelap: #0A2C32;
  --pasir: #F4E4C1;
  --pasir-2: #E2C893;
  --pasir-3: #EBD6A8;
  --krim: #FBF3E0;
  --emas: #E8B33A;
  --emas-gelap: #A8740F;
  --terakota: #C2553B;
  --terakota-gelap: #7E2F1F;
  --bata: #9C3F2A;
  --dakwat: #3B2414;
  --pudar: #BFD9D6;
  --betul: #2E8B57;
  --salah: #C2553B;
  --nav-h: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--teal-gelap);
  color: var(--krim);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.apl {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--teal);
  position: relative;
  overflow-x: hidden;
}

/* ---------- Asas ---------- */
.skrin { display: none; min-height: 100dvh; flex-direction: column; }
.skrin.aktif { display: flex; animation: muncul .25s ease; }
.skrin.ada-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@keyframes muncul { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.isi { padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.tengah { text-align: center; }
.kecil { font-size: 13px; }
.tebal { font-weight: 800; }
.pudar { color: var(--pudar); margin: 0; }
.emas { color: var(--emas); }
.ar { font-family: 'Noto Naskh Arabic', serif; font-weight: 700; direction: rtl; unicode-bidi: isolate; }
.tajuk-ar { font-size: 28px; line-height: 1.5; }
.tajuk-kufi { font-family: 'Reem Kufi', sans-serif; font-weight: 700; font-size: 22px; margin: 0; line-height: 1.2; }
.tajuk-kufi.besar { font-size: 32px; }
.subtajuk { font-family: 'Reem Kufi', sans-serif; font-size: 18px; margin: 6px 0 0; color: var(--emas); }
.baris-antara { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.latar-bintang {
  background-color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 10l3.6 6.2 6.8-2.6-2.6 6.8L38 24l-6.2 3.6 2.6 6.8-6.8-2.6L24 38l-3.6-6.2-6.8 2.6 2.6-6.8L10 24l6.2-3.6-2.6-6.8 6.8 2.6z' fill='none' stroke='%231C6B77' stroke-width='1.2' opacity='.6'/%3E%3C/svg%3E");
}
.latar-sinar { background: radial-gradient(circle at 50% 28%, var(--teal-3) 0%, var(--teal) 62%); }

.ikon { display: inline-flex; width: 1.25em; height: 1.25em; flex-shrink: 0; }
.ikon svg { width: 100%; height: 100%; }

/* ---------- Butang ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; border-radius: 14px; padding: 15px 16px;
  font-size: 16px; font-weight: 800; transition: transform .1s;
}
.btn:active { transform: translateY(2px); }
.btn.terakota { background: var(--terakota); color: var(--krim); box-shadow: inset 0 -4px 0 var(--terakota-gelap); }
.btn.emas { background: var(--emas); color: var(--dakwat); box-shadow: inset 0 -4px 0 var(--emas-gelap); }
.btn.teal-garis { background: var(--teal-2); color: var(--emas); border: 2px solid var(--emas); }
.btn.putih { background: #fff; color: var(--dakwat); border: 2px solid #E5E0D6; }
.btn-bulat {
  width: 44px; height: 44px; border-radius: 22px; border: 2px solid var(--teal-3);
  background: var(--teal-2); color: var(--krim); display: flex; align-items: center; justify-content: center; padding: 0;
}
.btn-bulat .ikon { width: 20px; height: 20px; }

.lencana-emas { background: var(--emas); color: var(--dakwat); font-weight: 800; border-radius: 20px; padding: 6px 14px; font-size: 14px; }
.chip-emas, .chip-teal {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 10px;
  font-weight: 800; font-size: 14px; white-space: nowrap;
}
.chip-emas { background: var(--teal-2); border: 2px solid var(--emas); color: var(--emas); }
.chip-teal { background: var(--teal-2); border: 2px solid var(--teal-3); color: var(--krim); }
.chip-emas.besar { font-size: 16px; padding: 6px 14px; }

.bar-atas { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; }

/* ---------- 1. PIN ---------- */
#s-pin { background: var(--pasir); }
.pemandangan { width: 100%; height: 34vh; min-height: 200px; max-height: 300px; display: block; }
.panel-pasir { flex: 1; padding: 6px 22px 24px; display: flex; flex-direction: column; gap: 12px; color: var(--dakwat); }
.panel-pasir .tajuk-ar { color: var(--terakota-gelap); font-size: 30px; }
.panel-pasir .tajuk-kufi { color: var(--teal); }
.label-tengah { text-align: center; font-weight: 800; margin: 0; }
.pin-kotak { display: flex; justify-content: center; gap: 10px; }
.pin-kotak div {
  width: 56px; height: 56px; border-radius: 12px; background: var(--pasir-3); border: 2px dashed #B8955A;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Reem Kufi', sans-serif; font-size: 28px; font-weight: 700; color: var(--dakwat);
}
.pin-kotak div.isi-pin { background: var(--emas); border: none; box-shadow: inset 0 -4px 0 var(--emas-gelap); }
.pin-kotak.goyang { animation: goyang .4s; }
@keyframes goyang { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.papan-kekunci { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.papan-kekunci button {
  height: 52px; border-radius: 12px; border: none; background: var(--teal-2); color: var(--krim);
  font-size: 22px; font-weight: 800; box-shadow: inset 0 -4px 0 var(--teal-gelap);
}
.papan-kekunci button.kecil-k { font-size: 15px; }
.papan-kekunci button:active { transform: translateY(2px); }

/* ---------- 2. NAMA ---------- */
.kotak-cari {
  display: flex; align-items: center; gap: 10px; background: var(--krim); color: var(--dakwat);
  border-radius: 14px; padding: 0 14px; border: 3px solid var(--emas);
}
.kotak-cari .ikon { color: var(--bata); }
.kotak-cari input {
  flex: 1; border: none; outline: none; background: transparent; font-family: inherit;
  font-size: 18px; font-weight: 800; padding: 14px 0; color: var(--dakwat); text-transform: uppercase;
}
.hasil-cari { display: flex; flex-direction: column; gap: 8px; }
.petunjuk { text-align: center; color: var(--pudar); padding: 18px 8px; font-size: 14px; }
.nama-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  background: var(--pasir); color: var(--dakwat); border: none; border-radius: 14px; padding: 13px 14px;
  font-size: 15px; font-weight: 800; box-shadow: inset 0 -3px 0 var(--pasir-2);
}
.nama-item mark { background: var(--emas); color: var(--dakwat); border-radius: 3px; padding: 0 1px; }
.chip-kelas { background: var(--teal); color: var(--krim); font-size: 12px; border-radius: 10px; padding: 3px 9px; white-space: nowrap; }

/* ---------- Avatar ---------- */
.potret { position: relative; width: var(--s); height: var(--s); flex-shrink: 0; }
.potret .bulat {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; position: relative;
  box-shadow: 0 0 0 3px var(--emas); background: var(--bg);
}
.potret .bulat img { position: absolute; width: 170%; max-width: none; left: -35%; top: -2%; }
.potret .lencana-lv {
  position: absolute; right: -4px; bottom: -4px; min-width: calc(var(--s) * .34); height: calc(var(--s) * .34);
  border-radius: 50%; background: var(--terakota); border: 2px solid var(--emas); color: var(--krim);
  display: flex; align-items: center; justify-content: center; font-family: 'Reem Kufi', sans-serif;
  font-size: max(10px, calc(var(--s) * .18)); font-weight: 700;
}
.kad-watak {
  width: var(--s); border-radius: calc(var(--s) * .1); background: var(--bg); padding: calc(var(--s) * .05);
  display: flex; flex-direction: column; align-items: center; color: var(--dakwat); position: relative;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}
.kad-watak img { width: 100%; aspect-ratio: 1; display: block; background: radial-gradient(circle at 50% 45%, #FFF6DE 0%, transparent 70%); border-radius: calc(var(--s) * .08); }
.kad-watak .kad-ar { font-family: 'Noto Naskh Arabic', serif; font-weight: 700; font-size: max(13px, calc(var(--s) * .17)); line-height: 1.5; direction: rtl; }
.kad-watak .kad-my { font-weight: 800; font-size: max(10px, calc(var(--s) * .095)); line-height: 1.1; padding-bottom: 3px; text-align: center; }
.kad-watak.kunci img { filter: grayscale(1) brightness(.6); opacity: .55; }
.kad-watak.kunci { background: #6C8E92 !important; }
.kad-watak .kunci-ikon { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); width: 30%; color: var(--krim); }

/* ---------- 3. PETA ---------- */
.kepala-teal {
  display: flex; align-items: center; gap: 12px; padding: 16px 14px 12px; background: var(--teal);
  position: sticky; top: 0; z-index: 5; border-bottom: 3px solid var(--emas);
}
.kepala-teks { flex: 1; min-width: 0; }
.nama-kecil { font-size: 13px; font-weight: 800; color: var(--pudar); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gelaran { font-weight: 800; font-size: 16px; line-height: 1.3; }
.gelaran .ar { font-size: 19px; color: var(--emas); }
.kepala-kanan { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.kad-pangkat { margin: 12px 14px 0; background: var(--krim); color: var(--dakwat); border-radius: 14px; padding: 10px 14px; }
.bar { height: 9px; border-radius: 5px; background: var(--pasir-2); overflow: hidden; margin-top: 6px; }
.bar-isi { height: 100%; width: 0; background: var(--terakota); border-radius: 5px; transition: width .6s ease; }

.peta-skrol { flex: 1; background: linear-gradient(180deg, #F4E4C1 0%, #EBD6A8 55%, #E2C893 100%); margin-top: 12px; position: relative; color: var(--dakwat); }
.sepanduk {
  margin: 14px auto 0; width: fit-content; max-width: 92%; background: var(--terakota); color: var(--krim);
  border: 3px solid var(--emas); padding: 6px 18px; font-weight: 800; font-size: 14px; border-radius: 6px; text-align: center;
  box-shadow: 0 3px 0 var(--terakota-gelap);
}
.sepanduk .ar { font-size: 17px; }
.peta { position: relative; margin: 0 auto; width: 100%; max-width: 420px; }
.peta svg.laluan { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nod {
  position: absolute; transform: translateX(-50%); width: 132px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; background: none; border: none; padding: 0; color: var(--dakwat);
}
.nod .khemah { width: 76px; height: 64px; filter: drop-shadow(0 4px 0 rgba(59,36,20,.18)); }
.nod.kini .khemah { animation: denyut 1.4s ease-in-out infinite; }
@keyframes denyut { 50% { transform: scale(1.08); } }
.nod .nod-nama { font-weight: 800; font-size: 13px; line-height: 1.2; text-align: center; background: var(--krim); border-radius: 8px; padding: 3px 8px; box-shadow: 0 2px 0 var(--pasir-2); }
.nod .nod-info { font-size: 11px; font-weight: 800; color: var(--bata); text-align: center; }
.nod .nod-fanus { display: flex; gap: 1px; height: 16px; }
.nod .nod-fanus .ikon { width: 15px; height: 15px; }
.nod-qasr { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.nod-qasr svg { width: 120px; height: 96px; }
.nod-qasr div { font-weight: 800; font-size: 13px; }
.hiasan { position: absolute; pointer-events: none; opacity: .9; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px; z-index: 20;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--teal); border-top: 4px solid var(--emas);
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.nav button {
  background: none; border: none; color: var(--pudar); font-size: 12px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.nav button .ikon { width: 24px; height: 24px; }
.nav button.aktif { color: var(--emas); font-weight: 800; }

/* ---------- 4. KUIZ ---------- */
#s-kuiz { padding: 16px 16px 22px; gap: 12px; }
.kuiz-atas { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.masa { display: flex; align-items: center; gap: 6px; font-family: 'Reem Kufi', sans-serif; font-weight: 700; font-size: 22px; color: var(--emas); min-width: 64px; justify-content: flex-end; }
.masa .ikon { width: 22px; height: 26px; }
.masa.kritikal { color: #FF8A6B; animation: denyut .6s infinite; }
.langkah { display: flex; gap: 4px; }
.langkah div { flex: 1; height: 8px; border-radius: 4px; background: var(--teal-2); }
.langkah div.siap { background: var(--emas); }
.langkah div.kini { background: var(--terakota); }
.masa-bar { height: 5px; border-radius: 3px; background: var(--teal-2); overflow: hidden; }
.masa-bar div { height: 100%; width: 100%; background: var(--emas); transition: width .2s linear; }
.progres { text-align: center; font-size: 12px; font-weight: 800; color: var(--pudar); }

.gulungan { position: relative; }
.gulung-kayu { height: 18px; border-radius: 9px; background: #C98B2A; margin: 0 4px; box-shadow: inset 0 -4px 0 #9A6A12; position: relative; z-index: 1; }
.gulung-kayu.bawah { margin-top: -9px; }
.gulung-kertas {
  background: var(--krim); color: var(--dakwat); margin: -9px 14px 0; padding: 20px 14px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: inset 0 0 0 2px var(--pasir-2);
}
.label-titah { font-size: 11px; font-weight: 800; letter-spacing: 3px; color: var(--bata); }
.soalan-teks { font-size: 22px; font-weight: 800; text-align: center; color: var(--terakota-gelap); line-height: 1.5; }
.soalan-teks.ar { font-size: 32px; }
.soalan-melayu { font-size: 14px; color: #6B4A2A; font-weight: 700; text-align: center; }
.soalan-imej { max-height: 180px; max-width: 86%; border-radius: 12px; background: #fff; padding: 6px; border: 2px solid var(--pasir-2); object-fit: contain; }
.huruf-box { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: rtl; }
.huruf-box:empty { display: none; }
.huruf-ayat { font-family: 'Noto Naskh Arabic', serif; font-size: 34px; font-weight: 700; color: var(--teal-gelap); direction: rtl; line-height: 1.6; text-align: center; }
.hw { white-space: nowrap; }
.kosong-h { display: inline-block; min-width: 34px; margin: 0 3px; padding: 0 4px; border: 3px dashed var(--emas); border-radius: 10px;
  color: var(--terakota); font-size: 26px; line-height: 1.3; vertical-align: middle; background: #E8B33A22; }
.huruf {
  width: 48px; height: 52px; border-radius: 10px; background: var(--emas); color: var(--dakwat);
  display: flex; align-items: center; justify-content: center; font-family: 'Noto Naskh Arabic', serif;
  font-size: 26px; font-weight: 700; box-shadow: inset 0 -4px 0 var(--emas-gelap); animation: jatuh .35s both;
}
@keyframes jatuh { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.btn-audio {
  display: flex; align-items: center; gap: 8px; background: var(--teal); color: var(--krim); border: none;
  border-radius: 20px; padding: 9px 16px; font-weight: 800; font-size: 13px;
}

.pilihan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.pil {
  min-height: 82px; border: 3px solid var(--emas); border-radius: 40px 40px 14px 14px; color: var(--krim);
  display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px; text-align: center;
  transition: transform .1s, opacity .2s;
}
.pil:active { transform: translateY(3px); }
.pil-0 { background: #1C7C8C; box-shadow: inset 0 -5px 0 #0F5560; }
.pil-1 { background: var(--terakota); box-shadow: inset 0 -5px 0 var(--terakota-gelap); }
.pil-2 { background: #9A6A12; box-shadow: inset 0 -5px 0 #6B4A0B; }
.pil-3 { background: #3F4C9A; box-shadow: inset 0 -5px 0 #2A3368; }
.pil .lbl {
  width: 30px; height: 30px; border-radius: 15px; background: var(--emas); color: var(--dakwat);
  font-family: 'Reem Kufi', sans-serif; font-weight: 700; font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pil .tks { flex: 1; font-size: 16px; font-weight: 800; word-break: break-word; }
.pil .tks.ar { font-family: 'Noto Naskh Arabic', serif; font-size: 23px; font-weight: 700; }
.pilihan.kunci .pil { opacity: .45; pointer-events: none; }
.pilihan.panjang { grid-template-columns: 1fr; gap: 10px; }
.pilihan.panjang .pil { min-height: 62px; border-radius: 18px; padding: 10px 12px; }
.pilihan.panjang .pil .tks.ar { font-size: 21px; line-height: 1.5; }
.pilihan.kunci .pil.dipilih { opacity: 1; transform: scale(1.04); box-shadow: 0 0 0 4px var(--krim), 0 0 18px var(--emas); }
.kuiz-mesej { text-align: center; font-weight: 800; color: var(--emas); min-height: 22px; }

/* ---------- 5. NAIK PANGKAT ---------- */
.naik { justify-content: center; flex: 1; align-items: center; gap: 12px; padding-top: 30px; }
.naik-watak { display: flex; align-items: center; gap: 12px; }
.pudar-60 { opacity: .6; }
.bingkai-emas { padding: 6px; border-radius: 18px; background: var(--emas); animation: masuk .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes masuk { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.pita {
  position: relative; background: var(--terakota); color: var(--krim); border: 3px solid var(--emas);
  padding: 8px 26px; font-weight: 800; font-size: 19px; box-shadow: 0 4px 0 var(--terakota-gelap);
}
.pita .ar { font-size: 23px; }
.pita::before, .pita::after {
  content: ''; position: absolute; top: 8px; width: 22px; height: calc(100% - 4px); background: var(--terakota-gelap); z-index: -1;
}
.pita::before { left: -18px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.pita::after { right: -18px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }

/* ---------- 6. HASIL ---------- */
.fanus-besar { display: flex; justify-content: center; gap: 10px; }
.fanus-besar .ikon { width: 52px; height: 52px; animation: jatuh .4s both; }
.fanus-besar .ikon:nth-child(2) { animation-delay: .15s; }
.fanus-besar .ikon:nth-child(3) { animation-delay: .3s; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--teal-2); border: 2px solid var(--teal-3); border-radius: 14px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.stat b { font-size: 20px; font-weight: 800; color: var(--emas); }
.stat > span { font-size: 11px; color: var(--pudar); }
.dinar-teks { display: inline-flex; align-items: center; gap: 4px; }
.dinar-teks .ikon { width: 18px; height: 18px; }
.kad-krim { background: var(--krim); color: var(--dakwat); border-radius: 14px; padding: 10px 14px; }
.semakan { display: flex; flex-direction: column; gap: 8px; }
.semak-item { background: var(--krim); color: var(--dakwat); border-radius: 14px; padding: 10px 12px; border-left: 6px solid var(--betul); }
.semak-item.salah { border-left-color: var(--salah); }
.semak-atas { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: #6B4A2A; }
.semak-soalan { font-weight: 800; margin: 4px 0; }
.semak-soalan.ar { font-size: 20px; }
.semak-baris { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; align-items: center; }
.semak-baris .jwp { font-weight: 800; }
.semak-baris .jwp.ar { font-size: 18px; }
.semak-baris .betul { color: var(--betul); }

/* ---------- 7. DIWAN ---------- */
.tab-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--teal-2); border: 2px solid var(--teal-3); border-radius: 14px; padding: 4px; }
.tab-2 button { background: transparent; color: var(--pudar); border: none; border-radius: 11px; padding: 10px; font-weight: 800; font-size: 14px; }
.tab-2 button.aktif { background: var(--emas); color: var(--dakwat); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 6px; margin-top: 4px; }
.podium:empty { display: none; }
.tiang { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.tiang .pod-nama { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tiang .pod-nama.saya { color: var(--emas); }
.tiang .blok { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; }
.tiang .blok b { font-family: 'Reem Kufi', sans-serif; font-size: 22px; }
.tiang.t1 .blok { height: 100px; background: var(--emas); color: var(--dakwat); border-radius: 48px 48px 0 0; box-shadow: inset 0 -6px 0 var(--emas-gelap); font-weight: 800; }
.tiang.t2 .blok { height: 74px; background: var(--teal-3); border: 2px solid var(--pudar); border-bottom: none; border-radius: 40px 40px 0 0; }
.tiang.t3 .blok { height: 56px; background: var(--terakota); border-radius: 36px 36px 0 0; box-shadow: inset 0 -4px 0 var(--terakota-gelap); }
.tiang .mahkota { width: 34px; height: 20px; }
.senarai-rank { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: grid; grid-template-columns: 28px 46px 1fr auto; align-items: center; gap: 8px;
  background: var(--pasir); color: var(--dakwat); border-radius: 14px; padding: 6px 10px; box-shadow: inset 0 -3px 0 var(--pasir-2);
}
.rank-item.saya { background: var(--emas); box-shadow: 0 0 0 3px var(--krim); }
.rank-no { font-family: 'Reem Kufi', sans-serif; font-weight: 700; text-align: center; color: var(--terakota-gelap); }
.rank-nama { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 11px; color: #6B4A2A; }
.rank-sub .ar { font-size: 13px; }
.rank-mata { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--terakota-gelap); font-size: 14px; }
.rank-mata .ikon { width: 16px; height: 16px; }
.kosong { text-align: center; color: var(--pudar); padding: 20px 10px; background: var(--teal-2); border-radius: 14px; }

/* ---------- 8. GALERI ---------- */
.galeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; justify-items: center; }
.galeri-item { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; }
.galeri-item .min { font-size: 11px; font-weight: 800; color: var(--dakwat); background: var(--pasir); border-radius: 10px; padding: 2px 8px; }
.galeri-item.kini .kad-watak { box-shadow: 0 0 0 3px var(--emas), 0 0 16px rgba(232,179,58,.7); }
.galeri-item.kini .min { background: var(--emas); }

/* ---------- LOADING ---------- */
.loading { position: fixed; inset: 0; background: rgba(10,44,50,.72); display: flex; align-items: center; justify-content: center; z-index: 50; }
.loading-kotak { background: var(--krim); color: var(--dakwat); border-radius: 18px; padding: 20px 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; }
.putar { width: 44px; height: 44px; color: var(--emas); animation: putar 1.4s linear infinite; }
.putar .ikon { width: 100%; height: 100%; }
@keyframes putar { to { transform: rotate(360deg); } }

/* ---------- MODAL PUTIH ---------- */
.modal { position: fixed; inset: 0; background: rgba(10,44,50,.6); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal-kotak {
  background: #fff; color: #2A2A2A; border-radius: 20px; padding: 22px 20px 18px; width: 100%; max-width: 360px;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: muncul .2s ease;
}
.modal-ikon { display: flex; justify-content: center; margin-bottom: 6px; }
.modal-ikon:empty { display: none; }
.modal-ikon .ikon { width: 48px; height: 48px; }
.modal-ikon .potret, .modal-ikon .kad-watak { margin: 0 auto; }
.modal-kotak h3 { margin: 0 0 6px; font-family: 'Reem Kufi', sans-serif; font-size: 20px; color: var(--teal); }
.modal-mesej { font-size: 15px; color: #555; line-height: 1.5; }
.modal-mesej .ar { font-size: 20px; color: var(--terakota-gelap); }
.modal-mesej .baris-info { display: flex; justify-content: space-between; border-bottom: 1px solid #EEE; padding: 6px 2px; font-size: 14px; }
.modal-mesej .baris-info b { color: var(--dakwat); }
.modal-butang { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.modal-butang .btn { padding: 13px; }

/* ================= v4.1: XP, TAHAP, SESI, GURU ================= */
.xp-label { font-family: 'Reem Kufi', sans-serif; font-size: 12px; color: var(--emas); }
.xp-hari { margin-top: 8px; }
.bar.nipis { height: 6px; }
.bar-isi.teal { background: var(--teal-3); }
.sesi-pita {
  margin: 10px 14px 0; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: var(--teal-2); border: 2px solid var(--teal-3); color: var(--krim);
}
.sesi-pita.tutup { background: #3B2414; border-color: var(--terakota); color: #F7D57A; }

/* Bingkai sublevel: gangsa (1-2), perak (3-4), emas (5) */
.potret .bulat { box-shadow: 0 0 0 3px var(--bingkai, var(--emas)); }
.potret .bintang-sub {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  background: var(--teal-gelap); border: 1.5px solid var(--bingkai, var(--emas)); border-radius: 10px;
  padding: 0 5px; line-height: 1.3; font-size: max(8px, calc(var(--s) * .14)); color: #F7C948; white-space: nowrap; letter-spacing: 1px;
}
.potret .bintang-sub i { color: rgba(247,201,72,.25); font-style: normal; }
.kad-watak { box-shadow: inset 0 0 0 3px var(--bingkai, rgba(255,255,255,.5)); }
.kad-watak .kad-bintang { color: #C98B2A; font-size: max(10px, calc(var(--s) * .1)); letter-spacing: 1px; }
.kad-watak .kad-bintang i { color: rgba(0,0,0,.18); font-style: normal; }

.nod.rehat .khemah { filter: grayscale(.7) opacity(.7); }
.nod .nod-sesi { font-size: 10px; font-weight: 800; color: #6B4A2A; }
.nod .nod-bendera { font-size: 10px; font-weight: 800; background: var(--emas); color: var(--dakwat); border-radius: 8px; padding: 1px 6px; }

.nota-hasil { display: flex; flex-direction: column; gap: 6px; }
.nota-hasil:empty { display: none; }
.nota-hasil div { background: var(--teal-2); border: 2px solid var(--teal-3); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; text-align: center; }
.nota-hasil div.emas { border-color: var(--emas); color: #F7D57A; }
.nota-hasil div.amaran { border-color: var(--terakota); color: #FFC9B8; }

/* Tangga sublevel (skrin Pangkat) */
.tangga { display: flex; flex-direction: column; gap: 6px; }
.tangga-baris { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; background: var(--teal-2); border: 2px solid var(--teal-3); border-radius: 12px; padding: 8px 10px; }
.tangga-baris.kini { background: var(--emas); color: var(--dakwat); border-color: var(--krim); }
.tangga-baris.lepas { opacity: .7; }
.tangga-baris .no { font-family: 'Reem Kufi', sans-serif; font-weight: 700; text-align: center; }
.tangga-baris .ar { font-size: 16px; }
.tangga-baris .xp { font-weight: 800; font-size: 12px; white-space: nowrap; }

/* Guru */
.kepala-guru { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 18px 16px 0; }
.pilih-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--pudar); }
.pilih-label select { font-family: inherit; font-size: 15px; font-weight: 800; padding: 10px; border-radius: 12px; border: 2px solid var(--emas); background: var(--krim); color: var(--dakwat); }
.guru-isi { display: flex; flex-direction: column; gap: 12px; }
.guru-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guru-kad { background: var(--krim); color: var(--dakwat); border-radius: 14px; padding: 12px; }
.guru-kad h3 { margin: 0 0 8px; font-family: 'Reem Kufi', sans-serif; font-size: 16px; color: var(--teal); }
.guru-baris { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--pasir-2); font-size: 13px; align-items: center; }
.guru-baris:last-child { border-bottom: none; }
.guru-baris .n { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guru-baris .s { font-size: 11px; color: #6B4A2A; }
.guru-baris .v { text-align: right; font-weight: 800; white-space: nowrap; }
.tag { display: inline-block; border-radius: 8px; padding: 1px 7px; font-size: 10px; font-weight: 800; margin: 2px 2px 0 0; }
.tag.merah { background: #F4C7BB; color: #7E2F1F; }
.tag.kuning { background: #F7E3A8; color: #6B4A0B; }
.tag.kelabu { background: #E2DCCF; color: #5B4A35; }
.bar-guru { height: 8px; border-radius: 4px; background: var(--pasir-2); overflow: hidden; margin-top: 4px; }
.bar-guru div { height: 100%; background: var(--terakota); }
.pudar-guru { color: #6B4A2A; font-size: 12px; text-align: center; padding: 6px; }
.wac-senarai li::marker { color: var(--emas); }
.guru-kad summary { cursor: pointer; list-style: none; }
.guru-kad summary::-webkit-details-marker { display: none; }
.guru-kad details > summary h3::after { content: ' ▾'; font-size: 12px; }

/* ===== Mod ujian guru (v4.1) ===== */
.banner-uji{position:sticky;top:0;z-index:60;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px 12px;background:#9C3F2A;color:#FFF5DF;font-size:13px;font-weight:700;letter-spacing:.02em}
.banner-uji[hidden]{display:none}
.banner-uji .btn-kecil{flex-shrink:0;border:1.5px solid #FFF5DF;background:transparent;color:#FFF5DF;border-radius:999px;
  padding:5px 10px;font:inherit;font-size:12px;cursor:pointer}
.kad-uji{border:2px dashed #A8740F}
.uji-butang{display:flex;flex-wrap:wrap;gap:8px}
.uji-butang .btn{flex:1 1 120px;width:auto;margin:0}
.nota-uji{margin-top:10px;padding:8px 10px;border-radius:10px;background:#FBEBD0;color:#9C3F2A;font-size:13px;font-weight:600}

/* ===== Soalan seret huruf (v4.1) ===== */
.pilihan.seret { display: block; }
.seret-kotak { display: flex; flex-direction: row-reverse; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.seret-kotak .kotak { width: 60px; height: 68px; border: 3px dashed var(--emas); border-radius: 14px; background: #ffffff12;
  display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.seret-kotak .kotak.ada { border-style: solid; }
.seret-kotak .kotak.betul { border-color: #3BB273; background: #3BB27333; }
.seret-kotak .kotak.salah { border-color: #E2553B; background: #E2553B33; }
.seret-arah { text-align: center; font-size: 12px; opacity: .65; margin: 6px 0 12px; }
.seret-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 80px; padding: 10px; border-radius: 16px; background: #00000030; }
.jubin { width: 54px; height: 60px; border: none; border-radius: 13px; background: linear-gradient(#FFF6E0, #F2DDB0); color: var(--teal-gelap);
  box-shadow: 0 4px 0 var(--emas-gelap); font-size: 32px; line-height: 1; display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; padding: 0; }
.kotak .jubin { box-shadow: none; width: 100%; height: 100%; border-radius: 10px; }
.jubin.hantu { opacity: .25; }
.jubin.terbang { position: fixed; z-index: 999; pointer-events: none; transform: scale(1.12); box-shadow: 0 10px 18px #0006; }
.seret-butang { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.seret-butang .btn { width: auto; margin: 0; }
.pilihan.seret.kunci .seret-bank, .pilihan.seret.kunci .seret-butang, .pilihan.seret.kunci .seret-arah { display: none; }
.seret-jawapan { text-align: center; margin-top: 14px; font-weight: 800; }
.seret-jawapan .ok { color: #7EE0A8; } .seret-jawapan .tidak { color: #F4A08C; }
.seret-jawapan .ar { font-size: 38px; color: var(--emas); margin-top: 2px; }
.seret-kotak .kotak.betul .jubin { background: #D3F1DE; }
.seret-kotak .kotak.salah .jubin { background: #F9D5CC; }

/* ===== Soalan KOTAK: jambatan isi tempat kosong (v4.2) ===== */
.pilihan.kotak-jb { display: block; }
.jb-baris { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.jb { flex: 1 1 0; min-width: 0; max-width: 140px; display: flex; flex-direction: column; align-items: stretch; }
.jb-sel { min-height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4px; font-size: 20px; line-height: 1.25; word-break: break-word; position: relative; }
.jb-sel.bawah { min-height: 46px; font-size: 18px; }
.jb-sel.tetap { background: linear-gradient(#FFF6E0, #F2DDB0); color: var(--teal-gelap); box-shadow: 0 3px 0 var(--emas-gelap); }
.jb-sel.tetap.bawah { background: var(--teal-gelap); color: var(--emas); box-shadow: 0 3px 0 #00000055; border: 2px solid #E8B33A55; }
.jb-sel.kosong { border: 3px dashed var(--emas); background: #ffffff12; cursor: pointer; transition: background .2s, transform .2s, border-color .2s; }
.jb-sel.kosong.sasar { background: #E8B33A44; transform: scale(1.05); }
.jb-sel.kosong.ada { border-style: solid; padding: 0; }
.jb-sel.betul { border-color: #3BB273 !important; background: #3BB27333; }
.jb-sel.salah { border-color: #E2553B !important; background: #E2553B33; animation: gegarKotak .4s; }
.jb-sel.betul .kad-k { background: #D3F1DE; }
.jb-sel.salah .kad-k { background: #F9D5CC; text-decoration: line-through; opacity: .8; }
.jb-betul { display: block; font-size: 17px; color: #7EE0A8; font-weight: 700; margin-top: 2px; }
@keyframes gegarKotak { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.jb-lukis { height: 40px; margin: 2px 0; }
.jb-lukis svg { width: 100%; height: 100%; overflow: visible; display: block; }
.jb-lengan { transform-origin: 12px 30px; transform: rotate(-28deg); transition: transform .8s cubic-bezier(.3,1.5,.5,1); }
.jb-nyala { opacity: 0; transition: opacity .6s .4s; }
.jb.turun .jb-lengan { transform: rotate(0deg); }
.jb.turun .jb-nyala { opacity: 1; }
.kad-bank { gap: 8px; min-height: 64px; }
.kad-k { border: none; border-radius: 12px; padding: 6px 14px; min-height: 46px; background: linear-gradient(#FFF6E0, #F2DDB0); color: var(--teal-gelap);
  box-shadow: 0 4px 0 var(--emas-gelap); font-size: 20px; line-height: 1.3; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; transition: transform .15s, box-shadow .15s; }
.kad-k.pilih { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--emas), 0 6px 0 var(--emas-gelap); }
.jb-sel .kad-k { box-shadow: none; width: 100%; min-height: 48px; border-radius: 10px; padding: 4px; font-size: 19px; }
.kad-k.hantu { opacity: .25; }
.kad-k.terbang { position: fixed; z-index: 999; pointer-events: none; transform: scale(1.1); box-shadow: 0 10px 18px #0006; }
.pilihan.kotak-jb.kunci .seret-bank, .pilihan.kotak-jb.kunci .seret-butang, .pilihan.kotak-jb.kunci .seret-arah { display: none; }
@media (max-width: 360px) { .jb-sel { font-size: 17px; } .jb-sel .kad-k { font-size: 16px; } .kad-k { font-size: 18px; padding: 6px 10px; } }

/* ===== MAKMAL: enjin permainan baharu (v4.3) ===== */
.seret-jawapan .besar { font-size: 30px; color: var(--emas); }
/* Betul / Salah */
.pilihan.bs .pil { justify-content: center; gap: 12px; min-height: 92px; }
.pil.bs-betul { background: #1E7A4A; box-shadow: inset 0 -5px 0 #12502F; }
.pil.bs-salah { background: var(--terakota); box-shadow: inset 0 -5px 0 var(--terakota-gelap); }
.bs-ikon { font-size: 34px; font-weight: 800; }
.pil.bs-betul .tks, .pil.bs-salah .tks { flex: 0 1 auto; display: flex; flex-direction: column; }
.pil.bs-betul .tks .ar, .pil.bs-salah .tks .ar { font-family: 'Noto Naskh Arabic', serif; font-size: 24px; }
/* Pilih gambar */
.pil.pil-gambar { background: #FFF8E7; min-height: 120px; padding: 8px; justify-content: center; position: relative; border-radius: 18px; box-shadow: inset 0 -5px 0 #E3CFA2; }
.pil.pil-gambar img { width: 100%; height: 104px; object-fit: contain; }
.pil.pil-gambar .lbl { position: absolute; top: 6px; left: 6px; }
.semak-img { height: 48px; vertical-align: middle; border-radius: 8px; background: #fff; }
/* Susun ayat / urutan (guna enjin seret) */
.pilihan.susun .seret-kotak { gap: 6px; }
.pilihan.susun .kotak { width: auto; min-width: 66px; height: 56px; padding: 0; }
.pilihan.susun .jubin { width: auto; height: 50px; padding: 0 12px; font-size: 22px; }
.pilihan.susun .kotak .jubin { width: auto; height: 100%; }
/* Enjin slot (padan, kumpul, label) */
.pilihan.slot-enjin { display: block; }
.sl { min-height: 50px; border: 3px dashed var(--emas); border-radius: 14px; background: #ffffff12; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 6px; padding: 3px; transition: background .2s, transform .2s; position: relative; }
.sl.sasar { background: #E8B33A44; transform: scale(1.03); }
.sl.ada { border-style: solid; }
.sl:not(.banyak) > .kad-k { width: 100%; box-shadow: none; }
.sl.betul { border-color: #3BB273; background: #3BB27333; } .sl.salah { border-color: #E2553B; background: #E2553B33; }
.sl.betul .kad-k { background: #D3F1DE; } .sl.salah .kad-k { background: #F9D5CC; text-decoration: line-through; opacity: .8; }
.kad-k.betul { background: #D3F1DE; } .kad-k.salah { background: #F9D5CC; }
.kad-k .kad-ke { display: block; font-size: 12px; color: #9C3F2A; font-family: Nunito, sans-serif; }
.padan { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 8px; }
.padan-baris { display: grid; grid-template-columns: 1fr 22px 1.2fr; align-items: center; gap: 6px; direction: rtl; }
.padan-kiri { min-height: 64px; border-radius: 14px; background: #FFF8E7; color: var(--teal-gelap); display: flex; align-items: center; justify-content: center; padding: 4px; font-size: 22px; font-weight: 800; }
.padan-kiri img { max-height: 70px; max-width: 100%; object-fit: contain; }
.padan-kiri .ar { font-family: 'Noto Naskh Arabic', serif; font-size: 24px; }
.padan-kiri.audio { cursor: pointer; background: var(--emas); }
.ref-audio .ikon { width: 34px; height: 34px; display: inline-block; }
.padan-anak { color: var(--emas); font-weight: 800; text-align: center; }
.label-wrap { position: relative; margin: 0 auto 8px; max-width: 420px; }
.label-wrap img { width: 100%; display: block; border-radius: 16px; background: #FFF8E7; }
.label-sl { position: absolute; transform: translate(-50%, -50%); min-width: 76px; min-height: 40px; background: #0A2C32cc; padding: 2px; }
.label-sl::before { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--emas); z-index: -1; }
.label-sl > .kad-k { min-height: 34px; font-size: 17px; padding: 2px 6px; }
.kumpul { display: grid; gap: 8px; margin: 4px 0 8px; direction: rtl; }
.kumpul.k2 { grid-template-columns: 1fr 1fr; } .kumpul.k3 { grid-template-columns: 1fr 1fr 1fr; }
.kumpul-kotak { background: #00000030; border-radius: 16px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.kumpul-nama { text-align: center; color: var(--emas); font-weight: 800; font-size: 18px; }
.kumpul-nama.ar { font-family: 'Noto Naskh Arabic', serif; font-size: 22px; }
.sl.banyak { min-height: 120px; align-content: flex-start; }
.sl.banyak .kad-k { font-size: 18px; padding: 4px 8px; min-height: 38px; }
/* Kad memori */
.memori { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); margin: 4px 0; }
.memori.g8 { grid-template-columns: repeat(4, 1fr); }
.kad-mem { position: relative; height: 92px; border: none; padding: 0; background: none; perspective: 600px; }
.kad-mem .depan, .kad-mem .belakang { position: absolute; inset: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; transition: transform .45s; padding: 4px; }
.kad-mem .belakang { background: linear-gradient(135deg, var(--terakota), #8E3A26); color: var(--emas); font-size: 34px; border: 3px solid var(--emas); }
.kad-mem .depan { background: #FFF8E7; color: var(--teal-gelap); transform: rotateY(180deg); font-size: 18px; font-weight: 800; border: 3px solid var(--emas); }
.kad-mem .depan .ar { font-family: 'Noto Naskh Arabic', serif; font-size: 21px; }
.kad-mem .depan img { max-width: 100%; max-height: 78px; object-fit: contain; }
.kad-mem.buka .belakang { transform: rotateY(180deg); } .kad-mem.buka .depan { transform: rotateY(360deg); }
.kad-mem.padan .depan { border-color: #3BB273; background: #D3F1DE; }
/* Taip & papan kekunci Arab */
.taip-papar { text-align: center; font-size: 40px; color: var(--emas); min-height: 58px; }
.taip-kotak { display: flex; flex-direction: row-reverse; justify-content: center; gap: 5px; margin-bottom: 10px; }
.taip-kotak span { width: 34px; height: 40px; border-bottom: 3px solid var(--emas); font-family: 'Noto Naskh Arabic', serif; font-size: 24px; color: var(--krim); text-align: center; }
.taip-kotak span.betul { border-color: #3BB273; color: #7EE0A8; } .taip-kotak span.salah { border-color: #E2553B; color: #F4A08C; }
.papan-arab { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; direction: rtl; margin-bottom: 10px; }
.kunci-h { height: 40px; border: none; border-radius: 9px; background: linear-gradient(#FFF6E0, #F2DDB0); color: var(--teal-gelap);
  font-family: 'Noto Naskh Arabic', serif; font-size: 21px; box-shadow: 0 3px 0 var(--emas-gelap); padding: 0; }
.kunci-h:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--emas-gelap); }
.kunci-h.padam { grid-column: span 2; background: var(--terakota); color: #fff; font-family: Nunito, sans-serif; }
.pilihan.taip-enjin, .pilihan.silang-enjin, .pilihan.carikata-enjin, .pilihan.memori-enjin, .pilihan.unta-enjin, .pilihan.arena-enjin { display: block; }
.pilihan.kunci .papan-arab, .pilihan.kunci #btnTaipHantar, .pilihan.kunci #btnSkHantar { display: none; }
/* Cari kata */
.ck-grid { display: grid; gap: 3px; direction: rtl; touch-action: none; user-select: none; -webkit-user-select: none; max-width: 400px; margin: 0 auto; }
.ck-sel { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #FFF8E7; color: var(--teal-gelap);
  border-radius: 8px; font-family: 'Noto Naskh Arabic', serif; font-size: 22px; font-weight: 700; cursor: pointer; }
.ck-sel.pilih { background: var(--emas); } .ck-sel.salah { background: #F9D5CC; }
.ck-sel.jumpa.w0 { background: #9BE3B9; } .ck-sel.jumpa.w1 { background: #F7C59F; } .ck-sel.jumpa.w2 { background: #A9D6F5; }
.ck-sel.jumpa.w3 { background: #D7B9F2; } .ck-sel.jumpa.w4 { background: #F2E394; }
.ck-sel.dedah:not(.jumpa) { box-shadow: inset 0 0 0 3px #E2553B; }
.ck-senarai { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 4px; direction: rtl; }
.ck-kata { background: #00000030; color: var(--krim); border-radius: 99px; padding: 2px 14px; font-size: 20px; }
.ck-kata.jumpa { text-decoration: line-through; background: #3BB27355; }
/* Silang kata */
.sk-grid { display: grid; gap: 2px; direction: rtl; justify-content: center; margin: 4px auto 10px; }
.sk-sel, .sk-kosong { width: var(--sk); height: var(--sk); }
.sk-sel { position: relative; background: #FFF8E7; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sk-sel i { position: absolute; top: 1px; right: 3px; font-style: normal; font-size: 10px; font-weight: 800; color: var(--terakota); }
.sk-sel b { font-family: 'Noto Naskh Arabic', serif; font-size: calc(var(--sk) * .55); color: var(--teal-gelap); }
.sk-sel.aktif { background: #FFE7A3; box-shadow: inset 0 0 0 2px var(--emas-gelap); }
.sk-sel.kursor { box-shadow: inset 0 0 0 3px var(--terakota); }
.sk-sel.betul { background: #D3F1DE; } .sk-sel.salah { background: #F9D5CC; } .sk-sel.salah b { color: #9C3F2A; }
.sk-petunjuk { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; direction: rtl; }
.sk-pt { display: flex; align-items: center; gap: 6px; background: #00000030; color: var(--krim); border: 2px solid transparent; border-radius: 12px; padding: 4px 8px; font-weight: 800; }
.sk-pt.aktif { border-color: var(--emas); background: #E8B33A33; }
.sk-pt img { height: 40px; max-width: 60px; object-fit: contain; background: #fff; border-radius: 6px; }
.sk-pt .no { background: var(--emas); color: var(--dakwat); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.sk-pt .ar { font-family: 'Noto Naskh Arabic', serif; font-size: 20px; }
/* Lumba unta */
.unta-trek { position: relative; background: linear-gradient(#F4E4C1, #E9CF96); border-radius: 16px; padding: 8px 10px; margin-bottom: 12px; border: 3px solid var(--emas); }
.lorong { position: relative; height: 44px; border-bottom: 2px dashed #B8955A; }
.lorong:last-of-type { border-bottom: none; }
.unta { position: absolute; top: 2px; font-size: 34px; transition: right .9s cubic-bezier(.3,1.4,.5,1); transform: scaleX(1); }
.lorong .nama { position: absolute; right: 2px; bottom: 2px; font-size: 11px; font-weight: 800; color: #7A5A20; }
.penamat { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 30px; }
.unta-pilihan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.unta-pilihan .pil.betul { box-shadow: 0 0 0 4px #3BB273, 0 0 16px #3BB273; opacity: 1 !important; }
.unta-pilihan .pil.salah { box-shadow: 0 0 0 4px #E2553B; opacity: 1 !important; }
/* Pecah belon & tangkap */
.arena { position: relative; height: 290px; border-radius: 18px; overflow: hidden; touch-action: manipulation;
  background: linear-gradient(#7FC8E8, #CDEBF5 70%, #F4E4C1); border: 3px solid var(--emas); }
.arena-enjin.mod-tangkap .arena { background: linear-gradient(#0A2C32, #1C6B77); }
.belon, .jatuh { position: absolute; left: 0; top: 0; border: none; padding: 0; cursor: pointer; will-change: transform; }
.belon { width: 88px; height: 102px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 35% 30%, #ffffffaa, var(--w) 45%);
  color: #fff; font-weight: 800; box-shadow: inset -6px -8px 0 #00000022; }
.belon::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 2px; height: 26px; background: #ffffffaa; }
.belon .ar, .jatuh .ar { font-family: 'Noto Naskh Arabic', serif; font-size: 20px; text-shadow: 0 1px 2px #0006; }
.jatuh { background: linear-gradient(#FFF6E0, #F2DDB0); color: var(--teal-gelap); border-radius: 14px; padding: 6px 14px; box-shadow: 0 4px 0 var(--emas-gelap); font-weight: 800; }
.jatuh .ar { text-shadow: none; font-size: 22px; }
.pecah-betul { animation: pop .45s forwards; } .pecah-salah { animation: gegarKotak .4s; filter: grayscale(.6) brightness(.8); }
.belon.tunjuk, .jatuh.tunjuk { box-shadow: 0 0 0 4px #3BB273, 0 0 22px #3BB273; }
@keyframes pop { 50% { opacity: 1; scale: 1.4; } 100% { opacity: 0; scale: 1.8; } }

/* ===== Video sebelum menjawab (v4.1) ===== */
.video-tajuk { flex: 1; text-align: center; font-family: 'Reem Kufi', sans-serif; font-weight: 700; font-size: 18px; color: var(--emas); }
.video-isi { padding: 6px 16px 28px; max-width: 640px; margin: 0 auto; }
.video-nota { background: #00000030; border: 1px solid #ffffff22; border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.video-nota:empty { display: none; }
.video-senarai { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.video-kad { background: var(--krim); border-radius: 16px; padding: 8px; box-shadow: 0 4px 0 var(--emas-gelap); }
.video-bingkai { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-bingkai > div, .video-bingkai iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-status { display: flex; align-items: center; gap: 8px; padding: 8px 4px 2px; color: var(--teal); font-weight: 800; font-size: 13px; }
.video-status .bulat-no { width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: var(--krim); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.video-status.siap { color: #1E7A4A; } .video-status.siap .bulat-no { background: #2E9B5F; }
.video-status.amaran { color: #A8402A; } .video-status.amaran .bulat-no { background: var(--terakota); }
#btnVideoMula:disabled { opacity: .55; }

/* ===== Soalan dengar & pilih (v4.1) ===== */
.btn-audio.besar { margin: 12px auto 2px; padding: 14px 26px; font-size: 16px; border-radius: 999px; background: var(--terakota);
  box-shadow: inset 0 -4px 0 var(--terakota-gelap); animation: denyutAudio 1.6s ease-in-out infinite; }
.btn-audio.besar .ikon { width: 24px; height: 24px; }
@keyframes denyutAudio { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.pilihan.tunggu-dengar .pil { opacity: .35; pointer-events: none; filter: grayscale(.4); }
#s-video { padding-top: 12px; }
#s-video .kuiz-atas { padding: 0 16px; }

/* ===== Bazar Kanz (kedai dinar) ===== */
.btn-bazar { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-bazar .ikon { width: 20px; height: 20px; }
.kanz-hiasan { margin-top: 12px; text-align: center; font-size: 13px; color: var(--pudar); }
.kanz-hiasan img { width: 18px; height: 18px; vertical-align: middle; }
.bazar-profil { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--teal); border: 2px solid #ffffff22; margin-bottom: 14px; }
.bazar-tab { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.bazar-tab button { border: 2px solid #ffffff33; background: #00000030; color: var(--krim); border-radius: 14px; padding: 8px 4px; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bazar-tab button .ar { font-size: 13px; color: var(--emas); }
.bazar-tab button.aktif { background: var(--emas); color: var(--teal-gelap); border-color: var(--emas); }
.bazar-tab button.aktif .ar { color: var(--teal-gelap); }
.bazar-senarai { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kad-bazar { background: var(--krim); color: var(--teal-gelap); border: none; border-radius: 18px; padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 4px 0 var(--emas-gelap); font-family: inherit; }
.kad-bazar:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--emas-gelap); }
.kad-bazar.terkunci { filter: grayscale(.7); opacity: .75; }
.kad-bazar.dipakai { box-shadow: 0 0 0 3px var(--emas), 0 4px 0 var(--emas-gelap); }
.pratonton { width: 100%; height: 86px; border-radius: 12px; background: #00000010; display: flex; align-items: center; justify-content: center; }
.pratonton.aura { background: var(--teal); }
.ikon-besar { font-size: 46px; line-height: 1; }
.ikon-besar img { width: 60px; height: 60px; object-fit: contain; }
.nama-bazar { font-weight: 800; font-size: 14px; text-align: center; line-height: 1.2; }
.arab-bazar { font-size: 15px; color: var(--terakota-gelap); }
.lbl-bazar { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--teal); color: var(--emas); }
.lbl-bazar .ikon { width: 14px; height: 14px; }
.lbl-bazar.kurang { opacity: .6; }
.lbl-bazar.milik { background: #2E9B5F; color: #fff; }
.lbl-bazar.pakai { background: var(--emas); color: var(--teal-gelap); }
.lbl-bazar.kunci { background: #8a8a8a; color: #fff; font-size: 12px; }
.ikon-modal-bazar { font-size: 56px; line-height: 1; display: flex; justify-content: center; }
.ikon-modal-bazar img { width: 72px; height: 72px; object-fit: contain; }

/* peneman di sebelah avatar */
.potret .peneman { position: absolute; right: -12%; top: -10%; width: 46%; height: 46%; min-width: 20px; min-height: 20px; border-radius: 50%;
  background: var(--krim); border: 2px solid var(--emas); display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--s) * 0.26); line-height: 1; z-index: 3; box-shadow: 0 2px 4px #0005; }
.potret .peneman img { width: 80%; height: 80%; object-fit: contain; }

/* aura (cahaya) di sekeliling avatar */
.potret.aura .bulat { animation: aura-denyut 2.4s ease-in-out infinite; }
.aura-pelita { --aura: #FF9F43; } .aura-zamrud { --aura: #2ECC71; } .aura-hilal { --aura: #D6E4FF; } .aura-emas { --aura: #FFD54A; }
@keyframes aura-denyut {
  0%, 100% { box-shadow: 0 0 0 3px var(--aura), 0 0 10px 2px var(--aura); }
  50% { box-shadow: 0 0 0 3px var(--aura), 0 0 22px 8px var(--aura); }
}

/* panji (latar kepala profil) */
.panji-pasir { background: linear-gradient(135deg, #C98B2A, #8a5a14) !important; }
.panji-oasis { background: linear-gradient(135deg, #1E8C6E, #0E5A4A 60%, #2E9B5F) !important; }
.panji-bintang { background: radial-gradient(circle at 20% 30%, #ffffff55 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #ffffff66 0 1px, transparent 2px), radial-gradient(circle at 45% 80%, #ffffff44 0 1px, transparent 2px), linear-gradient(135deg, #0B1A3A, #1E2F6B) !important; background-size: 60px 60px, 80px 80px, 50px 50px, cover !important; }
.panji-diraja { background: linear-gradient(135deg, #4A1C6B, #7A2E9B 60%, #3A1452) !important; }
.panji-sultan { background: linear-gradient(135deg, #8a5d08, #E8B33A 45%, #FFE7A3 55%, #A8740F) !important; }
.panji-sultan .nama-kecil, .panji-sultan .gelaran { color: #2a1a00 !important; }

/* ===== Bazar: 30 barang (aura, panji & lencana tambahan) ===== */
.bazar-tab button { font-size: 13px; padding: 8px 2px; }
.aura-pasir { --aura: #E8C877; } .aura-delima { --aura: #E5484D; } .aura-firus { --aura: #3FB6F5; } .aura-pelangi { --aura: #FF5E5E; }
.potret.aura-pelangi .bulat { animation: aura-pelangi 3s linear infinite; }
@keyframes aura-pelangi {
  0%   { box-shadow: 0 0 0 3px #FF5E5E, 0 0 16px 6px #FF5E5E; }
  20%  { box-shadow: 0 0 0 3px #FFB347, 0 0 20px 8px #FFB347; }
  40%  { box-shadow: 0 0 0 3px #FFE66D, 0 0 16px 6px #FFE66D; }
  60%  { box-shadow: 0 0 0 3px #4CD97B, 0 0 20px 8px #4CD97B; }
  80%  { box-shadow: 0 0 0 3px #4DA6FF, 0 0 16px 6px #4DA6FF; }
  100% { box-shadow: 0 0 0 3px #FF5E5E, 0 0 16px 6px #FF5E5E; }
}
.panji-fajar { background: linear-gradient(135deg, #3B2A5C, #C2553B 55%, #F6A57A) !important; }
.panji-rempah { background: repeating-linear-gradient(45deg, #9C3F2A 0 12px, #B5532F 12px 24px), #9C3F2A !important; }
.panji-taman { background: linear-gradient(135deg, #0E5A3A, #1E8C5A 50%, #C9A13A) !important; }
.lencana-nama { display: inline-block; font-size: 1.05em; line-height: 1; margin-right: 4px; vertical-align: -1px; }
.lencana-nama img { width: 1.1em; height: 1.1em; vertical-align: middle; }

/* kuasa barang Bazar */
.kuasa-bazar { font-size: 11px; font-weight: 800; color: #1E6B4A; background: #DDF3E6; border-radius: 8px; padding: 3px 6px; text-align: center; line-height: 1.3; }
.kuasa-modal { background: #DDF3E6; color: #1E6B4A; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 14px; }

/* pelarasan dinar guru (Kanz) */
.kanz-pelarasan { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.kanz-pelarasan:empty { display: none; }
.pelarasan { border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pelarasan.bonus { background: #DDF3E6; color: #1E6B4A; }
.pelarasan.penalti { background: #F9DED6; color: #9C3F2A; }
.pelarasan span { font-size: 13px; }

/* had XP setiap tajuk & tajuk dikuasai */
.nod .nod-xp { font-size: 10px; font-weight: 800; color: #1E6B4A; }
.nod.dikuasai .nod-nama { background: var(--emas); }
.nod.dikuasai .nod-sesi { color: #A8740F; }
