:root {
  /* Brand emerald + gold */
  --emerald: #0d7c3e;
  --emerald-dark: #085028;
  --emerald-light: #14a04d;
  --gold: #d4af37;
  --gold-dark: #a58828;
  --gold-light: #f4d06b;

  /* UI greens (gameplay feedback, kekalkan Duolingo feel) */
  --green: #58cc02;
  --green-dark: #58a700;
  --green-soft: #e5f8d0;

  --blue: #1cb0f6;
  --blue-dark: #0e84bd;
  --yellow: #ffc800;
  --red: #ff4b4b;
  --purple: #ce82ff;
  --gray-50: #fafafa;
  --gray-100: #f7f7f7;
  --gray-200: #e5e5e5;
  --gray-300: #afafaf;
  --gray-700: #4b4b4b;
  --bg: #ffffff;
  --text: #3c3c3c;
  --shadow: 0 4px 0 rgba(0, 0, 0, 0.12);

  --brand-gradient: linear-gradient(135deg, #0d7c3e 0%, #14a04d 60%, #d4af37 100%);
}

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

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px; /* room for bottom nav */
  -webkit-font-smoothing: antialiased;
}

.arabic {
  font-family: 'Amiri Quran', 'Scheherazade New', serif;
  direction: rtl;
  line-height: 2.2;
}

h1, h2, h3 { color: var(--gray-700); }

/* ===== TOP BAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 2px solid var(--gray-200);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--brand-gradient);
  color: #fff; border-radius: 12px;
  font-family: 'Amiri Quran', serif;
  font-size: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.logo::after {
  content: "";
  position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px var(--gold);
}
.name {
  font-weight: 900; font-size: 20px;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
.name .dot-ai {
  font-size: 14px;
  opacity: 0.85;
  vertical-align: super;
}
.stats { display: flex; gap: 18px; }
.stat { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gray-700); }
.stat .icon { font-size: 18px; }
.heart-timer {
  font-size: 11px;
  color: var(--gray-300);
  margin-left: 4px;
}

/* ===== SCREENS ===== */
.screen { display: none; max-width: 720px; margin: 0 auto; padding: 20px 20px 40px; }
.screen.active { display: block; }
.page-title { font-size: 26px; font-weight: 900; margin-bottom: 18px; }

/* ===== HOME: HERO ===== */
.hero { text-align: center; padding: 16px 8px 8px; }
.hero h1 { font-size: 24px; font-weight: 900; }
.hero .subtitle { margin-top: 6px; color: var(--gray-300); font-weight: 700; font-size: 13px; }

/* ===== SEARCH + FILTERS ===== */
.search-wrap { margin: 18px 0 10px; }
#searchInput {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  background: var(--gray-50);
}
#searchInput:focus { border-color: var(--blue); background: #fff; }

.filters {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.filter-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 999px;
  background: #fff;
  font-weight: 900;
  color: var(--gray-700);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green-dark);
}

/* ===== SURAH GRID ===== */
.surah-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.surah-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
  transition: background 0.1s;
}
.surah-card:hover { background: var(--gray-50); }
.surah-card:active { transform: translateY(1px); }

