/* ============================================================
   Shared styles for all Kids Corner pages (kids.html + topic pages).
============================================================ */
:root {
  --teal: #04B2AB;
  --teal-dark: #038C86;
  --coral: #FF6B6B;
  --coral-dark: #E8514F;
  --yellow: #FFC93C;
  --yellow-dark: #F0AD1E;
  --purple: #9B5DE5;
  --purple-dark: #7C3FD1;
  --green: #06D6A0;
  --green-dark: #04A97E;
  --blue: #3A86FF;
  --rose: #F4518C;
  --rose-dark: #D6336C;
  --cream: #FFFBF0;
  --navy: #1C2B4A;
  --sidebar: #23234A;
  --sidebar-hover: #32325E;
  --text: #2D2A32;
  --text-soft: #5C5868;
  --white: #FFFFFF;
}
* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Quicksand', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}
h1, h2, h3, .display { font-family: 'Baloo 2', cursive; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ── APP SHELL (sidebar dashboard layout) ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar);
  color: var(--white);
  padding: 1.6rem 1.1rem;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 1.8rem;
  padding: 0 0.5rem;
  text-decoration: none;
}
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; }
.sidebar-brand-text {
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 1rem; line-height: 1.15;
  color: var(--white);
}
.sidebar-brand-text span { display: block; font-size: 0.62rem; color: var(--yellow); font-weight: 600; }
.sidebar-kicker {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); padding: 0 0.6rem; margin: 0.6rem 0 0.5rem;
}
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.65rem 0.7rem; border-radius: 12px;
  font-family: 'Baloo 2', cursive; font-weight: 600; font-size: 0.92rem;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); }
.sidebar-nav a.active { background: var(--sidebar-hover); color: var(--white); }
.sidebar-nav .icon-badge {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; flex-shrink: 0;
}
.sidebar-spacer { flex: 1; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 0.8rem; margin-top: 0.8rem; }
.sidebar-foot a { font-size: 0.8rem; color: rgba(255,255,255,0.55); padding: 0.5rem 0.7rem; display:block; text-decoration: none; }
.sidebar-foot a:hover { color: var(--white); }

.main { flex: 1; min-width: 0; }

.topbar {
  padding: 1.6rem 2.2rem;
  background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 100%);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem;
}
.topbar-main { min-width: 0; }
.topbar .emoji { font-size: 2rem; margin-bottom: 0.4rem; }
.topbar h1 { color: var(--white); font-size: 1.6rem; }
.topbar p, .topbar .sub { color: rgba(255,255,255,0.88); font-size: 0.92rem; margin-top: 0.3rem; max-width: 520px; }

.mobile-nav-toggle { display: none; }

/* ── TOPBAR USER SLOT (top-right: who's logged in) ── */
.topbar-user {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 0.7rem;
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 0.5rem 0.6rem 0.5rem 1rem;
}
.kids-user-name {
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 0.88rem;
  color: var(--white); white-space: nowrap;
}
.kids-user-switch {
  font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 0.72rem;
  color: var(--navy); background: var(--white);
  border: none; border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer;
  white-space: nowrap;
}
.kids-user-switch:hover { background: var(--cream); }
.kids-user-progress {
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 0.72rem;
  color: var(--white); background: rgba(255,255,255,0.22);
  border-radius: 999px; padding: 0.4rem 0.8rem; text-decoration: none;
  white-space: nowrap;
}
.kids-user-progress:hover { background: rgba(255,255,255,0.34); }

/* ── PASSCODE GATE (blocks the page until a passcode is entered) ── */
html.kids-locked .app-shell { display: none; }
.kids-gate {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(180deg, #2C3A63 0%, var(--navy) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.kids-gate-card {
  background: var(--white); border-radius: 28px;
  padding: 2.4rem 2.2rem; max-width: 380px; width: 100%;
  text-align: center;
  box-shadow: 0 10px 0 rgba(0,0,0,0.15);
}
.kids-gate-logo { font-size: 2.6rem; margin-bottom: 0.6rem; }
.kids-gate-card h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: 0.6rem; }
.kids-gate-card > p { font-size: 0.92rem; color: var(--text-soft); line-height: 1.55; margin-bottom: 1.4rem; }
.kids-gate-form { display: flex; flex-direction: column; gap: 0.8rem; }
.kids-gate-form input {
  font-family: 'Quicksand', sans-serif; font-size: 1.05rem; text-align: center;
  padding: 0.85rem 1rem; border-radius: 14px; border: 2px solid rgba(0,0,0,0.1);
  background: var(--cream); color: var(--navy);
}
.kids-gate-form input:focus { outline: none; border-color: var(--teal); }
.kids-gate-btn {
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 1rem;
  color: var(--white); background: var(--teal);
  border: none; border-radius: 999px; padding: 0.85rem 1rem; cursor: pointer;
}
.kids-gate-btn:hover { background: var(--teal-dark); }
.kids-gate-btn:disabled { opacity: 0.6; cursor: default; }
.kids-gate-status { font-size: 0.85rem; min-height: 1.2em; color: var(--text-soft); }
.kids-gate-status.err { color: var(--coral-dark); font-weight: 600; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-user { align-self: flex-start; }
}

