/* Hidayat360 — shared styles. Brand name is a placeholder. */
:root {
  --night: #0b1533;
  --night-2: #13224d;
  --night-3: #1c2f66;
  --gold: #f4b942;
  --gold-soft: #ffd98a;
  --green: #3db38f;
  --green-dark: #23866a;
  --rose: #e87a7a;
  --cream: #fff8ec;
  --paper: #ffffff;
  --ink: #1d2340;
  --ink-soft: #545b7a;
  --line: #e9e1d0;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(11, 21, 51, 0.12);
  --font: "Baloo 2", "Nunito", system-ui, sans-serif;
  --arabic: "Amiri", "Scheherazade New", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.arabic { font-family: var(--arabic); direction: rtl; }

/* ---------- Header ---------- */
.site-header {
  background: var(--night);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .2px; }
.logo svg { width: 30px; height: 30px; }
.logo span b { color: var(--gold); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-weight: 600; font-size: .98rem;
  padding: 6px 12px; border-radius: 999px; color: #dfe6ff;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1.08rem;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 0 rgba(0,0,0,.18);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-green { background: var(--green); color: #fff; }
.btn-light { background: #fff; color: var(--night); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }

/* ---------- Night sky hero ---------- */
.sky {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse at 70% 0%, var(--night-3) 0%, var(--night-2) 40%, var(--night) 100%);
}
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  opacity: .7; animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .15; } }
.hero { padding: 64px 0 120px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); line-height: 1.05; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: 1.2rem; color: #d5ddf7; max-width: 34ch; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; height: 320px; }
.lantern { position: absolute; top: -70px; transform-origin: top center; animation: sway 4s ease-in-out infinite; }
.lantern img { width: 90px; height: auto; }
.lantern.l2 { left: 45%; animation-delay: -1.3s; }
.lantern.l2 img { width: 70px; }
.lantern.l3 { left: 75%; animation-delay: -2.4s; }
.lantern.l3 img { width: 56px; }
@keyframes sway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.moon { position: absolute; right: 6%; bottom: 10px; width: 140px; }
.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; }