.surah-num {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 900;
  font-size: 14px;
}
.surah-text { flex: 1; min-width: 0; }
.surah-name {
  font-weight: 900;
  color: var(--gray-700);
  display: flex; align-items: center; gap: 8px;
}
.surah-badge {
  font-size: 10px; padding: 2px 6px;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.badge-makki { background: #fff4d6; color: #b07800; }
.badge-madani { background: #e1f0ff; color: #0a6bbd; }
.surah-sub {
  font-size: 12px; color: var(--gray-300);
  font-weight: 700; margin-top: 2px;
}
.surah-arabic {
  font-size: 24px;
  color: var(--green-dark);
  flex-shrink: 0;
}

.mini-progress {
  margin-top: 6px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.mini-progress > div {
  height: 100%;
  background: var(--green);
  transition: width 0.3s;
}

/* ===== LOADER / EMPTY / ERROR ===== */
.loader {
  text-align: center;
  padding: 40px;
  color: var(--gray-300);
  font-weight: 700;
}
.loader::before {
  content: "";
  display: block;
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty, .error {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-300);
  font-weight: 700;
}
.error-sub { font-size: 13px; margin: 6px 0 16px; }

/* ===== SURAH DETAIL ===== */
.detail-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0 18px;
}
.detail-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--gray-700);
  letter-spacing: 0.5px;
}

.surah-hero {
  text-align: center;
  padding: 22px;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border-radius: 18px;
  margin-bottom: 20px;
}
.surah-hero-num {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.surah-hero h2 {
  font-size: 26px;
  color: #fff;
  margin-bottom: 6px;
}
.surah-hero-arabic { font-size: 36px; margin: 8px 0; }
.surah-hero-meta {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 700;
}

.lesson-list {
  display: flex; flex-direction: column; gap: 10px;
}
.lesson-node {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: background 0.1s;
}
.lesson-node:hover:not(.locked) { background: var(--gray-50); }
.lesson-node.done { background: #fffbea; border-color: var(--yellow); border-bottom-color: #c79500; }
.lesson-node.locked { background: var(--gray-100); color: var(--gray-300); cursor: not-allowed; opacity: 0.7; }
.lesson-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
}
.lesson-node.done .lesson-icon { background: var(--yellow); }
.lesson-node.locked .lesson-icon { background: var(--gray-200); color: var(--gray-300); }
.lesson-meta { flex: 1; }
.lesson-title { font-weight: 900; color: var(--gray-700); }
.lesson-node.locked .lesson-title { color: var(--gray-300); }
.lesson-sub { font-size: 12px; color: var(--gray-300); font-weight: 700; }
.lesson-action {
  font-size: 12px;
  font-weight: 900;
  color: var(--green-dark);
  letter-spacing: 0.5px;
}

/* ===== LESSON ===== */
.lesson-header {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0 18px;
}
.close-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--gray-300);
  cursor: pointer;
  font-weight: 900;
  padding: 4px 8px;
}
.progress {
  flex: 1;
  height: 14px;
  background: var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.3s;
  border-radius: 10px;
}
.lesson-hearts { font-weight: 900; color: var(--red); }

.lesson-body { padding: 10px 0 20px; min-height: 360px; }
.question-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--gray-700);
  margin-bottom: 18px;
}
.surah-info {
  text-align: center;
  color: var(--gray-300);
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.ayah-display {
  background: var(--green-soft);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  font-size: 30px;
  margin-bottom: 18px;
}
.ayah-translation {
  margin-top: 10px;
  font-size: 14px;
  color: var(--gray-700);
  font-style: italic;
  text-align: center;
  margin-bottom: 16px;
}
.blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px dashed var(--green-dark);
  color: var(--gray-300);
}
.blank.filled { color: var(--green-dark); border-bottom-style: solid; }

.options { display: grid; gap: 10px; }
.option {
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  user-select: none;
}
.option:hover { background: var(--gray-50); }
.option:active { transform: translateY(1px); }
.option.selected {
  border-color: var(--blue);
  background: #ddf4ff;
  color: #1899d6;
}
.option.arabic { font-size: 22px; }

/* Word build */
.word-slot {
  min-height: 60px;
  border-bottom: 2px solid var(--gray-200);
  display: flex; flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 8px;
  padding: 10px;
  margin-bottom: 20px;
}
.word-bank {
  display: flex; flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 8px;
  padding: 8px;
  justify-content: center;
}
.word-tile {
  padding: 8px 14px;
  background: #fff;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  font-family: 'Amiri Quran', serif;
  user-select: none;
}
.word-tile.used { visibility: hidden; }
.word-tile:hover { background: var(--gray-50); }

/* Audio */
.audio-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 72px; height: 72px;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--blue-dark);
  margin: 16px auto 6px;
  display: block;
}
.audio-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--blue-dark); }
.audio-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray-300);
  margin-bottom: 18px;
  font-weight: 700;
}

