/* ============================================================
   Cordova E-Learn — Belajar Al-Qur'an Interaktif (Anak SMP)
   Tema: Emerald + Gold, modern, playful
   ============================================================ */

:root {
  --emerald-950: #022c22;
  --emerald-900: #064e3b;
  --emerald-800: #065f46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-200: #a7f3d0;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;

  --gold-600: #b8860b;
  --gold-500: #d4a937;
  --gold-400: #e3b94a;
  --gold-300: #f0cf6b;
  --gold-100: #fdf3d0;

  --ink: #15322b;
  --ink-soft: #4d6b63;
  --cream: #faf9f4;
  --white: #ffffff;
  --danger: #e11d48;
  --success: #16a34a;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(6, 78, 59, .08);
  --shadow-md: 0 8px 24px rgba(6, 78, 59, .12);
  --shadow-lg: 0 16px 48px rgba(6, 78, 59, .18);

  --font-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-ar: "Amiri", "Scheherazade New", "Traditional Arabic", "Times New Roman", serif;

  --sidebar-w: 264px;
  --topbar-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, #e6f7ee 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #fdf6e3 0%, transparent 55%),
    var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ---- dekoratif pattern & elemen utama ---- */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23059869' stroke-opacity='0.07' stroke-width='1'%3E%3Cpath d='M40 8l8 14 16 2-12 11 3 16-15-8-15 8 3-16-12-11 16-2z'/%3E%3C/g%3E%3C/svg%3E");
}

button { font-family: inherit; cursor: pointer; border: none; background: none; touch-action: manipulation; }
input { font-family: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ================= SIDEBAR ================= */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-800) 60%, #043c30 100%);
  color: #eafff3;
  padding: calc(22px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  z-index: 60;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar__logo { display: flex; align-items: center; gap: 12px; padding: 4px 6px; }
.logo-badge {
  width: 46px; height: 46px; flex: none;
  display: block;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}
.sidebar__logo h1 {
  font-size: 16px; font-weight: 800; letter-spacing: .1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__logo p { font-size: 11.5px; color: var(--emerald-200); }

.sidebar__nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: #d7f5e6; font-size: 14.5px; font-weight: 600;
  text-align: left; width: 100%;
  transition: background .2s, transform .15s, color .2s;
}
.nav-item:hover { background: rgba(255,255,255,.08); transform: translateX(3px); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(212,169,55,.25), rgba(212,169,55,.08));
  color: var(--gold-300);
  box-shadow: inset 3px 0 0 var(--gold-400);
}
.nav-ico { font-size: 19px; width: 26px; text-align: center; }

.sidebar__progress {
  margin-top: auto;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 14px;
}
.sp-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 8px; }
.sp-head strong { color: var(--gold-300); font-size: 16px; }
.sp-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.sp-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300));
  border-radius: 99px; transition: width .6s ease;
}
.sidebar__progress p { font-size: 11.5px; color: var(--emerald-200); margin-top: 8px; }

.sidebar__footer { font-size: 11px; color: rgba(215,245,230,.55); text-align: center; }

/* ================= MAIN & TOPBAR ================= */
.main {
  margin-left: var(--sidebar-w);
  padding: var(--topbar-h) clamp(26px, 3.5vw, 60px) 48px;
}

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: rgba(250, 249, 244, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(6,78,59,.08);
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(26px, 3.5vw, 60px);
  z-index: 50;
}
.topbar__title h2 { font-size: 19px; font-weight: 800; }
.topbar__title p { font-size: 12.5px; color: var(--ink-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 18px; line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--gold-100) 100%);
  border: 1.5px solid var(--gold-300);
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s, filter .2s, background .25s, border-color .25s;
}
.theme-toggle:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: var(--shadow-md); }
.theme-toggle:active { transform: scale(.94); }

.points-chip {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fff 0%, var(--gold-100) 100%);
  border: 1.5px solid var(--gold-300);
  border-radius: 99px; padding: 7px 16px;
  box-shadow: var(--shadow-sm);
}
.points-chip span { font-size: 16px; }
.points-chip strong { font-size: 16px; color: var(--gold-600); }
.points-chip em { font-style: normal; font-size: 11px; color: var(--ink-soft); }

.hamburger {
  font-size: 22px; color: var(--emerald-800);
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--emerald-50);
  display: none;
  transition: transform .2s;
}
.hamburger:hover { transform: rotate(90deg); }

/* ================= PAGES ================= */
.page { display: none; animation: fadeUp .45s ease both; }
.page.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head { margin: 8px 0 22px; }
.page-head h3 { font-size: 24px; font-weight: 800; color: var(--emerald-900); }
.page-head p { color: var(--ink-soft); margin-top: 4px; }

/* ================= CARD ================= */
.card {
  background: var(--white);
  border: 1px solid rgba(6,78,59,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ================= HERO ================= */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 20px; align-items: center;
  background: linear-gradient(120deg, var(--emerald-900), var(--emerald-700) 70%, var(--emerald-600));
  border-radius: 28px;
  padding: 44px 46px;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M60 12l12 22 25 3-19 17 5 25-23-12-23 12 5-25-19-17 25-3z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__text { position: relative; z-index: 2; }
.hero__tag {
  display: inline-block;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
}
.hero__title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; line-height: 1.2; margin: 16px 0 12px; }
.hero__title em { font-style: normal; color: var(--gold-300); }
.hero__desc { color: #d9f3e6; font-size: 15px; max-width: 54ch; margin-bottom: 22px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: 99px;
  font-weight: 700; font-size: 14.5px;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.96); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #3a2a03;
  box-shadow: 0 8px 20px rgba(212,169,55,.45);
}
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-2px); }
.btn-ghost {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff;
}
.btn-ghost.dark { background: var(--emerald-50); border-color: var(--emerald-200); color: var(--emerald-800); }
.btn-ghost.dark:hover { background: var(--emerald-100); }
.btn-soft { background: var(--emerald-50); color: var(--emerald-800); border-radius: 99px; padding: 10px 18px; font-weight: 700; font-size: 13.5px; }
.btn-soft:hover { background: var(--emerald-100); }

/* Hero art */
.hero__art { position: relative; z-index: 2; height: 260px; }
.moon {
  position: absolute; top: 8px; right: 30px;
  font-size: 92px;
  filter: drop-shadow(0 10px 24px rgba(240,207,107,.5));
  animation: floatMoon 5s ease-in-out infinite;
}
.quran {
  position: absolute; bottom: 12px; left: 18px;
  font-size: 74px;
  animation: floatSoft 5.5s ease-in-out infinite .6s;
}
.lamp {
  position: absolute; bottom: 4px; right: 8px;
  font-size: 54px;
  animation: floatSoft 6s ease-in-out infinite 1.2s;
}
.star { position: absolute; color: var(--gold-300); animation: twinkle 2.6s ease-in-out infinite; }
.s1 { top: 10px; left: 40px; font-size: 26px; }
.s2 { top: 90px; right: 16px; font-size: 20px; animation-delay: .7s; }
.s3 { bottom: 110px; left: 0; font-size: 18px; animation-delay: 1.3s; }
.cloud { position: absolute; font-size: 44px; opacity: .7; animation: drift 11s ease-in-out infinite; }
.c1 { top: 130px; left: 8px; }
.c2 { top: 190px; right: 40px; animation-delay: 5.5s; }
.moon, .quran, .lamp, .cloud { will-change: transform; }

