/* =========================================================
   Zikr Groups — Glassmorphism Islamic UI (modernized)
   Dark-first; light/dark/auto via [data-theme] on <html>.
   ========================================================= */

:root {
  /* ---------- Dark palette (default) ---------- */
  --bg-0: #060f0d;
  --bg-1: #0a1f1a;
  --bg-2: #0f2a23;

  --emerald: #34d399;
  --emerald-2: #10b981;
  --emerald-deep: #047857;
  --gold: #d4a85a;
  --gold-2: #f1c87a;
  --rose: #f87171;

  --ink: #ecfff7;
  --ink-soft: #c8e0d5;
  --muted: #8aa39a;

  --glass-bg: rgba(20, 40, 35, 0.45);
  --glass-bg-strong: rgba(20, 40, 35, 0.62);
  --glass-border: rgba(212, 168, 90, 0.22);
  --glass-border-strong: rgba(212, 168, 90, 0.45);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --input-bg: rgba(0, 0, 0, 0.25);
  --header-fade: linear-gradient(to bottom, rgba(6, 15, 13, 0.6), rgba(6, 15, 13, 0));

  --blur: 20px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
}

/* Light vars applied when system says light AND no override set... */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-0: #f5f1e8;
    --bg-1: #eadfc8;
    --bg-2: #d9eadd;
    --ink: #1a2a23;
    --ink-soft: #2c4035;
    --muted: #5e6b64;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-strong: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(16, 100, 70, 0.22);
    --glass-border-strong: rgba(16, 100, 70, 0.4);
    --glass-shadow: 0 8px 32px rgba(20, 40, 30, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --input-bg: rgba(255, 255, 255, 0.6);
    --header-fade: linear-gradient(to bottom, rgba(245, 241, 232, 0.7), rgba(245, 241, 232, 0));
  }
}
/* ...or when forced via [data-theme="light"]. */
:root[data-theme="light"] {
  --bg-0: #f5f1e8;
  --bg-1: #eadfc8;
  --bg-2: #d9eadd;
  --ink: #1a2a23;
  --ink-soft: #2c4035;
  --muted: #5e6b64;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(16, 100, 70, 0.22);
  --glass-border-strong: rgba(16, 100, 70, 0.4);
  --glass-shadow: 0 8px 32px rgba(20, 40, 30, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --input-bg: rgba(255, 255, 255, 0.6);
  --header-fade: linear-gradient(to bottom, rgba(245, 241, 232, 0.7), rgba(245, 241, 232, 0));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { position: relative; overflow-x: hidden; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   Animated background
   ========================================================= */
.bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 100% 0%, var(--bg-2), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, var(--bg-1), transparent 55%),
    var(--bg-0);
}
.bg-pattern {
  position: absolute; inset: 0; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23d4a85a' stroke-width='1'><path d='M40 4 L48 18 L64 18 L52 30 L60 46 L40 38 L20 46 L28 30 L16 18 L32 18 Z'/><circle cx='40' cy='40' r='16'/><path d='M40 24 L46 34 L58 36 L48 44 L52 56 L40 50 L28 56 L32 44 L22 36 L34 34 Z'/></g></svg>");
  background-size: 80px 80px;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.55; will-change: transform;
}
.blob-1 { width: 480px; height: 480px; background: radial-gradient(circle, var(--emerald-2), transparent 70%); top: -120px; left: -120px; animation: drift1 22s ease-in-out infinite alternate; }
.blob-2 { width: 520px; height: 520px; background: radial-gradient(circle, var(--gold), transparent 70%); bottom: -160px; right: -120px; animation: drift2 26s ease-in-out infinite alternate; opacity: 0.35; }
.blob-3 { width: 380px; height: 380px; background: radial-gradient(circle, var(--emerald-deep), transparent 70%); top: 40%; left: 50%; animation: drift3 30s ease-in-out infinite alternate; opacity: 0.32; }
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-100px, -60px) scale(1.1); } }
@keyframes drift3 { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-30%, -60%) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* =========================================================
   Glass primitive
   ========================================================= */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 12px 0;
  background: var(--header-fade);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.brand {
  margin: 0; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  display: inline-flex;
  filter: drop-shadow(0 2px 8px rgba(212, 168, 90, 0.4));
}
.brand-text { color: var(--ink); }
.brand-accent {
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.main-nav {
  display: flex; gap: 4px; padding: 4px;
  border-radius: var(--radius-pill);
  justify-self: center;
}
.nav-btn {
  background: transparent; border: none;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer; font-size: 14px; font-weight: 500;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-btn svg { opacity: 0.75; }
.nav-btn:hover { background: rgba(212, 168, 90, 0.12); color: var(--ink); }
.nav-btn.active {
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald-deep));
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
.nav-btn.active svg { opacity: 1; }

.header-actions {
  display: inline-flex; align-items: center; gap: 8px;
  justify-self: end;
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--gold-2); }
/* Theme icon visibility: by default (dark) show sun (offer "go light"); when light show moon. */
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; }
:root[data-theme="light"] .theme-icon-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-icon-light { display: inline; }
  :root:not([data-theme]) .theme-icon-dark { display: none; }
}

