/* lexi.css - Gaya permainan LEXI27 (diskop .lx). Menggantikan Tailwind CDN + Font Awesome dalam sumber asal
   (Apps Script) dengan CSS tempatan; palet asal dikekalkan: parliament-blue #0f172a, budget-teal #0f766e,
   gold-accent #fbbf24, latar kecerunan #0f172a -> #1e3a8a -> #0f766e, panel kaca, animasi fadeIn/slideUp.
   Saiz teks dalam em (Bhg 16A). */
.lx { --lx-biru: #0f172a; --lx-teal: #0f766e; --lx-emas: #fbbf24; --lx-emas2: #f59e0b; --lx-garis: rgba(255,255,255,.12);
  --iv-sp-latar: #0f172a;
  position: relative; overflow: hidden; border-radius: var(--radius, 14px); color: #fff;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f766e 100%);
  min-height: 620px; font-family: Inter, system-ui, sans-serif; display: flex; flex-direction: column; }
.lx *, .lx *::before, .lx *::after { box-sizing: border-box; }
.lx [hidden] { display: none !important; }
.lx button { font: inherit; cursor: pointer; }
svg.lx-i { width: 1.15em; height: 1.15em; fill: currentColor; flex: 0 0 auto; vertical-align: -.2em; }
.lx [data-ik] { display: inline-flex; }
.lx .w-emas { color: var(--lx-emas); } .lx .w-teal, .lx-teal { color: #2dd4bf; } .lx .w-merah { color: #ef4444; } .lx .w-hijau { color: #22c55e; }
.lx .w-perak { color: #d1d5db; } .lx .w-gangsa { color: #fb923c; }
.lx-kaca { background: rgba(255,255,255,.05); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.1); border-radius: 1rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }

/* Bar atas (asal: header logo + bunyi + skrin penuh) */
.lx-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 10px; }
.lx-logo { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; background: none; border: 0; color: inherit; padding: 0; text-align: left; }
.lx-logo-ikon { width: 40px; height: 40px; border-radius: 50%; background: var(--lx-emas); color: var(--lx-biru); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.lx-logo-ikon svg { width: 22px; height: 22px; }
.lx-logo b { display: block; font-size: 1.35em; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.lx-logo b span { color: var(--lx-emas); }
.lx-logo small { display: block; font-size: .72em; color: #99f6e4; margin-top: 2px; }
.lx-bulat { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--lx-emas); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); flex: 0 0 auto; }
.lx-bulat:hover { background: rgba(255,255,255,.18); }
.lx-bulat.mati { color: #6b7280; }
.lx-bulat svg { width: 20px; height: 20px; }
.lx-bar .iv-sp-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: var(--lx-emas); border-radius: 99px; padding: 6px 12px; min-height: 40px; flex: 0 0 auto; }
.lx-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) { .lx-bar .iv-sp-btn span { display: none; } .lx-bar .iv-sp-btn { width: 40px; padding: 0; justify-content: center; } .lx-logo b { font-size: 1.15em; } }