/* animasi halus: bulan bergoyang lembut, buku & masjid melayang pelan,
   awan bergerak bolak-balik tanpa "lompatan" */
@keyframes floatMoon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-10px) rotate(-2deg); }
  65% { transform: translateY(-4px) rotate(1.5deg); }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-9px); }
  70% { transform: translateY(-3px); }
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes drift { 0%,100% { transform: translateX(0); } 50% { transform: translateX(60px); } }

/* ================= STATS ================= */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: 20px 0 26px;
}
.stat {
  background: var(--white); border: 1px solid rgba(6,78,59,.08);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.stat strong { font-size: 22px; color: var(--emerald-700); font-weight: 800; }
.stat span { font-size: 12px; color: var(--ink-soft); }

/* ================= HOME GRID ================= */
.home-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 16px;
  margin-bottom: 24px;
}
.feature-card {
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.feature-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, var(--emerald-50), transparent 70%);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.fc-ico { font-size: 34px; }
.feature-card h3 { font-size: 17px; font-weight: 800; color: var(--emerald-900); }
.feature-card p { font-size: 13px; color: var(--ink-soft); flex: 1; }
.link-btn { color: var(--emerald-600); font-weight: 800; font-size: 13.5px; text-align: left; }
.link-btn:hover { color: var(--gold-600); }

.home-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quote-card { padding: 26px; background: linear-gradient(135deg, #fff, var(--gold-100)); }
.quote-ar {
  font-family: var(--font-ar); font-size: 30px; color: var(--emerald-900);
  direction: rtl; text-align: center; display: block; margin-bottom: 10px;
}
.quote-latin { text-align: center; font-style: italic; color: var(--ink-soft); font-size: 14px; }
.quote-id { text-align: center; margin-top: 8px; font-size: 13.5px; }
.quote-id small { color: var(--ink-soft); }

.daily-card { padding: 22px; }
.daily-card h3 { font-size: 16px; margin-bottom: 12px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--emerald-50); color: var(--emerald-800);
  border: 1px solid var(--emerald-200);
  padding: 8px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 700;
  transition: all .15s;
}
.chip:hover { background: var(--emerald-600); color: #fff; transform: translateY(-2px); }

/* ================= SURAH LIST ================= */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar input {
  flex: 1; min-width: 200px;
  padding: 12px 18px; border-radius: 99px;
  border: 1.5px solid rgba(6,78,59,.15);
  background: #fff; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.toolbar input:focus { outline: 2px solid var(--emerald-500); outline-offset: 1px; }
.seg { display: flex; background: #fff; border: 1.5px solid rgba(6,78,59,.12); border-radius: 99px; padding: 4px; gap: 4px; }
.seg-btn { padding: 8px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.seg-btn.active { background: var(--emerald-700); color: #fff; }

.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); gap: 16px; }
.surah-card {
  padding: 20px; display: flex; align-items: center; gap: 14px;
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.surah-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.surah-num {
  flex: none; width: 52px; height: 52px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-800));
  color: #fff; font-weight: 800; font-size: 17px;
  border-radius: 16px;
  box-shadow: 0 6px 14px rgba(6,78,59,.3);
}
.surah-info { flex: 1; min-width: 0; }
.surah-info h4 { font-size: 15.5px; font-weight: 800; color: var(--emerald-900); }
.surah-info .ar-name { display: block; font-family: var(--font-ar); font-size: 23px; line-height: 1.35; color: var(--gold-600); margin-bottom: 3px; }
.surah-info p { font-size: 12px; color: var(--ink-soft); }
.surah-badges { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: .3px;
  padding: 3px 8px; border-radius: 99px;
  background: var(--emerald-50); color: var(--emerald-700);
}
.badge.gold { background: var(--gold-100); color: var(--gold-600); }
.surah-card .fav-btn {
  position: absolute; top: 10px; right: 12px;
  font-size: 16px; opacity: .55; transition: transform .2s, opacity .2s;
}
.surah-card .fav-btn:hover { transform: scale(1.25); opacity: 1; }
.surah-card .fav-btn.on { opacity: 1; }

/* ================= SURAH DETAIL ================= */
.learn-head {
  padding: 22px 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--emerald-900), var(--emerald-700));
  color: #fff; border: none;
}
.learn-head .surah-num { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #3a2a03; }
.learn-head h3 { font-size: 24px; font-weight: 800; }
.learn-head p { font-size: 13px; color: var(--emerald-100); }
.learn-head .ar-head { font-family: var(--font-ar); font-size: 34px; color: var(--gold-300); }

.player-bar {
  margin: 14px 0; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.player-bar > span { font-size: 13px; color: var(--ink-soft); font-weight: 600; flex: 1 0 100%; }
.mur-controls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  width: 100%;
}
.mur-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--emerald-200);
  background: var(--white); color: var(--emerald-700);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, border-color .15s, background .15s;
}
.mur-btn:hover { transform: scale(1.1); border-color: var(--emerald-400); }
.mur-btn.mur-play {
  width: 46px; height: 46px;
  background: var(--emerald-600); border-color: var(--emerald-600);
  color: #fff; box-shadow: var(--shadow-sm);
}
.mur-btn.mur-play:hover { background: var(--emerald-700); }
.mur-auto {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  background: var(--white); border: 1.5px solid var(--emerald-200);
  border-radius: 99px; padding: 8px 12px; cursor: pointer; user-select: none;
}
.mur-auto input { accent-color: var(--emerald-600); }
.mur-status { font-size: 12.5px; font-weight: 800; color: var(--emerald-700); margin-left: auto; white-space: nowrap; }
@media (min-width: 620px) {
  .player-bar > span { flex: 0 0 auto; }
  .mur-controls { width: auto; flex: 1; min-width: 0; }
}

