/* =============================================================
   KHATAMAN BERJAMA'AH — STYLESHEET (v4 — Mushaf Reader)
   ============================================================= */

:root {
  --emerald-950: #052e16; --emerald-900: #14532d; --emerald-800: #166534;
  --emerald-700: #15803d; --emerald-600: #16a34a; --emerald-500: #22c55e;
  --emerald-200: #bbf7d0; --emerald-100: #dcfce7; --emerald-50:  #f0fdf4;
  --gold:        #d4a853;
  --amber-500:   #f59e0b; --amber-100:   #fef3c7; --amber-900:   #78350f;
  --sapphire-600: #2563eb; --sapphire-100: #dbeafe; --sapphire-900: #1e3a8a;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
  --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280;
  --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937; --gray-900: #111827;
  --white: #ffffff; --red-600: #dc2626; --orange-600: #ea580c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.22);
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 20px; --radius-pill: 999px;
  --font-ui:     'Plus Jakarta Sans', system-ui, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', Georgia, serif;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-ui); background: var(--emerald-50); color: var(--gray-800);
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font-ui); cursor: pointer; border: none; outline: none; }
button:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; }
.hidden { display: none !important; }

/* =============================================================
   LOGIN
   ============================================================= */
#login-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(22,163,74,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(20,83,45,0.35) 0%, transparent 60%),
    linear-gradient(160deg, #052e16 0%, #0f3d1e 40%, #14532d 100%);
  position: relative; overflow: hidden;
}
.login-bg-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(212,168,83,0.04) 0px, rgba(212,168,83,0.04) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(-45deg, rgba(212,168,83,0.04) 0px, rgba(212,168,83,0.04) 1px, transparent 1px, transparent 28px);
}
.login-box {
  background: rgba(255,255,255,0.97); backdrop-filter: blur(20px);
  border-radius: var(--radius-xl); padding: 36px 28px 28px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.6); text-align: center;
  animation: loginReveal 0.5s var(--ease-out) both;
}
@keyframes loginReveal { from{opacity:0;transform:translateY(24px) scale(0.97)} to{opacity:1;transform:translateY(0) scale(1)} }
.login-emblem { margin-bottom: 18px; }
.emblem-ring {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-600));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; box-shadow: 0 8px 24px rgba(22,101,52,0.35); position: relative;
}
.emblem-ring::before { content:''; position:absolute; inset:-4px; border-radius:50%; border:1.5px solid rgba(212,168,83,0.4); }
.emblem-icon { font-size: 34px; line-height: 1; }
.login-arabic { font-family: var(--font-arabic); font-size: 20px; color: var(--emerald-800); margin-bottom: 4px; direction: rtl; }
.login-title  { font-size: 21px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.02em; margin-bottom: 5px; }
.login-subtitle { font-size: 13px; color: var(--gray-500); margin-bottom: 24px; line-height: 1.5; }
.login-form-wrap { text-align: left; margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 7px; letter-spacing: 0.01em; }
.label-hint { display: block; font-size: 11px; font-weight: 400; color: var(--gray-400); margin-top: 2px; }
.name-input {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  font-family: var(--font-ui); font-size: 15px; color: var(--gray-900);
  background: var(--gray-50); outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.name-input:focus { border-color: var(--emerald-600); background: var(--white); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.name-input::placeholder { color: var(--gray-400); }
.room-input-wrap { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.room-input { flex: 1; margin-bottom: 0 !important; }
.random-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--emerald-50); border: 1.5px solid var(--emerald-200);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.random-btn:hover  { background: var(--emerald-100); }
.random-btn:active { transform: scale(0.88) rotate(30deg); }
.login-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--emerald-800) 0%, var(--emerald-600) 100%);
  color: var(--white); border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(22,101,52,0.30); transition: opacity 0.15s, transform 0.15s;
}
.login-btn:hover  { opacity: 0.92; }
.login-btn:active { transform: scale(0.98); }
.login-note { font-size: 11px; color: var(--gray-400); text-align: center; }