/* Profile chip */
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  font-size: 13px;
}
.profile-chip img,
.profile-chip .avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.profile-chip .profile-name {
  color: var(--ink); font-weight: 500;
  max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--emerald-2), var(--gold));
  color: #fff; font-weight: 700; border-radius: 50%;
  width: 32px; height: 32px;
}
.avatar-fallback.small { width: 24px; height: 24px; font-size: 12px; }

.btn-link {
  background: none; border: none;
  color: var(--gold-2); cursor: pointer; font: inherit; font-size: 12px;
  padding: 4px 8px; border-radius: var(--radius-sm);
}
.btn-link:hover { background: rgba(212, 168, 90, 0.1); }
.btn-link.danger { color: var(--rose); }

/* =========================================================
   Screens & views
   ========================================================= */
.screen { display: none; padding: 22px 0 100px; }
.screen.active { display: block; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.center { text-align: center; }

/* Cards */
.card { padding: 22px 24px; margin-bottom: 18px; }
.card h2, .card h3, .card h4 { margin-top: 0; color: var(--ink); }
.card h2 { font-size: 22px; font-weight: 700; }
.card h3 { font-size: 17px; font-weight: 600; }

.section-heading {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gold-2); margin: 22px 4px 12px;
}

/* Hero */
.hero {
  padding: 36px 32px;
  margin: 16px 0 24px;
  position: relative; overflow: hidden;
}
.hero h2 {
  font-size: 36px; line-height: 1.15;
  margin: 0 0 12px;
  background: linear-gradient(135deg, var(--ink), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { color: var(--ink-soft); font-size: 16px; max-width: 60ch; margin: 0 0 22px; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--gold-2); margin-bottom: 8px;
}
.ornament {
  position: absolute; top: -10px; right: 16px;
  font-size: 80px; color: var(--gold); opacity: 0.18;
  font-family: var(--font-arabic); pointer-events: none; user-select: none;
}
.feature-bullets {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; gap: 8px; color: var(--ink-soft); font-size: 14px;
}
.feature-bullets .bullet-icon {
  display: inline-block; width: 22px;
  color: var(--gold-2); font-weight: 700;
}
.hadith {
  margin: 24px 0 0;
  padding: 16px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 168, 90, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--ink-soft);
}
.hadith cite {
  display: block; margin-top: 8px;
  font-style: normal; font-size: 13px; color: var(--muted);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.sub-card { padding: 20px 22px; background: var(--glass-bg-strong); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* =========================================================
   Forms
   ========================================================= */
form label { display: block; margin-bottom: 14px; }
form label > span {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.form-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
  margin-top: 8px;
}
.form-row > input, .form-row > select { flex: 1 1 200px; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.06s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.btn:hover { background: rgba(212, 168, 90, 0.12); border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald-deep));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-2));
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}
.btn.warn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff; border-color: transparent;
}
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.quick { flex: 1 1 auto; padding: 9px 8px; font-size: 14px; }

.google-btn {
  background: #fff; color: #1f1f1f;
  border-color: rgba(0,0,0,0.08);
  padding: 12px 20px; font-size: 15px;
}
.google-btn:hover { background: #f5f5f5; border-color: rgba(0,0,0,0.15); }

/* =========================================================
   Group strip (header above views)
   ========================================================= */
.group-strip {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap; padding: 18px 22px;
}
.strip-info h2 { margin: 0 0 4px; font-size: 20px; }
.strip-info .dot { opacity: 0.5; padding: 0 4px; }
.strip-stats {
  display: flex; align-items: center; gap: 14px;
}
.streak-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(212, 168, 90, 0.10);
  border: 1px solid rgba(212, 168, 90, 0.25);
  border-radius: var(--radius-pill);
}
.streak-flame { font-size: 18px; }
.streak-pill strong {
  display: block; font-size: 16px; line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums;
}
.streak-pill small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