.lx-isi { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; padding: 6px 10px 14px; }
.lx-skrin { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1 1 auto; animation: lxFade .4s ease-in-out both; }
.lx-panel { padding: 1.6em 1.3em; width: 100%; position: relative; overflow: hidden; }
@media (min-width: 768px) { .lx-panel { padding: 2.4em 2.4em; } }
.lx-m3 { max-width: 48rem; } .lx-m2 { max-width: 42rem; } .lx-m1 { max-width: 36rem; } .lx-m4 { max-width: 56rem; }
.lx-naik { animation: lxNaik .5s ease-out both; }
@keyframes lxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lxNaik { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Utama */
.lx-utama { text-align: center; }
.lx-gelembung { position: absolute; width: 16rem; height: 16rem; border-radius: 50%; filter: blur(48px); pointer-events: none; }
.lx-gelembung.a { top: -5rem; right: -5rem; background: var(--lx-teal); opacity: .3; }
.lx-gelembung.b { bottom: -5rem; left: -5rem; background: var(--lx-emas); opacity: .2; }
.lx-jaguh { position: relative; font-size: 2.1em; font-weight: 800; line-height: 1.15; margin: 0 0 .6em; background: linear-gradient(to right, #fff, var(--lx-emas)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (min-width: 768px) { .lx-jaguh { font-size: 3em; } }
.lx-petik { position: relative; font-size: 1.08em; font-weight: 300; line-height: 1.65; color: #e5e7eb; margin: 0 0 1.8em; }
.lx-btn-baris { position: relative; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
@media (min-width: 640px) { .lx-btn-baris { flex-direction: row; flex-wrap: wrap; } }

/* Butang (asal: btn-gold, btn-primary, glass-panel) */
.lx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 99px; padding: .9em 1.8em; font-weight: 700; border: 1px solid rgba(255,255,255,.2); color: #fff; min-height: 46px; transition: transform .3s, box-shadow .3s, background .3s; text-decoration: none; }
.lx-btn.emas { background: linear-gradient(to right, var(--lx-emas2), var(--lx-emas)); color: var(--lx-biru); border-color: transparent; }
.lx-btn.emas:hover { background: linear-gradient(to right, #fbbf24, #fcd34d); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(251,191,36,.4); }
.lx-btn.teal { background: linear-gradient(to right, #0f766e, #0d9488); }
.lx-btn.teal:hover { background: linear-gradient(to right, #0d9488, #14b8a6); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(13,148,136,.4); }
.lx-btn.kaca { background: rgba(255,255,255,.05); }
.lx-btn.kaca:hover { background: rgba(255,255,255,.12); }
.lx-btn.persegi { border-radius: .6em; }
.lx-btn.kecil { padding: .55em 1.2em; min-height: 40px; font-size: .92em; border-radius: .5em; }
.lx-btn:disabled { opacity: .7; cursor: wait; transform: none; }
.lx-btn.teks { background: none; border: 0; color: #d1d5db; padding: .5em .8em; }
.lx-btn.teks:hover { color: #fff; }

/* Cara bermain */
.lx-h3 { font-size: 1.5em; font-weight: 800; color: var(--lx-emas); display: flex; align-items: center; gap: 10px; margin: 0 0 1em; }
.lx-peraturan { list-style: none; margin: 0 0 1.8em; padding: 0; display: grid; gap: 1em; color: #e5e7eb; line-height: 1.55; }
.lx-peraturan li { display: flex; gap: 12px; align-items: flex-start; }
.lx-peraturan li svg { margin-top: .2em; color: #14b8a6; }
.lx-peraturan li.awas svg { color: #f87171; }
.lx-antara { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Daftar */
.lx-ket { font-size: .9em; color: #d1d5db; margin: 0 0 1.4em; }
.lx-borang { display: grid; gap: 1.1em; }
.lx-borang label { display: block; font-size: .9em; font-weight: 600; margin-bottom: .45em; }
.lx-borang label span { color: #f87171; }
.lx-borang input, .lx-borang select { width: 100%; padding: .8em 1em; border-radius: .6em; background: rgba(15,23,42,.5); border: 1px solid var(--lx-teal); color: #fff; font: inherit; outline: none; min-height: 46px; }
.lx-borang select option { background: #0f172a; color: #fff; }
.lx-borang input:focus, .lx-borang select:focus { border-color: var(--lx-emas); box-shadow: 0 0 0 1px var(--lx-emas); }
.lx-borang input::placeholder { color: #94a3b8; }

/* Kuiz */
.lx-status { width: 100%; max-width: 48rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 1em; font-size: .9em; font-weight: 600; background: rgba(0,0,0,.3); padding: .75em; border-radius: .6em; border: 1px solid rgba(255,255,255,.1); }
.lx-status > span, .lx-status-k > span { display: inline-flex; align-items: center; gap: 6px; }
.lx-status-k { display: flex; align-items: center; gap: 14px; }
.lx-status .lx-masa { color: #f87171; font-weight: 800; min-width: 4.2em; justify-content: flex-end; }
.lx-masa.denyut { color: #ef4444; animation: lxDenyut 1s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes lxDenyut { 50% { opacity: .5; } }
.lx-kemajuan { width: 100%; max-width: 48rem; height: 8px; background: #374151; border-radius: 99px; margin-bottom: 1.4em; overflow: hidden; }
.lx-kemajuan div { height: 100%; background: linear-gradient(to right, var(--lx-teal), var(--lx-emas)); transition: width .3s; }
.lx-soalan-kad { min-height: 400px; display: flex; flex-direction: column; justify-content: center; }
.lx-soalan { font-size: 1.3em; font-weight: 800; line-height: 1.35; text-align: center; margin: 0 0 1.4em; }
@media (min-width: 768px) { .lx-soalan { font-size: 1.75em; } }
.lx-opsyen-grid { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; }
@media (min-width: 768px) { .lx-opsyen-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
.lx-opsyen { display: flex; align-items: center; gap: 12px; padding: 1em; border-radius: .8em; text-align: left; width: 100%; color: #fff; background: rgba(255,255,255,.1); border: 2px solid transparent; transition: all .2s; min-height: 56px; }
.lx-opsyen:hover:not(:disabled) { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }
.lx-opsyen:disabled { cursor: default; }
.lx-opsyen.pudar { opacity: .7; }
.lx-opsyen.betul { background: #10b981; border-color: #059669; }
.lx-opsyen.salah { background: #ef4444; border-color: #b91c1c; }
.lx-huruf { width: 2em; height: 2em; border-radius: .3em; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.lx-opsyen-t { flex: 1 1 auto; }
.lx-opsyen .tanda { width: 1.3em; height: 1.3em; }
.lx-tindakan { margin-top: 1.6em; animation: lxNaik .5s ease-out both; }
.lx-maklum { display: flex; flex-direction: column; align-items: center; width: 100%; background: rgba(15,23,42,.6); padding: 1.3em; border-radius: .8em; border: 1px solid; text-align: center; }
.lx-maklum.ok { border-color: rgba(34,197,94,.5); } .lx-maklum.tidak { border-color: rgba(239,68,68,.5); }
.lx-maklum-t { font-weight: 800; font-size: 1.08em; margin: 0 0 .6em; }
.lx-maklum.ok .lx-maklum-t { color: #4ade80; } .lx-maklum.tidak .lx-maklum-t { color: #f87171; }
.lx-terang { display: inline-flex; gap: 8px; align-items: flex-start; text-align: left; font-size: .9em; color: #e5e7eb; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.1); padding: .75em; border-radius: .6em; margin: 0 0 1em; line-height: 1.55; }
.lx-terang svg { margin-top: .15em; }
.lx-maklum .lx-btn { border-radius: .6em; width: 100%; }
@media (min-width: 768px) { .lx-maklum .lx-btn { width: auto; } }

/* Keputusan */
.lx-keputusan { text-align: center; }
.lx-keputusan canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.lx-keputusan .lx-atas { position: relative; z-index: 1; }
.lx-res-t { font-size: 2em; font-weight: 800; color: var(--lx-emas); margin: 0 0 .25em; }
@media (min-width: 768px) { .lx-res-t { font-size: 3em; } }
.lx-res-q { font-size: 1.08em; font-weight: 300; margin: 0 0 1.4em; line-height: 1.55; }
.lx-stat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.6em; }
@media (min-width: 768px) { .lx-stat { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.lx-stat > div { background: rgba(0,0,0,.3); padding: 1em; border-radius: .8em; border: 1px solid rgba(255,255,255,.1); }
.lx-stat small { display: block; font-size: .85em; color: #9ca3af; margin-bottom: .25em; }
.lx-stat b { font-size: 1.6em; font-weight: 800; }
.lx-stat b i { font-style: normal; font-size: .6em; color: #9ca3af; }
.lx-pangkat { display: inline-block; background: linear-gradient(to right, rgba(15,118,110,.2), rgba(15,23,42,.2)); border: 1px solid rgba(15,118,110,.3); padding: 1.2em 2.4em; border-radius: .8em; margin-bottom: 1em; max-width: 100%; }
.lx-pangkat small { display: block; font-size: .8em; text-transform: uppercase; letter-spacing: .15em; color: #d1d5db; margin-bottom: .2em; }
.lx-pangkat b { font-size: 1.6em; font-weight: 800; color: var(--lx-emas); }
@media (min-width: 768px) { .lx-pangkat b { font-size: 2.2em; } }
.lx-simpan { font-size: .88em; color: #99f6e4; margin: 0 0 1.4em; min-height: 1.3em; }
.lx-res-btn { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lx-res-btn .lx-btn { border-radius: .6em; width: 100%; }
@media (min-width: 640px) { .lx-res-btn .lx-btn { width: auto; } }
.lx-res-btn .pusing { animation: lxPusing 1s linear infinite; }
@keyframes lxPusing { to { transform: rotate(360deg); } }

/* Papan kedudukan */
.lx-lb-kepala { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 1.2em; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 1em; }
.lx-lb-kepala h2 { font-size: 1.5em; font-weight: 800; color: var(--lx-emas); display: flex; align-items: center; gap: 10px; margin: 0; }
.lx-jadual { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lx-jadual table { width: 100%; border-collapse: collapse; text-align: left; }
.lx-jadual th { background: rgba(0,0,0,.4); color: #d1d5db; font-size: .85em; padding: .75em; white-space: nowrap; }
.lx-jadual th:first-child { border-radius: .5em 0 0 0; } .lx-jadual th:last-child { border-radius: 0 .5em 0 0; }
.lx-jadual td { padding: .75em; border-bottom: 1px solid rgba(255,255,255,.05); }
.lx-jadual tr:hover td { background: rgba(255,255,255,.05); }
.lx-jadual tr.anda td { background: rgba(251,191,36,.12); }
.lx-jadual .kanan { text-align: right; }
.lx-no { font-weight: 800; white-space: nowrap; }
.lx-nama { font-weight: 600; text-transform: uppercase; }
.lx-pudar { color: #9ca3af; font-size: .9em; }
.lx-teal { font-size: .9em; }
.lx-emas-t { font-weight: 800; color: var(--lx-emas); }
.lx-kosong { text-align: center; padding: 2em; color: #9ca3af; }
.lx-lb-nota { font-size: .85em; color: #9ca3af; margin: .9em 0 0; }
.lx-lb-saya { font-size: .92em; color: var(--lx-emas); font-weight: 700; margin: .4em 0 0; }
@media (max-width: 600px) { .lx-jadual th:nth-child(4), .lx-jadual td:nth-child(4) { display: none; } .lx-jadual td, .lx-jadual th { padding: .6em .45em; } }

/* Kaki (asal: footer) */
.lx-kaki { text-align: center; padding: 1em; font-size: .78em; color: #9ca3af; border-top: 1px solid rgba(255,255,255,.08); }
.lx-kaki p { margin: 0; } .lx-kaki p + p { margin-top: .3em; color: #6b7280; }
.lx-kaki #copyright-year { cursor: pointer; }

/* Popup: helaian bawah seragam (Bhg 36 pengecualian dialog ringkas: tinggi ikut kandungan) */
.lx-modal { position: fixed; inset: 0; z-index: 200000; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; padding: 4px 4px 0; }
.lx-modal-helai { width: 100%; max-height: calc(100% - 4px); overflow: auto; background: #0f172a; color: #fff; border: 1px solid #4b5563; border-bottom: 0; border-radius: 4px 4px 0 0; padding: 0 8px 18px; animation: lxNaik .3s ease-out both; font-family: Inter, system-ui, sans-serif; }
@media (min-width: 900px), (min-width: 768px) and (orientation: landscape) { .lx-modal { padding: 24px 24px 0; } .lx-modal-helai { border-radius: 24px 24px 0 0; padding: 0 22px 24px; } }
.lx-modal-kepala { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.12); background: #0f172a; margin-bottom: 14px; }
.lx-modal-kepala h3 { font-size: 1.22em; font-weight: 800; margin: 0 auto 0 0; }
.lx-modal-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.lx-modal-x svg { width: 18px; height: 18px; fill: currentColor; }
.lx-modal-badan { text-align: center; max-width: 30rem; margin: 0 auto; }
.lx-modal-ikon svg { width: 2.6em; height: 2.6em; }
.lx-modal-desc { color: #d1d5db; font-size: .95em; margin: .6em 0 1.3em; line-height: 1.55; word-break: break-word; }
.lx-modal-butang { display: flex; gap: 12px; justify-content: center; }
.lx-modal .lx-btn { color: #fff; border: 1px solid rgba(255,255,255,.2); font-family: inherit; font-weight: 700; cursor: pointer; }
.lx-modal .lx-btn.teal { background: linear-gradient(to right, #0f766e, #0d9488); }
.lx-modal .lx-btn.kaca { background: rgba(255,255,255,.06); }
.lx-modal .lx-btn.kecil { padding: .55em 1.4em; min-height: 40px; border-radius: .5em; display: inline-flex; align-items: center; }
.lx-modal svg.lx-i { fill: currentColor; } .lx-modal .w-emas { color: #fbbf24; } .lx-modal .w-teal { color: #2dd4bf; } .lx-modal .w-merah { color: #ef4444; } .lx-modal .w-hijau { color: #22c55e; }

/* Sijil (asal: #certificate-container 1122x793, dijana html2canvas -> jsPDF A4 landskap) */
#certificate-container { position: fixed; top: 0; left: -20000px; width: 1122px; height: 793px; pointer-events: none; }
#cert-content { width: 1122px; height: 793px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 70px 84px;
  background-color: #f8fafc; background-image: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%); color: #0f172a; font-family: Inter, Arial, sans-serif; box-sizing: border-box; }
#cert-content * { box-sizing: border-box; }
.cert-air { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .03; }
.cert-air svg { width: 350px; height: 350px; fill: #0f172a; }
.cert-border-outer { border: 12px solid #0f172a; position: absolute; top: 20px; bottom: 20px; left: 20px; right: 20px; z-index: 2; }
.cert-border-inner { border: 4px solid #fbbf24; position: absolute; top: 36px; bottom: 36px; left: 36px; right: 36px; z-index: 3; }
.cert-isi { position: relative; z-index: 10; text-align: center; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 896px; }
.cert-lencana { margin-bottom: 10px; background: #0f172a; width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 4px solid #fbbf24; box-shadow: 0 10px 20px rgba(0,0,0,.2); }
.cert-lencana svg { width: 34px; height: 34px; fill: #fbbf24; }
.cert-h1 { font-family: Merriweather, Georgia, serif; font-size: 40px; line-height: 1.15; font-weight: 700; color: #0f172a; letter-spacing: .1em; margin: 0; text-transform: uppercase; }
.cert-garis { width: 256px; height: 4px; background: #fbbf24; margin: 16px auto 14px; }
.cert-p { font-size: 18px; line-height: 1.3; color: #374151; margin: 0 0 10px; }
.cert-p.i { font-style: italic; }
.cert-nama { font-family: Merriweather, Georgia, serif; font-size: 38px; font-weight: 700; color: #0f172a; margin: 0 0 10px; text-transform: uppercase; line-height: 1.15; }
.cert-acara { font-size: 22px; line-height: 1.25; font-weight: 700; color: #0f766e; letter-spacing: .03em; margin: 0 0 14px; }
.cert-markah { font-size: 17px; line-height: 1.3; color: #374151; margin: 0 0 6px; }
.cert-markah strong { color: #0f172a; }
.cert-pangkat { background: #0f172a; color: #fbbf24; padding: 3px 36px 13px; border-radius: 999px; font-size: 26px; line-height: 1.25; font-weight: 700; margin: 4px 0 14px; text-transform: uppercase; border: 2px solid #fbbf24; display: inline-block; box-shadow: 0 6px 14px rgba(0,0,0,.2); }
.cert-doa { font-size: 14px; line-height: 1.45; color: #4b5563; font-style: italic; max-width: 672px; margin: 0 auto 14px; }
.cert-bawah { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; border-top: 1px solid #d1d5db; padding-top: 12px; }
.cert-bawah small { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.cert-bawah b { font-size: 14px; color: #0f172a; }
.cert-qr { width: 64px; height: 64px; border: 2px solid #d1d5db; padding: 4px; margin: 0 auto 4px; }
.cert-qr svg { width: 100%; height: 100%; fill: #0f172a; }
.cert-id { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: #6b7280; }
.cert-kaki { position: absolute; bottom: 46px; left: 0; width: 100%; text-align: center; font-size: 10px; color: #9ca3af; z-index: 10; }
.cert-kaki p { margin: 0; }