/* ===== LESSON FOOTER ===== */
.lesson-footer {
  position: sticky;
  bottom: 80px;
  background: #fff;
  border-top: 2px solid var(--gray-200);
  padding: 16px 20px;
  margin: 0 -20px 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.feedback { font-weight: 900; font-size: 14px; flex: 1; }
.feedback.correct { color: var(--green-dark); }
.feedback.wrong { color: var(--red); }

.primary-btn {
  background: var(--green);
  color: #fff;
  font-weight: 900;
  padding: 14px 26px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--green-dark);
  min-width: 120px;
}
.primary-btn:disabled {
  background: var(--gray-200);
  color: var(--gray-300);
  cursor: not-allowed;
  box-shadow: 0 4px 0 #cfcfcf;
}
.primary-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.primary-btn.btn-wrong { background: var(--red); box-shadow: 0 4px 0 #cc3a3a; }
.primary-btn.btn-wrong:active { box-shadow: 0 2px 0 #cc3a3a; }

.secondary-btn, .danger-btn {
  padding: 10px 18px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-700);
}
.danger-btn { color: var(--red); border-color: #ffcccc; }
.secondary-btn:active, .danger-btn:active { transform: translateY(1px); }

/* ===== COMPLETE / GAMEOVER ===== */
.complete-box { text-align: center; padding: 40px 20px; }
.trophy { font-size: 80px; }
.complete-box h2 { font-size: 28px; font-weight: 900; margin: 10px 0; color: var(--green-dark); }
.complete-box p { color: var(--gray-300); font-weight: 700; margin-bottom: 20px; }
.rewards {
  display: flex; justify-content: center; gap: 12px;
  margin: 20px 0 28px; flex-wrap: wrap;
}
.reward {
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 100px;
}
.reward span { font-size: 24px; }
.reward p { font-weight: 900; color: var(--yellow); margin-top: 4px; font-size: 13px; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--gray-300);
  font-size: 12px;
}
.stat-card .big {
  font-size: 24px;
  font-weight: 900;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.section-title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 12px;
}
.learning-row {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.learning-row:hover { background: var(--gray-50); }
.learning-name { font-weight: 900; color: var(--gray-700); font-size: 13px; }
.learning-stat { text-align: right; font-weight: 900; font-size: 12px; color: var(--gray-300); }

/* ===== SETTINGS ===== */
.settings-list { display: flex; flex-direction: column; gap: 10px; }
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  background: #fff;
}
.setting-item.about { background: var(--gray-50); }
.setting-title { font-weight: 900; color: var(--gray-700); margin-bottom: 4px; }
.setting-sub { font-size: 12px; color: var(--gray-300); font-weight: 700; line-height: 1.5; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: #fff;
  border-top: 2px solid var(--gray-200);
  display: flex;
  max-width: 720px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  padding: 12px 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--gray-300);
  font-weight: 900;
}
.nav-btn span { font-size: 22px; }
.nav-btn em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.nav-btn.active { color: var(--green-dark); }

/* Sembunyikan bottom nav & topbar semasa lesson / onboarding / paywall / gameover */
#lesson.active ~ .bottom-nav,
#complete.active ~ .bottom-nav,
#gameover.active ~ .bottom-nav,
#onboarding.active ~ .bottom-nav,
#paywall.active ~ .bottom-nav { display: none; }