.goal-ring {
  position: relative; width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
}
.goal-ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--glass-border); stroke-width: 5; }
.ring-fill {
  fill: none;
  stroke: url(#ringGrad) var(--emerald);
  stroke: var(--emerald);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 163.36; /* 2*PI*26 */
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.5s ease;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.4));
}
.goal-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.goal-text strong { font-size: 13px; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.goal-text small { font-size: 9px; color: var(--muted); margin-top: 1px; }

/* =========================================================
   Totals card
   ========================================================= */
.totals-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}
.total-pill {
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.22);
  color: var(--emerald);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.total-pill.accent {
  background: rgba(212, 168, 90, 0.10);
  border-color: rgba(212, 168, 90, 0.28);
  color: var(--gold-2);
}
.total-pill.ghost {
  background: var(--input-bg);
  border-color: var(--glass-border);
  color: var(--ink);
}
.total-pill span {
  font-size: 26px; font-weight: 700; display: block;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.total-pill small {
  display: block; margin-top: 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
@media (max-width: 520px) {
  .totals-card { grid-template-columns: 1fr; }
}

/* =========================================================
   Tasbih view
   ========================================================= */
.tasbih-card { padding: 24px; text-align: center; }
.tasbih-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.tasbih-pick {
  flex: 1 1 auto; max-width: 320px; text-align: left; margin: 0;
}
.tasbih-pick > span {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 4px; font-weight: 600;
}
.tasbih-pick select { padding: 10px 12px; font-size: 15px; }
.tasbih-cycle {
  font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--gold-2);
  background: rgba(212, 168, 90, 0.1);
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid rgba(212, 168, 90, 0.22);
  font-size: 13px;
}

.tasbih-tap {
  position: relative;
  width: min(78vw, 360px);
  height: min(78vw, 360px);
  margin: 12px auto 18px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), transparent 60%),
              linear-gradient(135deg, var(--emerald-deep), #0a3a2c);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  box-shadow:
    0 20px 60px rgba(16, 185, 129, 0.35),
    inset 0 -8px 24px rgba(0, 0, 0, 0.35),
    inset 0 4px 16px rgba(255, 255, 255, 0.12);
  user-select: none; -webkit-user-select: none;
  transition: transform 0.08s ease;
  font-family: inherit;
}
.tasbih-tap:active { transform: scale(0.97); }
.tasbih-tap.pulse {
  animation: tapPulse 0.3s ease-out;
}
@keyframes tapPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.tasbih-ring, .tasbih-ring-2 {
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(212, 168, 90, 0.45);
  pointer-events: none;
  opacity: 0;
}
.tasbih-tap.ripple .tasbih-ring {
  animation: ringExpand 0.6s ease-out;
}
.tasbih-tap.ripple .tasbih-ring-2 {
  animation: ringExpand 0.6s ease-out 0.1s;
}
@keyframes ringExpand {
  0%   { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.15); }
}
.tasbih-count {
  font-size: 84px; font-weight: 800;
  line-height: 1; font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.tasbih-arabic {
  font-family: var(--font-arabic);
  font-size: 24px; line-height: 1.4; opacity: 0.9;
  margin-top: 4px;
}
.tasbih-translit { font-size: 13px; opacity: 0.75; font-style: italic; }

.tasbih-actions {
  display: flex; gap: 10px; justify-content: center;
  margin-bottom: 8px;
}
.tasbih-actions .btn { min-width: 110px; }

@media (prefers-reduced-motion: reduce) {
  .tasbih-tap.pulse, .tasbih-tap.ripple .tasbih-ring, .tasbih-tap.ripple .tasbih-ring-2 {
    animation: none;
  }
}

/* =========================================================
   Zikr cards (Submit view)
   ========================================================= */
.zikr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.zikr-card {
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.18s, border-color 0.18s;
}
.zikr-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-strong);
}
.zikr-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.zikr-head h4 {
  margin: 0; font-size: 13px; font-weight: 700;
  color: var(--gold-2); text-transform: uppercase; letter-spacing: 1.2px;
}
.tag-custom, .tag-owner {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.tag-custom { background: rgba(212, 168, 90, 0.15); color: var(--gold-2); }
.tag-owner { background: rgba(52, 211, 153, 0.15); color: var(--emerald); margin-left: 6px; }

.zikr-arabic {
  font-family: var(--font-arabic);
  font-size: 26px; line-height: 1.4; margin: 0;
  color: var(--ink); direction: rtl; text-align: right;
}
.zikr-translit { font-size: 13px; color: var(--muted); font-style: italic; margin: 0; }
.zikr-mine {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted); margin: 0;
}
.zikr-mine strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.zikr-mine .dot { opacity: 0.5; }
.zikr-actions { display: flex; gap: 6px; margin-top: auto; }
.zikr-count-input { display: flex; gap: 6px; }
.zikr-count-input input { flex: 1; padding: 9px 12px; font-size: 14px; }
.zikr-count-input .btn { padding: 9px 14px; font-size: 14px; }

