/* ============================================================
   Nurul Quran - Tema Islami (Emerald + Gold), Mobile-First v16
   ============================================================ */

:root {
  --emerald-900: #044e3c;
  --emerald-800: #067a5f;
  --emerald-700: #0a8f6e;
  --emerald-600: #10a37f;
  --emerald-100: #d3f3e8;
  --emerald-50: #ecf9f4;
  --gold: #d4af37;
  --gold-light: #f0d98c;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --paper: #f6fbf9;
  --white: #ffffff;
  --red-soft: #e74c3c;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(4, 78, 60, .10);
  --shadow-lg: 0 10px 30px rgba(4, 78, 60, .18);
  --font-ar: "Amiri", "Scheherazade New", "Traditional Arabic", "Times New Roman", serif;
  color-scheme: light;
}

/* ============================================================
   v15: Tema Light/Dark — CSS custom properties
   :root = light (default); [data-theme="dark"] = dark.
   prefers-color-scheme: script inline di index.html/dashboard.html
   menetapkan data-theme sebelum paint bila pengguna mengikuti sistem.
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --emerald-100: #13412f;   /* border gelap */
  --emerald-50: #0d2f24;    /* permukaan hijau gelap */
  --gold-light: #e8c96a;
  --ink: #e6edf3;
  --ink-soft: #9fb0bd;
  --paper: #0b1513;
  --white: #14231e;         /* kartu gelap */
  --shadow: 0 4px 18px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
}
/* Teks hijau tua -> hijau terang agar terbaca di kartu gelap */
[data-theme="dark"] .masjid-name,
[data-theme="dark"] .home-widget-title,
[data-theme="dark"] .menu-sheet-head h2,
[data-theme="dark"] .kiblat-readout,
[data-theme="dark"] .donasi-head h3,
[data-theme="dark"] .donasi-steps h4,
[data-theme="dark"] .akun-username,
[data-theme="dark"] .akun-detail-row span:last-child,
[data-theme="dark"] .waris-section-title,
[data-theme="dark"] .ayah-arab { color: #7ee2b9; }
[data-theme="dark"] .saweria-link,
[data-theme="dark"] .home-more-btn,
[data-theme="dark"] .info-cat,
[data-theme="dark"] .ayah-audio-btn,
[data-theme="dark"] .surah-num,
[data-theme="dark"] .masjid-nav,
[data-theme="dark"] .audio-status,
[data-theme="dark"] .footer-link,
[data-theme="dark"] .info-likes,
[data-theme="dark"] .page-indicator { color: #34d399; }
[data-theme="dark"] .bottom-nav { background: #14231e; border-top-color: #13412f; }
[data-theme="dark"] .nav-item { color: #9fb0bd; }
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .bottom-nav .nav-more-btn { color: #34d399; }
[data-theme="dark"] .home-widget,
[data-theme="dark"] .home-quick-card,
[data-theme="dark"] .lang-picker,
[data-theme="dark"] .doa-tab,
[data-theme="dark"] .kiblat-card { background: #14231e; }
[data-theme="dark"] .home-menu-card:hover,
[data-theme="dark"] .home-menu-card:active { background: #1a3d2e; }
[data-theme="dark"] .page-btn { background: #14231e; border-color: #13412f; color: #34d399; }
[data-theme="dark"] .page-btn:hover:not(:disabled) { background: #0d2f24; }
[data-theme="dark"] .saweria-card { background: linear-gradient(160deg, #14231e, #0d2f24); }
[data-theme="dark"] .donasi-note { background: #3a2e0e; color: #e8c96a; }
[data-theme="dark"] .donasi-ico { background: #3a2e0e; }
[data-theme="dark"] .compass { background: radial-gradient(circle at 50% 50%, #0d2f24, #13412f); }
[data-theme="dark"] .info-card,
[data-theme="dark"] .info-detail-card { border-color: #1f3a31; }
[data-theme="dark"] .info-detail-content { color: #cbd5e1; }
[data-theme="dark"] .calc-form input[type="number"],
[data-theme="dark"] .calc-form select { background: #0f1c17; }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  transition: background-color .3s ease, color .3s ease;
}

/* Transisi halus saat ganti tema (v15) */
[data-theme] body,
[data-theme] .surah-card,
[data-theme] .card,
[data-theme] .ayah-block,
[data-theme] .home-widget,
[data-theme] .home-quick-card,
[data-theme] .menu-grid-item,
[data-theme] .info-card,
[data-theme] .info-detail-card,
[data-theme] .kiblat-card,
[data-theme] .calc-form,
[data-theme] .akun-card,
[data-theme] .donasi-account,
[data-theme] .bottom-nav {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* Tombol tema (🌙/☀️) di header */
.chip-theme-btn .theme-ico { font-size: .95rem; line-height: 1; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: #fff;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 720px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.brand-text h1 { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.brand-text p { font-size: 11.5px; color: var(--gold-light); }
.header-actions { display: flex; gap: 8px; }

.chip-toggle {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 5px 10px; color: #fff; font-size: 12px; cursor: pointer;
}
.toggle-ico {
  font-size: 16px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.toggle-switch {
  width: 34px; height: 19px; border-radius: 999px; background: rgba(255,255,255,.3);
  position: relative; transition: background .25s; flex-shrink: 0;
}
.toggle-switch .knob {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; transition: left .25s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-switch.on { background: var(--gold); }
.toggle-switch.on .knob { left: 17px; }

/* ---------- Main ---------- */
.app-main { max-width: 720px; margin: 0 auto; padding: 14px 14px 24px; }
.view { display: none; animation: fadeUp .3s ease; }
.view.active { display: block; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-title { font-size: 20px; font-weight: 800; color: var(--emerald-900); }
.view-sub { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0 16px; }

/* ---------- Search & filters ---------- */
.search-wrap { margin-bottom: 12px; }
.search-input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--emerald-100);
  border-radius: 999px; font-size: 14.5px; background: var(--white);
  outline: none; transition: border .2s;
}
.search-input:focus { border-color: var(--emerald-600); }

.filter-row { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.filter-row.wrap { flex-wrap: wrap; overflow-x: visible; }
.filter-chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--emerald-100);
  background: var(--white); color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: all .2s;
}
.filter-chip.active, .filter-chip:hover {
  background: var(--emerald-800); border-color: var(--emerald-800); color: #fff; font-weight: 600;
}

.juz-banner {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-600));
  color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  text-align: center; box-shadow: var(--shadow);
}
.juz-banner p { font-size: 13.5px; font-weight: 600; }

/* ---------- Surah list ---------- */
.surah-list { display: flex; flex-direction: column; gap: 8px; }
.surah-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1.5px solid transparent; border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .15s, border-color .2s;
}
.surah-card:hover { transform: translateY(-2px); border-color: var(--emerald-300, #9be3cd); }
.surah-num {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--emerald-50); color: var(--emerald-800); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--emerald-100);
}
.surah-info { flex: 1; min-width: 0; }
.surah-latin { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.surah-arti { font-size: 12.5px; color: var(--ink-soft); }
.surah-meta { font-size: 11.5px; color: var(--emerald-700); font-weight: 600; }
.surah-arab {
  font-family: var(--font-ar); font-size: 21px; color: var(--emerald-900);
  flex-shrink: 0; direction: rtl;
}

/* ---------- Cards (hadits & doa) ---------- */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--emerald-600);
}
.card-arab {
  font-family: var(--font-ar); font-size: 20px; line-height: 2; color: var(--emerald-900);
  direction: rtl; text-align: right; margin-bottom: 10px;
}
.card-arab.big { font-size: 24px; line-height: 2.1; }
.card-latin { font-size: 13.5px; color: var(--emerald-700); font-style: italic; margin-bottom: 8px; }
.card-trans { font-size: 14px; color: var(--ink-soft); }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.card-tag {
  background: var(--emerald-50); color: var(--emerald-800); font-weight: 700;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
}

/* ---------- Kiblat ---------- */
.kiblat-wrap { text-align: center; }
.compass-card {
  background: linear-gradient(160deg, var(--white), var(--emerald-50));
  border-radius: 24px; padding: 24px 16px 18px; box-shadow: var(--shadow-lg);
  margin: 0 0 16px; position: relative;
}
.compass {
  width: 250px; height: 250px; margin: 0 auto; position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #eef8f3 70%, #d9efe6);
  border: 8px solid var(--emerald-100);
  box-shadow: inset 0 0 24px rgba(4,78,60,.10), 0 8px 24px rgba(4,78,60,.15);
}
.compass-ring { position: absolute; inset: 0; border-radius: 50%; }
.compass-ring .deg {
  position: absolute; font-weight: 800; font-size: 16px; color: var(--emerald-900);
}
.deg-n { top: 6px; left: 50%; transform: translateX(-50%); color: var(--red-soft) !important; }
.deg-e { top: 50%; right: 8px; transform: translateY(-50%); }
.deg-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.deg-w { top: 50%; left: 8px; transform: translateY(-50%); }

.tick {
  position: absolute; background: var(--emerald-200, #b8e6d6); width: 2px; height: 8px;
  left: 50%; top: 4px; transform-origin: 50% 121px;
}
.tick.t0 { transform: rotate(0deg); }
.tick.t45 { transform: rotate(45deg); }
.tick.t90 { transform: rotate(90deg); }
.tick.t135 { transform: rotate(135deg); }
.tick.t180 { transform: rotate(180deg); }
.tick.t225 { transform: rotate(225deg); }
.tick.t270 { transform: rotate(270deg); }
.tick.t315 { transform: rotate(315deg); }

.compass-needle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(0deg); transition: none; }
.needle-top {
  width: 0; height: 0; margin: 0 auto;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-bottom: 62px solid var(--red-soft);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.needle-bottom {
  width: 0; height: 0; margin: 0 auto;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 62px solid #d1d5db;
}
.needle-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); z-index: 2;
}
.kiblat-arrow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 26px; z-index: 3; pointer-events: none;
  transition: transform .5s cubic-bezier(.4, 1.6, .5, 1);
}

.kiblat-readout { font-size: 34px; font-weight: 800; color: var(--emerald-900); margin-top: 12px; }
.kiblat-status { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin-bottom: 14px;
}
.info-item {
  background: var(--white); border-radius: 14px; padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.info-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.info-value { font-size: 13.5px; font-weight: 700; color: var(--ink); word-break: break-word; }

.manual-loc { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.manual-details { width: 100%; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; }
.manual-details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--emerald-800); text-align: center; }
.manual-fields { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.manual-fields label { flex: 1; min-width: 120px; font-size: 12px; color: var(--ink-soft); }
.manual-fields input {
  width: 100%; margin-top: 4px; padding: 9px 10px; border: 2px solid var(--emerald-100);
  border-radius: 10px; font-size: 14px; outline: none;
}
.manual-fields input:focus { border-color: var(--emerald-600); }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 999px; padding: 11px 20px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: transform .15s, box-shadow .2s, opacity .2s; font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--emerald-800); color: #fff; box-shadow: 0 4px 12px rgba(6,122,95,.35); }
.btn-primary:hover { background: var(--emerald-700); }
.btn-secondary { background: var(--emerald-50); color: var(--emerald-800); border: 2px solid var(--emerald-100); }
.btn-audio { background: var(--gold); color: #3d2f00; box-shadow: 0 4px 12px rgba(212,175,55,.4); }
.btn-audio:hover { background: var(--gold-light); }
.btn-block { width: 100%; padding: 13px; font-size: 15.5px; margin-top: 12px; }

/* ---------- Kalkulator ---------- */
.calc-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.calc-tab {
  flex: 1; padding: 11px; border-radius: 999px; border: 2px solid var(--emerald-100);
  background: var(--white); font-size: 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.calc-tab.active { background: var(--emerald-800); color: #fff; border-color: var(--emerald-800); }

.calc-panel { display: none; }
.calc-panel.active { display: block; animation: fadeUp .3s ease; }

.zakat-type-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.zakat-type {
  flex: 1; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--emerald-100);
  background: var(--white); font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.zakat-type.active { background: var(--gold); color: #3d2f00; border-color: var(--gold); }

.calc-form { background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.calc-form label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }
.calc-form input[type="number"], .calc-form select {
  width: 100%; padding: 11px 12px; border: 2px solid var(--emerald-100); border-radius: 12px;
  font-size: 15px; outline: none; background: #fff;
}
.calc-form input:focus, .calc-form select:focus { border-color: var(--emerald-600); }

.waris-section-title { font-size: 13.5px; font-weight: 800; color: var(--emerald-900); margin-top: 2px; }
.waris-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-card {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 10px 12px; border: 2px solid var(--emerald-100); border-radius: 12px; cursor: pointer;
  background: var(--white); flex-direction: row !important;
}
.check-card input { width: 17px; height: 17px; accent-color: var(--emerald-800); }
.check-card:has(input:checked) { background: var(--emerald-50); border-color: var(--emerald-600); }

.waris-counts { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--emerald-50); border-radius: 12px; }

.calc-result { margin-top: 14px; background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.calc-result h3 { color: var(--emerald-900); font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.calc-summary { font-size: 15px; font-weight: 700; color: var(--emerald-800); margin-bottom: 12px; }
.calc-note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--emerald-100); }
.result-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.result-table th, .result-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--emerald-50); }
.result-table th { background: var(--emerald-50); color: var(--emerald-900); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.result-table td:last-child, .result-table th:last-child { text-align: right; font-weight: 700; }
.result-table tr:last-child td { border-bottom: none; }

.hidden { display: none !important; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 46, 36, .55); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay[hidden] { display: none !important; }
.modal-overlay:not([hidden]) { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--paper); width: 100%; max-width: 720px; max-height: 88dvh;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .3s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes slideUp { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }

.modal-header {
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700)); color: #fff;
  padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.modal-header h2 { font-size: 18px; }
.modal-meta { font-size: 12px; color: var(--gold-light); }
.modal-close {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 50%; font-size: 16px; cursor: pointer; flex-shrink: 0;
}

.modal-actions { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--white); border-bottom: 1px solid var(--emerald-50); }
.audio-status { font-size: 12px; color: var(--emerald-700); font-weight: 600; }

.modal-ayahs { overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.ayah-block {
  background: var(--white); border-radius: 14px; padding: 14px; box-shadow: var(--shadow);
  border-top: 3px solid var(--emerald-600);
}
.ayah-arab {
  font-family: var(--font-ar); font-size: 23px; line-height: 2.1; direction: rtl; text-align: right;
  color: var(--emerald-900); margin-bottom: 8px; word-break: break-word;
}
.ayah-num {
  float: left; background: var(--gold); color: #3d2f00; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px; margin-left: 6px;
}
.ayah-trans { font-size: 13.5px; color: var(--ink-soft); border-top: 1px dashed var(--emerald-100); padding-top: 8px; }
.ayah-audio-btn {
  background: var(--emerald-50); border: 1.5px solid var(--emerald-100); color: var(--emerald-800);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; margin-top: 8px;
}
.ayah-audio-btn.playing { background: var(--gold); color: #3d2f00; border-color: var(--gold); }

.empty-state { text-align: center; color: var(--ink-soft); padding: 40px 16px; font-size: 14px; }
.empty-state .big { font-size: 40px; display: block; margin-bottom: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: var(--emerald-900); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s;
  z-index: 200; box-shadow: var(--shadow-lg); max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--white); display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(4,78,60,.12); border-top: 1px solid var(--emerald-50);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer; padding: 6px 2px; color: var(--ink-soft);
  font-size: 10.5px; font-weight: 600; border-radius: 12px; transition: color .2s; font-family: inherit;
}
.nav-ico { font-size: 21px; filter: grayscale(.4); transition: transform .2s, filter .2s; }
.nav-item.active { color: var(--emerald-800); }
.nav-item.active .nav-ico { filter: none; transform: translateY(-2px) scale(1.12); }

/* ---------- Desktop breakpoint ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 24px; }
  .bottom-nav {
    position: sticky; top: auto; max-width: 720px; margin: 0 auto; border-radius: 18px;
    box-shadow: var(--shadow-lg); margin-top: 8px;
  }
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 22px; max-height: 84dvh; }
  .surah-card { padding: 14px 18px; }
}

/* ============================================================
   v4: Bookmark, Favorit, Lazy-load, Donasi, badge surah
   ============================================================ */

/* --- Donasi chip di header --- */
.donasi-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 5px 10px; color: #fff; font-size: 12px; cursor: pointer;
  transition: background .2s;
}
.donasi-chip.active { background: var(--gold); color: #3d2f00; font-weight: 700; }
.donasi-icon { font-size: 15px; }

/* --- Badge kelengkapan surah --- */
.surah-off-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: var(--emerald-100); color: var(--emerald-900);
  font-size: 9.5px; font-weight: 800; border-radius: 999px; padding: 1px 7px;
  text-transform: uppercase; letter-spacing: .3px;
}
.surah-off-badge.partial { background: #fdf0d5; color: #8a6d1a; }

/* --- Bookmark per ayat --- */
.ayah-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ayah-top .ayah-num { float: none; margin-left: 0; }
.ayah-bookmark {
  background: none; border: none; font-size: 22px; cursor: pointer; line-height: 1;
  padding: 2px 6px; border-radius: 10px; transition: transform .15s, background .2s;
  color: #c9a227;
}
.ayah-bookmark:hover { transform: scale(1.2); background: var(--emerald-50); }
.ayah-bookmark.active { animation: popStar .3s ease; }
@keyframes popStar { 0% { transform: scale(.5); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

.ayah-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ayah-partial-tag {
  font-size: 10.5px; color: #8a6d1a; background: #fdf0d5;
  border-radius: 999px; padding: 2px 9px; font-weight: 700;
}

/* --- Lazy load --- */
.lazy-load-wrap {
  margin-top: 4px; padding: 14px; background: var(--emerald-50);
  border: 2px dashed var(--emerald-200, #b8e6d6); border-radius: 14px; text-align: center;
}
.lazy-load-wrap .btn { margin-top: 0; }
.lazy-hint { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* --- Favorit --- */
.fav-card { cursor: pointer; }
.fav-card:hover { border-left-color: var(--gold); }
.fav-remove {
  background: none; border: none; cursor: pointer; font-size: 16px;
  padding: 2px 6px; border-radius: 8px; transition: background .2s;
}
.fav-remove:hover { background: #fde8e8; }
.fav-hint { font-size: 13px; color: var(--ink-soft); font-style: italic; }
/* Font Arab favorit konsisten dengan kartu lain */
#favList .card-arab { font-size: 26px; line-height: 2; direction: rtl; }
#favList .card-trans { font-size: 14px; line-height: 1.6; }

/* --- Donasi view --- */
.donasi-wrap { text-align: center; }
.donasi-card {
  background: linear-gradient(160deg, var(--white), #fdf8ec);
  border-radius: 20px; padding: 20px 18px; box-shadow: var(--shadow-lg);
  border: 2px solid var(--gold-light); max-width: 460px; margin: 0 auto;
}
.donasi-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; text-align: left; }
.donasi-logo {
  font-size: 38px; width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: #fdf0d5; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(212,175,55,.35);
}
.donasi-head h3 { font-size: 17px; color: var(--emerald-900); }
.donasi-head p { font-size: 12.5px; color: var(--ink-soft); }
.donasi-account {
  background: var(--white); border-radius: 14px; padding: 16px;
  border: 2px dashed var(--gold); box-shadow: var(--shadow);
}
.account-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.account-number {
  font-size: 30px; font-weight: 800; color: var(--emerald-900); letter-spacing: 2px;
  margin: 6px 0 10px; font-variant-numeric: tabular-nums;
}
.donasi-account .btn { background: var(--gold); color: #3d2f00; }
.donasi-account .btn:hover { background: var(--gold-light); }
.donasi-steps { text-align: left; margin: 16px 0 10px; }
.donasi-steps h4 { font-size: 13.5px; color: var(--emerald-900); margin-bottom: 6px; }
.donasi-steps ol { padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.donasi-steps li { font-size: 13px; color: var(--ink-soft); }
.donasi-note { font-size: 11.5px; color: #8a6d1a; background: #fdf0d5; border-radius: 10px; padding: 8px 12px; }

/* --- Bottom nav: 6 item lebih rapat --- */
.bottom-nav .nav-item { padding: 6px 0; }
.bottom-nav .nav-label { white-space: nowrap; }
/* --- App footer (link dashboard) --- */
.app-footer {
  text-align: center;
  padding: 14px 16px 90px; /* ruang untuk bottom nav */
  margin-bottom: 4.5rem;  /* v14: ruang ekstra agar nav sticky tidak menutupi footer */
  font-size: 12px;
  color: var(--ink-soft, #64748b);
}.footer-link { color: var(--emerald, #067a5f); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

/* ============================================================
   v5: Game Edukasi (Kuis Cerdas) - ramah anak, emerald + emas
   ============================================================ */

.game-hero { margin-bottom: 14px; }
.game-hero h2 { font-size: 22px; font-weight: 800; color: var(--emerald-900); }
.game-hero p { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

.game-levels { display: grid; gap: 12px; }
.game-level-card {
  display: grid; grid-template-columns: 44px 1fr; grid-template-areas:
    "ikon nama" "ikon desc" "ikon best";
  gap: 2px 12px; align-items: center; text-align: left;
  background: var(--white); border: 2px solid var(--emerald-100);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  font-family: inherit;
}
.game-level-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); }
.gl-ikon { grid-area: ikon; font-size: 34px; }
.gl-nama { grid-area: nama; font-size: 17px; font-weight: 800; color: var(--emerald-900); }
.gl-desc { grid-area: desc; font-size: 12px; color: var(--ink-soft); }
.gl-best { grid-area: best; font-size: 12px; font-weight: 700; color: var(--gold); }

.game-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-cat-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  background: var(--white); border: 2px solid var(--emerald-100);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: transform .18s, border-color .18s; font-family: inherit;
}
.game-cat-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.gc-ikon { font-size: 26px; }
.gc-nama { font-size: 14.5px; font-weight: 800; color: var(--emerald-900); }
.gc-count { font-size: 11.5px; color: var(--ink-soft); }

.btn-ghost {
  background: none; border: 1.5px solid var(--emerald-200, #b5e4d5);
  color: var(--emerald-800); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 10px;
}

.quiz-meta { display: flex; gap: 8px; margin: 8px 0 6px; }
.quiz-level, .quiz-cat {
  background: var(--emerald-100); color: var(--emerald-900);
  font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
}
.quiz-cat { background: var(--gold-light); color: #3d2f00; }

.quiz-progress { height: 8px; background: var(--emerald-100); border-radius: 999px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--emerald-600), var(--gold)); border-radius: 999px; transition: width .35s; }
.quiz-score-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.quiz-score { color: var(--gold); }

.quiz-timer {
  position: relative; height: 34px; background: var(--emerald-100);
  border-radius: 999px; overflow: hidden; margin: 4px 0 12px;
}
.quiz-timer-fill {
  height: 100%; background: var(--emerald-600); width: 100%;
  transition: width 1s linear; border-radius: 999px;
}
.quiz-timer-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--emerald-900);
}

.quiz-card {
  background: var(--white); border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow); border: 2px solid var(--emerald-100);
}
.quiz-q { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 14px; line-height: 1.5; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--emerald-50); border: 2px solid transparent; border-radius: 14px;
  padding: 12px 14px; cursor: pointer; font-size: 14.5px; font-weight: 600;
  color: var(--ink); transition: border-color .15s, background .15s; font-family: inherit;
}
.quiz-opt:hover { border-color: var(--emerald-600); }
.qo-letter {
  width: 30px; height: 30px; border-radius: 50%; background: var(--white);
  border: 2px solid var(--emerald-600); color: var(--emerald-800);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.quiz-opt.correct { background: #dcfce7; border-color: #16a34a; animation: popIn .3s; }
.quiz-opt.correct .qo-letter { background: #16a34a; color: #fff; border-color: #16a34a; }
.quiz-opt.wrong { background: #fee2e2; border-color: #dc2626; animation: shakeX .35s; }
.quiz-opt.wrong .qo-letter { background: #dc2626; color: #fff; border-color: #dc2626; }
.quiz-opt.reveal-correct { background: #dcfce7; border-color: #16a34a; }
.quiz-opt.reveal-correct .qo-letter { background: #16a34a; color: #fff; border-color: #16a34a; }

.quiz-card.pulse-good { animation: popIn .45s; }
.quiz-card.shake-bad { animation: shakeX .4s; }

@keyframes popIn { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* --- Layar hasil --- */
.game-result {
  text-align: center; background: var(--white); border-radius: 22px;
  padding: 26px 18px 110px; box-shadow: var(--shadow-lg); border: 2px solid var(--emerald-100);
}
.result-badge { font-size: 64px; animation: bounceIn .6s; }
.result-score {
  font-size: 56px; font-weight: 900; color: var(--emerald-800); line-height: 1.1;
  margin: 6px 0;
}
.result-msg { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 10px; }
.result-stars { font-size: 26px; letter-spacing: 4px; margin-bottom: 16px; }
.result-stats { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.rs-item {
  background: var(--emerald-50); border-radius: 14px; padding: 10px 16px; min-width: 72px;
}
.rs-num { display: block; font-size: 20px; font-weight: 900; color: var(--emerald-900); }
.rs-lab { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@keyframes bounceIn {
  0% { transform: scale(0); } 55% { transform: scale(1.25); } 75% { transform: scale(.95); } 100% { transform: scale(1); }
}

/* ============================================================
   v6: Masjid Terdekat (GPS) + Modal Nama + Donasi Saweria
   ============================================================ */

/* --- User greeting di header --- */
.user-greeting {
  font-size: 12px;
  color: var(--gold-light);
  font-weight: 600;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Modal kecil (nama user) --- */
.modal-small { max-width: 420px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.form-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--emerald-200); color: var(--emerald-800);
  font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; font-size: 14px;
}
.btn-ghost:hover { background: var(--emerald-50); }

/* --- View Akun / Profil (login & register) --- */
.akun-wrap { padding: 6px 0 24px; }
#view-akun { padding-bottom: 110px; }
.akun-card {
  background: var(--white); border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--emerald-50);
  margin-top: 14px;
}
.akun-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--emerald-700);
  color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.akun-username { text-align: center; font-size: 19px; font-weight: 900; color: var(--emerald-900); margin: 0; }
.akun-role { text-align: center; font-size: 12.5px; color: var(--gold, #b8860b); font-weight: 700; margin: 2px 0 14px; }
.akun-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; padding: 9px 2px; border-bottom: 1px dashed var(--emerald-100);
}
.akun-detail-row span:first-child { color: var(--ink-soft); }
.akun-detail-row span:last-child { font-weight: 700; color: var(--emerald-900); }
.akun-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.akun-tab {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--emerald-200);
  background: var(--white); color: var(--emerald-800); font-weight: 700; font-size: 14px; cursor: pointer;
}
.akun-tab.active { background: var(--emerald-700); color: #fff; border-color: var(--emerald-700); }
.akun-form { display: none; flex-direction: column; gap: 12px; }
.akun-form.active { display: flex; }
.akun-error { font-size: 12.5px; color: #dc2626; font-weight: 600; margin: 0; }
.akun-note { font-size: 12px; color: var(--ink-soft); margin-top: 12px; text-align: center; }
.btn-danger {
  background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca;
  font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; font-size: 14px;
}
.btn-danger:hover { background: #fecaca; }
.btn-secondary {
  background: var(--white); color: var(--emerald-800); border: 1px solid var(--emerald-300);
  font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; font-size: 14px;
}
.btn-secondary:hover { background: var(--emerald-50); }

/* --- View Masjid --- */
.masjid-wrap { padding: 6px 0 24px; }
#view-masjid { padding-bottom: 110px; }
.masjid-actions { margin: 12px 0; display: flex; justify-content: center; }
.masjid-status {
  text-align: center; font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px;
  background: var(--emerald-50); border-radius: 12px; padding: 10px;
}
.masjid-loading { color: var(--emerald-800); font-weight: 600; }
.masjid-list { display: flex; flex-direction: column; gap: 10px; }
.masjid-card {
  display: flex; gap: 12px; background: var(--white); border-radius: 14px;
  padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--emerald-50);
}
.masjid-rank {
  width: 32px; height: 32px; border-radius: 50%; background: var(--emerald-700); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  flex-shrink: 0;
}
.masjid-info { flex: 1; min-width: 0; }
.masjid-name { font-weight: 800; color: var(--emerald-900); font-size: 15px; }
.masjid-addr { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.masjid-dist { font-size: 12px; color: var(--gold, #b8860b); font-weight: 700; margin-top: 4px; }
.masjid-nav {
  display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700;
  color: var(--emerald-700); text-decoration: none;
}
.masjid-nav:hover { text-decoration: underline; }

/* --- Donasi Saweria --- */
.saweria-card { border-color: var(--emerald-300); background: linear-gradient(160deg, var(--white), #f0faf6); }
.saweria-link {
  display: block; font-size: 17px; font-weight: 800; color: var(--emerald-800);
  text-decoration: none; margin: 8px 0 12px; word-break: break-all;
}
.saweria-link:hover { text-decoration: underline; }

/* ============================================================
   v10: Grid Menu — 3 ikon utama + tombol Semua Menu (overlay)
   ============================================================ */
.chip-menu-btn { padding: 5px 12px; }
.menu-burger { font-size: 17px; line-height: 1; }

.bottom-nav .nav-more-btn { color: var(--emerald-800); }
.bottom-nav .nav-more-btn .nav-ico { filter: none; }

/* Overlay grid menu (sheet dari bawah, mirip bottom sheet) */
.menu-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 40, 31, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
  animation: fadeUp .2s ease;
}
.menu-overlay.hidden { display: none; }
.menu-sheet {
  width: 100%; max-width: 560px;
  background: var(--paper, #f6fbf9);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(4, 78, 60, .25);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 78dvh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.menu-sheet-head h2 { font-size: 17px; font-weight: 800; color: var(--emerald-900, #064e3b); }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px 8px;
}
.menu-grid-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--white, #fff);
  border: 1px solid var(--emerald-100, #d1fae5);
  border-radius: 16px;
  padding: 14px 6px 10px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  font-family: inherit; text-align: center;
}
.menu-grid-item:hover, .menu-grid-item:active {
  transform: translateY(-2px);
  border-color: var(--emerald-600, #059669);
  box-shadow: 0 6px 16px rgba(4, 120, 87, .15);
}
.menu-grid-item .mg-ico { font-size: 26px; line-height: 1; }
.menu-grid-item .mg-label { font-size: 11.5px; font-weight: 700; color: var(--ink-soft, #475569); }
.menu-grid-item .mg-url { font-size: 10px; color: #94a3b8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-grid-divider {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: var(--ink-soft, #64748b);
  margin: 6px 0 0;
}
.menu-grid-divider::before, .menu-grid-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--emerald-100, #d1fae5);
}
.menu-grid-note { font-size: 11px; color: #94a3b8; text-align: center; margin: 10px 0 0; }

@media (min-width: 560px) {
  .menu-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 768px) {
  .menu-overlay { align-items: center; padding: 24px; }
  .menu-sheet { border-radius: 22px; max-height: 84dvh; }
  .menu-grid { grid-template-columns: repeat(6, 1fr); }
}
/* ============================================================
   v11: Home/Landing, i18n lang picker, doa tabs (dzikir),
        kiblat di view masjid, RTL
   ============================================================ */

/* ---------- Lang picker (ID/EN/AR) ---------- */
.chip-lang-btn { min-width: 40px; }
.lang-badge {
  font-size: 12px; font-weight: 800; color: #fff; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 8px;
}
.lang-picker {
  position: fixed; top: 58px; right: 12px; z-index: 130; min-width: 210px;
  background: #fff; border: 1px solid var(--emerald-100, #d1fae5); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(4,78,60,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.lang-picker.hidden { display: none; }
.lang-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: none; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft, #334155); font-family: inherit;
}
.lang-option:hover { background: var(--emerald-50, #ecfdf5); color: var(--emerald-800, #065f46); }

/* ---------- Home / Landing ---------- */
#view-home { padding: 8px 0 16px; }
.home-hero {
  text-align: center; padding: 26px 16px 18px; margin-bottom: 10px;
  background: linear-gradient(160deg, var(--emerald-700, #047857), var(--emerald-900, #064e3b));
  border-radius: 20px; color: #fff;
}
.home-hero-icon { font-size: 44px; }
.home-hero-title { font-size: 24px; font-weight: 800; margin: 6px 0 2px; }
.home-hero-sub { font-size: 13px; opacity: .92; }
.home-widget-head {
  display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 8px;
}
.home-widget-title { font-size: 15px; font-weight: 800; color: var(--emerald-900, #064e3b); }
.home-more-btn {
  border: none; background: var(--emerald-50, #ecfdf5); color: var(--emerald-800, #065f46);
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.home-widget {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: #fff; border: 1px solid var(--emerald-50, #d1fae5); border-radius: 18px; padding: 12px;
}
.home-menu-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--emerald-50, #ecfdf5); border: none; border-radius: 14px; padding: 12px 6px;
  cursor: pointer; transition: transform .15s, background .2s; font-family: inherit;
}
.home-menu-card:hover, .home-menu-card:active { transform: translateY(-2px); background: #d1fae5; }
.home-menu-card .hm-ico { font-size: 24px; line-height: 1; }
.home-menu-card .hm-label { font-size: 10.5px; font-weight: 700; color: var(--ink-soft, #334155); text-align: center; }
.home-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.home-quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--emerald-50, #d1fae5); border-radius: 14px; padding: 12px 6px;
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-soft, #334155); font-family: inherit;
}
.home-quick-card .hq-ico { font-size: 22px; }
.home-hint { text-align: center; font-size: 11.5px; color: #94a3b8; margin: 14px 0 4px; }

/* ---------- Doa tabs (harian / dzikir pagi / sore) ---------- */
.doa-tabs {
  display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap;
}
.doa-tab {
  flex: 1; min-width: 90px; border: 1px solid var(--emerald-100, #d1fae5); background: #fff;
  color: var(--ink-soft, #334155); border-radius: 12px; padding: 9px 8px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.doa-tab.active { background: var(--emerald-700, #047857); color: #fff; border-color: var(--emerald-700, #047857); }
.dzikir-head {
  display: flex; align-items: center; gap: 8px; background: var(--emerald-50, #ecfdf5);
  border: 1px solid var(--emerald-100, #d1fae5); border-radius: 14px; padding: 10px 12px;
  font-size: 12.5px; color: var(--emerald-900, #064e3b); margin-bottom: 10px;
}
.dzikir-head .big { font-size: 22px; }
.dzikir-card .card-latin { font-size: 13.5px; }

/* ---------- Kiblat di view masjid ---------- */
.kiblat-card {
  background: #fff; border: 1px solid var(--emerald-50, #d1fae5); border-radius: 18px;
  padding: 16px 14px; margin-bottom: 16px; text-align: center;
}
.compass {
  position: relative; width: 180px; height: 180px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #f0fdf4, #d1fae5);
  border: 2px solid var(--emerald-200, #a7f3d0);
}
.compass-ring { position: absolute; inset: 0; border-radius: 50%; }
.compass-ring .deg { position: absolute; font-size: 15px; font-weight: 800; color: var(--emerald-800, #065f46); }
.compass-ring .n { top: 6px; left: 50%; transform: translateX(-50%); color: #dc2626; }
.compass-ring .e { right: 8px; top: 50%; transform: translateY(-50%); }
.compass-ring .s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.compass-ring .w { left: 8px; top: 50%; transform: translateY(-50%); }
.compass-needle {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(0deg);
  font-size: 18px; transition: none; z-index: 3;
}
.kiblat-arrow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(0deg);
  font-size: 26px; z-index: 4; transition: none;
}
.kiblat-readout { font-size: 34px; font-weight: 800; color: var(--emerald-900, #064e3b); margin-top: 12px; }
.kiblat-location { font-size: 12.5px; color: var(--ink-soft, #334155); margin-top: 2px; }
.kiblat-direction { font-size: 13px; font-weight: 700; color: var(--emerald-800, #065f46); margin-top: 4px; }
.kiblat-distance { font-size: 12.5px; color: var(--ink-soft, #334155); }
.kiblat-status { font-size: 12.5px; color: var(--ink-soft, #334155); margin: 6px 0; min-height: 18px; }
.kiblat-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.kiblat-manual { margin-top: 12px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.kiblat-manual.hidden { display: none; }

/* ---------- RTL ---------- */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .lang-picker { right: auto; left: 12px; }
html[dir="rtl"] .lang-option { text-align: right; }
html[dir="rtl"] .header-inner { direction: rtl; }
html[dir="rtl"] .surah-card, html[dir="rtl"] .card, html[dir="rtl"] .ayah-block { direction: rtl; }

/* ============================================================
   v12: Responsive mobile — semua browser (Chrome, Safari,
   Samsung Internet, UC, dll) + fallback browser lama
   ============================================================ */
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { overflow-x: hidden; max-width: 100%; }
img, video, canvas, iframe { max-width: 100%; height: auto; }
button, input, select, textarea { font-size: 16px; } /* cegah iOS zoom */
@media (min-width: 561px) {
  button, input, select, textarea { font-size: 14px; }
}
/* Fallback untuk browser lama yang belum dukung flexbox gap */
@supports not (gap: 8px) {
  .home-widget { margin: -6px; }
  .home-widget > * { margin: 6px; }
}

/* ============================================================
   v12: Banner carousel (halaman utama)
   ============================================================ */
.banner-carousel {
  position: relative; width: 100%; max-width: 100%;
  border-radius: var(--radius, 16px); overflow: hidden;
  margin: 4px 0 14px; box-shadow: var(--shadow, 0 4px 18px rgba(4,78,60,.1));
}
.banner-track { position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 120px; }
.banner-slide {
  position: absolute; inset: 0; display: none; align-items: flex-end;
  background-size: cover; background-position: center;
  padding: clamp(14px, 4vw, 28px); color: #fff;
}
.banner-slide.active { display: flex; animation: bannerFade .5s ease; }
@keyframes bannerFade { from { opacity: .4; } to { opacity: 1; } }
.banner-content { max-width: 92%; }
.banner-title { font-size: clamp(15px, 4vw, 22px); font-weight: 800; line-height: 1.25; }
.banner-desc { font-size: clamp(12px, 3vw, 14px); opacity: .94; margin: 4px 0 8px; max-width: 90%; }
.banner-cta {
  display: inline-block; background: var(--gold, #d4af37); color: #1f2937;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-decoration: none;
}
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.35); color: #fff; border: 0; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; font-size: 15px; line-height: 1;
  z-index: 3; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.banner-prev { left: 8px; } .banner-next { right: 8px; }
.banner-dots {
  position: absolute; bottom: 8px; left: 0; right: 0; display: flex;
  justify-content: center; gap: 6px; z-index: 3; flex-wrap: wrap;
}
.banner-dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.5); padding: 0;
}
.banner-dot.active { background: var(--gold, #d4af37); transform: scale(1.25); }

/* ============================================================
   v12: Informasi & berita (home) + detail
   ============================================================ */
.info-section-head { margin: 10px 0 8px; }
.home-info-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.info-card {
  display: block; width: 100%; text-align: left; background: var(--white, #fff);
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit; color: inherit;
}
.info-card:active { transform: scale(.985); }
.info-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.info-cat {
  background: var(--emerald-100, #d3f3e8); color: var(--emerald-800, #067a5f);
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  text-transform: capitalize;
}
.info-date { font-size: 11.5px; color: #94a3b8; }
.info-title { font-size: 14.5px; font-weight: 700; color: var(--ink, #1f2937); margin: 6px 0 4px; line-height: 1.35; }
.info-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #64748b; }
.info-likes { color: #0f766e; font-weight: 600; }
.info-open { margin-left: auto; font-size: 15px; color: #94a3b8; }

/* Detail informasi */
.info-detail-wrap { padding: 4px 0 20px; }
.info-detail-card {
  background: var(--white, #fff); border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 18px; margin-top: 10px;
}
.info-detail-title { font-size: 19px; font-weight: 800; color: var(--ink, #1f2937); margin: 8px 0 4px; line-height: 1.35; }
.info-detail-date { font-size: 12.5px; color: #94a3b8; margin-bottom: 10px; }
.info-detail-content {
  font-size: 15px; line-height: 1.7; color: #334155; white-space: pre-wrap;
  word-break: break-word;
}
.info-detail-actions { margin-top: 16px; }
.btn.liked { background: var(--gold, #d4af37); color: #1f2937; }

/* ============ Notifikasi (v13) ============ */
.chip-notif-btn .notif-ico {
  font-size: 1.15rem;
  line-height: 1;
}
/* ============ Filter kategori info + pagination (v13) ============ */
.info-filter-row {
  margin: 0.35rem 0 0.75rem;
  gap: 0.4rem;
}
.info-filter-row .filter-chip {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 0.25rem;
}
.page-btn {
  border: 1px solid #cde3da;
  background: #fff;
  color: #067a5f;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.page-btn:hover:not(:disabled) { background: #e7f5ef; }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.page-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0e5c46;
  min-width: 3.5rem;
  text-align: center;
}
/* ============ Widget banner sidebar (v13) ============ */
.sidebar-widget {
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sidebar-widget.hidden { display: none; }
.sb-banner {
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  min-height: 92px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(4, 60, 44, 0.18);
}
.sb-banner-content {
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, rgba(3, 40, 30, 0.88), rgba(3, 40, 30, 0.55));
  color: #fff;
  height: 100%;
}
.sb-title { margin: 0 0 0.2rem; font-size: 0.95rem; }
.sb-desc { margin: 0 0 0.3rem; font-size: 0.78rem; opacity: 0.9; }
.sb-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #b9f3dd;
  text-decoration: underline;
}

/* ============================================================
   v14: Header & Bottom-nav Compact, Modern, Minimalis
   - tombol/ikon lebih kecil (rem), rounded, subtle shadow,
     gradient accent, spacing rapi, unit relatif, tanpa overflow
   ============================================================ */
.app-header {
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
}
.header-inner { gap: 0.5rem; }
.brand { gap: 0.5rem; }
.brand-icon { font-size: 1.55rem; }
.brand-text h1 { font-size: 1.05rem; }
.brand-text p { font-size: 0.66rem; }
.header-actions { gap: 0.375rem; flex-wrap: nowrap; }

.chip-toggle {
  gap: 0.25rem;
  border-radius: 0.7rem;
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
  transition: background .2s, transform .1s;
  min-height: 2.1rem;
}
.chip-toggle:hover, .chip-toggle:active { background: rgba(255,255,255,.24); }
.toggle-ico { font-size: 0.92rem; }
.toggle-switch { width: 1.75rem; height: 1rem; }
.toggle-switch .knob { width: 0.75rem; height: 0.75rem; }
.toggle-switch.on .knob { left: 0.88rem; }
.chip-menu-btn { padding: 0.32rem 0.6rem; }
.menu-burger { font-size: 0.95rem; }
.chip-lang-btn { min-width: 2.25rem; padding: 0.32rem 0.45rem; }
.lang-badge { font-size: 0.68rem; padding: 0.12rem 0.45rem; }
.chip-notif-btn .notif-ico { font-size: 0.95rem; }
.chip-toggle:active { transform: scale(.94); }

.bottom-nav {
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -3px 14px rgba(4,78,60,.10);
  border-top: 1px solid var(--emerald-50);
  gap: 0.125rem;
}
.nav-item {
  gap: 0.125rem;
  padding: 0.3rem 0.125rem;
  font-size: 0.6rem;
  border-radius: 0.85rem;
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1.4rem; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald-600), var(--gold));
}
.nav-ico { font-size: 1.15rem; }
.nav-item.active .nav-ico { transform: translateY(-1px) scale(1.08); }
.bottom-nav .nav-item { padding: 0.3rem 0; }
.bottom-nav .nav-label { white-space: nowrap; }

/* --- Lang picker menyesuaikan header compact --- */
.lang-picker { top: 3.4rem; right: 0.5rem; }
.lang-option { padding: 0.55rem 0.7rem; font-size: 0.8rem; }

/* --- Responsive: layar sangat sempit (320px) --- */
@media (max-width: 360px) {
  .brand-text p { display: none; }
  .toggle-switch { display: none; }
  .chip-toggle { padding: 0.32rem 0.5rem; }
  .header-actions { gap: 0.3rem; }
}

/* --- Bottom nav tidak menutupi konten (ruang aman ekstra) --- */
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
#view-home { padding-bottom: 2.25rem; }
.app-footer { padding-bottom: 96px; }
@media (min-width: 768px) {
  body { padding-bottom: 24px; }
  #view-home { padding-bottom: 1rem; }
  .app-footer { padding-bottom: 14px; margin-bottom: 1rem; }
}

@media (min-width: 768px) {
  .chip-toggle { border-radius: 999px; }
  .nav-item { font-size: 0.65rem; }
}
/* ============================================================
   v16: Tab filter tempat (Masjid / Pesantren / Warung)
   ============================================================ */
.place-tabs {
  display: flex; gap: 8px; margin: 12px 0 10px; flex-wrap: wrap;
}
.place-tab {
  flex: 1; min-width: 90px;
  background: var(--white); border: 2px solid var(--emerald-100);
  color: var(--ink-soft); border-radius: 999px; padding: 8px 12px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  transition: all .18s; font-family: inherit;
}
.place-tab.active {
  background: linear-gradient(135deg, var(--emerald-600), #064a38);
  color: #fff; border-color: transparent; box-shadow: var(--shadow);
}
.place-tab:hover { border-color: var(--gold); }
@media (max-width: 360px) {
  .place-tab { font-size: 12px; padding: 7px 8px; min-width: 72px; }
}

/* ============================================================
   v16: Game - daftar kategori per kelas & penjelasan jawaban
   ============================================================ */
.game-cats { grid-template-columns: 1fr 1fr; }
@media (max-width: 360px) {
  .game-cats { grid-template-columns: 1fr; }
}
.quiz-explanation {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--emerald-50); border: 1.5px solid var(--emerald-200);
  color: var(--emerald-900); font-size: 13px; font-weight: 600;
  animation: fadeInUp .25s ease;
}
[data-theme="dark"] .quiz-explanation {
  background: rgba(16, 163, 127, .12); border-color: rgba(16, 163, 127, .35); color: #9fe8cf;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   v17: Leaderboard (Papan Skor) & Simpan Skor
   ============================================================ */
#view-game { padding-bottom: 130px; }
.game-hero-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.game-hero-actions .btn { padding: 8px 14px; font-size: 13px; border-radius: 12px; }

.lb-panel {
  background: var(--white); border: 1.5px solid var(--emerald-100);
  border-radius: 16px; padding: 14px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.06));
  animation: fadeInUp .25s ease;
}
[data-theme="dark"] .lb-panel { background: var(--emerald-950, #0a231c); border-color: rgba(16,163,127,.25); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lb-head h3 { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0; }
.lb-note { font-size: 11.5px; color: var(--ink-soft); }
.offline-note {
  font-size: 11px; font-weight: 700; color: #b7791f; background: #fef3c7;
  padding: 3px 9px; border-radius: 99px;
}
[data-theme="dark"] .offline-note { background: rgba(212,175,55,.15); color: #f3d679; }
.lb-table { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--emerald-50, #f0faf6); border-radius: 12px; font-size: 13px;
}
[data-theme="dark"] .lb-row { background: rgba(16,163,127,.1); }
.lb-row.lb-top { background: linear-gradient(90deg, rgba(212,175,55,.14), rgba(212,175,55,.04)); border: 1px solid rgba(212,175,55,.35); }
.lb-rank { min-width: 26px; font-weight: 800; font-size: 14px; }
.lb-name { flex: 1; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; color: var(--emerald-900, #065f46); white-space: nowrap; }
[data-theme="dark"] .lb-score { color: #5eead4; }
.lb-score small { font-weight: 600; font-size: 10.5px; color: var(--ink-soft); }
.lb-meta { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.lb-close { margin-top: 12px; width: 100%; }

.score-save {
  margin: 14px 0 4px; padding: 12px; border-radius: 14px;
  background: var(--emerald-50, #f0faf6); border: 1.5px dashed var(--emerald-300, #6ee7b7);
}
[data-theme="dark"] .score-save { background: rgba(16,163,127,.08); border-color: rgba(16,163,127,.4); }
.score-save h3 { font-size: 13.5px; font-weight: 800; color: var(--emerald-900, #065f46); margin: 0 0 8px; }
[data-theme="dark"] .score-save h3 { color: #6ee7b7; }
.score-save-row { display: flex; gap: 8px; }
.score-save-row input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white);
  color: var(--ink); font-size: 14px; outline: none;
}
.score-save-row input:focus { border-color: var(--emerald-500); }
.score-save-msg { font-size: 12.5px; font-weight: 600; color: var(--emerald-900, #065f46); margin: 8px 0 0; min-height: 16px; }
[data-theme="dark"] .score-save-msg { color: #99f6e4; }
.score-save.saved .score-save-row { display: none; }

/* ============ Papan Skor per game + filter kategori (v18) ============ */
.lb-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.lb-tab {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--emerald-50, #f0faf6); color: var(--emerald-800, #065f46);
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; transition: all .2s;
}
[data-theme="dark"] .lb-tab { background: rgba(16,163,127,.12); color: #6ee7b7; }
.lb-tab.active { background: var(--emerald-600, #059669); color: #fff; border-color: var(--emerald-700, #047857); }
[data-theme="dark"] .lb-tab.active { background: #0d9488; color: #fff; }
.lb-cat-row { margin-bottom: 10px; }
.lb-cat-select {
  width: 100%; padding: 8px 12px; border-radius: 12px; font-size: 13px;
  border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white); color: var(--ink); outline: none;
}
[data-theme="dark"] .lb-cat-select { background: #0a231c; color: #e7f7f0; border-color: rgba(16,163,127,.4); }

/* ============ Duel 1v1 (v18) ============ */
.duel-menu { display: grid; gap: 10px; }
.duel-card {
  background: var(--white); border: 1.5px solid var(--emerald-100); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.06));
}
[data-theme="dark"] .duel-card { background: var(--emerald-950, #0a231c); border-color: rgba(16,163,127,.25); }
.duel-card h3 { font-size: 14px; font-weight: 800; color: var(--ink); margin: 0 0 2px; }
.duel-desc { font-size: 12px; color: var(--ink-soft); margin: 0 0 8px; }
.duel-select, .duel-input {
  width: 100%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; margin-bottom: 6px;
  border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white); color: var(--ink); outline: none;
}
[data-theme="dark"] .duel-select, [data-theme="dark"] .duel-input { background: #0a231c; color: #e7f7f0; border-color: rgba(16,163,127,.4); }
.duel-code-input { text-transform: uppercase; letter-spacing: 2px; font-weight: 800; text-align: center; }
.duel-msg { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--emerald-800, #065f46); text-align: center; min-height: 18px; }
[data-theme="dark"] .duel-msg { color: #6ee7b7; }
.duel-code-big { font-size: 24px; font-weight: 900; letter-spacing: 3px; color: var(--emerald-600, #059669); }
[data-theme="dark"] .duel-code-big { color: #5eead4; }
.duel-waiting { text-align: center; padding: 20px 16px; }
.duel-pulse { font-size: 30px; animation: duelPulse 1.2s ease-in-out infinite; margin-bottom: 6px; }
@keyframes duelPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: .7; } }
/* Hero duel kompak agar muat viewport kecil (tanpa tertutup bottom-nav) */
.duel-hero h2 { font-size: 18px; margin: 2px 0; }
.duel-hero p { font-size: 12px; margin: 0 0 6px; }
@media (min-width: 480px) {
  .duel-menu { grid-template-columns: 1fr 1fr; align-items: start; }
}
.duel-vs-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--emerald-50, #f0faf6); font-size: 12.5px; font-weight: 700; }
[data-theme="dark"] .duel-vs-row { background: rgba(16,163,127,.1); }
.duel-vs-me { color: var(--emerald-900, #065f46); }
[data-theme="dark"] .duel-vs-me { color: #5eead4; }
.duel-vs-opp { color: var(--ink-soft); }
.duel-vs-sub { margin-top: -6px; padding-top: 4px; padding-bottom: 4px; font-size: 11.5px; opacity: .85; }
.duel-final-scores { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 16px 0; }
.dfs-item { text-align: center; background: var(--emerald-50, #f0faf6); border-radius: 14px; padding: 12px 20px; min-width: 96px; }
[data-theme="dark"] .dfs-item { background: rgba(16,163,127,.1); }
.dfs-name { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.dfs-score { font-size: 28px; font-weight: 900; color: var(--emerald-700, #047857); }
[data-theme="dark"] .dfs-score { color: #5eead4; }
.dfs-vs { font-size: 15px; font-weight: 900; color: var(--gold, #d4af37); }

/* ============ Pencarian & filter jarak tempat (v18) ============ */
.place-search-row { display: flex; gap: 8px; margin: 10px 0; }
.place-search-row .search-input { flex: 1; min-width: 0; margin: 0; }

/* ============ Chat Duel real-time (v19) ============ */
.duel-chat { margin-top: 12px; border-radius: 14px; border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white); overflow: hidden; display: flex; flex-direction: column; }
[data-theme="dark"] .duel-chat { background: #0a231c; border-color: rgba(16,163,127,.4); }
.duel-chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: var(--emerald-50, #f0faf6); font-size: 12.5px; font-weight: 800; color: var(--emerald-900, #065f46); }
[data-theme="dark"] .duel-chat-head { background: rgba(16,163,127,.12); color: #5eead4; }
.duel-chat-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.duel-chat-status.online { background: rgba(5,150,105,.15); color: #059669; }
.duel-chat-status.offline { background: rgba(100,116,139,.15); color: #64748b; }
.duel-chat-status.connecting { background: rgba(217,119,6,.15); color: #d97706; }
.duel-chat-msgs { height: 140px; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--white); }
[data-theme="dark"] .duel-chat-msgs { background: #0a231c; }
.duel-chat-system { font-size: 11px; color: var(--ink-soft); text-align: center; font-style: italic; padding: 2px 0; }
.duel-chat-msg { align-self: flex-start; max-width: 82%; background: var(--emerald-50, #f0faf6); border-radius: 12px 12px 12px 4px; padding: 6px 10px; font-size: 12.5px; line-height: 1.35; }
[data-theme="dark"] .duel-chat-msg { background: rgba(16,163,127,.12); }
.duel-chat-msg.me { align-self: flex-end; background: linear-gradient(135deg, #059669, #10b981); color: #fff; border-radius: 12px 12px 4px 12px; }
.duel-chat-msg .dc-name { display: block; font-size: 10.5px; font-weight: 800; color: var(--emerald-700, #047857); margin-bottom: 1px; }
.duel-chat-msg.me .dc-name { color: rgba(255,255,255,.85); }
.duel-chat-msg .dc-text { display: block; word-break: break-word; color: var(--ink); }
.duel-chat-msg.me .dc-text { color: #fff; }
.duel-chat-input-row { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--emerald-100, #d1fae5); }
[data-theme="dark"] .duel-chat-input-row { border-top-color: rgba(16,163,127,.25); }
.duel-chat-input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white); color: var(--ink); font-size: 13px; outline: none; }
[data-theme="dark"] .duel-chat-input { background: #0a231c; color: #e7f7f0; border-color: rgba(16,163,127,.4); }
.duel-chat-send { flex: 0 0 auto; border-radius: 999px !important; padding: 8px 14px !important; font-size: 14px !important; }
/* Emoticon cepat chat duel (v20) */
.duel-chat-emoji { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px 2px; border-top: 1px solid var(--emerald-100, #d1fae5); }
[data-theme="dark"] .duel-chat-emoji { border-top-color: rgba(16,163,127,.25); }
.duel-chat-em { flex: 0 0 auto; min-width: 34px; padding: 4px 6px; border: 1px solid var(--emerald-200, #a7f3d0); border-radius: 999px; background: var(--white); font-size: 15px; line-height: 1; cursor: pointer; transition: transform .15s ease, background .2s ease; }
[data-theme="dark"] .duel-chat-em { background: #0a231c; border-color: rgba(16,163,127,.4); }
.duel-chat-em:hover { transform: scale(1.15); background: var(--emerald-50, #f0faf6); }
[data-theme="dark"] .duel-chat-em:hover { background: rgba(16,163,127,.18); }
/* Tabel riwayat duel (v20) */
.dm-table .dm-row { flex-wrap: wrap; gap: 4px 8px; }
.dm-game { flex: 1 1 100%; font-size: 10.5px; font-weight: 800; color: var(--emerald-700, #047857); text-transform: uppercase; letter-spacing: .4px; }
[data-theme="dark"] .dm-game { color: #5eead4; }
.dm-fight { flex: 1 1 auto; font-size: 12.5px; color: var(--ink); }
.dm-fight b { color: var(--emerald-900, #065f46); }
[data-theme="dark"] .dm-fight b { color: #5eead4; }
.dm-winner { font-size: 11.5px; font-weight: 800; color: var(--emerald-700, #047857); }
[data-theme="dark"] .dm-winner { color: #6ee7b7; }
.search-input-select { flex: 0 0 auto; width: auto; max-width: 45%; padding: 9px 10px; border-radius: 12px; border: 1.5px solid var(--emerald-200, #a7f3d0); background: var(--white); color: var(--ink); font-size: 13px; outline: none; }
[data-theme="dark"] .search-input-select { background: #0a231c; color: #e7f7f0; border-color: rgba(16,163,127,.4); }