.learn-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch__track {
  width: 46px; height: 26px; border-radius: 99px;
  background: var(--emerald-200); position: relative; transition: background .25s;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .25s;
}
.switch input:checked + .switch__track { background: var(--emerald-600); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch__label { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }

.verse-list { display: flex; flex-direction: column; gap: 12px; }
.verse-item {
  padding: 20px 22px; position: relative; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.verse-item:hover { box-shadow: var(--shadow-md); }
.verse-item.basmalah-item {
  border: 1px dashed var(--gold-300);
  background: linear-gradient(135deg, #fff 0%, var(--gold-100) 100%);
  padding: 14px 22px;
}
.verse-item.basmalah-item .v-ar {
  text-align: center;
  padding-right: 0;
  color: var(--emerald-800);
}
.verse-item .v-num {
  position: absolute; top: 14px; right: 16px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--gold-100); color: var(--gold-600);
  border: 1.5px solid var(--gold-300);
  font-size: 13px; font-weight: 800; border-radius: 50%;
}
.verse-item .v-ar {
  font-family: var(--font-ar);
  font-size: clamp(27px, 3.6vw, 36px);
  line-height: 2.1;
  direction: rtl; text-align: right;
  color: var(--emerald-950);
  padding-right: 40px;
}
.verse-item .v-lat { font-size: 14.5px; font-style: italic; color: var(--ink-soft); margin-top: 8px; }
.verse-item .v-id {
  font-size: 14px; color: var(--emerald-900); margin-top: 4px;
  border-left: 3px solid var(--gold-400); padding-left: 10px;
}
.verse-item.lat-hide .v-lat, .verse-item.lat-hide .v-id { display: none; }
.verse-item .v-id { padding-right: 46px; }
.verse-item .v-play {
  position: absolute; right: 14px; bottom: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer;
  display: grid; place-items: center;
  background: var(--emerald-600); color: #fff;
  font-size: 13px; line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, background .15s;
}
.verse-item .v-play:hover { transform: scale(1.12); background: var(--emerald-700); }
.verse-item.playing { border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(227, 185, 74, .28); }
.verse-item.playing .v-play { background: var(--gold-500); box-shadow: 0 0 0 4px rgba(227, 185, 74, .25); }

.learn-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 12px; flex-wrap: wrap; }
.learn-nav .btn-ghost.dark { border-radius: 99px; }

/* ================= TAJWID ================= */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.rule-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: transform .2s, box-shadow .2s; }
.rule-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.rule-head { display: flex; align-items: center; gap: 12px; }
.rule-ico {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: var(--emerald-50); border-radius: 14px;
}
.rule-card h4 { font-size: 16px; font-weight: 800; color: var(--emerald-900); }
.rule-card .sub { font-size: 11.5px; font-weight: 800; color: var(--gold-600); text-transform: uppercase; letter-spacing: .8px; }
.rule-desc { font-size: 13.5px; color: var(--ink-soft); }
.rule-example {
  background: var(--emerald-50); border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--emerald-900);
}
.rule-example .ex-ar { font-family: var(--font-ar); font-size: 22px; direction: rtl; display: block; margin-bottom: 4px; color: var(--emerald-950); }
.rule-card { cursor: pointer; }
.rule-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.rule-card:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.rule-more { font-size: 11px; font-weight: 800; color: var(--gold-600); letter-spacing: .3px; }

/* pop-up 5 contoh tajwid */
.tajwid-modal { text-align: left; max-width: 480px; max-height: 86vh; overflow-y: auto; }
.tjm-head { display: flex; align-items: center; gap: 12px; }
.tjm-ico { flex: none; font-size: 30px; line-height: 1; }
.tjm-head-t { min-width: 0; }
.tjm-head h4 { font-size: 17.5px; font-weight: 800; color: var(--emerald-900); }
.tjm-head .sub { font-size: 11.5px; font-weight: 800; color: var(--gold-600); text-transform: uppercase; letter-spacing: .8px; }
.tjm-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin: 12px 0 16px; }
.tjm-examples { display: flex; flex-direction: column; gap: 10px; }
.tjm-ex {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--emerald-50); border: 1px solid var(--emerald-100);
  border-radius: 12px; padding: 12px 14px;
}
.tjm-n {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 99px; background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #3a2a03; font-size: 12px; font-weight: 800; margin-top: 3px;
}
.tjm-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tjm-ar { font-family: var(--font-ar); font-size: 22px; line-height: 1.45; color: var(--emerald-950); direction: rtl; text-align: right; }
.tjm-lat { font-size: 13px; font-weight: 600; color: var(--gold-600); }
.tjm-done { width: 100%; margin-top: 18px; }

/* ================= HIJAIYAH ================= */
.hijaiyah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 14px; }
.hijaiyah-card {
  padding: 18px 12px; text-align: center;
  transition: transform .2s, box-shadow .2s, background .2s;
  cursor: pointer;
}
.hijaiyah-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: var(--emerald-50); }
.hijaiyah-card .h-ar {
  font-family: var(--font-ar); font-size: 44px; color: var(--emerald-900);
  line-height: 1.2;
}
.hijaiyah-card .h-name { font-size: 13px; font-weight: 800; color: var(--gold-600); margin-top: 6px; }
.hijaiyah-card .h-example { font-size: 12px; color: var(--ink-soft); }
.hijaiyah-card.flash {
  animation: flashGreen .9s ease;
  background: var(--gold-100);
  box-shadow: 0 0 0 3px var(--gold-300);
}
@keyframes flashGreen {
  0% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ================= LATIHAN TAHSIN METODE TAKWIN ================= */
.takwin-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; margin-bottom: 22px;
  background: linear-gradient(135deg, #eefbf3 0%, #fdf6e0 100%);
  border: 1.5px solid var(--gold-300);
  box-shadow: var(--shadow-sm);
}
.takwin-hero h4 { font-size: 19px; font-weight: 800; color: var(--emerald-900); margin-bottom: 6px; }
.takwin-hero p { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; max-width: 540px; }
.takwin-hero__tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: var(--gold-700);
  background: var(--gold-100); border: 1px solid var(--gold-300);
  padding: 3px 10px; border-radius: 99px; margin-bottom: 8px;
}
.takwin-hero__art { font-size: 56px; line-height: 1; margin-left: auto; }
.takwin-hero__txt { flex: 1; min-width: 240px; }

.takwin-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.takwin-head__t { flex: 1; min-width: 200px; }
.takwin-head__t h4 { font-size: 16.5px; font-weight: 800; color: var(--emerald-900); }
.takwin-head__t p { font-size: 11.5px; color: var(--ink-soft); }

.takwin-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; margin-bottom: 20px; }
.takwin-level {
  text-align: left; padding: 18px; cursor: pointer;
  border: 1.5px solid var(--emerald-100);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.takwin-level:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.takwin-level .tl-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.takwin-level .tl-ico { font-size: 26px; line-height: 1; }
.takwin-level h5 { font-size: 14px; font-weight: 800; color: var(--emerald-900); }
.takwin-level .tl-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.takwin-level .tl-status {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; font-size: 11.5px; font-weight: 800; color: var(--gold-600);
}
.takwin-level.done { border-color: var(--emerald-400); }
.takwin-level.done .tl-status { color: var(--emerald-600); }
.takwin-level.locked { opacity: .55; cursor: not-allowed; filter: grayscale(.5); }
.takwin-level.locked:hover { transform: none; box-shadow: none; }
.takwin-level.locked .tl-status { color: var(--ink-soft); }
.takwin-level:disabled { pointer-events: none; }

.takwin-stage { padding: 22px; margin-bottom: 20px; }
.takwin-stage__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.takwin-stage__top h5 { font-size: 17px; font-weight: 800; color: var(--emerald-900); }
.takwin-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.takwin-tip {
  background: var(--gold-100); color: var(--gold-800);
  border: 1px solid var(--gold-300); font-size: 12.5px; line-height: 1.55;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 18px;
}
.takwin-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(118px, 100%), 1fr)); gap: 12px; }
.takwin-item {
  background: var(--emerald-50); border: 1.5px solid var(--emerald-200);
  border-radius: 12px; padding: 14px 10px; text-align: center;
  transition: transform .18s, box-shadow .18s;
}
.takwin-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.takwin-item .ti-ar { font-family: var(--font-ar); font-size: 27px; color: var(--emerald-900); line-height: 1.35; }
.takwin-item .ti-lat { font-size: 12.5px; font-weight: 700; color: var(--gold-600); margin-top: 5px; }
.takwin-item .ti-note { font-size: 11px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }
.takwin-stage__go {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center;
  margin-top: 20px;
}
.takwin-stage__go .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ================= DOA ================= */
.doa-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: translateY .2s, box-shadow .2s; }
.doa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.doa-card:hover { box-shadow: var(--shadow-md); }
.doa-title { display: flex; align-items: center; justify-content: space-between; }
.doa-title h4 { font-size: 15.5px; font-weight: 800; color: var(--emerald-900); }
.doa-ico { font-size: 26px; }
.doa-ar {
  font-family: var(--font-ar); font-size: 25px; direction: rtl; text-align: center;
  color: var(--emerald-950); line-height: 1.9;
}
.doa-lat { font-style: italic; font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.doa-id { font-size: 13px; color: var(--emerald-900); border-top: 1px dashed var(--emerald-200); padding-top: 10px; }
.doa-id strong { display:block; font-size: 11px; color: var(--gold-600); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }

/* ================= KUIS ================= */
.quiz-intro {
  max-width: 560px; margin: 8px auto 0; text-align: center; padding: 40px 32px 46px;
}
.quiz-intro__art { font-size: 64px; animation: bob 3.4s ease-in-out infinite; margin-bottom: 14px; }
.quiz-intro h3 { font-size: 26px; font-weight: 800; color: var(--emerald-900); margin: 12px 0 10px; }
.quiz-intro > p { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 16px; }
.quiz-intro__meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 26px; }
.quiz-intro__meta span {
  background: var(--emerald-50); border: 1px solid var(--emerald-200);
  border-radius: 99px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; color: var(--emerald-800);
}
.quiz-intro #btn-start-quiz { margin-top: 4px; margin-bottom: 8px; }
.quiz-best { margin-top: 16px; font-size: 13px; color: var(--gold-600); font-weight: 800; }