/* =========================================================
   Lists & tables
   ========================================================= */
.recent-list, .members-list { list-style: none; margin: 0; padding: 0; }
.recent-list li, .members-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
  display: flex; justify-content: space-between; gap: 10px;
  align-items: center; flex-wrap: wrap;
}
.recent-list li:last-child, .members-list li:last-child { border-bottom: none; }
.recent-main { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.recent-meta { display: flex; align-items: center; gap: 4px; }
.recent-list time { color: var(--muted); font-size: 12px; }
.recent-count { color: var(--emerald); font-weight: 700; font-variant-numeric: tabular-nums; }

.member-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.member-cell img, .member-cell .avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--glass-border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { font-size: 18px; width: 56px; }
tr.me { background: rgba(212, 168, 90, 0.06); }

/* Leaderboard segmented control */
.lb-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.lb-header h2 { margin: 0; }
.segmented {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.seg {
  background: transparent; border: none; cursor: pointer; font: inherit;
  color: var(--muted); padding: 6px 14px; font-size: 13px; font-weight: 600;
  border-radius: var(--radius-pill);
  transition: background 0.18s, color 0.18s;
}
.seg:hover { color: var(--ink); }
.seg.active {
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald-deep));
  color: #fff;
}

/* =========================================================
   Group page
   ========================================================= */
.group-share {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  justify-content: space-between;
}
.group-share h2 { margin: 0 0 4px; }
.share-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 10px;
}
.qr-wrap {
  width: 144px; height: 144px;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.qr-wrap svg { width: 100%; height: 100%; display: block; }

/* Code pill */
code, .code-pill {
  background: var(--input-bg);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--gold-2);
  border: 1px solid var(--glass-border);
  letter-spacing: 0.5px;
}
.code-large {
  font-size: 18px; padding: 6px 14px;
  letter-spacing: 1.5px; font-weight: 700;
}

/* =========================================================
   Toast / spinner / confetti
   ========================================================= */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10, 31, 26, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  max-width: 92%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
  width: 32px; height: 32px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--emerald);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

#confetti-root {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -10px;
  left: var(--x, 50%);
  width: 8px; height: 12px;
  background: var(--c, var(--gold));
  border-radius: 2px;
  transform: rotate(var(--rot, 0deg));
  animation: confettiFall var(--d, 1.6s) cubic-bezier(.2,.7,.4,1) forwards;
}
@keyframes confettiFall {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), 110vh, 0) rotate(calc(var(--rot, 0deg) + 720deg)); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* =========================================================
   Misc
   ========================================================= */
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.danger { border-color: rgba(248, 113, 113, 0.3); }

.site-footer {
  margin-top: 40px; padding: 24px 0 max(32px, env(safe-area-inset-bottom));
  color: var(--muted); font-size: 13px; text-align: center;
}

/* =========================================================
   Heart of dhikr + ayah
   ========================================================= */