/* ── SIDEBAR TOPIC GRID (hub page, inside .main) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
}
.big-card {
  display: flex; flex-direction: column;
  border-radius: 24px; padding: 1.8rem 1.6rem;
  min-height: 190px;
  color: var(--white);
  text-decoration: none;
  position: relative; overflow: hidden;
}
.big-card .emoji-badge {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 0.9rem;
}
.big-card h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.big-card p { font-size: 0.88rem; opacity: 0.92; line-height: 1.5; flex: 1; }
.big-card .go-btn {
  align-self: flex-start;
  margin-top: 1rem;
  background: rgba(255,255,255,0.95);
  color: var(--navy);
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 0.85rem;
  padding: 0.55rem 1.1rem; border-radius: 999px;
}
.big-card .blob {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,0.12); top: -40px; right: -40px;
}
.bc-coral { background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%); }
.bc-teal { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); }
.bc-purple { background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%); }
.bc-green { background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); }
.bc-blue { background: linear-gradient(135deg, var(--blue) 0%, #1D4ED8 100%); }
.bc-navy { background: linear-gradient(135deg, #2C3A63 0%, var(--navy) 100%); }
.bc-rose { background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%); }
.bc-yellow { background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%); color: var(--navy); }
.bc-yellow .go-btn { background: var(--navy); color: var(--white); }
.bc-yellow .emoji-badge { background: rgba(28,43,74,0.14); }

.small-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem;
}
.small-card {
  background: var(--white); border-radius: 18px; padding: 1.1rem 1.2rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04); display: flex; align-items: center; gap: 0.8rem;
  opacity: 0.6;
}
.small-card .icon-badge {
  width: 38px; height: 38px; border-radius: 11px; background: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0;
}
.small-card .label { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 0.88rem; }
.small-card .tag { font-size: 0.68rem; color: var(--text-soft); display:block; }

/* ── HERO (hub page) ── */
#hero {
  position: relative;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, #FFF6DC 0%, var(--cream) 100%);
}
#hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}
#hero h1 .accent { color: var(--coral-dark); }
#hero h1 .accent2 { color: var(--teal-dark); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto;
  font-weight: 500;
}

/* ── PAGE HEADER (topic pages) ── */
.page-header {
  position: relative;
  padding: 2.6rem 1.5rem 2.2rem;
  text-align: center;
  overflow: hidden;
}
.page-header .emoji { font-size: 2.6rem; margin-bottom: 0.6rem; }
.page-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.page-header p {
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 500;
}
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--text-soft);
  margin-bottom: 1.2rem;
}
.back-link:hover { color: var(--teal-dark); }