body:has(#onboarding.active) .topbar,
body:has(#paywall.active) .topbar { display: none; }

/* ===== ONBOARDING ===== */
#onboarding { max-width: 480px; padding-bottom: 20px; }
.onb-progress {
  display: flex; gap: 6px;
  padding: 16px 0;
}
.onb-progress > div {
  flex: 1; height: 6px;
  background: var(--gray-200);
  border-radius: 10px;
}
.onb-progress > div.active { background: var(--emerald); }
.onb-step { text-align: center; padding: 20px 0; }
.onb-emoji { font-size: 72px; margin-bottom: 12px; }
.onb-step h1 {
  font-size: 26px; font-weight: 900; margin-bottom: 10px;
  color: var(--gray-700);
}
.onb-step p {
  color: var(--gray-700);
  font-weight: 700; line-height: 1.5;
  margin-bottom: 20px;
  font-size: 15px;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0 24px;
}
.goal-option {
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
}
.goal-option:hover { background: var(--gray-50); }
.goal-option.selected {
  border-color: var(--emerald);
  background: #e8f5ee;
  color: var(--emerald-dark);
}
.goal-option .goal-min {
  font-size: 22px; color: var(--emerald-dark); margin-bottom: 2px;
}
.goal-option .goal-label {
  font-size: 11px; color: var(--gray-300);
  letter-spacing: 0.5px;
}

.feature-list { text-align: left; margin: 12px 0 24px; }
.feature-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}
.feature-item:last-child { border-bottom: none; }
.feature-icon {
  font-size: 28px; flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #e8f5ee;
}
.feature-text h4 { font-size: 15px; font-weight: 900; margin-bottom: 2px; }
.feature-text p { font-size: 13px; color: var(--gray-300); font-weight: 700; margin: 0; }

.onb-footer {
  position: sticky; bottom: 0;
  background: #fff;
  padding: 14px 0;
  border-top: 2px solid var(--gray-200);
  display: flex; gap: 10px;
}
.onb-footer .primary-btn { flex: 1; }
.onb-skip {
  background: transparent;
  color: var(--gray-300);
  border: none;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  padding: 14px 16px;
  letter-spacing: 0.5px;
}

/* ===== PAYWALL ===== */
#paywall {
  max-width: 480px;
  background: linear-gradient(180deg, #ffffff 0%, #fff9e8 100%);
  min-height: 100vh;
}
.paywall-header {
  text-align: center;
  padding: 30px 20px 16px;
  position: relative;
}
.paywall-close {
  position: absolute;
  top: 10px; right: 12px;
  background: transparent; border: none;
  font-size: 22px; color: var(--gray-300);
  cursor: pointer; font-weight: 900;
}
.premium-crown { font-size: 60px; margin-bottom: 10px; }
.paywall-header h1 {
  font-size: 28px; font-weight: 900;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.paywall-header .tag {
  color: var(--gray-700); font-weight: 700;
  margin-top: 8px; font-size: 14px;
}

.benefit-list {
  padding: 0 20px 20px;
}
.benefit-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 0;
  font-weight: 700;
  color: var(--gray-700);
  font-size: 14px;
}
.benefit-check {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
}

.plans { padding: 0 20px 10px; }
.plan {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  position: relative;
}
.plan.selected {
  border-color: var(--gold);
  background: #fffaec;
}
.plan.best::after {
  content: "PALING POPULAR";
  position: absolute;
  top: -10px; left: 14px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10px; font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.plan.lifetime::after {
  content: "SEUMUR HIDUP";
  position: absolute;
  top: -10px; left: 14px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
  color: #1a1a1a;
  font-size: 10px; font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.plan-info .plan-name { font-weight: 900; font-size: 15px; color: var(--gray-700); }
.plan-info .plan-desc { font-size: 12px; color: var(--gray-300); font-weight: 700; margin-top: 2px; }
.plan-price { text-align: right; }
.plan-price .amt { font-size: 18px; font-weight: 900; color: var(--emerald-dark); }
.plan-price .sub { font-size: 11px; color: var(--gray-300); font-weight: 700; }
.plan-price .strike {
  font-size: 11px; color: var(--gray-300);
  text-decoration: line-through;
}

.paywall-cta {
  padding: 14px 20px 20px;
  background: #fff;
  border-top: 2px solid var(--gray-200);
  position: sticky; bottom: 0;
}
.subscribe-btn {
  width: 100%;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 900;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--emerald-dark);
}
.subscribe-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--emerald-dark); }
.trial-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray-300);
  font-weight: 700;
  margin-top: 8px;
}

/* Premium badge */
.premium-badge {
  display: inline-block;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}
.lock-icon {
  display: inline-block;
  font-size: 12px;
  margin-left: 4px;
}
.surah-card.premium-locked { opacity: 0.75; }
.surah-card.premium-locked .surah-num {
  background: #fff4cc;
  color: var(--gold-dark);
}