/* ---------- Sections ---------- */
section.block { padding: 64px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; font-size: .8rem; color: var(--green-dark); margin: 0 0 6px; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 10px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 52ch; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
  transition: transform .2s ease;
  border: 1px solid var(--line);
}
a.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.card .art { height: 150px; display: grid; place-items: center; font-size: 3.4rem; }
.card .body { padding: 16px 20px 20px; }
.card h3 { margin: 0 0 4px; font-size: 1.25rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #eef7f3; color: var(--green-dark); margin-bottom: 8px; }
.card.soon { opacity: .6; }
.card.soon .tag { background: #f2eee6; color: var(--ink-soft); }
.art-gold { background: linear-gradient(135deg, #ffe7b3, #f4b942); }
.art-green { background: linear-gradient(135deg, #c8f0e1, #3db38f); }
.art-night { background: linear-gradient(135deg, #2b3f80, #0b1533); color: #fff; }
.art-rose { background: linear-gradient(135deg, #ffd9d0, #e87a7a); }
.art-sea { background: linear-gradient(180deg, #2a5ea8, #0d2a5c); color: #fff; }

/* Game of the day */
.gotd {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  background: var(--night); color: #fff; border-radius: 28px; padding: 26px 30px;
  box-shadow: var(--shadow);
}
.gotd .big { font-size: 3.6rem; width: 96px; height: 96px; border-radius: 24px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.gotd h3 { margin: 0; font-size: 1.5rem; }
.gotd p { margin: 2px 0 0; color: #cdd6f5; }

/* Parents trust strip */
.trust { background: #fff; border-block: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .ic { flex: 0 0 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: #eef7f3; }
.trust-item h3 { margin: 0; font-size: 1.05rem; }
.trust-item p { margin: 0; font-size: .92rem; color: var(--ink-soft); }

.ramadan-band { background: linear-gradient(120deg, var(--night-2), var(--night)); color: #fff; border-radius: 28px; padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.ramadan-band p { color: #cdd6f5; margin: 0; }
.countdown { display: flex; gap: 10px; }
.countdown div { background: rgba(255,255,255,.08); border-radius: 16px; padding: 10px 14px; text-align: center; min-width: 70px; }
.countdown b { display: block; font-size: 1.8rem; color: var(--gold); line-height: 1; }
.countdown span { font-size: .8rem; color: #cdd6f5; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #cdd6f5; padding: 40px 0 28px; margin-top: 40px; font-size: .95rem; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer h4 { color: #fff; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: #cdd6f5; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .small { margin-top: 26px; font-size: .82rem; opacity: .75; }

/* ---------- Game shell ---------- */
.game-page { background: radial-gradient(ellipse at top, #fdf2da, var(--cream) 60%); min-height: 100vh; }
.game-head { padding: 34px 0 10px; text-align: center; }
.game-head h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.8rem); }
.game-head p { margin: 4px auto 0; color: var(--ink-soft); max-width: 50ch; }
.game-box {
  background: #fff; border-radius: 30px; box-shadow: var(--shadow); border: 1px solid var(--line);
  max-width: 720px; margin: 20px auto 40px; padding: 26px;
}
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--ink-soft); }
.progress { height: 12px; background: #f1ebdf; border-radius: 999px; overflow: hidden; margin: 12px 0 20px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 999px; transition: width .35s ease; }
.prompt { text-align: center; font-size: 1.35rem; font-weight: 700; margin: 6px 0 18px; }
.prompt .target { color: var(--green-dark); font-size: 1.8rem; display: block; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choice {
  font: inherit; font-weight: 700; font-size: 1.15rem; color: var(--ink);
  background: #fff; border: 3px solid var(--line); border-radius: 22px;
  padding: 16px 12px; cursor: pointer; min-height: 72px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.choice:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.choice.letter { font-family: var(--arabic); font-size: 3.4rem; line-height: 1.1; min-height: 110px; font-weight: 400; }
.choice.correct { background: #e3f6ee; border-color: var(--green); }
.choice.wrong { background: #fde9e7; border-color: var(--rose); animation: shake .35s; }
.choice:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { min-height: 64px; margin-top: 18px; text-align: center; font-size: 1.02rem; color: var(--ink-soft); }
.feedback b { color: var(--ink); }
.feedback .ref { display: block; font-size: .85rem; margin-top: 2px; }
.game-actions { display: flex; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.mode-switch { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.mode-switch button { font: inherit; font-weight: 700; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--ink-soft); }
.mode-switch button[aria-pressed="true"] { background: var(--night); color: #fff; border-color: var(--night); }
.result { text-align: center; padding: 10px 0; }
.result .stars-row { font-size: 3rem; letter-spacing: 6px; }
.result h2 { margin: 6px 0; }
.hidden { display: none !important; }

.info-box { max-width: 720px; margin: 0 auto 40px; color: var(--ink-soft); font-size: 1rem; }
.info-box h2 { color: var(--ink); font-size: 1.5rem; }

/* ---------- Content pages ---------- */
.page-head { padding: 54px 0 40px; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); }
.page-head p { color: #cdd6f5; max-width: 60ch; margin: 6px 0 0; }
.prose { max-width: 740px; margin: 40px auto; }
.prose h2 { font-size: 1.6rem; margin-top: 34px; }
.prose li { margin: 6px 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { padding: 40px 0 110px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 150px; order: -1; }
  .lantern { top: -50px; }
  .lantern img { width: 64px; }
  .lantern.l2 img { width: 50px; }
  .lantern.l3 img { width: 40px; }
  .moon { width: 90px; bottom: 0; }
  .gotd { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .ramadan-band { grid-template-columns: 1fr; padding: 26px 20px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .choice.letter { font-size: 2.8rem; min-height: 96px; }
  .game-box { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Language switcher & RTL ---------- */
.head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; font-weight: 600; font-size: .95rem; color: #dfe6ff;
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); white-space: nowrap;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60;
  list-style: none; margin: 0; padding: 6px; min-width: 160px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
}
.lang-switch li a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.lang-switch li a:hover, .lang-switch li a[aria-current="true"] { background: #eef7f3; color: var(--green-dark); }
.logo span { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .eyebrow, [dir="rtl"] .page .num, [dir="rtl"] .tag { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .gotd, [dir="rtl"] .trust-item { text-align: right; }
/* ---------- Compact header on phones ---------- */
@media (max-width: 760px) {
  .site-header { position: relative; }
  .site-header .wrap { min-height: 0; padding: 8px 0; gap: 6px; }
  .head-right { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; min-width: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 5px 9px; font-size: .9rem; white-space: nowrap; }
  .lang-switch summary { padding: 5px 10px; font-size: .85rem; }
  .logo { font-size: 1.15rem; }
}
/* ---------- Tools (prayer times, zakat) ---------- */
.tool-box { background: #fff; border-radius: 30px; box-shadow: var(--shadow); border: 1px solid var(--line); max-width: 860px; margin: 20px auto 40px; padding: 26px; }
.controls { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.field select, .field input {
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: 14px; padding: 9px 12px; width: 100%; min-width: 0;
}
.field select:focus, .field input:focus { outline: none; border-color: var(--gold); }
.msg { min-height: 24px; margin: 10px 0 0; color: var(--ink-soft); font-size: .95rem; }
.msg.err { color: #b4443b; }
.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0 10px; }
.pt-head h2 { margin: 0; font-size: 1.5rem; }
.pt-head p { margin: 2px 0 0; color: var(--ink-soft); }
.pt-next { background: var(--night); color: #fff; border-radius: 20px; padding: 12px 18px; text-align: center; min-width: 170px; }
.pt-next span { display: block; font-size: .85rem; color: #cdd6f5; }
.pt-next b { display: block; font-size: 1.4rem; color: var(--gold); line-height: 1.3; }
.pt-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.pt-table td { padding: 12px 16px; background: #faf6ee; font-size: 1.1rem; }
.pt-table td:first-child { border-start-start-radius: 14px; border-end-start-radius: 14px; font-weight: 700; }
.pt-table td:last-child { border-start-end-radius: 14px; border-end-end-radius: 14px; text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.pt-table tr.now td { background: #e3f6ee; }
.pt-table tr.minor td { background: transparent; color: var(--ink-soft); font-size: .98rem; padding-top: 4px; padding-bottom: 4px; }
.pt-table small { display: block; font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
.qibla { display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 14px 16px; border-radius: 18px; background: #eef7f3; }
.qibla svg { width: 56px; height: 56px; flex: 0 0 56px; }
.qibla p { margin: 0; }
.table-scroll { overflow-x: auto; margin-top: 14px; border-radius: 14px; border: 1px solid var(--line); }
.pt-month { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.pt-month th, .pt-month td { padding: 7px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid #f1ebdf; }
.pt-month th { background: var(--night); color: #fff; position: sticky; top: 0; }
.pt-month tr.today td { background: #fff3cf; font-weight: 800; }

.zk-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.zk-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.zk-section h3 { margin: 0 0 10px; font-size: 1.15rem; }
.zk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hint { font-size: .88rem; color: var(--ink-soft); margin: 8px 0 0; font-weight: 500; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 700; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.radio-row input { accent-color: var(--green); }
.zk-result { margin-top: 20px; border-radius: 22px; background: var(--night); color: #fff; padding: 20px 22px; }
.zk-result .big { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; color: var(--gold); line-height: 1.2; font-variant-numeric: tabular-nums; }
.zk-result dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 14px 0 0; color: #cdd6f5; font-size: .95rem; }
.zk-result dd { margin: 0; text-align: end; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.tool-card .art { font-size: 3rem; }

@media (max-width: 760px) {
  .controls { grid-template-columns: 1fr; }
  .tool-box { padding: 18px; border-radius: 24px; }
  .pt-next { width: 100%; }
  .pt-table td { padding: 10px 12px; font-size: 1rem; }
}