/* ── TOPIC GRID (hub page) ── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}
.topic-card {
  display: block;
  text-decoration: none;
  background: var(--white);
  border-radius: 26px;
  padding: 1.8rem 1.5rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  border: 3px solid transparent;
  transition: transform 0.18s, border-color 0.18s;
}
.topic-card:hover { transform: translateY(-5px); }
.topic-card .topic-emoji {
  width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  color: var(--white);
  margin-bottom: 1rem;
}
.topic-card h2 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.topic-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}
.topic-card .topic-go {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 0.85rem;
}
.topic-card.c-coral { border-color: rgba(255,107,107,0.0); }
.topic-card.c-coral:hover { border-color: var(--coral); }
.topic-card.c-coral .topic-emoji { background: var(--coral); }
.topic-card.c-coral .topic-go { color: var(--coral-dark); }
.topic-card.c-teal:hover { border-color: var(--teal); }
.topic-card.c-teal .topic-emoji { background: var(--teal); }
.topic-card.c-teal .topic-go { color: var(--teal-dark); }
.topic-card.c-purple:hover { border-color: var(--purple); }
.topic-card.c-purple .topic-emoji { background: var(--purple); }
.topic-card.c-purple .topic-go { color: var(--purple-dark); }
.topic-card.c-green:hover { border-color: var(--green); }
.topic-card.c-green .topic-emoji { background: var(--green); }
.topic-card.c-green .topic-go { color: var(--green-dark); }
.topic-card.c-blue:hover { border-color: var(--blue); }
.topic-card.c-blue .topic-emoji { background: var(--blue); }
.topic-card.c-blue .topic-go { color: var(--blue); }

/* ── SECTION BASE ── */
.section { padding: 1rem 1.5rem 3.5rem; position: relative; }
.section-inner { max-width: 1000px; margin: 0 auto; position: relative; z-index: 1; }
.content { padding: 1.7rem 2rem 3rem; max-width: 1100px; }
.section-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft); margin: 2rem 0 1rem;
}
.section-title:first-child { margin-top: 0; }

/* ── QUR'AN ── */
.quran-intro {
  background: var(--white); border-radius: 20px; padding: 1.3rem 1.5rem;
  margin-bottom: 1.6rem; box-shadow: 0 3px 0 rgba(0,0,0,0.05);
  font-size: 0.92rem; line-height: 1.65; color: var(--text-soft);
}
.quran-intro strong { color: var(--navy); font-family: 'Baloo 2', cursive; }
.surah-list { display: flex; flex-direction: column; gap: 0.7rem; }
.surah-row {
  background: var(--white); border-radius: 20px;
  border: 3px solid transparent;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04);
  transition: border-color 0.18s, transform 0.18s;
}
.surah-row:hover { border-color: var(--teal); transform: translateY(-2px); }
.surah-num {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 0.95rem;
}
.surah-title-wrap { flex: 1; min-width: 0; }
.surah-title { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.surah-title .surah-arabic-name { font-size: 1.1rem; margin-inline-start: 0.4rem; color: var(--teal-dark); font-family: 'Noto Naskh Arabic', serif; }
.surah-meaning { font-size: 0.82rem; color: var(--text-soft); }
.surah-meta {
  font-size: 0.7rem; font-weight: 700; color: var(--text-soft);
  background: var(--cream); padding: 0.3rem 0.6rem; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.surah-chevron { font-size: 1.1rem; color: var(--text-soft); flex-shrink: 0; }

/* ── SURAH PAGE: view toggle + full/verse panels ── */
.view-toggle {
  display: inline-flex; background: var(--white); border-radius: 999px;
  padding: 0.3rem; gap: 0.2rem; margin-bottom: 1.6rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}
.view-toggle-btn {
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 0.85rem;
  border: none; background: transparent; color: var(--text-soft);
  padding: 0.55rem 1.2rem; border-radius: 999px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-toggle-btn.active { background: var(--navy); color: var(--white); }

.mushaf-block {
  background: var(--white); border-radius: 22px; padding: 2rem 2.2rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05); margin-bottom: 1.6rem;
}
.mushaf-text {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.6rem; line-height: 2.6; text-align: right; direction: rtl;
  color: var(--navy);
}
.ayah-end {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--cream); color: var(--teal-dark);
  font-family: 'Quicksand', sans-serif; font-size: 0.7rem; font-weight: 700;
  margin: 0 0.3rem; vertical-align: middle;
}

.surah-body-plain {
  background: var(--white); border-radius: 22px; padding: 0.4rem 1.6rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05); margin-bottom: 1.6rem;
}
.verse-row { padding: 1.1rem 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.verse-row:last-child { border-bottom: none; }
.verse-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.5rem; line-height: 2.1; text-align: right; direction: rtl;
  color: var(--navy); margin-bottom: 0.6rem;
}
.verse-ar .ayah-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--cream); color: var(--teal-dark);
  font-family: 'Quicksand', sans-serif; font-size: 0.75rem; font-weight: 700;
  margin-inline-start: 0.5rem; vertical-align: middle;
}
.verse-en { font-size: 0.9rem; line-height: 1.65; color: var(--text-soft); }

.surah-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 0.5rem;
}
.surah-nav-link {
  font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 0.85rem;
  text-decoration: none; color: var(--teal-dark);
  background: var(--white); padding: 0.6rem 1.1rem; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}
.surah-nav-list { color: var(--text-soft); }