/* Google login button */
.google-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: #fff;
  border: 2px solid var(--gray-200);
  border-bottom-width: 4px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  margin-top: 8px;
}
.google-btn:active { transform: translateY(1px); }
.google-icon {
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path fill='%23FFC107' d='M43.6 20.1H42V20H24v8h11.3c-1.6 4.7-6.1 8-11.3 8-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3l5.7-5.7C34 6.1 29.3 4 24 4 13 4 4 13 4 24s9 20 20 20 20-9 20-20c0-1.3-.1-2.6-.4-3.9z'/><path fill='%23FF3D00' d='M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.8 1.2 7.9 3l5.7-5.7C34 6.1 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7z'/><path fill='%234CAF50' d='M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 35.1 26.7 36 24 36c-5.2 0-9.6-3.3-11.3-8l-6.5 5C9.5 39.6 16.2 44 24 44z'/><path fill='%231976D2' d='M43.6 20.1H42V20H24v8h11.3c-.8 2.3-2.2 4.3-4.1 5.7l6.2 5.2C41.5 36.3 44 30.8 44 24c0-1.3-.1-2.6-.4-3.9z'/></svg>");
  background-size: contain;
}

/* Upgrade button in settings */
.upgrade-card {
  background: var(--brand-gradient);
  color: #fff;
  padding: 20px;
  border-radius: 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--emerald-dark);
}
.upgrade-card .crown { font-size: 40px; }
.upgrade-card h3 { color: #fff; font-size: 16px; margin-bottom: 2px; }
.upgrade-card p { color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 700; }
.upgrade-card:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--emerald-dark); }

@media (max-width: 480px) {
  .hero h1 { font-size: 20px; }
  .ayah-display { font-size: 24px; padding: 16px; }
  .surah-hero-arabic { font-size: 28px; }
  .surah-arabic { font-size: 20px; }
  .lesson-footer { bottom: 76px; }
}