/* =============================================================
   APP SCREEN
   ============================================================= */
#app-screen { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.app-header {
  background-image:
    repeating-linear-gradient(45deg, rgba(212,168,83,0.05) 0px, rgba(212,168,83,0.05) 1px, transparent 1px, transparent 20px),
    linear-gradient(160deg, var(--emerald-950) 0%, var(--emerald-900) 50%, var(--emerald-800) 100%);
  color: var(--white); position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 0; }
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-icon  { font-size: 22px; line-height: 1; }
.header-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.room-badge-wrap { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; flex-wrap: nowrap; max-width: 180px; }
.room-badge-label { font-size: 9.5px; font-weight: 500; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; margin-top: 2px; }
.room-badge-code { font-size: 10.5px; font-weight: 700; background: rgba(212,168,83,0.25); color: var(--gold); border: 1px solid rgba(212,168,83,0.35); border-radius: var(--radius-sm); padding: 1px 7px; word-break: break-word; line-height: 1.4; }
.user-chip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15); color: var(--white); border-radius: var(--radius-pill); padding: 6px 10px 6px 8px; font-size: 12px; font-weight: 500; max-width: 130px; transition: background 0.2s; }
.user-chip:hover  { background: rgba(255,255,255,0.20); }
.user-chip:active { background: rgba(255,255,255,0.25); }
.user-chip-dot { width: 7px; height: 7px; background: var(--emerald-500); border-radius: 50%; flex-shrink: 0; animation: pulse-dot 2.5s infinite; }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 2px rgba(34,197,94,0.35)} 50%{box-shadow:0 0 0 4px rgba(34,197,94,0.12)} }
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.progress-section { padding: 12px 16px 14px; }
.progress-stats { display: flex; align-items: center; margin-bottom: 9px; }
.stat-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-number { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--white); }
.stat-number.stat-highlight { color: var(--gold); }
.stat-label { font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; }
.stat-divider { width: 1px; height: 26px; background: rgba(255,255,255,0.12); flex-shrink: 0; }
.progress-bar-track { height: 6px; background: rgba(255,255,255,0.15); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--emerald-500) 0%, var(--gold) 100%); border-radius: var(--radius-pill); transition: width 0.6s var(--ease-out); min-width: 0; width: 0%; }
.legend-bar { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 9px 16px; background: var(--white); border-bottom: 1px solid var(--gray-100); }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--gray-500); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-available { background: var(--emerald-600); } .dot-reading { background: var(--amber-500); } .dot-done { background: var(--sapphire-600); }
.offline-banner { background: var(--amber-100); color: var(--amber-900); text-align: center; padding: 7px 16px; font-size: 12px; font-weight: 600; border-bottom: 1px solid rgba(245,158,11,0.2); }

/* =============================================================
   JUZ GRID & CARDS
   ============================================================= */