/* ── PILLARS ── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.3rem;
}
.pillar-card {
  background: var(--white);
  border-radius: 24px;
  padding: 1.6rem 1.4rem;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}
.pillar-card:hover { transform: translateY(-4px); }
.pillar-card[open] { border-color: var(--yellow); }
.pillar-card summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.9rem;
}
.pillar-card summary::-webkit-details-marker { display: none; }
.pillar-num {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 1.2rem;
  color: var(--white); flex-shrink: 0;
}
.pillar-title-wrap { flex: 1; }
.pillar-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}
.pillar-arabic { font-size: 0.85rem; color: var(--text-soft); }
.pillar-chevron {
  font-size: 1.1rem;
  color: var(--text-soft);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.pillar-card[open] .pillar-chevron { transform: rotate(180deg); }
.pillar-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed rgba(0,0,0,0.08);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}
.pillar-body strong { color: var(--navy); }

/* ── TAJWEED PAGER (one rule at a time, with arrows) ── */
.tajweed-pager { display: flex; align-items: stretch; gap: 1rem; }
.tajweed-pager .pillar-card { flex: 1; cursor: default; min-width: 0; }
.tajweed-pager .pillar-card:hover { transform: none; }
.tajweed-head { display: flex; align-items: center; gap: 0.9rem; }
.tajweed-arrow {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--white); box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  font-size: 1.6rem; font-weight: 800; color: var(--rose-dark); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  align-self: center; transition: transform 0.15s, opacity 0.15s;
}
.tajweed-arrow:hover:not(:disabled) { transform: scale(1.08); }
.tajweed-arrow:disabled { opacity: 0.25; cursor: default; }
.tajweed-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.2rem; }
.tajweed-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(0,0,0,0.15); transition: background 0.15s, transform 0.15s; }
.tajweed-dot.active { background: var(--rose); transform: scale(1.3); }
.tajweed-ar { font-family: 'Noto Naskh Arabic', serif; font-size: 1.05rem; }
.tajweed-tip {
  margin-top: 1rem; background: rgba(0,0,0,0.04); border-radius: 12px;
  padding: 0.9rem 1rem; border-left: 4px solid var(--rose);
}
.tajweed-tip strong { color: var(--rose-dark); }
@media (max-width: 640px) {
  .tajweed-arrow { width: 38px; height: 38px; font-size: 1.3rem; }
  .tajweed-pager { gap: 0.5rem; }
}

/* ── STEP SECTIONS (Wudu / Salah) ── */
.steps-wrap { display: grid; gap: 1rem; }
.step-card {
  background: var(--white);
  border-radius: 20px;
  padding: 1.2rem 1.4rem;
  display: flex; align-items: flex-start; gap: 1rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
  border: 2px solid rgba(0,0,0,0.05);
}
.step-num-badge {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', cursive; font-weight: 800;
  color: var(--white); flex-shrink: 0; font-size: 1.05rem;
}
.step-text strong { color: var(--navy); font-family: 'Baloo 2', cursive; font-weight: 600; }
.step-text { font-size: 0.95rem; line-height: 1.6; }

.theme-wudu .step-num-badge { background: var(--teal); }
.theme-salah .step-num-badge { background: var(--purple); }

