:root{
  --bg-deep:#0A1D1B;
  --bg-mid:#0E2623;
  --bead:#C99A5B;
  --bead-lit:#EFC077;
  --bead-lit-glow: rgba(239,192,119,.55);
  --ivory:#F1EAD9;
  --muted:#8FAFA6;
  --card: rgba(241,234,217,0.05);
  --card-hover: rgba(241,234,217,0.09);
  --border: rgba(241,234,217,0.14);
  --maroon:#7A2E2E;
}
*{box-sizing:border-box; -webkit-tap-highlight-color: transparent;}
html,body{height:100%; margin:0;}
body{
  min-height:100vh;
  background:
    radial-gradient(900px 500px at 15% -8%, rgba(201,154,91,0.12), transparent 60%),
    radial-gradient(1200px 700px at 85% -10%, var(--bg-mid), var(--bg-deep) 60%);
  color:var(--ivory);
  font-family:'Vazirmatn', sans-serif;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 0 16px 34px;
}

/* ---------- SPLASH (3s) ---------- */
.hero-splash{
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:center; justify-content:center;
  background: var(--bg-deep);
  overflow:hidden;
  transition: opacity .7s ease;
}
.hero-splash.fade-out{ opacity:0; pointer-events:none; }
.hero-splash-photo{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.85;
}
.hero-splash-svg{
  position:absolute; inset:0; width:100%; height:100%;
  z-index:1;
}
.hero-splash-caption{
  position:relative; z-index:2;
  font-family:'Amiri', serif;
  font-size:34px; font-weight:700; color:var(--bead-lit);
  text-shadow: 0 0 24px rgba(239,192,119,.5);
}

/* ---------- HERO ---------- */
.hero{
  width:100%;
  max-width:460px;
  text-align:center;
  padding: 34px 6px 20px;
  position:relative;
}
.hero .eyebrow{
  font-size:12px;
  letter-spacing:2px;
  color:var(--bead-lit);
  margin-bottom:8px;
}
.hero h1{
  font-size:26px;
  font-weight:800;
  margin:0 0 6px;
}
.hero p{
  font-size:13.5px;
  color:var(--muted);
  margin:0;
}
.divider{
  width:120px;
  height:1px;
  margin:18px auto 0;
  background: linear-gradient(90deg, transparent, var(--bead), transparent);
  position:relative;
}
.divider::after{
  content:'✦';
  position:absolute;
  top:50%; left:50%;
  transform: translate(-50%,-50%);
  background: var(--bg-deep);
  color:var(--bead-lit);
  font-size:12px;
  padding:0 8px;
}

/* ---------- BIG MENU BUTTONS ---------- */
.menu-grid{
  width:100%; max-width:460px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:22px;
}
.menu-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:20px;
  padding:20px 14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-align:center;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.menu-card:active{ transform: scale(.96); background: var(--card-hover); }
.menu-card .icon{
  width:46px; height:46px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 35% 30%, #E9C892, var(--bead) 65%, #8A6636 100%);
  box-shadow: 0 0 14px 2px rgba(239,192,119,.25);
}
.menu-card .icon svg{ width:22px; height:22px; }
.menu-card .title{ font-size:14.5px; font-weight:700; }
.menu-card .desc{ font-size:11.5px; color:var(--muted); line-height:1.5; }

/* ---------- PANELS (secondary pickers) ---------- */
.panel{
  width:100%; max-width:460px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  margin-top:16px;
}
.panel-title{ font-size:14px; font-weight:700; margin-bottom:12px; }
.option-list{ display:flex; flex-direction:column; gap:8px; }
.option-btn{
  width:100%;
  text-align:right;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(241,234,217,0.04);
  color:var(--ivory);
  font-family:inherit;
  font-size:14.5px;
  font-weight:600;
  display:flex; justify-content:space-between; align-items:center;
}
.option-btn:active{ background: var(--card-hover); }
.option-btn small{ color:var(--muted); font-weight:400; font-size:12px; }

.back-link{
  display:inline-block;
  margin-top:12px;
  font-size:13px;
  color:var(--muted);
  background:none; border:none; font-family:inherit;
}

