:root {
  --bg: #f2f8f1; --surface: #fff; --surface-2: #eaf5ea; --text: #17301f; --muted: #5b7263; --line: #d6e8d6;
  --accent: #16a34a; --accent-strong: #15803d; --soft: #dcfce7; --sun: #f5b400; --sun-soft: #fff4cc;
  --bad: #dc2626; --radius: 18px; --shadow: 0 1px 2px rgba(22,60,35,.05), 0 6px 18px rgba(22,60,35,.07);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Nunito", -apple-system, "Segoe UI", "Noto Sans Arabic", sans-serif; -webkit-font-smoothing: antialiased; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 900; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.back { font-weight: 900; color: var(--accent-strong); text-decoration: none; }
.sync { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
main { max-width: 720px; margin: 0 auto; padding: 4px 16px 16px; }

.hero { border-radius: 24px; padding: 18px; color: #fff; background: radial-gradient(circle at 88% 10%, rgba(255,255,255,.2) 0 64px, transparent 65px), linear-gradient(135deg, #22c55e, #0f9f6e); box-shadow: 0 10px 24px rgba(22,120,60,.25); margin-bottom: 14px; }
.hero h1 { font-size: 1.45rem; }
.hero .ar { font-family: "Cairo", sans-serif; font-size: 1.05rem; opacity: .95; }
.goal { margin-top: 12px; }
.goal .bar { height: 14px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.goal .bar i { display: block; height: 100%; border-radius: 99px; background: #facc15; transition: width .5s; }
.goal .lbl { display: flex; justify-content: space-between; font-weight: 800; font-size: .85rem; margin-top: 4px; }

.daynav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.daynav button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 900; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.daynav button:disabled { opacity: .35; cursor: default; }
.daynav .d { text-align: center; font-weight: 900; }
.daynav .d small { display: block; font-weight: 700; color: var(--muted); }

.people { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.person { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.person .av { position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; background: var(--surface); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.person.on .av { border-color: var(--accent); box-shadow: 0 3px 0 var(--accent-strong); background: var(--soft); }
.person .nm { font-weight: 800; font-size: .82rem; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .st { position: absolute; right: -6px; bottom: -4px; background: var(--sun); color: #3a2a00; font-size: .7rem; font-weight: 900; border-radius: 99px; padding: 1px 6px; border: 2px solid #fff; }
.person .crown { position: absolute; top: -14px; font-size: 1.1rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h2 { font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 .pill { font-size: .75rem; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 900; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.sun { background: var(--sun-soft); color: #8a6300; }
.pill.good { background: var(--soft); color: var(--accent-strong); }

.prayers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pray { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; cursor: pointer; padding: 0; font-weight: 800; font-size: .78rem; color: var(--muted); }
.pray .c { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; border: 3px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); transition: transform .08s; }
.pray.done { color: var(--accent-strong); }
.pray.done .c { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-strong); animation: pop .25s ease-out; }
.pray:active .c { transform: translateY(2px); }

.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.act { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: 0 3px 0 var(--line); font-weight: 800; min-height: 60px; }
.act .i { font-size: 1.5rem; flex: none; }
.act .t { flex: 1; min-width: 0; line-height: 1.2; }
.act .t small { display: block; font-weight: 700; color: var(--muted); font-size: .72rem; }
.act .ck { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: .9rem; color: #fff; }
.act.done { border-color: var(--accent); background: var(--soft); box-shadow: 0 3px 0 var(--accent-strong); }
.act.done .ck { background: var(--accent); border-color: var(--accent); animation: pop .25s ease-out; }
.act:active { transform: translateY(2px); }
.act.auto { cursor: default; }

.board .row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.board .row:last-child { border-bottom: 0; }
.board .rk { width: 26px; text-align: center; font-weight: 900; color: var(--muted); }
.board .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; background: var(--surface-2); flex: none; }
.board .grow { flex: 1; min-width: 0; }
.board .nm { font-weight: 900; }
.board .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.board .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.board .sc { text-align: right; font-weight: 900; min-width: 64px; }
.board .sc small { display: block; font-weight: 700; color: var(--muted); }
.champ { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--sun-soft); border: 2px solid var(--sun); margin-bottom: 12px; font-weight: 800; }
.champ .big { font-size: 2rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 900; box-shadow: 0 3px 0 var(--line); text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-strong); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=number], select { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); }
label.f { display: block; margin-bottom: 10px; } label.f span { display: block; font-size: .82rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.mrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.mrow input.emoji { text-align: center; font-size: 1.3rem; padding: 4px; }
.arow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.arow:last-child { border-bottom: 0; }
.arow input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.banner { padding: 12px 14px; border-radius: 14px; background: var(--soft); font-size: .9rem; margin-bottom: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 30; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 16px; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.star-pop { position: fixed; z-index: 40; pointer-events: none; font-weight: 900; color: #8a6300; background: var(--sun-soft); border: 2px solid var(--sun); padding: 3px 10px; border-radius: 99px; animation: float 1s ease-out forwards; }
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes float { 0% { transform: translate(-50%, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%, -44px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 440px) { .acts { grid-template-columns: 1fr; } .act { min-height: 54px; } }