/* ========== Chunk chaining ========== */
.chunk-stage {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.chunk-text {
  font-size: 26px;
  line-height: 1.9;
  text-align: center;
  color: #0f172a;
  font-family: "Amiri Quran", serif;
}
.chunk-text.chunk-hidden {
  color: #94a3b8;
  letter-spacing: 4px;
}
.chunk-piece {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.3s;
}
.chunk-piece.new {
  background: #d1fae5;
  animation: pulse-new 0.6s ease;
}
@keyframes pulse-new {
  0% { background: #fef3c7; transform: scale(1.05); }
  100% { background: #d1fae5; transform: scale(1); }
}
.chunk-hint {
  color: #64748b;
  font-size: 14px;
}
.chunk-next-btn { margin-top: 8px; }
.chunk-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}
.chunk-progress {
  text-align: center;
  color: #64748b;
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
}

/* ========== Voice recite ========== */
.recite-stage {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px 20px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: #0d7c3e;
  color: #fff;
  font-size: 44px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(13, 124, 62, 0.4);
  transition: all 0.2s;
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.mic-btn.recording {
  background: #dc2626;
  animation: pulse-mic 1s infinite;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}
@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.recite-status {
  color: #64748b;
  font-size: 14px;
  text-align: center;
}
.recite-transcript {
  font-size: 22px;
  color: #334155;
  min-height: 36px;
  text-align: center;
  padding: 8px;
  font-family: "Amiri Quran", serif;
}
.recite-score {
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
}
.score-num {
  font-size: 28px;
  padding: 4px 14px;
  border-radius: 10px;
  margin-right: 6px;
}
.score-num.good { background: #d1fae5; color: #065f46; }
.score-num.weak { background: #fee2e2; color: #991b1b; }
.recite-reveal {
  margin-top: 12px;
  padding: 14px;
  background: #f0f9ff;
  border-radius: 12px;
  border: 1px solid #bae6fd;
}
.recite-reveal-label {
  font-size: 13px;
  color: #0369a1;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ========== Talqin intro ========== */
.talqin-box {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px 20px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.talqin-box .ayah-display {
  font-size: 32px;
  text-align: center;
  line-height: 2;
  color: #0f172a;
}
.talqin-box .ayah-translation {
  color: #475569;
  text-align: center;
  font-style: italic;
}
.audio-btn-lg {
  background: #0d7c3e;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 124, 62, 0.35);
}
.audio-btn-lg:hover { background: #0a6433; }
.talqin-hint {
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

/* ========== AI badge ========== */
.recite-ai-badge {
  display: inline-block;
  background: linear-gradient(90deg, #ede9fe, #dbeafe);
  color: #4338ca;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #c7d2fe;
}

/* ========== Muraja'ah card ========== */
.murajaah-card {
  grid-column: 1 / -1;
  padding: 18px 20px;
  border-radius: 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.murajaah-card.alert {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
}
.murajaah-card.calm {
  background: #f0fdf4;
  border: 2px solid #86efac;
}
.murajaah-title {
  font-weight: 900;
  font-size: 18px;
  color: #0f172a;
}
.murajaah-sub {
  color: #475569;
  font-size: 14px;
}
.murajaah-btn {
  margin-top: 8px;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  align-self: flex-start;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}
.murajaah-btn:hover { background: #b91c1c; }

/* ========== Audio settings card ========== */
.audio-settings-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.audio-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.setting-label {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}
.qari-select {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  min-width: 200px;
}
.qari-select:focus {
  border-color: #0d7c3e;
  outline: none;
}
.speed-group {
  display: flex;
  gap: 6px;
}
.speed-btn {
  padding: 8px 14px;
  border: 2px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
}
.speed-btn:hover { background: #f1f5f9; }
.speed-btn.active {
  background: #0d7c3e;
  color: #fff;
  border-color: #0d7c3e;
}

/* Referral block dalam settings */
.referral-block {
  background: linear-gradient(135deg, #fffaec 0%, #fef9c3 100%);
  border: 2px solid var(--gold-light);
}
.referral-block .setting-title {
  font-size: 15px;
  margin-bottom: 6px;
}
.referral-block .setting-sub {
  margin-bottom: 12px;
}
.referral-link-box {
  background: #fff;
  border: 1.5px dashed var(--gold-dark);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  color: var(--emerald-dark);
  word-break: break-all;
  margin-bottom: 10px;
  font-weight: 700;
}
.referral-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.referral-actions button {
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  border: 2px solid transparent;
}
.referral-actions .secondary-btn {
  background: #fff;
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}
.referral-actions .primary-btn {
  background: #25D366;
  color: #fff;
}
.referral-stats {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 700;
  text-align: center;
  background: rgba(255,255,255,0.6);
  padding: 8px;
  border-radius: 8px;
}

/* Parent dashboard greeting + insight cards */
.parent-greeting {
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-light) 100%);
  color: #fff;
  padding: 18px 20px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.greeting-text { font-size: 18px; font-weight: 900; margin-bottom: 2px; }
.greeting-sub { font-size: 13px; opacity: 0.9; font-weight: 700; }

.parent-insight {
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  border-left: 5px solid;
}
.parent-insight.win { background: #ecfdf5; border-color: var(--emerald); }
.parent-insight.warn { background: #fef9c3; border-color: var(--gold-dark); }
.parent-insight.info { background: #eff6ff; border-color: #1cb0f6; }
.insight-title { font-weight: 900; font-size: 15px; margin-bottom: 4px; color: var(--gray-700); }
.insight-text { font-size: 14px; color: var(--gray-700); line-height: 1.5; }

.share-progress-btn {
  width: 100%;
  background: #25D366;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  margin: 16px 0 22px;
  font-family: inherit;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 0 #1da855;
}
.share-progress-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #1da855; }

/* Paywall Google login prompt */
.paywall-login-prompt {
  background: linear-gradient(135deg, #fffaec 0%, #fef9c3 100%);
  border: 2px solid var(--gold-light);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.login-prompt-text {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.google-btn-paywall {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 2px solid var(--gold-dark);
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}
.google-btn-paywall:hover { background: var(--gold-light); }
.google-btn-paywall .google-icon {
  width: 18px; height: 18px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="%23FFC107" d="M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917z"/><path fill="%23FF3D00" d="M6.306 14.691l6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691z"/><path fill="%234CAF50" d="M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238C29.211 35.091 26.715 36 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44z"/><path fill="%231976D2" d="M43.611 20.083H42V20H24v8h11.303c-.792 2.237-2.231 4.166-4.087 5.571.001-.001.002-.001.003-.002l6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917z"/></svg>') no-repeat center / contain;
}