.juz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 13px; flex: 1; }
.juz-skeleton { border-radius: var(--radius-md); min-height: 118px; background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; }
@keyframes skeleton-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.juz-card {
  border-radius: var(--radius-md); padding: 10px 9px; background: var(--white);
  box-shadow: var(--shadow-sm); border: 1.5px solid transparent;
  display: flex; flex-direction: column; min-height: 118px;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s;
  position: relative; overflow: hidden;
  animation: cardReveal 0.3s var(--ease-out) both; cursor: pointer;
}
@keyframes cardReveal { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
.juz-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius:var(--radius-md) var(--radius-md) 0 0; }
.juz-card.status-available { border-color: var(--emerald-100); }
.juz-card.status-available::before { background: var(--emerald-600); }
.juz-card.status-available:hover   { border-color: var(--emerald-500); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.juz-card.status-available:active  { transform: scale(0.96); }
.juz-card.status-reading           { background: var(--amber-100); border-color: rgba(245,158,11,0.3); }
.juz-card.status-reading::before   { background: var(--amber-500); }
.juz-card.status-reading:active    { transform: scale(0.96); }
.juz-card.status-reading.is-mine   { border-color: var(--amber-500); animation: cardReveal 0.3s var(--ease-out) both, minePulse 2.5s 1s infinite; }
@keyframes minePulse { 0%,100%{box-shadow:0 0 0 3px rgba(245,158,11,0.15)} 50%{box-shadow:0 0 0 5px rgba(245,158,11,0.06)} }
.juz-card.status-done           { background: var(--sapphire-100); border-color: rgba(37,99,235,0.18); }
.juz-card.status-done::before   { background: var(--sapphire-600); }
.juz-card.status-done:active    { transform: scale(0.96); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 3px; margin-bottom: 5px; }
.juz-number { font-size: 11px; font-weight: 700; color: var(--gray-900); }
.status-badge { font-size: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 5px; border-radius: var(--radius-pill); white-space: nowrap; flex-shrink: 0; }
.badge-available { background: var(--emerald-100); color: var(--emerald-800); }
.badge-reading   { background: rgba(245,158,11,0.2); color: var(--amber-900); }
.badge-done      { background: rgba(37,99,235,0.12); color: var(--sapphire-900); }
.juz-arabic { font-family: var(--font-arabic); font-size: 17px; font-weight: 700; color: var(--gray-800); line-height: 1.5; direction: rtl; text-align: right; display: block; margin-bottom: 1px; font-feature-settings: "liga" 1, "calt" 1; }
.juz-card.status-reading .juz-arabic { color: var(--amber-900); opacity: 0.85; }
.juz-card.status-done    .juz-arabic { color: var(--sapphire-900); opacity: 0.75; }
.juz-latin { font-size: 9px; color: var(--gray-400); font-style: italic; display: block; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-bottom { margin-top: auto; min-height: 16px; }
.action-hint { font-size: 9.5px; color: var(--gray-400); font-weight: 500; display: block; }
.mine-hint { color: #b45309 !important; font-weight: 600 !important; }
.reader-name { font-size: 10px; font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 3px; overflow: hidden; }
.reader-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.completion-banner { margin: 12px 13px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700)); color: var(--white); box-shadow: var(--shadow-lg); animation: bannerReveal 0.6s var(--ease-spring); }
@keyframes bannerReveal { from{opacity:0;transform:scale(0.9)} to{opacity:1;transform:scale(1)} }
.completion-inner { padding: 22px 20px; text-align: center; }
.completion-emoji { font-size: 38px; margin-bottom: 7px; display: block; animation: celebrate 1s var(--ease-spring) 0.3s both; }
@keyframes celebrate { 0%{transform:scale(0)} 60%{transform:scale(1.3)} 100%{transform:scale(1)} }
.completion-text { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.completion-sub  { font-family: var(--font-arabic); font-size: 18px; opacity: 0.85; direction: rtl; }

/* =============================================================
   MODALS
   ============================================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: flex-end; justify-content: center; animation: modalFadeIn 0.2s ease; }
@keyframes modalFadeIn { from{opacity:0} to{opacity:1} }
.modal-box { background: var(--white); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 22px 20px 36px; width: 100%; max-width: 480px; text-align: center; animation: modalSlideUp 0.3s var(--ease-out); }
@keyframes modalSlideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-box::before { content:''; display:block; width:36px; height:4px; background:var(--gray-200); border-radius:var(--radius-pill); margin:0 auto 18px; }
.modal-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); margin-bottom: 4px; }
.modal-user-name { font-size: 21px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; letter-spacing: -0.02em; }
.modal-room-info { display: flex; align-items: center; gap: 7px; background: var(--emerald-50); border: 1.5px solid var(--emerald-100); border-radius: var(--radius-md); padding: 8px 14px; margin-bottom: 18px; justify-content: center; flex-wrap: wrap; }
.modal-room-label { font-size: 11px; font-weight: 500; color: var(--gray-500); flex-shrink: 0; }
.modal-room-code  { font-size: 13px; font-weight: 700; color: var(--emerald-800); word-break: break-word; line-height: 1.4; }
.action-sheet-arabic { font-family: var(--font-arabic); font-size: 28px; font-weight: 700; color: var(--gray-900); direction: rtl; text-align: center; margin-bottom: 3px; line-height: 1.6; }
.action-sheet-latin  { font-size: 12px; color: var(--gray-400); font-style: italic; text-align: center; margin-bottom: 6px; }
.action-sheet-status { font-size: 12.5px; color: var(--gray-500); margin-bottom: 18px; min-height: 18px; }
.modal-btn { display: block; width: 100%; padding: 13px; border-radius: var(--radius-md); font-size: 14.5px; font-weight: 600; margin-bottom: 10px; transition: opacity 0.15s, transform 0.15s; letter-spacing: 0.01em; }
.modal-btn:last-child  { margin-bottom: 0; }
.modal-btn:active      { transform: scale(0.98); opacity: 0.85; }
.modal-btn-read      { background: linear-gradient(135deg, var(--emerald-800), var(--emerald-600)); color: var(--white); border: none; box-shadow: 0 3px 12px rgba(22,101,52,0.25); }
.modal-btn-success   { background: var(--emerald-100); color: var(--emerald-800); border: 1.5px solid var(--emerald-200); }
.modal-btn-complete  { background: #dbeafe; color: #1e3a8a; border: 1.5px solid #bfdbfe; }
.modal-btn-room      { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #bfdbfe; }
.modal-btn-warning   { background: #fff7ed; color: var(--orange-600); border: 1.5px solid #fed7aa; }
.modal-btn-danger    { background: #fef2f2; color: var(--red-600); border: 1.5px solid #fecaca; }
.modal-btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--gray-900); color: var(--white); padding: 10px 18px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; z-index: 9999; white-space: nowrap; max-width: calc(100vw - 40px); text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.3); animation: toastIn 0.3s var(--ease-out); pointer-events: none; }
@keyframes toastIn { from{opacity:0;transform:translateX(-50%) translateY(16px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.toast.toast-hide { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut { to{opacity:0;transform:translateX(-50%) translateY(12px)} }
.toast.toast-success { background: var(--emerald-900); } .toast.toast-warning { background: #92400e; } .toast.toast-error { background: var(--red-600); }

/* =============================================================
   MUSHAF READER SCREEN
   ============================================================= */
.reader-screen {
  position: fixed; inset: 0; z-index: 800;
  display: flex; flex-direction: column;
  background: #0f1f12;
  animation: readerOpen 0.3s var(--ease-out);
}
@keyframes readerOpen { from{opacity:0;transform:scale(0.97)} to{opacity:1;transform:scale(1)} }

/* ── Top Bar ────────────────────────────────────────────────── */
.reader-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--emerald-950);
  border-bottom: 1px solid rgba(212,168,83,0.25);
  flex-shrink: 0; min-height: 54px;
}
.reader-close-btn {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.reader-close-btn:hover  { background: rgba(255,255,255,0.15); }
.reader-close-btn:active { background: rgba(255,255,255,0.25); }
.reader-topbar-info { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; text-align: center; }
.reader-topbar-row  { display: flex; align-items: center; gap: 8px; }
.reader-juz-label   { font-size: 15px; font-weight: 700; color: var(--white); letter-spacing: -0.01em; }
.reader-mode-badge  { font-size: 10px; font-weight: 600; background: rgba(212,168,83,0.2); color: var(--gold); border: 1px solid rgba(212,168,83,0.3); border-radius: var(--radius-pill); padding: 1px 8px; }
.reader-page-info   { font-size: 11px; color: rgba(255,255,255,0.45); }

/* ── Image Wrap ─────────────────────────────────────────────── */
.reader-image-wrap {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #222; display: flex;
  flex-direction: column; align-items: center;
  position: relative;
}
.reader-img {
  width: 100%; max-width: 680px; height: auto; display: block;
  background: #fff; transition: opacity 0.2s;
  user-select: none; -webkit-user-drag: none;
}
.reader-img-loader {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(34,34,34,0.85);
}
.reader-img-error {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: rgba(255,255,255,0.7); text-align: center; padding: 20px;
}

/* ── Text Content Area ──────────────────────────────────────── */
.reader-content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #faf6ef; padding-bottom: 40px;
}
.reader-text-loader {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px;
  color: var(--gray-500); gap: 14px; font-size: 13px;
}
.reader-text-error {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 60px 32px; gap: 10px; color: var(--gray-600);
}
.reader-error-icon  { font-size: 48px; }
.reader-error-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.reader-error-desc  { font-size: 13px; color: var(--gray-500); line-height: 1.5; }