.quiz-stage-box {
  max-width: 380px; margin: 26px auto 22px; padding: 14px 18px; text-align: left;
  background: linear-gradient(160deg, #fffdf4, #fdf3d0);
  border: 1.5px solid rgba(184, 134, 11, .35); border-radius: 14px;
}
.quiz-stage-label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--gold-600); }
.quiz-stage-track { height: 7px; background: #f0e2b8; border-radius: 99px; margin: 10px 0 2px; overflow: hidden; }
.quiz-stage-track span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); border-radius: 99px; transition: width .35s ease; }
#quiz-stage-name { display: block; margin-top: 2px; font-size: 17px; font-weight: 800; color: var(--emerald-900); }
#quiz-stage-desc { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin-top: 6px; }

.quiz-box { max-width: 640px; margin: 0 auto; padding: 28px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; color: var(--emerald-800); }
.quiz-score { color: var(--gold-600); }
.quiz-track { height: 8px; background: var(--emerald-100); border-radius: 99px; margin: 10px 0 22px; overflow: hidden; }
.quiz-track span { display: block; height: 100%; width: 10%; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); border-radius: 99px; transition: width .35s ease; }
.quiz-question { font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }
.quiz-question .q-ar { font-family: var(--font-ar); font-size: 30px; direction: rtl; display: block; color: var(--emerald-900); margin-bottom: 6px; }

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left; padding: 14px 18px; border-radius: 14px;
  border: 1.5px solid rgba(6,78,59,.15); background: #fff;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  transition: all .15s;
}
.quiz-option .opt-key {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--emerald-50); color: var(--emerald-700); font-weight: 800; font-size: 13px;
}
.quiz-option:hover { border-color: var(--emerald-500); background: var(--emerald-50); transform: translateX(4px); }
.quiz-option.correct { border-color: var(--success); background: #e9f9ef; }
.quiz-option.correct .opt-key { background: var(--success); color: #fff; }
.quiz-option.wrong { border-color: var(--danger); background: #fdeef2; }
.quiz-option.wrong .opt-key { background: var(--danger); color: #fff; }
.quiz-option.disabled { pointer-events: none; }

.quiz-explain {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--gold-100); border: 1px solid var(--gold-300);
  font-size: 13.5px; color: #5c4a10;
}
.quiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.quiz-nav .btn-ghost.dark { border-radius: 99px; }

/* result */
.quiz-result { max-width: 520px; margin: 8px auto 0; text-align: center; padding: 40px 32px; }
.result-art { font-size: 74px; animation: bob 3.4s ease-in-out infinite; }
.quiz-result h3 { font-size: 26px; font-weight: 800; color: var(--emerald-900); margin: 8px 0; }
.result-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.result-score strong { font-size: 64px; font-weight: 800; color: var(--gold-500); }
.result-score span { font-size: 22px; color: var(--ink-soft); font-weight: 700; }
.result-motivation { margin: 12px 0 20px; color: var(--ink-soft); font-size: 14.5px; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ================= BOTTOM NAV ================= */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(6,78,59,.1);
  z-index: 55;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px; border-radius: 12px; color: var(--ink-soft);
  font-size: 15px;
}
.bottom-nav em { font-style: normal; font-size: 10.5px; font-weight: 700; }
.bottom-nav button.active { background: var(--emerald-50); color: var(--emerald-800); }
.bottom-nav button.active span { transform: scale(1.15); }

/* ================= OVERLAY & TOAST & CONFETTI ================= */
.overlay {
  position: fixed; inset: 0; background: rgba(2,44,34,.5); z-index: 58;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
  transform: translate(-50%, 90px);
  -webkit-transform: translate(-50%, 90px);
  background: var(--emerald-900); color: #fff;
  padding: 12px 22px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  box-shadow: var(--shadow-lg); z-index: 90;
  opacity: 0; transition: all .35s ease;
  width: auto; min-width: 0;
  max-width: min(88vw, 460px);
  text-align: center;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); -webkit-transform: translate(-50%, 0); opacity: 1; }
.toast.gold { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: #3a2a03; }
.toast.error { background: var(--danger); }

#confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 80;
}

/* ================= AKUN MURID ================= */
.auth-status {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gold-300);
  font-weight: 700;
}
.sidebar__user {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 10px 12px;
  cursor: pointer;
  transition: background .2s ease;
}
.sidebar__user:hover { background: rgba(255,255,255,.15); }
.sidebar__user[hidden],
.user-settings[hidden] { display: none !important; }
.sidebar__user .su-ico { font-size: 17px; }
.sidebar__user strong {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: #eafff3;
}
.user-settings {
  font-size: 12px; line-height: 1; flex: none;
  color: var(--gold-300);
  background: rgba(212,169,55,.16); border: 1px solid rgba(212,169,55,.4);
  padding: 6px 7px; border-radius: 99px;
  transition: background .2s ease;
}
.user-settings:hover { background: rgba(212,169,55,.34); }
.user-logout {
  font-size: 11px; font-weight: 800; color: #fecdd3;
  background: rgba(225,29,72,.18); border: 1px solid rgba(225,29,72,.35);
  padding: 5px 10px; border-radius: 99px;
}
.user-logout:hover { background: rgba(225,29,72,.35); }
.btn-login {
  width: 100%; margin-top: 10px;
  padding: 10px 12px; font-size: 13.5px; border-radius: 12px;
}
.btn-login[hidden] { display: none !important; }

.auth-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(2,44,34,.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}
.auth-overlay.show { display: grid; }
.auth-card {
  width: 100%; max-width: 400px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 99px;
  background: rgba(6,78,59,.08); border: none;
  color: var(--ink-soft); font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: background .2s ease;
}
.modal-close:hover { background: rgba(6,78,59,.16); }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 10px;
  display: block; object-fit: contain;
  padding: 7px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(6, 78, 59, .18);
}
.auth-title { font-size: 20px; font-weight: 800; color: var(--emerald-900); }
.auth-sub { font-size: 13px; color: var(--ink-soft); margin: 6px 0 14px; }
.auth-tabs {
  display: flex; gap: 4px; background: var(--emerald-50);
  border: 1px solid var(--emerald-200); border-radius: 99px; padding: 4px;
  margin-bottom: 10px;
}
.auth-tab {
  flex: 1; padding: 9px 10px; border-radius: 99px;
  font-size: 13.5px; font-weight: 800; color: var(--ink-soft);
}
.auth-tab.active { background: var(--emerald-700); color: #fff; }
#auth-form { text-align: left; }
#auth-form label {
  display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft);
  margin-top: 10px;
}
#auth-form input {
  width: 100%; margin-top: 4px; padding: 11px 14px;
  border: 1.5px solid rgba(6,78,59,.15); border-radius: 12px;
  font-size: 16px; background: #fff;
}
#auth-form input:focus { outline: 2px solid var(--emerald-500); outline-offset: 1px; }
.auth-msg { font-size: 12.5px; color: var(--danger); margin: 10px 0 0; min-height: 18px; }
#auth-form .btn { width: 100%; margin-top: 6px; }
.auth-guest { margin-top: 12px; display: block; width: 100%; text-align: center; }

