/* Raaj Hifz — shared styles for the site pages and the arcade. Emerald, turquoise, cream and gold. */
@font-face { font-family: 'Baloo 2'; src: url(/fonts/baloo-2-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url(/fonts/baloo-2-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url(/fonts/baloo-2-latin-800-normal.woff2) format('woff2'); font-weight: 800; font-display: swap; }
/* Al-Kanz for Arabic interface text (titles, Surah names, labels). */
@font-face { font-family: 'AL-KANZ'; src: url(/fonts/Al-Kanz.ttf) format('truetype'); font-display: swap; }
/* Kanz al-Marjaan for Quran text: it has every Uthmani mark (Al-Kanz lacks 13 of them). */
@font-face { font-family: 'Kanz-al-Marjaan'; src: url(/fonts/Kanz-al-Marjaan.ttf) format('truetype'); font-display: swap; }

:root {
  --emerald-900: #053b30; --emerald-800: #065443; --emerald-700: #047857; --emerald-600: #059669; --emerald-100: #d1fae5; --emerald-50: #ecfdf5;
  --teal: #0d9488; --turq: #14b8a6; --turq-300: #5eead4; --turq-100: #ccfbf1;
  --cream: #fdf8ec; --cream-2: #f7eed6; --sand: #efe3c2;
  --gold: #d4a017; --gold-300: #f2c94c; --gold-100: #fdf0c4;
  --ink: #17302b; --ink-2: #44605a; --muted: #6b7f7a;
  --red: #dc2626; --red-100: #fee2e2; --green: #16a34a; --green-100: #dcfce7; --blue: #2563eb;
  --card: #fffdf7; --line: #e7dcc0;
  --r: 18px; --r-sm: 12px; --shadow: 0 2px 0 rgba(5, 59, 48, .08), 0 8px 24px -12px rgba(5, 59, 48, .25);
  --font: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ar: 'AL-KANZ', 'Kanz-al-Marjaan', 'Noto Naskh Arabic', serif;
  --quran: 'Kanz-al-Marjaan', 'Amiri Quran', 'Noto Naskh Arabic', serif;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23d4a017' stroke-opacity='.16' stroke-width='1.4'%3E%3Cpath d='M32 6l7.5 18.5L58 32l-18.5 7.5L32 58l-7.5-18.5L6 32l18.5-7.5z'/%3E%3Crect x='17' y='17' width='30' height='30' transform='rotate(45 32 32)'/%3E%3Crect x='17' y='17' width='30' height='30'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream) var(--pattern); font-size: 17px; line-height: 1.5; min-height: 100vh; overflow-x: hidden; }
a { color: var(--emerald-700); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; color: var(--emerald-900); font-weight: 800; }
p { margin: 0 0 .8em; }
.ar, [lang=ar] { font-family: var(--ar); }
.quran { font-family: var(--quran); direction: rtl; unicode-bidi: isolate; line-height: 2.1; font-size: 1.55em; color: var(--emerald-900); word-spacing: .08em; }
.quran.sm { font-size: 1.25em; line-height: 1.9; }
.quran.lg { font-size: 2em; }
.ref { font-size: .8rem; color: var(--muted); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- buttons, chips, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 48px; padding: .55em 1.2em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--emerald-700); color: #fff; font-weight: 800; font-size: 1.02rem; text-decoration: none; box-shadow: 0 4px 0 var(--emerald-900); transition: transform .08s, box-shadow .08s, background .15s; touch-action: manipulation; }
.btn:hover { background: var(--emerald-600); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--emerald-900); }
.btn.gold { background: var(--gold-300); color: var(--emerald-900); box-shadow: 0 4px 0 #b8860b; }
.btn.gold:hover { background: #f7d56e; }
.btn.ghost { background: #fff; color: var(--emerald-800); box-shadow: 0 3px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn.ghost:hover { background: var(--emerald-50); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 #991b1b; }
.btn.sm { min-height: 38px; padding: .3em .9em; font-size: .92rem; }
.btn.big { min-height: 60px; font-size: 1.25rem; padding: .6em 1.8em; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { min-height: 40px; padding: .25em .95em; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.chip[aria-pressed=true], .chip.on { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
label.field { display: grid; gap: .25rem; font-weight: 700; color: var(--ink-2); font-size: .95rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: .5em .8em; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--turq); outline: none; }
.form { display: grid; gap: .9rem; }
.err { color: var(--red); font-weight: 700; min-height: 1.2em; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow); }
.card.tint { background: linear-gradient(160deg, var(--emerald-50), #fff 70%); }
.pill { display: inline-flex; align-items: center; gap: .3em; padding: .1em .7em; border-radius: 999px; background: var(--gold-100); color: #7a5a00; font-weight: 800; font-size: .85rem; }
.pill.teal { background: var(--turq-100); color: var(--emerald-800); }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.games { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

/* ---------- site header / footer (shared) ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(253, 248, 236, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: .45rem 1rem; display: flex; align-items: center; gap: .7rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--emerald-900); font-weight: 800; font-size: 1.15rem; line-height: 1.05; }
.brand img, .brand svg { width: 40px; height: 40px; }
.brand small { display: block; font-family: var(--ar); font-weight: 400; color: var(--gold); font-size: .95rem; }
.top nav { display: flex; gap: .2rem; margin-inline-start: auto; align-items: center; }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 700; padding: .4em .7em; border-radius: 999px; }
.top nav a:hover, .top nav a[aria-current=page] { background: var(--emerald-50); color: var(--emerald-800); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 1rem; }
.foot { margin-top: 3rem; background: var(--emerald-900) var(--pattern); color: #d7efe8; }
.foot a { color: #fff; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 6rem; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.foot h3 { color: var(--gold-300); font-size: 1rem; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.motto { border-top: 1px solid rgba(255, 255, 255, .15); text-align: center; padding: 1.4rem 1rem 2rem; font-size: .95rem; }
.motto b { color: var(--gold-300); letter-spacing: .08em; }
@media (max-width: 720px) { .top nav .hide-sm { display: none; } }

/* ---------- landing pages ---------- */
.hero { position: relative; overflow: hidden; border-radius: 28px; background: linear-gradient(135deg, var(--emerald-800), var(--teal) 70%, var(--turq)); color: #fff; padding: 2rem 1.3rem; margin-top: .5rem; }
.hero::after { content: ''; position: absolute; inset: 0; background: var(--pattern); opacity: .9; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 3.2rem); }
.hero .ar-title { font-family: var(--ar); color: var(--gold-300); font-size: clamp(1.6rem, 5vw, 2.6rem); margin: 0 0 .2rem; }
.hero p { font-size: 1.1rem; max-width: 46rem; color: #e6fbf5; }
.hero-grid { display: grid; gap: 1rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: 1.4fr 1fr; } .hero { padding: 3rem 2.4rem; } }
.mascot { width: min(260px, 70%); justify-self: center; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .25)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.section { margin: 2.4rem 0; }
.section > h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 52rem; }
.answer-box { border-inline-start: 6px solid var(--gold); background: #fff; padding: 1rem 1.2rem; border-radius: var(--r-sm); box-shadow: var(--shadow); font-size: 1.08rem; }
.gcard { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: inherit; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; position: relative; }
.gcard:hover { transform: translateY(-3px); border-color: var(--turq); }
.gcard .gi { font-size: 2.2rem; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(140deg, var(--gold-100), var(--turq-100)); }
.gcard h3 { margin: .2rem 0 0; font-size: 1.15rem; }
.gcard .ar { color: var(--gold); font-size: 1.15rem; line-height: 1.3; }
.gcard p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.faq details { background: #fff; border: 2px solid var(--line); border-radius: var(--r-sm); padding: .7rem 1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 800; color: var(--emerald-900); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: .6rem; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 3rem; min-height: 2.4rem; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; background: var(--gold-300); color: var(--emerald-900); font-weight: 800; }
.surah-list { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); padding: 0; list-style: none; }
.surah-list a { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: #fff; border: 2px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.surah-list a:hover { border-color: var(--turq); }
.surah-list .num { width: 2.2rem; height: 2.2rem; flex: none; display: grid; place-items: center; background: var(--emerald-50); border-radius: 50%; font-weight: 800; color: var(--emerald-700); font-size: .9rem; }
.surah-list .ar { margin-inline-start: auto; font-size: 1.25rem; color: var(--emerald-800); }
.mushaf { background: #fffdf5; border: 3px double var(--gold); border-radius: var(--r); padding: 1.2rem 1.4rem; text-align: justify; text-align-last: center; }
.mushaf .quran { font-size: 1.7rem; line-height: 2.4; }
.basmala { text-align: center; font-family: var(--quran); font-size: 1.7rem; color: var(--emerald-800); margin-bottom: .4rem; }
.bc { font-size: .9rem; color: var(--muted); margin: .4rem 0 .2rem; }
.bc a { color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r-sm); overflow: hidden; }
table.data th, table.data td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.data th { background: var(--emerald-50); color: var(--emerald-900); font-size: .9rem; }
.scroll-x { overflow-x: auto; }
.cta-band { background: linear-gradient(135deg, var(--gold-100), var(--turq-100)); border-radius: var(--r); padding: 1.5rem; text-align: center; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.ayah-no { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .2em; margin: 0 .2em; border-radius: 50%; border: 2px solid var(--gold); color: var(--emerald-800); font-family: var(--ar); font-size: .62em; line-height: 1; vertical-align: middle; background: #fffbea; }