.heart-card {
  display: flex; align-items: center; gap: 28px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(52,211,153,0.08), rgba(212,168,90,0.06)), var(--glass-bg);
  border-color: var(--glass-border-strong);
  position: relative; overflow: hidden;
}
.heart-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 18% 50%, rgba(52,211,153,0.18), transparent 55%);
  pointer-events: none;
}
.heart-wrap {
  position: relative;
  flex-shrink: 0;
  width: 180px; height: 165px;
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 8px 24px rgba(52,211,153,0.35));
}
.heart-svg {
  display: block;
  animation: heartbeat 1.6s ease-in-out infinite;
  transform-origin: 60px 100px;
}
.heart-halo {
  animation: haloPulse 1.6s ease-in-out infinite;
  transform-origin: center;
}
.heart-word {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--font-arabic);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 0 18px rgba(255,255,255,0.25);
  pointer-events: none;
  animation: wordPulse 1.6s ease-in-out infinite;
  letter-spacing: 0;
}
@keyframes heartbeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.12); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.08); }
  70%  { transform: scale(1); }
  100% { transform: scale(1); }
}
@keyframes haloPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.18); }
}
@keyframes wordPulse {
  0%   { opacity: 0.85; transform: translate(-50%, -55%) scale(1); }
  14%  { opacity: 1;    transform: translate(-50%, -55%) scale(1.08); }
  28%  { opacity: 0.85; transform: translate(-50%, -55%) scale(1); }
  42%  { opacity: 1;    transform: translate(-50%, -55%) scale(1.05); }
  70%  { opacity: 0.85; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0.85; transform: translate(-50%, -55%) scale(1); }
}

.ayah {
  margin: 0;
  flex: 1 1 auto;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 168, 90, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative; z-index: 1;
}
.ayah-arabic {
  font-family: var(--font-arabic);
  font-size: 28px; line-height: 1.7;
  margin: 0 0 6px;
  color: var(--ink);
}
.ayah-translit { font-size: 13px; font-style: italic; color: var(--gold-2); margin: 0 0 4px; }
.ayah-english  { font-size: 14px; color: var(--ink-soft); margin: 0 0 6px; }
.ayah-cite     { display: block; font-size: 12px; color: var(--muted); font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  .heart-svg, .heart-halo, .heart-word { animation: none; }
}
@media (max-width: 720px) {
  .heart-card { flex-direction: column; gap: 16px; padding: 22px; text-align: center; }
  .heart-wrap { width: 150px; height: 138px; }
  .heart-svg { width: 150px; height: 138px; }
  .heart-word { font-size: 26px; }
  .ayah { border-left: none; border-top: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; }
  .ayah-arabic { font-size: 24px; }
}

/* WhatsApp share buttons */
.wa-btn { color: #25D366; }
.wa-btn:hover { background: rgba(37, 211, 102, 0.12); border-color: rgba(37, 211, 102, 0.45); color: #25D366; }
.btn.small.wa-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn.wa-btn { color: #25D366; }
.icon-btn.wa-btn:hover { background: rgba(37, 211, 102, 0.14); color: #25D366; }

/* Toast action button */
.toast { display: inline-flex; align-items: center; gap: 12px; }
.toast-action {
  background: rgba(37, 211, 102, 0.18);
  border: 1px solid rgba(37, 211, 102, 0.5);
  color: #4ade80;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.toast-action:hover { background: rgba(37, 211, 102, 0.28); }

/* =========================================================
   Mobile bottom-tab nav
   ========================================================= */
@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 8px; }
  .brand { font-size: 17px; }
  .brand-text { display: inline-block; }

  .main-nav {
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 60;
    justify-self: stretch;
    justify-content: space-around;
    padding: 6px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    box-shadow: 0 12px 36px rgba(0,0,0,0.35);
  }
  .nav-btn {
    flex-direction: column; gap: 2px;
    padding: 7px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 14px;
    min-width: 0; flex: 1;
  }
  .nav-btn svg { width: 20px; height: 20px; }
  .nav-btn span { font-size: 10px; letter-spacing: 0.3px; }
  .nav-btn.active { box-shadow: none; }

  .screen { padding-bottom: 110px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .hero { padding: 28px 22px; }
  .hero h2 { font-size: 28px; }
  .card { padding: 18px; }
  .ornament { font-size: 60px; }
  .container { padding: 0 14px; }

  .group-strip { padding: 14px 16px; }
  .strip-info h2 { font-size: 18px; }
  .group-share { justify-content: center; }
  .qr-wrap { width: 120px; height: 120px; }

  .tasbih-count { font-size: 64px; }
  .tasbih-arabic { font-size: 20px; }
}