/* form pengaturan akun (profil & ganti password) */
#profile-form, #password-form { text-align: left; }
#profile-form label, #password-form label {
  display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft);
  margin-top: 10px;
}
#profile-form input, #password-form input {
  width: 100%; margin-top: 4px; padding: 11px 14px;
  border: 1.5px solid rgba(6,78,59,.15); border-radius: 12px;
  font-size: 16px; background: #fff;
}
#profile-form input:focus, #password-form input:focus { outline: 2px solid var(--emerald-500); outline-offset: 1px; }
#profile-form input[readonly] { background: #f1f6f3; color: var(--ink-soft); }
#profile-form .btn, #password-form .btn { width: 100%; margin-top: 6px; }

/* ================= KLASEMEN ================= */
.btn.sm { padding: 8px 14px; font-size: 12.5px; border-radius: 99px; }
.leader-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.leader-note { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 10px; margin-bottom: 14px;
}
.podium-item {
  background: linear-gradient(160deg, #ffffff, #f4fbf7);
  border: 1px solid rgba(6, 78, 59, .14);
  border-radius: 16px; padding: 14px 10px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.podium-item.gold {
  background: linear-gradient(160deg, #fff9e6, #fdecc9);
  border-color: rgba(180, 138, 22, .35);
  box-shadow: 0 10px 24px rgba(200, 160, 40, .22);
  transform: scale(1.03);
}
.pp-medal { font-size: 26px; display: block; margin-bottom: 4px; }
.pp-name { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink-strong, #123b30); }
.pp-points { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--emerald-700); }
.pp-sub { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-soft); font-weight: 600; }
.pp-you { font-style: normal; font-size: 10px; color: var(--gold-600, #b0760a); font-weight: 800; }
.leader-card { padding: 6px 14px 14px; }
.leader-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px 8px; border-bottom: 2px dashed var(--emerald-100);
}
.leader-head h4 { font-size: 14.5px; font-weight: 800; color: var(--emerald-900); }
.leader-count { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.leader-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px; border-bottom: 1px solid rgba(6, 78, 59, .06);
}
.leader-row:last-child { border-bottom: 0; }
.leader-row.me {
  background: var(--emerald-50);
  border-radius: 12px; margin: 6px 0;
  box-shadow: inset 0 0 0 1.5px var(--emerald-300);
}
.lr-rank { width: 34px; font-weight: 800; font-size: 12.5px; color: var(--ink-soft); }
.lr-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 800; color: var(--ink-strong, #123b30);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-hafal, .lr-quiz { font-size: 11px; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.lr-points { font-size: 13px; font-weight: 800; color: var(--gold-700, #986e08); white-space: nowrap; }
.leader-empty, .leader-more {
  padding: 18px 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.leader-more { padding: 10px 8px 4px; }
#leader-note code { background: var(--emerald-100); padding: 2px 6px; border-radius: 6px; font-size: 11.5px; }
@media (max-width: 420px) {
  .lr-quiz { display: none; }
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--emerald-200); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--emerald-500); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding: 34px 30px; }
  .hero__art { height: 190px; }
}

/* ================= FULLSCREEN PC ================= */
@media (min-width: 1025px) {
  .topbar { padding: 0 clamp(26px, 3.5vw, 60px); }

  .hero { padding: 54px clamp(40px, 5vw, 76px); }
  .hero__art { height: 300px; }
  .moon { font-size: 112px; animation-duration: 6.2s; }
  .quran { font-size: 88px; animation-duration: 6.8s; }
  .lamp { font-size: 64px; animation-duration: 7.4s; }

  .stats-strip { gap: 18px; margin: 26px 0 30px; }
  .stat strong { font-size: 26px; }
  .login-card { margin-bottom: 30px; }
  .home-grid, .surah-grid, .rules-grid, .doa-grid, .hijaiyah-grid { gap: 20px; }
  .podium { max-width: 920px; margin: 0 auto 14px; gap: 14px; }

  /* halaman baca surah: batasi lebar agar baris ayat tetap nyaman dibaca */
  #page-belajar { max-width: 1180px; margin: 0 auto; }
}

@media (max-width: 860px) {
  .sidebar {
    width: min(280px, 88vw);
    transform: translateX(-110%);
    transition: transform .3s ease;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: calc(var(--topbar-h) + 12px) 16px 96px; }
  .topbar { left: 0; padding: 0 16px; }
  .hamburger { display: grid; place-items: center; }
  .bottom-nav { display: flex; }
  .home-bottom { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 30px; }
}

@media (max-width: 480px) {
  .verse-item .v-ar { font-size: 27px; padding-right: 34px; }
  .learn-head .ar-head { font-size: 26px; }
  .page-head h3 { font-size: 20px; }

  /* hero */
  .hero { padding: 26px 18px; border-radius: 22px; }
  .hero__title { font-size: 26px; }
  .hero__art { height: 130px; }
  .moon { font-size: 56px; right: 6px; top: -6px; }
  .quran { font-size: 44px; bottom: 0; left: 2px; }
  .lamp { font-size: 34px; right: 0; bottom: 0; }
  .star { font-size: 13px; }
  .cloud { display: none; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }

  /* kuis & hasil */
  .quiz-intro, .quiz-box, .quiz-result { padding: 28px 18px; }
  .result-score strong { font-size: 52px; }

  /* topbar */
  .theme-toggle { width: 36px; height: 36px; font-size: 16px; }
  .topbar-right { gap: 8px; }
  .points-chip { padding: 6px 12px; }
  .points-chip em { display: none; }
  .topbar__title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 260px); }
  .learn-head { padding: 18px 16px; gap: 12px; }
  .learn-head h3 { font-size: 20px; }

  /* toast di atas bottom-nav */
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .stats-strip .stat { padding: 12px; }
}

