/* pokok.css - Gaya permainan POKOK AL-QURAN SPM 2026 (diskop .pq). Menggantikan Tailwind CDN dalam sumber asal
   (Canva) dengan CSS tempatan; palet emerald/lime/amber dan animasi asal (pulse-correct, shake, waterDrop, splash,
   coinPop, fruitPop, toastSlide, bounce, fadeIn) dikekalkan. Saiz teks dalam em (Bhg 16A). */
.pq { --pq-teks: #ecfdf5; --pq-pudar: #6ee7b7; --pq-garis: rgba(16,185,129,.3); --pq-kad: rgba(255,255,255,.08);
  --iv-sp-latar: #052e22;
  position: relative; overflow: hidden; border-radius: var(--radius, 14px); color: var(--pq-teks);
  background: radial-gradient(70% 50% at 85% 0%, rgba(163,230,53,.12), transparent 60%), linear-gradient(160deg, #064e3b 0%, #053b2e 45%, #052e22 100%);
  min-height: 600px; font-family: 'DM Sans', Inter, system-ui, sans-serif; display: flex; flex-direction: column; }
.pq *, .pq *::before, .pq *::after { box-sizing: border-box; }
.pq [hidden] { display: none !important; }
.pq button { font: inherit; cursor: pointer; }
svg.pq-i { width: 1.2em; height: 1.2em; flex: 0 0 auto; vertical-align: -.22em; }
.pq [data-ik] { display: inline-flex; }

/* Bar atas (rangka: tajuk + skrin penuh) */
.pq-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(0,0,0,.28); border-bottom: 1px solid var(--pq-garis); position: relative; z-index: 5; }
.pq-logo { font-weight: 900; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 6px; color: #fff; margin-right: auto; font-size: .95em; min-width: 0; }
.pq-logo svg { width: 1.4em; height: 1.4em; }
.pq-bar .iv-sp-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pq-garis); background: rgba(0,0,0,.3); color: #d1fae5; border-radius: 10px; padding: 6px 10px; min-height: 36px; flex: 0 0 auto; }
.pq-bar .iv-sp-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { .pq-bar .iv-sp-btn span { display: none; } .pq-logo { font-size: .85em; } }

