:root { --safe-b: env(safe-area-inset-bottom, 0px); }
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { background: radial-gradient(1200px 600px at 50% -10%, #124f45 0%, #06201f 55%); min-height: 100vh; }
.safe-bottom { padding-bottom: var(--safe-b); }

/* Bottom nav */
.nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 10px 4px 8px; font-size: 11px; color: #79cfb6; opacity: .65; transition: all .2s; position: relative; }
.nav-btn i { font-size: 20px; }
.nav-btn.active { opacity: 1; color: #f5d98b; }
.nav-center-circle { width: 54px; height: 54px; margin-top: -26px; border-radius: 9999px; background: linear-gradient(145deg, #e9c15a, #b88a24); display: flex; align-items: center; justify-content: center; color: #06201f; box-shadow: 0 8px 20px rgba(233,193,90,.35), 0 0 0 5px #06201f; }
.nav-center-circle i { font-size: 22px; }
.nav-center.active .nav-center-circle { transform: scale(1.06); }

/* Cards */
.card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 18px; backdrop-filter: blur(6px); }
.card-glow { background: linear-gradient(145deg, rgba(35,153,125,.25), rgba(18,79,69,.15)); border: 1px solid rgba(69,180,151,.35); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; background: rgba(255,255,255,.07); color: #aee4d2; }
.chip-gold { background: rgba(233,193,90,.15); color: #f5d98b; }
.chip-red { background: rgba(248,113,113,.15); color: #fca5a5; }
.chip-blue { background: rgba(96,165,250,.15); color: #93c5fd; }
.chip-purple { background: rgba(192,132,252,.15); color: #d8b4fe; }

/* Quran text */
.quran { font-family: 'Amiri', serif; font-size: 1.35rem; line-height: 2.2; }

/* Page transitions */
.page { animation: fadeUp .25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* Progress ring */
.ring { transform: rotate(-90deg); }
.ring circle { transition: stroke-dashoffset .5s ease; }

/* Sheet (bottom modal) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; animation: fadeIn .2s both; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #0d2f2d; border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto; padding: 8px 18px calc(24px + var(--safe-b)); animation: slideUp .28s cubic-bezier(.2,.8,.2,1) both; border-top: 1px solid rgba(255,255,255,.08); }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 6px auto 14px; }
@keyframes slideUp { from { transform: translateY(100%);} to { transform: none; } }
@keyframes fadeIn { from { opacity: 0;} to { opacity: 1; } }

/* Tasbih */
.tasbih-btn { width: 220px; height: 220px; border-radius: 9999px; background: radial-gradient(circle at 35% 30%, #2bb08f, #0f3d3e 70%); box-shadow: 0 20px 60px rgba(35,153,125,.35), inset 0 -10px 30px rgba(0,0,0,.35), inset 0 10px 30px rgba(255,255,255,.08); border: 3px solid rgba(233,193,90,.5); user-select: none; transition: transform .08s; }
.tasbih-btn:active { transform: scale(.95); }

/* Toast */
.toast-box { background: #136354; border: 1px solid #45b497; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: fadeUp .25s both; text-align: center; font-weight: 500; }

/* Checkbox done */
.done-btn { width: 40px; height: 40px; border-radius: 12px; border: 2px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; transition: all .2s; }
.done-btn.on { background: linear-gradient(145deg,#e9c15a,#b88a24); border-color: #e9c15a; color: #06201f; }
.deed-row.is-done .deed-title { text-decoration: line-through; opacity: .55; }

/* Hide scrollbar for horizontal chips */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Shimmer */
.shimmer { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 75%); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.btn-gold { background: linear-gradient(145deg,#e9c15a,#b88a24); color: #06201f; font-weight: 800; border-radius: 14px; padding: 12px 18px; box-shadow: 0 8px 22px rgba(233,193,90,.25); }
.btn-ghost { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 10px 14px; color: #d5f2e8; }

/* Streak flame */
@keyframes flame { 0%,100% { transform: scale(1) rotate(-2deg);} 50% { transform: scale(1.12) rotate(2deg);} }
.flame { animation: flame 1.2s ease-in-out infinite; display: inline-block; }

/* ===== الوضع الفاتح ===== */
html.light body { background: radial-gradient(1200px 600px at 50% -10%, #d5f2e8 0%, #eefaf6 55%); color: #0f3d3e; }
html.light .card { background: #ffffff; border-color: rgba(15,61,62,.08); box-shadow: 0 2px 10px rgba(15,61,62,.05); }
html.light .card-glow { background: linear-gradient(145deg, #d5f2e8, #ffffff); border-color: rgba(35,153,125,.3); }
html.light .text-brand-200, html.light .text-brand-300, html.light .text-brand-100, html.light .text-brand-50 { color: #136354 !important; }
html.light .text-brand-200\/90 { color: #177b66 !important; }
html.light .text-gold-300 { color: #b88a24 !important; }
html.light .text-white { color: #0f3d3e !important; }
html.light .chip { background: rgba(15,61,62,.07); color: #136354; }
html.light .chip-gold { background: rgba(184,138,36,.15); color: #8a6516; }
html.light .chip-red { background: rgba(220,38,38,.1); color: #b91c1c; }
html.light .chip-blue { background: rgba(37,99,235,.1); color: #1d4ed8; }
html.light .chip-purple { background: rgba(147,51,234,.1); color: #7e22ce; }
html.light #bottom-nav { background: rgba(255,255,255,.95); border-color: rgba(15,61,62,.1); }
html.light .nav-btn { color: #136354; }
html.light .nav-btn.active { color: #b88a24; }
html.light .nav-center-circle { box-shadow: 0 8px 20px rgba(233,193,90,.35), 0 0 0 5px #eefaf6; }
html.light .sheet { background: #ffffff; color: #0f3d3e; }
html.light .sheet-handle { background: rgba(15,61,62,.2); }
html.light .btn-ghost { background: rgba(15,61,62,.05); border-color: rgba(15,61,62,.12); color: #0f3d3e; }
html.light input, html.light select { background: rgba(15,61,62,.04) !important; border-color: rgba(15,61,62,.15) !important; color: #0f3d3e; }
html.light .bg-white\/10 { background: rgba(15,61,62,.1) !important; }
html.light .bg-white\/5 { background: rgba(15,61,62,.05) !important; }
html.light .done-btn { border-color: rgba(15,61,62,.2); }
html.light .toast-box { background: #177b66; }
html.light .tasbih-btn { background: radial-gradient(circle at 35% 30%, #45b497, #136354 70%); }
html.light .bg-brand-700\/60 { background: rgba(35,153,125,.15) !important; }
html.light .bg-brand-700\/40 { background: rgba(35,153,125,.12) !important; color: #136354 !important; }
html.light .bg-brand-600 { background: #45b497 !important; }
html.light .opacity-50 { opacity: .6; }
.aya { font-family: 'Amiri', serif; }
html.light #mf-page { background: #fffdf5 !important; }