.start-btn{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:none;
  background: linear-gradient(180deg, #123933, #0C2A26);
  color:var(--ivory);
  font-weight:700;
  font-family:inherit;
  font-size:15px;
  box-shadow: 0 4px 0 #06120F;
}
.start-btn:active{ transform: translateY(3px); box-shadow:none; }

/* ---------- COUNTER SCREEN ---------- */
#counterArea{ display:none; width:100%; max-width:460px; flex-direction:column; align-items:center; margin-top:10px;}

.set-title{ font-size:14px; color:var(--muted); margin-top:8px; }
.step-label{ font-size:13px; color:var(--muted); margin-bottom:4px; }

.dhikr-text{
  font-family:'Amiri', serif;
  font-size:clamp(30px, 8vw, 42px);
  font-weight:700;
  line-height:1.7;
  text-align:center;
  color:var(--bead-lit);
  text-shadow: 0 0 22px rgba(239,192,119,.25);
  padding: 6px 10px 2px;
  max-width:100%;
}

.stage{
  position:relative; width:min(72vw,270px); height:min(72vw,270px);
  display:flex; align-items:center; justify-content:center; margin:14px 0 6px;
}
.center{
  width:66%; height:66%; border-radius:50%;
  background: linear-gradient(180deg, rgba(241,234,217,0.05), rgba(241,234,217,0.02));
  border:1px solid var(--border);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
}
.count{ font-size:clamp(50px,16vw,68px); font-weight:800; font-variant-numeric: tabular-nums; }
.progress-text{ font-size:12px; color:var(--muted); }

.tap-btn{
  width:min(72vw,270px); padding:18px; border-radius:20px; border:none;
  background: linear-gradient(180deg, #123933, #0C2A26);
  color:var(--ivory); font-weight:700; font-size:17px;
  box-shadow: 0 6px 0 #06120F, 0 8px 16px rgba(0,0,0,.35);
}
.tap-btn:active{ transform: translateY(5px); box-shadow: 0 1px 0 #06120F; }

.bottom-row{ display:flex; gap:6px; width:min(72vw,270px); margin-top:12px; }
.ghost-btn{
  flex:1; padding:10px 6px; border-radius:12px; border:1px solid var(--border);
  background:transparent; color:var(--muted); font-size:12px; font-family:inherit;
}

/* ---------- QURAN KHATM / SHARES GRID ---------- */
#quranArea{ display:none; width:100%; max-width:460px; flex-direction:column; align-items:center; margin-top:10px; }
.quran-progress{
  width:100%;
  height:8px;
  border-radius:6px;
  background: rgba(241,234,217,0.08);
  overflow:hidden;
  margin:10px 0 6px;
}
.quran-progress-bar{
  height:100%;
  background: linear-gradient(90deg, var(--bead), var(--bead-lit));
  width:0%;
  transition: width .3s ease;
}
.quran-progress-label{ font-size:12.5px; color:var(--muted); margin-bottom:10px; }
.juz-grid{
  width:100%;
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap:8px;
}
.juz-cell{
  aspect-ratio:1;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(241,234,217,0.04);
  color:var(--ivory);
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  line-height:1.2;
}
.juz-cell.done{
  background: radial-gradient(circle at 35% 30%, #FFF3D6, var(--bead-lit) 60%, #B9803B 100%);
  color:#2A1B08;
  box-shadow: 0 0 10px 2px var(--bead-lit-glow);
}

/* ---------- TOAST + FLASH ---------- */
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:#0F2E2B; border:1px solid var(--bead-lit); color:var(--ivory);
  padding:12px 18px; border-radius:14px; font-size:14px; opacity:0;
  transition: opacity .3s ease, transform .3s ease; pointer-events:none; z-index:20;
  text-align:center; max-width:90vw;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

.flash{
  position:fixed; inset:0; background: radial-gradient(circle, rgba(239,192,119,0.35), transparent 60%);
  opacity:0; pointer-events:none; transition: opacity .4s ease;
  z-index:10;
}
.flash.on{ opacity:1; transition: opacity .05s ease; }

/* ---------- HISTORY ---------- */
.history-list{ font-size:13px; color:var(--muted); max-height:140px; overflow-y:auto; }
.history-list div{ padding:5px 0; border-bottom:1px dashed var(--border); }