@media (max-width: 400px) {
  .home-grid, .surah-grid, .rules-grid, .doa-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .verse-item { padding: 16px 14px; }
  .verse-item .v-num { right: 10px; top: 10px; }
  .verse-item .v-ar { padding-right: 30px; font-size: 25px; }
  .quote-ar { font-size: 26px; }
  .hero__desc { font-size: 13.5px; }
}

/* ================= LOGIN MILESTONE ================= */
.login-card { padding: 22px; margin-bottom: 26px; }
.login-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.login-head__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.login-fire { font-size: 30px; line-height: 1; }
.login-head h3 { font-size: 16.5px; font-weight: 800; color: var(--emerald-900); }
.login-head p { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

.login-streak {
  display: flex; align-items: baseline; gap: 5px; flex: none;
  background: var(--emerald-50); border: 1.5px solid var(--emerald-200);
  border-radius: 99px; padding: 8px 16px;
}
.login-streak strong { font-size: 22px; font-weight: 800; color: var(--gold-600); }
.login-streak span { font-size: 11px; font-weight: 800; color: var(--emerald-800); white-space: nowrap; }

.login-month__bar { height: 10px; background: var(--emerald-100); border-radius: 99px; overflow: hidden; }
.login-month__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
  border-radius: 99px; transition: width .6s ease;
}
.login-month__meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 12px; font-weight: 700; flex-wrap: wrap; }
.login-month__meta span:first-child { color: var(--emerald-800); }
.login-month__meta span:last-child { color: var(--gold-600); }
.login-month__meta span:last-child.done { color: var(--emerald-700); }

.login-miles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.log-mile {
  text-align: center; padding: 9px 4px; border-radius: 14px;
  background: #fff; border: 1.5px solid rgba(6, 78, 59, .12);
  transition: transform .2s, box-shadow .2s;
}
.log-mile__num {
  display: block; width: 30px; height: 30px; margin: 0 auto 5px;
  line-height: 27px; border-radius: 50%;
  font-size: 12px; font-weight: 800;
  color: var(--emerald-700); background: var(--emerald-50);
  border: 1.5px solid var(--emerald-200);
}
.log-mile small { font-size: 10px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.log-mile.done { border-color: #f0c14b; background: linear-gradient(135deg, #fffdf4, var(--gold-100)); }
.log-mile.done .log-mile__num { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #fff; border-color: var(--gold-500); }
.log-mile.next { border-color: var(--gold-500); transform: translateY(-3px); box-shadow: 0 0 0 3px rgba(212, 169, 55, .22), var(--shadow-md); }
.log-mile.next .log-mile__num { animation: pulseGold 1.8s ease-in-out infinite; }
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 169, 55, .45); }
  50% { box-shadow: 0 0 0 7px rgba(212, 169, 55, 0); }
}

.login-mini { margin-top: 20px; padding-top: 16px; border-top: 1px dashed rgba(6, 78, 59, .12); }
.login-mini__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; color: var(--emerald-900); margin-bottom: 10px; }
.login-dim { font-size: 10.5px; font-weight: 700; color: var(--gold-600); }
.login-mini__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.login-mini__dow { text-align: center; font-size: 9.5px; font-weight: 800; color: var(--ink-soft); padding: 2px 0 4px; }
.login-mini__cell {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 1px solid rgba(6, 78, 59, .07);
  border-radius: 8px;
}
.login-mini__cell.on { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; font-weight: 800; }
.login-mini__cell.today { box-shadow: 0 0 0 2px var(--gold-500); }
.login-mini__cell.empty { background: transparent; border-color: transparent; box-shadow: none; }

/* milestone Beranda: tautan ke halaman loyalitas */
.login-milestone__link {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed rgba(6, 78, 59, .16);
  display: flex; justify-content: flex-end;
}