/* Kad umum (asal: bg-white/10 backdrop-blur rounded-2xl border-emerald-500/30) */
.pq-kad { background: var(--pq-kad); border: 1px solid var(--pq-garis); border-radius: 1rem; padding: 1em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pq-h3 { font-size: 1em; font-weight: 700; margin: 0 0 .7em; text-align: center; color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pq-h3.besar { font-size: 1.2em; }
.pq-tengah { text-align: center; justify-content: center; }
.pq-tajuk { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 1.9em; line-height: 1.15; margin: 0 0 .3em; text-align: center; color: #fff; }
.pq-tajuk.kecil { font-size: 1.45em; margin: 0; }
.pq-subtajuk { text-align: center; color: #a7f3d0; margin: 0 0 1.4em; line-height: 1.5; }
.pq-emas { color: #fcd34d; font-weight: 700; }
.pq-kecil-emas { color: #fde68a; font-size: .9em; }
.pq-lime { color: #bef264; font-weight: 700; }
.pq-oren { color: #fdba74; font-weight: 700; }

/* Butang */
.pq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: .8rem; padding: .8em 1.5em; font-weight: 700; min-height: 46px; color: #fff; transition: opacity .2s, filter .2s; }
.pq-btn.utama { background: linear-gradient(90deg, #059669, #65a30d); }
.pq-btn.utama:hover { filter: brightness(1.08); }
.pq-btn.penuh { width: 100%; margin-top: 1em; }
.pq-pautan { display: block; margin: .8em auto 0; border: 0; background: transparent; color: #a7f3d0; text-decoration: underline; font-size: .9em; padding: 6px; }

/* Pendaftaran */
.pq-daftar { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.pq-borang-kad { width: 100%; max-width: 28rem; padding: 1.8em 1.5em; }
.pq-daftar-ikon { display: flex !important; justify-content: center; margin-bottom: .3em; }
.pq-daftar-ikon svg { width: 4em; height: 4em; animation: pqBounce 2.4s ease-in-out infinite; }
.pq-borang { display: grid; gap: 1em; }
.pq-borang label { display: block; font-size: .9em; margin-bottom: .3em; color: #d1fae5; font-weight: 600; }
.pq-borang input { width: 100%; padding: .65em 1em; border-radius: .6rem; background: rgba(255,255,255,.1); border: 1px solid rgba(16,185,129,.4); color: #fff; font: inherit; min-height: 44px; }
.pq-borang input::placeholder { color: rgba(110,231,183,.55); }
.pq-borang input:focus { outline: none; border-color: #a3e635; }
.pq-borang .pq-btn { width: 100%; margin-top: .3em; }
.pq-ciri { list-style: none; margin: 1.3em 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pq-ciri li { display: flex; align-items: center; gap: 6px; font-size: .82em; color: #d1fae5; background: rgba(0,0,0,.2); border-radius: .6rem; padding: 7px 9px; }

/* Permainan */
.pq-permainan { flex: 1; display: flex; flex-direction: column; }
.pq-kepala { padding: 14px 12px 6px; background: radial-gradient(60% 100% at 50% 0%, rgba(163,230,53,.15), transparent 70%); }
.pq-tab { display: flex; gap: 4px; border-bottom: 1px solid rgba(4,120,87,.5); padding: 0 12px; margin: 0 auto; width: 100%; max-width: 56rem; overflow-x: auto; }
.pq-tab button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 12px; font-weight: 600; font-size: .92em; white-space: nowrap;
  border-bottom: 3px solid transparent; color: #6ee7b7; opacity: .7; }
.pq-tab button[aria-selected="true"] { border-bottom-color: #a3e635; color: #ecfdf5; opacity: 1; }
.pq-panel { width: 100%; max-width: 56rem; margin: 0 auto; padding: 14px 12px 24px; animation: pqFade .3s ease; }
.pq-grid-main { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pq-papan { order: 2; }
.pq-utama { order: 1; min-width: 0; }
@media (min-width: 900px) {
  .pq-grid-main { grid-template-columns: 1fr 2fr; }
  .pq-papan { order: 1; }
  .pq-utama { order: 2; }
  .pq-papan .pq-kad { position: sticky; top: 12px; }
}
.pq-dl { margin: 0; font-size: .9em; display: grid; gap: 6px; }
.pq-dl > div { display: flex; justify-content: space-between; gap: 10px; }
.pq-dl dt { color: #6ee7b7; display: inline-flex; align-items: center; gap: 5px; }
.pq-dl dd { margin: 0; color: #fff; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pq-dl hr, .pq-nota-isi hr { border: 0; border-top: 1px solid #047857; margin: 4px 0; width: 100%; }

.pq-atas { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pq-syiling-pil { display: inline-flex; align-items: center; gap: 6px; background: rgba(254,243,199,.2); padding: 4px 12px; border-radius: 99px; }
.pq-syiling-pil b { color: #fcd34d; }
.pq-tahap { color: #a7f3d0; font-weight: 600; font-size: .92em; }
.pq-xp { margin-bottom: 12px; }
.pq-xp-t { display: flex; justify-content: space-between; font-size: .78em; margin-bottom: 4px; color: #6ee7b7; }
.pq-streak { color: #fcd34d; display: inline-flex; align-items: center; gap: 3px; }
.pq-xp-bar { height: 12px; background: rgba(6,78,59,.6); border-radius: 99px; overflow: hidden; }
.pq-xp-isi { height: 100%; background: linear-gradient(90deg, #34d399, #bef264); border-radius: 99px; transition: width .6s ease; }

.pq-pokok { position: relative; display: flex; justify-content: center; margin: 14px 0; filter: drop-shadow(0 4px 12px rgba(16,85,40,.3)); }
.pq .pq-pokok svg#tree-svg { width: 160px !important; height: 192px !important; max-width: 100%; }
#tree-crown { transition: r .6s ease; }
.pq-fx { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.pq-fx > span { position: absolute; display: inline-flex; }
.pq-fx svg { width: 2em; height: 2em; }
.pq-peringkat { text-align: center; color: #6ee7b7; font-weight: 600; font-size: .92em; margin: 0 0 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }

.pq-level-pilih { text-align: center; }
.pq-level-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pq-lv { display: inline-flex; align-items: center; gap: 6px; padding: .75em 1em; border-radius: .8rem; border: 2px solid; color: #fff; font-weight: 600; font-size: .92em; transition: background .2s, opacity .2s; }
.pq-lv .pq-bintang svg { width: 1em; height: 1em; }
.pq-lv:disabled { opacity: .5; cursor: not-allowed; }
.pq-lv.w1 { background: #047857; border-color: #10b981; } .pq-lv.w1:not(:disabled):hover { background: #059669; }
.pq-lv.w2 { background: #b45309; border-color: #f59e0b; } .pq-lv.w2:not(:disabled):hover { background: #d97706; }
.pq-lv.w3 { background: #be123c; border-color: #f43f5e; } .pq-lv.w3:not(:disabled):hover { background: #e11d48; }
.pq-lv.w4 { background: #7e22ce; border-color: #a855f7; } .pq-lv.w4:not(:disabled):hover { background: #9333ea; }
.pq-lv.w5 { background: #0369a1; border-color: #0ea5e9; } .pq-lv.w5:not(:disabled):hover { background: #0284c7; }

.pq-kuiz-atas { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pq-kiraan { font-size: .9em; font-weight: 600; color: #6ee7b7; }
.pq-lencana { font-size: .78em; background: #065f46; color: #a7f3d0; padding: 2px 9px; border-radius: 99px; }
.pq-soalan-kad { padding: 1.4em; }
.pq-soalan { font-size: 1.12em; font-weight: 600; color: #fff; margin: 0 0 1.1em; line-height: 1.5; }
.pq-opsyen { display: grid; gap: 10px; }
.pq-opsyen button { width: 100%; text-align: start; padding: .8em; border-radius: .8rem; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05); color: rgba(255,255,255,.92); font-weight: 500; transition: border-color .2s; min-height: 48px; }
.pq-opsyen button:not(:disabled):hover { border-color: #a3e635; }
.pq-opsyen button:disabled { cursor: default; }
.pq-opsyen button.betul { border-color: #a3e635; background: rgba(54,83,20,.4); }
.pq-opsyen button.salah { border-color: #f87171; background: rgba(127,29,29,.4); }
.pq-opsyen button .ar, .pq-soalan .ar { font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif; font-size: 1.5em; line-height: 1.4; }
.pq-maklum { margin: 1em 0 0; font-size: .92em; font-weight: 600; display: flex; align-items: flex-start; gap: 6px; }
.pq-maklum.ok { color: #bef264; }
.pq-maklum.tidak { color: #fca5a5; }
.pq-keputusan { text-align: center; padding: 2em 1.2em; }
.pq-skor { font-size: 2.5em; font-weight: 800; color: #bef264; margin: 0 0 .1em; }
.pq-keputusan p { margin: 0 0 .4em; display: flex; align-items: center; justify-content: center; gap: 5px; }
.pq-buka { color: #d9f99d; font-weight: 600; }
.pq-simpan { color: #a7f3d0; font-size: .85em; min-height: 1.2em; }
.pq-keputusan .pq-btn { margin-top: .8em; }

/* Animasi asal */
@keyframes pqPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pqShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pqFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pqWater { 0% { transform: translateY(-30px) scale(1); opacity: 1; } 60% { transform: translateY(20px) scale(1.1); opacity: .8; } 100% { transform: translateY(30px) scale(.5); opacity: 0; } }
@keyframes pqSplash { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }
@keyframes pqCoin { 0% { transform: translateY(0) scale(0); opacity: 1; } 50% { transform: translateY(-20px) scale(1.2); opacity: 1; } 100% { transform: translateY(-40px) scale(.8); opacity: 0; } }
@keyframes pqFruit { 0% { transform: scale(0) rotate(-180deg); } 60% { transform: scale(1.3) rotate(0); } 100% { transform: scale(1) rotate(0); } }
@keyframes pqToast { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pqBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pq-fade { animation: pqFade .3s ease; }
.pq-anim-betul { animation: pqPulse .4s ease; }
.pq-anim-salah { animation: pqShake .3s ease; }
.pq-titis { animation: pqWater .7s ease-in forwards; }
.pq-percik { animation: pqSplash .5s ease-out .5s forwards; opacity: 0; }
.pq-syiling-naik { animation: pqCoin .8s ease forwards; }
.pq-buah { transform-box: fill-box; transform-origin: center; animation: pqFruit .5s cubic-bezier(.68,-.55,.27,1.55) both; }

/* Toast motivasi (asal: bg-lime-500 rounded-full di bawah tengah) */
.pq-toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: #84cc16; color: #111827; font-weight: 700; padding: .7em 1.5em; border-radius: 99px;
  box-shadow: 0 10px 25px rgba(0,0,0,.3); animation: pqToast .4s ease forwards; transition: opacity .3s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 24px); }
.pq-toast.pudar { opacity: 0; }
html.iv-sp-aktif .pq-toast { position: fixed; }

/* Nota */
.pq-nota-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 768px) { .pq-nota-grid { grid-template-columns: 1fr 1fr; } .pq-nota-grid .pq-nota.lebar { grid-column: span 2; } .pq-dua { grid-template-columns: 1fr 1fr !important; } }
.pq-nota { padding: 1.2em; min-width: 0; }
.pq-nota-kepala { display: flex; align-items: center; gap: 8px; margin-bottom: .8em; }
.pq-nota-ikon { width: 2.5em; height: 2.5em; border-radius: .6rem; display: grid !important; place-items: center; background: rgba(163,230,53,.15); flex: 0 0 auto; }
.pq-nota-ikon svg { width: 1.6em; height: 1.6em; }
.pq-nota-kepala h3 { margin: 0; font-size: 1.05em; font-weight: 700; color: #fff; }
.pq-nota-isi { font-size: .92em; color: #d1fae5; line-height: 1.55; display: grid; gap: .5em; }
.pq-nota-isi p { margin: 0; }
.pq-nota-isi ol, .pq-nota-isi ul { margin: 0; padding-left: 1.3em; color: #a7f3d0; display: grid; gap: .25em; }
.pq-nota-isi strong { color: #fff; }
.pq-nota-isi .pq-l { color: #bef264; }
.pq-nota-isi .pq-sub { font-weight: 700; color: #fde68a; }
.pq-nota-isi .pq-kunci { color: #a7f3d0; font-size: .9em; }
.pq-nota-isi .pq-nota { color: #34d399; font-style: italic; font-size: .9em; padding: 0; }
.pq-dua { display: grid; grid-template-columns: 1fr; gap: 1em; }
.pq-infografik { border-radius: 1rem; overflow: hidden; border: 1px solid var(--pq-garis); max-width: 640px; margin: 0 auto; }
.pq-infografik img { display: block; width: 100%; height: auto; }
#panel-notes > .pq-h3 { margin-top: 1.4em; }

/* Ranking */
.pq-ranking-ket { text-align: center; color: #a7f3d0; font-size: .85em; margin: -.3em 0 .8em; }
.pq-jadual { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pq-jadual table { width: 100%; border-collapse: collapse; font-size: .9em; }
.pq-jadual th { color: #6ee7b7; text-align: left; padding: 8px 6px; border-bottom: 1px solid #047857; font-weight: 600; white-space: nowrap; }
.pq-jadual th.t, .pq-jadual td.t { text-align: center; }
.pq-jadual td { padding: 8px 6px; border-bottom: 1px solid rgba(6,78,59,.5); color: #fff; }
.pq-jadual td small { display: block; color: #6ee7b7; font-size: .8em; }
.pq-jadual td.e { color: #fcd34d; } .pq-jadual td.x { color: #bef264; }
.pq-jadual tr.anda td { background: rgba(54,83,20,.35); font-weight: 700; }
.pq-jadual tr.jarak td { text-align: center; color: #6ee7b7; border-bottom: 0; padding: 2px; }
.pq-kedudukan { text-align: center; color: #6ee7b7; font-size: .9em; font-weight: 600; margin: 1em 0 0; }

.pq-kaki { text-align: center; font-size: .78em; color: #a7f3d0; padding: 14px 12px 18px; border-top: 1px solid rgba(16,185,129,.18); margin-top: auto; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .pq *, .pq-toast { animation: none !important; transition: none !important; } }
/* Skrin penuh: isi boleh skrol */
html.iv-sp-aktif .pq { overflow-y: auto; border-radius: 0; }