.salah-times {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.salah-time {
  background: var(--purple);
  color: var(--white);
  border-radius: 16px;
  text-align: center;
  padding: 0.9rem 0.5rem;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
}
.salah-time span {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 0.2rem;
}

/* ── FASTING ── */
.fasting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.3rem;
  margin-bottom: 1.6rem;
}
.fasting-card {
  background: var(--white);
  border-radius: 20px;
  padding: 1.4rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.fasting-card h3 { font-size: 1.05rem; color: var(--coral-dark); margin-bottom: 0.5rem; }
.fasting-card p { font-size: 0.92rem; line-height: 1.65; color: var(--text); }
.ramadan-banner {
  background: var(--navy);
  color: var(--white);
  border-radius: 24px;
  padding: 1.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ramadan-banner h3 { font-size: 1.3rem; color: var(--yellow); margin-bottom: 0.5rem; }
.ramadan-banner p { color: rgba(255,255,255,0.75); font-size: 0.95rem; max-width: 420px; margin: 0 auto; }

/* ── VIDEOS ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.video-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.video-frame-wrap { position: relative; width: 100%; padding-top: 56.25%; background: var(--navy); }
.video-frame-wrap iframe { position: absolute; top:0; left:0; width: 100%; height: 100%; border: 0; }
.video-card-body { padding: 1rem 1.2rem 1.3rem; }
.video-card-body h3 { font-size: 1rem; color: var(--navy); margin-bottom: 0.3rem; }
.video-card-body p { font-size: 0.85rem; color: var(--text-soft); }
.video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.55);
  font-family: 'Baloo 2', cursive;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.video-placeholder .big { font-size: 2rem; }

/* ── TEACHER PROGRESS PAGE ── */
.teacher-only-msg {
  background: var(--white); border-radius: 20px; padding: 2.4rem 1.6rem;
  text-align: center; max-width: 420px; margin: 1rem auto;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.teacher-only-msg .big { font-size: 2.2rem; display: block; margin-bottom: 0.6rem; }
.teacher-only-msg p { color: var(--text-soft); font-size: 0.95rem; line-height: 1.55; }
.teacher-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.3rem;
}
.teacher-dash-card {
  background: var(--white); border-radius: 20px; padding: 1.3rem 1.4rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.teacher-dash-card h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: 0.7rem; }
.teacher-dash-topics { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.teacher-dash-topics li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  padding-bottom: 0.55rem; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.86rem;
}
.teacher-dash-topics li:last-child { border-bottom: none; padding-bottom: 0; }
.teacher-dash-topics .t-name { color: var(--text); font-weight: 600; }
.teacher-dash-topics .t-meta { color: var(--text-soft); white-space: nowrap; font-size: 0.78rem; }
.kids-loading, .kids-empty { color: var(--text-soft); font-size: 0.92rem; }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2.2rem 1.5rem;
  font-size: 0.82rem;
}
footer a { color: var(--yellow); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .footer-brand {
  font-family: 'Baloo 2', cursive;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

@media (max-width: 640px) {
  .nav-links { gap: 0.35rem; }
  .nav-links a { font-size: 0.72rem; padding: 0.4rem 0.7rem; }
  .section { padding: 0.5rem 1.1rem 2.6rem; }
}

/* ── RESPONSIVE SHELL ── */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center;
    padding: 0.8rem 1rem; gap: 0.8rem; overflow-x: auto;
  }
  .sidebar-brand { margin-bottom: 0; flex-shrink: 0; }
  .sidebar-kicker { display: none; }
  .sidebar-nav { flex-direction: row; }
  .sidebar-spacer { display: none; }
  .sidebar-foot { display: none; }
  .content { padding: 1.3rem 1.1rem 2.6rem; }
  .topbar { padding: 1.2rem 1.3rem; }
}

/* ============================================================
   QUIZZES
============================================================ */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.quiz-pick-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem 1.2rem 1.5rem;
  border-radius: 20px;
  color: var(--white);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  transition: transform 0.15s ease;
}
.quiz-pick-card:hover { transform: translateY(-3px); }
.quiz-pick-emoji { font-size: 2rem; }
.quiz-pick-title { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 1.15rem; }
.quiz-pick-stars { font-size: 0.85rem; opacity: 0.95; letter-spacing: 0.02em; }
.quiz-pick-card .go-btn {
  margin-top: 0.5rem;
  align-self: flex-start;
  background: rgba(255,255,255,0.22);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.quiz-progress {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 0.8rem;
  text-align: center;
}
.quiz-card {
  background: var(--white);
  border-radius: 22px;
  padding: 1.8rem 1.6rem;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}
.quiz-q {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  color: var(--text);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.quiz-opt {
  text-align: left;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 2px solid #ECE9F1;
  background: var(--cream);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--purple); background: #F4EEFF; }
.quiz-opt:disabled { cursor: default; opacity: 0.85; }
.quiz-opt-correct { border-color: var(--green) !important; background: #E3FBF3 !important; }
.quiz-opt-wrong { border-color: var(--coral) !important; background: #FFECEC !important; }

.quiz-explain {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.quiz-explain.is-right { background: #E3FBF3; color: #0A7A58; }
.quiz-explain.is-wrong { background: #FFF4E5; color: #946200; }

.quiz-next-btn {
  display: inline-block;
  margin-top: 1.1rem;
  margin-right: 0.6rem;
  padding: 0.7rem 1.3rem;
  border: none;
  border-radius: 999px;
  color: var(--white);
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.quiz-next-btn-outline {
  background: transparent !important;
  color: var(--text) !important;
  border: 2px solid #ECE9F1;
}

.quiz-result {
  background: var(--white);
  border-radius: 22px;
  padding: 2.2rem 1.6rem;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}
.quiz-result-stars { font-size: 2.6rem; color: var(--yellow-dark); letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.quiz-result h2 { font-family: 'Baloo 2', cursive; margin-bottom: 0.5rem; }
.quiz-result-score { color: var(--text-soft); margin-bottom: 0.4rem; }
.quiz-result-actions { margin-top: 1rem; }

.stars-card {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  color: var(--navy);
}
.stars-card .label { color: var(--navy); }

@media (max-width: 640px) {
  .quiz-card, .quiz-result { padding: 1.3rem 1.1rem; }
  .quiz-next-btn { display: block; width: 100%; margin: 0.5rem 0 0; text-align: center; }
}

/* ============================================================
   JOURNEY PATH — a friendlier step-by-step layout for Wudu & Salah,
   replacing the plain numbered list with a winding trail of stops.
============================================================ */
.journey-intro {
  text-align: center;
  max-width: 540px;
  margin: 0 auto 1.8rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}
.journey {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.journey::before {
  content: '';
  position: absolute;
  left: 37px;
  top: 14px;
  bottom: 14px;
  width: 4px;
  background-image: linear-gradient(var(--yellow) 60%, transparent 0%);
  background-position: left;
  background-size: 4px 16px;
  background-repeat: repeat-y;
  border-radius: 4px;
}
.journey-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}
.journey-emoji {
  position: relative;
  flex-shrink: 0;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2.1rem;
  color: var(--white);
  box-shadow: 0 6px 14px rgba(0,0,0,0.16);
  border: 4px solid var(--cream);
}
.journey-emoji img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.journey-emoji .journey-num {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cream);
}
.journey-body {
  flex: 1;
  background: var(--white);
  border-radius: 18px;
  padding: 1rem 1.3rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  margin-top: 0.5rem;
}
.journey-title {
  display: block;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--navy);
  margin-bottom: 0.2rem;
}
.journey-text { font-size: 0.93rem; line-height: 1.55; color: var(--text); }
.journey-text strong { color: var(--navy); }
.journey-finish {
  position: relative;
  margin-top: 0.3rem;
  margin-left: 96px;
  text-align: left;
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  color: var(--navy);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

@media (max-width: 640px) {
  .journey::before { left: 29px; }
  .journey-emoji { width: 66px; height: 66px; font-size: 1.6rem; }
  .journey-body { padding: 0.85rem 1rem; margin-top: 0.3rem; }
  .journey-finish { margin-left: 72px; padding: 0.9rem 1.1rem; font-size: 0.92rem; }
}

/* ── SALAH PAGE: trail on the left, the duas you say along the way on the right ── */
.salah-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 1.6rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.salah-layout .journey { max-width: none; margin: 0; }
.dua-rail {
  position: sticky;
  top: 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.dua-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dua-card {
  background: var(--white);
  border-radius: 20px;
  border-top: 6px solid var(--purple);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}
.dua-card-label {
  display: inline-block;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--white);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.dua-card-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.dua-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.05rem;
  line-height: 1.8;
  text-align: right;
  direction: rtl;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.dua-translit {
  font-size: 0.74rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.55rem;
}
.dua-en { font-size: 0.72rem; line-height: 1.45; color: var(--text-soft); }

@media (max-width: 1140px) and (min-width: 861px) {
  .salah-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .dua-rail { flex-direction: column; }
  .dua-card-title { font-size: 1.05rem; }
  .dua-ar { font-size: 1.25rem; line-height: 2; }
  .dua-translit { font-size: 0.85rem; }
  .dua-en { font-size: 0.83rem; line-height: 1.55; }
  .dua-card-label { font-size: 0.68rem; padding: 0.25rem 0.6rem; }
}

@media (max-width: 860px) {
  .salah-layout { grid-template-columns: 1fr; }
  .dua-rail { position: static; }
  .dua-card-title { font-size: 1rem; }
  .dua-ar { font-size: 1.15rem; line-height: 1.9; }
}

@media (max-width: 560px) {
  .dua-rail { flex-direction: column; }
  .dua-card-title { font-size: 1.05rem; }
  .dua-ar { font-size: 1.25rem; line-height: 2; }
  .dua-translit { font-size: 0.85rem; }
  .dua-en { font-size: 0.83rem; line-height: 1.55; }
}