/* ── Spinner ────────────────────────────────────────────────── */
.reader-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Retry Button ───────────────────────────────────────────── */
.reader-retry-btn {
  padding: 10px 24px; border-radius: var(--radius-pill);
  background: var(--emerald-700); color: var(--white);
  font-size: 14px; font-weight: 700;
  transition: opacity 0.15s, transform 0.15s;
}
.reader-retry-btn:active { transform: scale(0.96); opacity: 0.85; }

/* ── Bottom Nav (image mode) ────────────────────────────────── */
.reader-bottombar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--emerald-950);
  border-top: 1px solid rgba(212,168,83,0.2);
  flex-shrink: 0; min-height: 56px;
}
.reader-nav-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08); color: var(--white);
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}
.reader-nav-btn:hover    { background: rgba(255,255,255,0.15); }
.reader-nav-btn:active   { transform: scale(0.94); }
.reader-nav-btn:disabled { opacity: 0.3; pointer-events: none; }
.reader-slider-wrap { flex: 1; padding: 0 4px; }
.reader-slider {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.15); border-radius: 2px; outline: none;
}
.reader-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--gold); cursor: pointer;
}

/* ── Surah Header (text mode) ───────────────────────────────── */
.surah-header {
  background: var(--emerald-950); padding: 16px 20px 12px;
  text-align: center; border-bottom: 2px solid rgba(212,168,83,0.3);
  position: sticky; top: 0; z-index: 10;
}
.surah-header-inner { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.surah-number-badge {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(212,168,83,0.2); border: 1px solid rgba(212,168,83,0.4);
  color: var(--gold); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.surah-title-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.surah-ar   { font-family: var(--font-arabic); font-size: 20px; font-weight: 700; color: var(--white); direction: rtl; }
.surah-name { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.8); }
.surah-arti { font-size: 11px; color: rgba(255,255,255,0.4); }
.bismillah  { font-family: var(--font-arabic); font-size: 22px; font-weight: 700; color: var(--gold); direction: rtl; text-align: center; margin-top: 4px; line-height: 1.8; }
.surah-cont-note { font-size: 11px; color: rgba(255,255,255,0.4); font-style: italic; margin-top: 4px; }

/* ── Ayat Block (text mode) ─────────────────────────────────── */
.ayat-block { padding: 16px 18px 14px; border-bottom: 1px solid rgba(20,83,45,0.08); }
.ayat-block:nth-child(even) { background: rgba(20,83,45,0.025); }
.ayat-arab {
  font-family: var(--font-arabic); font-size: 26px; line-height: 2.1;
  color: #1a1a1a; direction: rtl; text-align: right; margin-bottom: 10px;
  font-feature-settings: "liga" 1, "calt" 1; text-rendering: optimizeLegibility;
}
.ayat-trans {
  font-size: 13px; line-height: 1.7; color: #444;
  border-left: 3px solid rgba(20,83,45,0.2); padding-left: 10px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.reader-toast {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(20,83,45,0.9); color: var(--white);
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; pointer-events: none;
  white-space: nowrap; z-index: 10;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .reader-bottombar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .reader-content   { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 340px) {
  .juz-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 16px; }
  .juz-arabic { font-size: 15px; }
}
@media (min-width: 540px) {
  .juz-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 720px) {
  .juz-grid { grid-template-columns: repeat(5, 1fr); max-width: 900px; margin: 0 auto; padding: 18px; }
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .juz-grid   { padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  .modal-box  { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
}
