/* MADVENTURE - gaya permainan asal (Abdul Muhaimin bin Abirerah), diskop .mv.
   Saiz teks dalam em (Bhg 16A); teks Arab/Jawi ikut skala --fs-scale. Emoji asal -> ikon SVG garis. */
.mv {
  --mv-teks: #17324d; --mv-teks2: #64748b; --mv-teks3: #94a3b8; --mv-kad: rgba(255,255,255,.97); --mv-kad2: #f8fafc;
  --mv-sempadan: #ccfbf1; --mv-sempadan2: #dbeafe; --mv-lembut: #f0fdfa; --mv-utama: #0f766e; --mv-biru: #0891b2;
  --mv-emas-bg: #fef3c7; --mv-emas: #92400e; --mv-emas-sp: #fbbf24;
  --mv-latar: radial-gradient(circle at 10% 10%, rgba(45,212,191,.18), transparent 30%), radial-gradient(circle at 90% 15%, rgba(14,165,233,.15), transparent 30%), radial-gradient(circle at 50% 100%, rgba(34,197,94,.12), transparent 35%), linear-gradient(160deg, #ecfeff, #f0fdfa 45%, #f8fafc);
  --mv-jawi: 'Scheherazade New', 'Sakkal Majalla', 'Traditional Arabic', 'Noto Naskh Arabic', serif;
  --iv-sp-latar: #ecfeff;
  position: relative; overflow: hidden; isolation: isolate;
  font-size: 1.08em; color: var(--mv-teks); background: var(--mv-latar);
  border: 1px solid var(--mv-sempadan); border-radius: var(--radius, 16px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mv {
  --mv-teks: #e2f3f1; --mv-teks2: #a3b8c2; --mv-teks3: #7c8fa0; --mv-kad: rgba(15,35,40,.96); --mv-kad2: #12292e;
  --mv-sempadan: #1f4d4a; --mv-sempadan2: #24444f; --mv-lembut: #0f3533; --mv-utama: #5eead4; --mv-biru: #67e8f9;
  --mv-emas-bg: #3d2e0a; --mv-emas: #fcd34d; --mv-emas-sp: #a16207;
  --mv-latar: radial-gradient(circle at 10% 10%, rgba(45,212,191,.12), transparent 30%), radial-gradient(circle at 90% 15%, rgba(14,165,233,.1), transparent 30%), linear-gradient(160deg, #071c1f, #0a2326 45%, #0b1620);
  --iv-sp-latar: #071c1f; } }
:root[data-theme="dark"] .mv {
  --mv-teks: #e2f3f1; --mv-teks2: #a3b8c2; --mv-teks3: #7c8fa0; --mv-kad: rgba(15,35,40,.96); --mv-kad2: #12292e;
  --mv-sempadan: #1f4d4a; --mv-sempadan2: #24444f; --mv-lembut: #0f3533; --mv-utama: #5eead4; --mv-biru: #67e8f9;
  --mv-emas-bg: #3d2e0a; --mv-emas: #fcd34d; --mv-emas-sp: #a16207;
  --mv-latar: radial-gradient(circle at 10% 10%, rgba(45,212,191,.12), transparent 30%), radial-gradient(circle at 90% 15%, rgba(14,165,233,.1), transparent 30%), linear-gradient(160deg, #071c1f, #0a2326 45%, #0b1620);
  --iv-sp-latar: #071c1f; }
.mv *, .mv *::before, .mv *::after { box-sizing: border-box; }
.mv button, .mv input { font-family: inherit; }
.mv button { cursor: pointer; }
.mv.iv-skrin-penuh { overflow-y: auto; border-radius: 0; }

/* Ikon SVG garis (ganti emoji) */
.mv .mvi { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: 0 0 auto; }
.mv [data-ik] { display: inline-flex; align-items: center; }
.mv [data-ik]:not(:empty) { margin-right: .35em; }

/* Gelembung latar */
.mv-latar { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.mv-latar span { position: absolute; display: block; border-radius: 50%; background: rgba(20,184,166,.08); animation: mvBubble 12s infinite ease-in-out; }
.mv-latar span:nth-child(1) { width: 140px; height: 140px; left: 5%; top: 15%; }
.mv-latar span:nth-child(2) { width: 85px; height: 85px; right: 8%; top: 35%; animation-delay: -3s; }
.mv-latar span:nth-child(3) { width: 170px; height: 170px; left: 30%; bottom: 5%; animation-delay: -6s; }
@keyframes mvBubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-25px); } }

/* Bar atas (topbar asal) */
.mv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px; background: var(--mv-kad); border: 1px solid var(--mv-sempadan2); padding: 10px 14px; border-radius: 18px; box-shadow: 0 8px 30px rgba(15,118,110,.08); }
.mv-bar .logo { font-size: 1.35em; font-weight: 900; color: var(--mv-utama); margin-right: auto; letter-spacing: -.01em; }
.mv-bar .logo span { color: var(--mv-biru); }
.xp-display { display: inline-flex; align-items: center; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border: 1px solid #fbbf24; padding: 7px 13px; border-radius: 999px; font-weight: 900; font-size: .92em; white-space: nowrap; box-shadow: 0 5px 14px rgba(245,158,11,.18); gap: 3px; }
.xp-display[hidden] { display: none; }
.sound-btn { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #99f6e4; background: var(--mv-lembut); color: var(--mv-utama); padding: 7px 12px; border-radius: 999px; font-size: .88em; font-weight: 800; white-space: nowrap; min-height: 38px; }
.sound-btn:hover { filter: brightness(.97); }
.sound-btn.iv-sp-btn svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn.mati { opacity: .7; }
.student-info { text-align: right; font-size: .85em; color: var(--mv-teks2); line-height: 1.3; }
.student-info strong { display: block; color: var(--mv-teks); font-size: 1.1em; }
.mv-isi { padding: 0 12px 6px; }
.mv-isi > section > div, .mv-isi > section { max-width: 1120px; margin-left: auto; margin-right: auto; }

/* Log masuk */
#loginScreen { display: flex; justify-content: center; padding: 6px 0 14px; }
.login-card { width: 100%; max-width: 670px; background: var(--mv-kad); border-radius: 26px; padding: 30px; box-shadow: 0 25px 70px rgba(15,118,110,.17); border: 2px solid rgba(153,246,228,.7); position: relative; overflow: hidden; }
.login-card::before { content: "مد"; position: absolute; right: -15px; top: -35px; font-family: var(--mv-jawi); font-size: calc(190px * var(--fs-scale, 1)); font-weight: bold; color: rgba(20,184,166,.06); pointer-events: none; line-height: 1.4; }
.brand-small { display: inline-flex; align-items: center; background: linear-gradient(135deg, #ccfbf1, #cffafe); color: #0f766e; font-size: .8em; font-weight: 900; padding: 8px 14px; border-radius: 999px; margin-bottom: 18px; }
.mv-h1 { margin: 0 0 14px; font-size: clamp(2.3em, 7vw, 3.8em); line-height: 1; color: var(--mv-teks); letter-spacing: -.04em; font-weight: 900; position: relative; }
.login-card .intro { color: var(--mv-teks2); font-size: 1.04em; line-height: 1.7; margin: 0 0 22px; position: relative; }
.mission-intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; position: relative; }
.mission-mini { background: var(--mv-lembut); border: 1px solid #99f6e4; border-radius: 15px; padding: 11px 8px; text-align: center; font-size: .86em; font-weight: bold; color: var(--mv-utama); font-family: inherit; display: block; }
.mission-mini > [data-ik] { display: flex; justify-content: center; margin: 0 auto 4px; }
.mission-mini > [data-ik] .mvi { width: 1.8em; height: 1.8em; }
.mission-mini.clickable { cursor: pointer; transition: .2s; }
.mission-mini.clickable:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(15,118,110,.12); }
.form-group { margin-bottom: 16px; position: relative; }
.mv label { display: block; font-weight: 800; color: var(--mv-teks); margin-bottom: 7px; font-size: 1em; }
.mv input[type="text"] { width: 100%; border: 2px solid var(--mv-sempadan2); padding: 13px 15px; border-radius: 14px; font-size: 1em; outline: none; background: var(--mv-kad2); color: var(--mv-teks); transition: .2s; }
.mv input[type="text"]:focus { border-color: #14b8a6; box-shadow: 0 0 0 4px rgba(20,184,166,.12); }
.mv-ralat { margin: -4px 0 10px; color: #be123c; font-weight: 700; font-size: .92em; }
.primary-btn { width: 100%; border: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f766e, #0891b2); color: #fff; padding: 15px 18px; border-radius: 15px; font-size: 1.04em; font-weight: 900; margin-top: 6px; transition: .2s; box-shadow: 0 8px 22px rgba(8,145,178,.22); }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(8,145,178,.3); }
.small-note { margin: 14px 0 0; color: var(--mv-teks3); font-size: .84em; line-height: 1.5; text-align: center; }

/* Animasi XP */
.xp-pop { animation: mvXpPop .55s ease; }
@keyframes mvXpPop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.xp-toast { position: fixed; top: 95px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border: 2px solid #f59e0b; padding: 11px 22px; border-radius: 999px; font-size: 1.3em; font-weight: 900; z-index: 9999; box-shadow: 0 12px 32px rgba(146,64,14,.25); animation: mvXpToast 1.35s ease forwards; pointer-events: none; font-family: Inter, system-ui, sans-serif; }
.xp-toast .mvi { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes mvXpToast { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.18); } 65% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -35px) scale(1); } }

/* Hero misi */
.mv .hero { background: linear-gradient(135deg, #115e59, #0891b2 60%, #2563eb); border-radius: 24px; padding: 30px; color: #fff; margin-bottom: 24px; position: relative; overflow: hidden; box-shadow: 0 18px 45px rgba(8,145,178,.22); border: 2px solid rgba(255,255,255,.18); }
.mv .hero::after { content: "مد"; position: absolute; right: 30px; bottom: -40px; font-size: calc(180px * var(--fs-scale, 1)); font-family: var(--mv-jawi); opacity: .08; font-weight: bold; line-height: 1.4; }
.hero-tag { display: inline-flex; align-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 999px; font-size: .78em; font-weight: bold; margin-bottom: 10px; }
.mv .hero h2 { font-size: clamp(1.8em, 5vw, 2.9em); margin: 0 0 10px; font-weight: 900; letter-spacing: -.02em; }
.mv .hero p { margin: 0; max-width: 680px; line-height: 1.75; color: #ecfeff; font-size: 1.04em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; z-index: 2; }
.hero-stat { display: inline-flex; align-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 13px; padding: 9px 14px; font-size: .86em; font-weight: bold; color: #fff; font-family: inherit; }
.hero-stat.rank-link { cursor: pointer; transition: .2s; }
.hero-stat.rank-link:hover { background: rgba(255,255,255,.24); transform: translateY(-2px); }

/* Peta misi */
.section-title { display: flex; align-items: center; margin: 0 0 6px; font-size: 1.5em; color: var(--mv-teks); font-weight: 800; }
.section-subtitle { margin: 0 0 18px; color: var(--mv-teks2); line-height: 1.6; font-size: .96em; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-bottom: 26px; }
.topic-card { background: linear-gradient(160deg, var(--mv-kad), var(--mv-lembut)); border: 2px solid var(--mv-sempadan); border-radius: 22px; padding: 20px; transition: .25s; box-shadow: 0 10px 25px rgba(15,118,110,.08); cursor: pointer; position: relative; overflow: hidden; text-align: left; color: inherit; font: inherit; width: 100%; display: block; }
.topic-card .tc-kilat { position: absolute; top: 16px; right: 17px; opacity: .35; color: #d97706; }
.topic-card .tc-kilat .mvi { width: 1.4em; height: 1.4em; }
.topic-card.completed { border-color: #86efac; }
.topic-card:hover { transform: translateY(-5px) scale(1.01); box-shadow: 0 18px 35px rgba(15,118,110,.18); border-color: #2dd4bf; }
.topic-number { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #14b8a6, #0891b2); color: #fff; font-weight: 900; font-size: 1.1em; margin-bottom: 12px; }
.topic-number .mvi { width: 1.3em; height: 1.3em; stroke-width: 3; }
.topic-card.completed .topic-number { background: linear-gradient(135deg, #16a34a, #22c55e); }
.topic-card h4 { margin: 0 0 4px; color: var(--mv-teks); font-size: calc(28px * var(--fs-scale, 1)); font-family: var(--mv-jawi); direction: rtl; text-align: right; line-height: 1.6; font-weight: 700; }
.arabic-name { font-size: calc(25px * var(--fs-scale, 1)); direction: rtl; text-align: right; color: var(--mv-utama); margin: 4px 0; font-family: var(--mv-jawi); line-height: 1.6; }
.rate-badge { display: inline-block; margin-top: 10px; padding: 3px 11px; background: var(--mv-lembut); color: var(--mv-utama); border-radius: 999px; font-family: var(--mv-jawi); font-size: calc(19px * var(--fs-scale, 1)); font-weight: bold; direction: rtl; }
.xp-badge { display: inline-flex; align-items: center; margin-top: 10px; margin-left: 5px; padding: 6px 11px; background: #fef3c7; color: #92400e; border-radius: 999px; font-size: .78em; font-weight: 800; }
.xp-badge.completed-badge { background: #dcfce7; color: #166534; }
.quiz-banner { background: linear-gradient(145deg, var(--mv-kad), var(--mv-lembut)); border: 2px solid #99f6e4; border-radius: 22px; padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; }
.quiz-banner h3 { display: flex; align-items: center; margin: 0 0 6px; font-size: 1.45em; color: var(--mv-teks); }
.quiz-banner p { margin: 0; color: var(--mv-teks2); line-height: 1.65; font-size: .96em; }
.start-quiz-btn { display: inline-flex; align-items: center; justify-content: center; border: none; background: linear-gradient(135deg, #0f766e, #0891b2); color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 900; white-space: nowrap; font-size: 1em; }
.mv-keluar { text-align: center; padding: 4px 0 8px; }
.mv-pautan { border: 0; background: none; color: var(--mv-teks2); font-size: .86em; text-decoration: underline; padding: 6px; }

/* Butiran misi */
.back-btn { display: inline-flex; align-items: center; border: none; background: #e2e8f0; color: #334155; padding: 10px 16px; border-radius: 12px; font-weight: bold; font-size: .92em; margin-bottom: 16px; }
.topic-detail-card { background: var(--mv-kad); border-radius: 24px; padding: 28px; box-shadow: 0 15px 40px rgba(15,23,42,.07); border: 1px solid var(--mv-sempadan); }
.mv-lencana { display: inline-flex; align-items: center; background: #ccfbf1; color: #0f766e; padding: 6px 12px; border-radius: 999px; font-size: .76em; font-weight: bold; margin-bottom: 10px; }
.topic-detail-card h2 { margin: 0 0 6px; font-size: calc(40px * var(--fs-scale, 1)); color: var(--mv-teks); font-family: var(--mv-jawi); direction: rtl; text-align: right; line-height: 1.6; }
.detail-arabic { direction: rtl; text-align: right; font-size: calc(34px * var(--fs-scale, 1)); color: var(--mv-utama); margin-bottom: 18px; font-family: var(--mv-jawi); line-height: 1.6; }
.info-box { border-radius: 16px; background: var(--mv-kad2); padding: 16px 18px; margin: 14px 0; border-right: 5px solid #14b8a6; line-height: 2; font-size: calc(25px * var(--fs-scale, 1)); font-family: var(--mv-jawi); direction: rtl; text-align: right; }
.info-title, .tip-title, .feedback-label { display: flex; align-items: center; margin-bottom: 6px; font-family: Inter, system-ui, sans-serif; font-size: calc(14px * var(--fs-scale, 1)); font-weight: 800; direction: ltr; text-align: left; line-height: 1.4; }
.info-title { color: var(--mv-utama); }
.example-box { margin: 22px 0; text-align: center; padding: 24px 16px; border-radius: 20px; background: linear-gradient(135deg, var(--mv-lembut), var(--mv-kad2)); border: 1px solid #99f6e4; }
.example-title { color: var(--mv-teks2); font-size: .8em; font-weight: bold; margin-bottom: 8px; letter-spacing: .05em; }
.example-arabic { font-size: calc(clamp(40px, 8vw, 70px) * var(--fs-scale, 1)); direction: rtl; font-family: var(--mv-jawi); color: var(--mv-teks); margin-bottom: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.focus-jawi { font-family: var(--mv-jawi); direction: rtl; font-size: calc(24px * var(--fs-scale, 1)); line-height: 2; }
.tip-box { background: #fff7ed; border: 1px solid #fed7aa; padding: 16px 18px; border-radius: 16px; color: #9a3412; line-height: 2; margin-top: 18px; font-family: var(--mv-jawi); font-size: calc(24px * var(--fs-scale, 1)); direction: rtl; text-align: right; }

/* Kuiz */
.quiz-card { max-width: 830px; margin: 0 auto; background: var(--mv-kad); border-radius: 26px; padding: 28px; box-shadow: 0 16px 45px rgba(15,23,42,.1); border: 1px solid var(--mv-sempadan); display: flow-root; }
.quiz-top-info { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 16px; }
.quiz-progress-text { font-weight: 900; color: var(--mv-utama); font-size: 1.04em; }
.score-live { display: inline-flex; align-items: center; justify-content: center; color: #92400e; font-weight: 900; background: #fef3c7; border: 1px solid #fde68a; padding: 9px 13px; border-radius: 14px; min-width: 100px; font-size: .98em; gap: 3px; }
.timer-box { min-width: 130px; text-align: center; background: linear-gradient(135deg, #172b4d, #334155); color: #fff; border-radius: 16px; padding: 7px 15px; box-shadow: 0 7px 18px rgba(15,23,42,.18); }
.timer-label { font-size: .62em; letter-spacing: 1.4px; font-weight: 900; opacity: .75; }
.timer-value { font-size: 1.6em; line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 3px; }
.timer-box.active { animation: mvTimerPulse 1.6s infinite; }
@keyframes mvTimerPulse { 0%, 100% { box-shadow: 0 7px 18px rgba(15,23,42,.18); } 50% { box-shadow: 0 8px 27px rgba(239,68,68,.28); } }
.progress-track { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 24px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #14b8a6, #0891b2); width: 0; transition: width .3s; }
.question-label { display: flex; align-items: center; font-size: .76em; color: var(--mv-biru); font-weight: 900; margin-bottom: 8px; }
.question-title { font-family: var(--mv-jawi); direction: rtl; text-align: right; font-size: calc(30px * var(--fs-scale, 1)); line-height: 1.8; margin: 0 0 14px; color: var(--mv-teks); font-weight: 700; }
.question-arabic { text-align: center; direction: rtl; font-family: var(--mv-jawi); font-size: calc(clamp(42px, 9vw, 60px) * var(--fs-scale, 1)); color: var(--mv-utama); margin: 12px 0 22px; line-height: 1.7; }
.options { display: grid; gap: 11px; }
.option-btn { width: 100%; text-align: right; direction: rtl; border: 2px solid #e2e8f0; background: var(--mv-kad2); padding: 12px 18px; border-radius: 16px; font-family: var(--mv-jawi); font-size: calc(26px * var(--fs-scale, 1)); color: var(--mv-teks); transition: .15s; line-height: 1.7; }
.option-btn:hover:not(:disabled) { border-color: #14b8a6; background: var(--mv-lembut); transform: translateX(-3px); }
.option-btn:disabled { cursor: default; }
.option-btn.correct { background: #dcfce7; border-color: #22c55e; color: #166534; }
.option-btn.wrong { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.answer-reward { display: flex; align-items: center; justify-content: center; margin-top: 14px; padding: 11px 16px; border-radius: 15px; background: linear-gradient(135deg, #fef3c7, #fffbeb); border: 2px solid #fbbf24; color: #92400e; font-size: 1.3em; font-weight: 900; animation: mvReward .5s ease; }
@keyframes mvReward { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.feedback-box { margin-top: 14px; border-radius: 15px; padding: 16px; line-height: 2; font-family: var(--mv-jawi); font-size: calc(24px * var(--fs-scale, 1)); direction: rtl; text-align: right; }
.feedback-correct { background: #ecfdf5; color: #166534; }
.feedback-wrong { background: #fff1f2; color: #9f1239; }
.next-btn { display: inline-flex; align-items: center; border: none; background: #172b4d; color: #fff; padding: 13px 20px; border-radius: 13px; font-weight: bold; font-size: 1em; margin-top: 16px; float: right; }

/* Keputusan & ranking */
.result-card { max-width: 820px; margin: 0 auto; text-align: center; background: var(--mv-kad); border-radius: 28px; padding: 32px 24px; box-shadow: 0 17px 50px rgba(15,23,42,.1); border: 1px solid var(--mv-sempadan); }
.result-icon { display: flex; justify-content: center; color: #d97706; margin-bottom: 6px; }
.result-icon .mvi, .ranking-header .trophy .mvi { width: 64px; height: 64px; stroke-width: 1.6; }
.result-card h2 { font-size: 2.1em; color: var(--mv-teks); margin: 0 0 6px; font-weight: 900; }
.result-subtitle { color: var(--mv-teks2); margin-bottom: 22px; font-size: .96em; }
.score-circle { width: 190px; height: 190px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 22px; background: linear-gradient(135deg, #ccfbf1, #cffafe); border: 8px solid #14b8a6; }
.score-circle .big { font-size: 2.9em; font-weight: 900; color: #0f766e; }
.score-circle .small { color: #475569; font-size: .86em; }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 540px; margin: 0 auto 16px; }
.result-stat { background: var(--mv-kad2); border: 1px solid var(--mv-sempadan2); border-radius: 16px; padding: 14px; }
.result-stat-label { color: var(--mv-teks2); font-size: .78em; margin-bottom: 5px; }
.result-stat-value { display: flex; align-items: center; justify-content: center; font-size: 1.25em; font-weight: 900; color: var(--mv-utama); gap: 3px; }
.result-message { font-size: 1.05em; line-height: 1.65; color: var(--mv-teks); margin: 18px auto; max-width: 550px; }
.save-status { margin: 16px 0; padding: 11px 14px; border-radius: 12px; font-size: .88em; }
.save-loading { background: #eff6ff; color: #1d4ed8; }
.save-success { background: #ecfdf5; color: #166534; }
.save-error { background: #fff1f2; color: #9f1239; }
.ranking-card { max-width: 760px; margin: 0 auto; background: var(--mv-kad); border-radius: 26px; padding: 24px; border: 2px solid #fde68a; box-shadow: 0 16px 45px rgba(146,64,14,.10); }
.ranking-header { text-align: center; margin-bottom: 18px; }
.ranking-header .trophy { display: flex; justify-content: center; color: #d97706; margin-bottom: 4px; }
.ranking-header h2 { margin: 0 0 6px; color: var(--mv-emas); font-size: 1.75em; font-weight: 900; }
.ranking-header p { margin: 0; color: var(--mv-teks2); font-size: .88em; line-height: 1.6; }
.leaderboard { margin: 22px auto 10px; max-width: 650px; text-align: left; padding: 18px; border-radius: 22px; background: linear-gradient(145deg, var(--mv-emas-bg), var(--mv-kad)); border: 2px solid #fde68a; }
.leaderboard-title { display: flex; align-items: center; justify-content: center; color: var(--mv-emas); font-size: 1.3em; font-weight: 900; }
.leaderboard-subtitle { text-align: center; color: var(--mv-teks2); margin: 6px 0 14px; font-size: .82em; line-height: 1.5; }
.leaderboard-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 10px; border-bottom: 1px solid var(--mv-emas-bg); border-radius: 10px; }
.leaderboard-row.current-student { background: var(--mv-lembut); border: 1px solid #99f6e4; }
.leaderboard-rank { font-size: 1.5em; font-weight: 900; text-align: center; color: var(--mv-emas); display: flex; justify-content: center; }
.mv-pingat { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .7em; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.mv-pingat.p1 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.mv-pingat.p2 { background: linear-gradient(135deg, #cbd5e1, #64748b); }
.mv-pingat.p3 { background: linear-gradient(135deg, #fdba74, #b45309); }
.leaderboard-name { font-weight: 900; color: var(--mv-teks); font-size: .98em; overflow-wrap: anywhere; }
.leaderboard-name .anda { font-size: .6em; color: var(--mv-utama); }
.leaderboard-class { display: block; color: var(--mv-teks3); font-size: .76em; margin-top: 3px; }
.leaderboard-score { text-align: right; color: var(--mv-utama); }
.rank-xp { display: inline-flex; align-items: center; font-size: 1.02em; font-weight: 900; color: var(--mv-emas); gap: 2px; }
.rank-percent { font-size: .82em; font-weight: bold; color: var(--mv-utama); margin-top: 3px; }
.rank-time { display: flex; align-items: center; justify-content: flex-end; font-size: .72em; color: var(--mv-teks2); margin-top: 3px; gap: 2px; }
.mv-kosong { text-align: center; color: var(--mv-teks3); padding: 18px; }
.mv-kosong.ralat { color: #9f1239; }
.result-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.result-buttons button { display: inline-flex; align-items: center; border: none; padding: 12px 19px; border-radius: 13px; font-weight: bold; font-size: .94em; }
.retry-btn { background: linear-gradient(135deg, #0f766e, #0891b2); color: #fff; }
.home-btn { background: #e2e8f0; color: #334155; }

/* Kaki asal */
.site-footer { text-align: center; padding: 8px 12px 18px; color: var(--mv-teks2); font-size: .8em; line-height: 1.7; }
.copyright-mark { display: inline-block; background: var(--mv-kad); border: 1px solid var(--mv-sempadan); border-radius: 16px; padding: 9px 16px; box-shadow: 0 5px 16px rgba(15,118,110,.07); }
.copyright-mark strong { color: var(--mv-utama); font-weight: 900; }

/* Tema gelap: kotak berwarna asal dilembutkan */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mv .tip-box { background: #3a230f; border-color: #7c3f12; color: #fed7aa; } :root:not([data-theme="light"]) .mv .feedback-correct, :root:not([data-theme="light"]) .mv .option-btn.correct { background: #0d3b26; color: #bbf7d0; } :root:not([data-theme="light"]) .mv .feedback-wrong, :root:not([data-theme="light"]) .mv .option-btn.wrong { background: #4a1220; color: #fecdd3; } :root:not([data-theme="light"]) .mv .option-btn { border-color: #2c4a52; } :root:not([data-theme="light"]) .mv .back-btn, :root:not([data-theme="light"]) .mv .home-btn { background: #23363d; color: #e2e8f0; } :root:not([data-theme="light"]) .mv .progress-track { background: #23363d; } }
:root[data-theme="dark"] .mv .tip-box { background: #3a230f; border-color: #7c3f12; color: #fed7aa; }
:root[data-theme="dark"] .mv .feedback-correct, :root[data-theme="dark"] .mv .option-btn.correct { background: #0d3b26; color: #bbf7d0; }
:root[data-theme="dark"] .mv .feedback-wrong, :root[data-theme="dark"] .mv .option-btn.wrong { background: #4a1220; color: #fecdd3; }
:root[data-theme="dark"] .mv .option-btn { border-color: #2c4a52; }
:root[data-theme="dark"] .mv .back-btn, :root[data-theme="dark"] .mv .home-btn { background: #23363d; color: #e2e8f0; }
:root[data-theme="dark"] .mv .progress-track { background: #23363d; }

@media (max-width: 760px) {
  .mv-bar { margin: 8px; padding: 9px 10px; }
  .mv-bar .logo { font-size: 1.2em; }
  .mv-lbl-p, .mv-bar [data-iv-skrin-lbl] { display: none; }
  .student-info { order: 9; flex: 1 1 auto; text-align: left; }
  .mv-bar .iv-sp-btn { order: 10; }
  .mv-isi { padding: 0 8px 4px; }
  .login-card { padding: 22px 16px; }
  .mission-intro { grid-template-columns: 1fr; }
  .mv .hero { padding: 22px 18px; }
  .quiz-banner { flex-direction: column; align-items: stretch; }
  .start-quiz-btn { width: 100%; }
  .topic-detail-card, .quiz-card { padding: 20px 14px; }
  .quiz-top-info { grid-template-columns: 1fr auto; }
  .timer-box { grid-column: 1 / -1; width: 100%; margin-top: 3px; }
  .timer-value { font-size: 1.8em; }
  .question-title { font-size: calc(27px * var(--fs-scale, 1)); }
  .option-btn { font-size: calc(24px * var(--fs-scale, 1)); }
  .result-stats { grid-template-columns: 1fr; }
  .leaderboard { padding: 12px 8px; }
  .leaderboard-row { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 10px 6px; gap: 8px; }
  .ranking-card { padding: 18px 12px; }
  .result-card { padding: 26px 14px; }
}