/* ================= HALAMAN LOYALITAS (kotak atas) ================= */
.loy-grid { display: flex; flex-direction: column; gap: 18px; }
.loy-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.loy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--emerald-50); border: 1.5px solid var(--emerald-200);
  color: var(--emerald-800); border-radius: 99px; padding: 8px 16px;
  font-size: 12.5px; font-weight: 700; line-height: 1.3;
  flex: 0 1 auto; max-width: 100%;
}
.loy-chip strong { color: var(--gold-600); font-size: 14.5px; font-weight: 800; }
.loy-progress__head { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.loy-progress__head span { font-weight: 800; color: var(--emerald-900); font-size: 14.5px; line-height: 1.4; min-width: 0; }
.loy-progress__head strong { font-size: 20px; color: var(--gold-600); flex: none; }
.loy-progress__bar { height: 12px; border-radius: 99px; background: var(--emerald-100); overflow: hidden; }
.loy-progress__bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); border-radius: 99px; transition: width .6s ease; }
.loy-progress p { margin-top: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

.loy-levels {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; align-items: stretch;
}
@media (min-width: 880px) {
  .loy-levels { grid-template-columns: repeat(3, 1fr); }
}
.loy-level {
  border-left: 5px solid var(--emerald-200); min-width: 0;
  display: flex; flex-direction: column; padding: 20px;
}
.loy-level.done { border-left-color: var(--gold-500); background: linear-gradient(135deg, #fffdf4, var(--gold-100)); }
.loy-level.current { border-left-color: var(--emerald-600); box-shadow: var(--shadow-md); }
.loy-level__head { display: flex; align-items: center; gap: 12px; }
.loy-level__ico { font-size: 26px; flex: none; line-height: 1; }
.loy-level__name { min-width: 0; flex: 1; }
.loy-level h4 { font-size: 15px; font-weight: 800; color: var(--emerald-900); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loy-level p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.loy-level__bar { height: 6px; border-radius: 99px; background: var(--emerald-100); overflow: hidden; margin-top: 14px; }
.loy-level__bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); transition: width .5s ease; }
.loy-level.locked .loy-level__bar > span { background: var(--emerald-200); }
.loy-level__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.loy-level__status { font-size: 11px; font-weight: 800; padding: 5px 12px; border-radius: 99px; white-space: nowrap; flex: none; }
.loy-level__status.ok { background: var(--gold-100); color: var(--gold-600); border: 1px solid var(--gold-300); }
.loy-level__status.now { background: var(--emerald-600); color: #fff; }
.loy-level__status.locked { background: var(--emerald-50); color: var(--emerald-800); border: 1px solid var(--emerald-200); }
.loy-level__reward { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.loy-level__reward strong { color: var(--gold-600); font-size: 13px; }

.loy-summary { padding: 22px; }
.loy-calendar { padding: 22px; }
.loy-calendar .login-mini__head { margin-bottom: 14px; }
.loy-mini__grid { gap: 7px; width: 100%; }
@media (max-width: 480px) {
  .loy-chips { gap: 6px; }
  .loy-chip { padding: 6px 10px; font-size: 11.5px; }
  .loy-progress__head span { font-size: 13px; }
  .loy-summary, .loy-level, .loy-calendar { padding: 16px 14px; }
  .loy-calendar .login-mini__head { margin-bottom: 12px; }
}

.lr-fire { font-size: 11px; font-weight: 800; color: var(--gold-600); white-space: nowrap; }

@media (max-width: 480px) {
  .login-card { padding: 18px 16px; }
  .login-miles { grid-template-columns: repeat(3, 1fr); }
  .login-mini__cell { font-size: 10.5px; border-radius: 6px; }
  .login-mini__dow { font-size: 8.5px; }
  .login-streak { padding: 7px 12px; }
  .login-streak strong { font-size: 18px; }
  .login-head { margin-bottom: 14px; }
}

/* ================= MODE GELAP =================
   Aktif saat <html data-theme="dark"> (toggle 🌙/☀️ di topbar).
   Variabel netral diganti; warna dengan peran ganda di-override per komponen. */
[data-theme="dark"] {
  color-scheme: dark;
  --cream: #0b1411;
  --white: #0f1f1a;
  --ink: #e6f4ee;
  --ink-soft: #93b0a5;
  --ink-strong: #e0f2e9;
  --emerald-50: #0d2017;
  --emerald-950: #e7f7ef;
  --gold-100: #241d0a;
  --gold-500: #e7c25a;
  --gold-600: #d9b24b;
  --gold-700: #d9ab3e;
  --danger: #fb7185;
  --success: #4ade80;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.45);
  --shadow-md: 0 8px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
}

[data-theme="dark"] body {
  background:
    radial-gradient(1100px 600px at 85% -10%, #123326 0%, transparent 55%),
    radial-gradient(900px 520px at -10% 15%, #221a08 0%, transparent 50%),
    var(--cream);
}

[data-theme="dark"] .card { border-color: rgba(140, 200, 175, .16); }

[data-theme="dark"] .topbar {
  background: rgba(11, 20, 17, .85);
  border-bottom-color: rgba(10, 30, 22, .5);
}
[data-theme="dark"] .hamburger { color: #a7f3d0; }

/* chip poin & tombol tema */
[data-theme="dark"] .points-chip,
[data-theme="dark"] .theme-toggle {
  background: linear-gradient(135deg, #16241d 0%, #2a220d 100%);
  border-color: rgba(212, 169, 55, .45);
}

/* input, pencarian, segmen, switch */
[data-theme="dark"] .toolbar input,
[data-theme="dark"] #auth-form input,
[data-theme="dark"] #profile-form input,
[data-theme="dark"] #password-form input { background: #0e1d18; border-color: rgba(140, 200, 175, .25); }
[data-theme="dark"] .toolbar input::placeholder,
[data-theme="dark"] #auth-form input::placeholder,
[data-theme="dark"] #profile-form input::placeholder,
[data-theme="dark"] #password-form input::placeholder { color: var(--ink-soft); }
[data-theme="dark"] #profile-form input[readonly] { background: #12291e; color: #9fe8c8; }
[data-theme="dark"] .seg { background: #14261f; border-color: rgba(140, 200, 175, .22); }
[data-theme="dark"] .tjm-ex { background: #0d2017; border-color: rgba(140, 200, 175, .2); }
[data-theme="dark"] .switch__track { background: #1d4a3a; }

/* teks hijau tua -> hijau muda di atas kartu gelap */
[data-theme="dark"] .page-head h3,
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .rule-card h4,
[data-theme="dark"] .surah-info h4,
[data-theme="dark"] .daily-card h3,
[data-theme="dark"] .doa-title h4,
[data-theme="dark"] .auth-title,
[data-theme="dark"] .quiz-intro h3,
[data-theme="dark"] .quiz-result h3,
[data-theme="dark"] .verse-item .v-id,
[data-theme="dark"] .rule-example,
[data-theme="dark"] .hijaiyah-card .h-ar,
[data-theme="dark"] .quote-ar,
[data-theme="dark"] .doa-id,
[data-theme="dark"] #quiz-stage-name,
[data-theme="dark"] .leader-head h4,
[data-theme="dark"] .quiz-question .q-ar,
[data-theme="dark"] .lr-name,
[data-theme="dark"] .pp-name,
[data-theme="dark"] .tjm-head h4,
[data-theme="dark"] .tjm-ar { color: #cdeede; }

[data-theme="dark"] .takwin-hero { background: linear-gradient(135deg, #0f201a 0%, #241d0a 100%); border-color: rgba(212, 169, 55, .45); }
[data-theme="dark"] .takwin-hero h4,
[data-theme="dark"] .takwin-head__t h4,
[data-theme="dark"] .takwin-stage__top h5,
[data-theme="dark"] .takwin-level h5 { color: #cdeede; }
[data-theme="dark"] .takwin-level { border-color: rgba(140, 200, 175, .18); }
[data-theme="dark"] .takwin-level.done { border-color: #1d4a3a; }
[data-theme="dark"] .takwin-level.done .tl-status { color: #7ee2b8; }
[data-theme="dark"] .takwin-item { border-color: rgba(140, 200, 175, .2); }
[data-theme="dark"] .takwin-item .ti-ar { color: #cdeede; }
[data-theme="dark"] .takwin-tip { background: #241d0a; border-color: #4a3c16; color: #f0cf6b; }

[data-theme="dark"] .stat strong,
[data-theme="dark"] .badge,
[data-theme="dark"] .pp-points { color: #7ee2b8; }
[data-theme="dark"] .chip,
[data-theme="dark"] .quiz-top,
[data-theme="dark"] .bottom-nav button.active { color: #9fe8c8; }
[data-theme="dark"] .opt-key { color: #a7f3d0; }
[data-theme="dark"] .icon-btn { color: #9fe8c8; }

/* tombol lembut & area kuis */
[data-theme="dark"] .btn-soft,
[data-theme="dark"] .btn-ghost.dark { background: #13322a; border-color: #1d4a3a; color: #a7f3d0; }
[data-theme="dark"] .btn-soft:hover,
[data-theme="dark"] .btn-ghost.dark:hover { background: #164031; }
[data-theme="dark"] .quiz-intro__meta span { background: #0d2017; border-color: #1d4a3a; color: #9fe8c8; }
[data-theme="dark"] .quiz-track { background: #14342a; }
[data-theme="dark"] .quiz-stage-track { background: #2a2310; }
[data-theme="dark"] .quiz-stage-box {
  background: linear-gradient(160deg, #141f19, #241d0a);
  border-color: rgba(212, 169, 55, .45);
}
[data-theme="dark"] .quiz-option { background: #14261f; border-color: rgba(140, 200, 175, .22); }
[data-theme="dark"] .quiz-option:hover { background: #142e26; }
[data-theme="dark"] .quiz-option.correct { background: #0d2b1d; }
[data-theme="dark"] .quiz-option.wrong { background: #33121f; }
[data-theme="dark"] .quiz-explain { background: #241d0a; border-color: rgba(212, 169, 55, .4); color: #f0e2b8; }

/* kutipan & basmalah */
[data-theme="dark"] .quote-card { background: linear-gradient(135deg, #13241d, #241d0a); }
[data-theme="dark"] .verse-item { border-color: rgba(140, 200, 175, .14); }
[data-theme="dark"] .verse-item.basmalah-item {
  background: linear-gradient(135deg, #13241d, #241d0a);
  border-color: rgba(212, 169, 55, .45);
}
[data-theme="dark"] .verse-item.basmalah-item .v-ar { color: #bce7d4; }
[data-theme="dark"] .verse-item.playing { border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(227, 185, 74, .3); }
[data-theme="dark"] .verse-item.playing .v-play,
[data-theme="dark"] .mur-btn.mur-play { background: var(--gold-500); border-color: var(--gold-500); }
[data-theme="dark"] .mur-btn,
[data-theme="dark"] .mur-auto { background: #13322a; border-color: #1d4a3a; }
[data-theme="dark"] .mur-btn { color: #a7f3d0; }
[data-theme="dark"] .mur-auto { color: #bce7d4; }
[data-theme="dark"] .mur-status { color: #bce7d4; }

/* klasemen */
[data-theme="dark"] .podium-item { background: linear-gradient(160deg, #13241d, #0f1f1a); border-color: rgba(140, 200, 175, .25); }
[data-theme="dark"] .podium-item.gold {
  background: linear-gradient(160deg, #241d0a, #1d1709);
  border-color: rgba(212, 169, 55, .5);
  box-shadow: 0 10px 24px rgba(212, 169, 55, .15);
}
[data-theme="dark"] .leader-head { border-bottom-color: #14342a; }
[data-theme="dark"] #leader-note code { background: #14342a; color: #a7f3d0; }

/* navigasi bawah, auth, statistik */
[data-theme="dark"] .bottom-nav { background: rgba(12, 22, 18, .96); border-top-color: rgba(140, 200, 175, .15); }
[data-theme="dark"] .auth-tabs { background: #0d2017; border-color: #1d4a3a; }
[data-theme="dark"] .stat { border-color: rgba(140, 200, 175, .15); }

/* kartu login milestone */
[data-theme="dark"] .login-card h3,
[data-theme="dark"] .login-mini__head { color: #cdeede; }
[data-theme="dark"] .login-head p { color: var(--ink-soft); }
[data-theme="dark"] .login-month__meta span:first-child { color: var(--ink-soft); }
[data-theme="dark"] .login-month__meta span:last-child.done { color: #7ee2b8; }
[data-theme="dark"] .login-streak span { color: #9fe8c8; }
[data-theme="dark"] .login-month__bar { background: #14342a; }
[data-theme="dark"] .log-mile { background: #14261f; border-color: rgba(140, 200, 175, .2); }
[data-theme="dark"] .log-mile__num { color: #a7f3d0; }
[data-theme="dark"] .log-mile.done { background: linear-gradient(135deg, #241d0a, #2a220d); border-color: rgba(212, 169, 55, .5); }
[data-theme="dark"] .log-mile.done .log-mile__num { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #fff; }
[data-theme="dark"] .login-mini { border-top-color: rgba(140, 200, 175, .15); }
[data-theme="dark"] .login-mini__cell { background: #0e1d18; border-color: rgba(140, 200, 175, .15); }
[data-theme="dark"] .login-mini__cell.on { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }
[data-theme="dark"] .login-milestone__link { border-top-color: rgba(140, 200, 175, .15); }
[data-theme="dark"] .loy-chip { background: #13322a; border-color: #1d4a3a; color: #a7f3d0; }
[data-theme="dark"] .loy-chip strong { color: var(--gold-400); }
[data-theme="dark"] .loy-progress__head span { color: #cdeede; }
[data-theme="dark"] .loy-progress__bar { background: #14342a; }
[data-theme="dark"] .loy-progress p { color: #9fe8c8; }
[data-theme="dark"] .loy-level { border-left-color: #1d4a3a; }
[data-theme="dark"] .loy-level.done { background: linear-gradient(135deg, #241d0a, #2a220d); border-left-color: var(--gold-400); }
[data-theme="dark"] .loy-level.current { border-left-color: var(--emerald-500); }
[data-theme="dark"] .loy-level h4 { color: #cdeede; }
[data-theme="dark"] .loy-level__reward { color: #9fe8c8; }
[data-theme="dark"] .loy-level__reward strong { color: var(--gold-400); }
[data-theme="dark"] .loy-level__bar { background: #14342a; }
[data-theme="dark"] .loy-level.locked .loy-level__bar > span { background: #1d4a3a; }
[data-theme="dark"] .loy-level__status.ok { background: #2a220d; color: #e3b94a; border-color: rgba(212, 169, 55, .5); }
[data-theme="dark"] .loy-level__status.now { background: var(--gold-500); }
[data-theme="dark"] .loy-level__status.locked { background: #13322a; color: #9fe8c8; border-color: #1d4a3a; }

/* ============================================================
   STABILITAS MOBILE & LAYAR LIPAT
   (iPhone incl. notch/landscape, Android foldable cover/terbuka)
   ============================================================ */

/* tinggi dinamis: tidak melompat saat bar alamat muncul/sembunyi */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}

/* safe-area: geser konten menjauh dari notch/dynamic island/home indicator
   (di sisi kiri/kanan saat iPhone landscape & layar lipat) */
.topbar {
  padding-left: calc(clamp(26px, 3.5vw, 60px) + env(safe-area-inset-left));
  padding-right: calc(clamp(26px, 3.5vw, 60px) + env(safe-area-inset-right));
}
.main {
  padding-left: calc(clamp(26px, 3.5vw, 60px) + env(safe-area-inset-left));
  padding-right: calc(clamp(26px, 3.5vw, 60px) + env(safe-area-inset-right));
}

/* layar super sempit (layar depan pelipat & ponsel kecil) */
@media (max-width: 360px) {
  .topbar__title h2 { font-size: 17px; }
  .topbar__title p { max-width: calc(100vw - 200px); }
  .theme-toggle, .hamburger { width: 36px; height: 36px; }
  .points-chip { padding: 5px 10px; gap: 4px; }
  .points-chip strong { font-size: 14px; }
  .hero { padding: 20px 14px; border-radius: 18px; }
  .hero__title { font-size: 23px; }
  .hero__art { height: 118px; }
  .hero__cta .btn { padding: 12px 14px; font-size: 14px; }
  .home-bottom { grid-template-columns: 1fr; }
  .surah-grid, .rules-grid, .doa-grid, .hijaiyah-grid { grid-template-columns: 1fr; }
  .seg { flex-wrap: wrap; border-radius: 16px; }
  .seg-btn { flex: 1 1 40%; min-width: 0; text-align: center; }
  .loy-levels { grid-template-columns: 1fr; }
  .login-miles { gap: 5px; }
  .log-mile { padding: 8px 2px; }
  .guru-stats { grid-template-columns: repeat(2, 1fr); }
  .guru-head h1 { font-size: 19px; }
  .guru-head .ght-ico { width: 44px; height: 44px; font-size: 22px; }
}

/* landscape dengan tinggi pendek (pelipat dibuka menyamping / ponsel dimiringkan) */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --topbar-h: 56px; }
  .hero__art { display: none; }
  .hero { padding: 20px 22px; border-radius: 22px; }
  .stats-strip { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0 18px; }
  .main { padding-top: calc(var(--topbar-h) + 10px); }
  .bottom-nav { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .bottom-nav button { padding: 4px 2px; gap: 1px; }
  .bottom-nav em { font-size: 9.5px; }
  .quote-card, .daily-card { padding: 18px; }
  .page-head { margin: 4px 0 14px; }
}

/* input minimal 16px agar iOS tidak zoom otomatis saat fokus */
@media (max-width: 480px) {
  .guru-toolbar input[type="search"],
  .guru-toolbar select { font-size: 16px; }
}