/* الدسوقي أكاديمي — تأسيس | shared styles, mobile-first, RTL */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #b45309;
  --brand-soft: #f59e0b;
  --blue: #1d4ed8;
  --green: #059669;
  --bg: #fffbeb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
}
html { direction: rtl; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.7;
}
body.adult { --bg: #f1f5f9; --brand: #1d4ed8; --brand-soft: #3b82f6; }
.wrap { max-width: 520px; margin: 0 auto; padding: 14px 14px 90px; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
h1 { font-size: 24px; }
h2 { font-size: 20px; margin: 14px 0 8px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px;
}
.topbar img { width: 44px; height: 44px; border-radius: 50%; }
.topbar .name { font-weight: 800; color: var(--brand); font-size: 18px; }
.backbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blue); color: #fff; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 15px; font-weight: 700; text-decoration: none;
  cursor: pointer;
}

.hero {
  background: var(--card); border-radius: 20px; padding: 22px 16px;
  text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-top: 8px;
}
.hero img { width: 110px; height: 110px; border-radius: 50%; }
.hero h1 { color: var(--brand); margin: 10px 0 4px; }

.btn {
  display: block; width: 100%; border: none; border-radius: 16px;
  padding: 16px; font-size: 19px; font-weight: 800; cursor: pointer;
  margin: 10px 0; text-decoration: none; text-align: center;
}
.btn-start { background: #facc15; color: #713f12; }
.btn-kids { background: var(--brand-soft); color: #fff; }
.btn-adult { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: #e5e7eb; color: var(--ink); }
.btn:disabled { background: #d1d5db; color: #9ca3af; cursor: not-allowed; }
.btn small { display: block; font-size: 13px; font-weight: 600; opacity: .85; }

.statbar {
  display: flex; gap: 8px; margin: 10px 0;
}
.stat {
  flex: 1; background: var(--card); border-radius: 14px; padding: 8px 6px;
  text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.stat b { display: block; font-size: 19px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); }

.maprow {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 10px 14px;
  margin: 8px 0; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  text-decoration: none; color: var(--ink);
}
.maprow .circle {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; background: var(--brand-soft);
}
.maprow.blend .circle { background: var(--green); font-size: 20px; }
.maprow.locked { opacity: .55; }
.maprow.locked .circle { background: #9ca3af; }
.maprow.done .circle { background: var(--green); }
.maprow .t { flex: 1; }
.maprow .t b { display: block; font-size: 17px; }
.maprow .t span { font-size: 13px; color: var(--muted); }
.maprow .state { font-size: 22px; }

.stepcard {
  background: var(--card); border-radius: 18px; padding: 16px;
  margin: 12px 0; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stepcard h3 { color: var(--brand); font-size: 18px; margin-bottom: 8px; }
.stepnum {
  display: inline-block; background: var(--brand); color: #fff;
  border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700;
}

.bigletter {
  font-size: 110px; font-weight: 900; color: var(--brand);
  text-align: center; line-height: 1.1; direction: ltr;
}

.cards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tcard {
  background: #fff; border: 3px solid var(--brand-soft); border-radius: 16px;
  width: 31%; min-width: 96px; padding: 10px 6px; text-align: center;
  cursor: pointer; user-select: none;
}
.tcard .em { font-size: 44px; display: block; }
.tcard .en { font-weight: 800; font-size: 16px; direction: ltr; display: block; }
.tcard .ar { font-size: 13px; color: var(--muted); display: block; }
.tcard:active { transform: scale(.95); }
.tcard.picked { border-color: var(--green); background: #ecfdf5; }
.tcard.wrong { border-color: #dc2626; background: #fef2f2; }

.blendrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  direction: ltr; margin: 10px 0; font-size: 30px; font-weight: 800;
}
.blendrow .pc {
  background: #eff6ff; border: 2px solid var(--blue); color: var(--blue);
  border-radius: 12px; padding: 6px 14px; cursor: pointer;
}
.blendrow .res {
  background: #ecfdf5; border: 2px solid var(--green); color: var(--green);
  border-radius: 12px; padding: 6px 14px; cursor: pointer;
}
.blendrow .op { color: var(--muted); }

.videobox {
  background: #111827; color: #d1d5db; border-radius: 14px;
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 10px; overflow: hidden;
}
.videobox iframe { width: 100%; height: 100%; border: 0; border-radius: 14px; }

canvas.trace {
  width: 100%; height: 220px; background: #fff; border-radius: 14px;
  border: 2px dashed var(--brand-soft); touch-action: none;
}

.quizopt {
  display: block; width: 100%; background: #fff; border: 3px solid #e5e7eb;
  border-radius: 14px; padding: 12px; margin: 8px 0; font-size: 17px;
  font-weight: 700; cursor: pointer; text-align: center;
}
.quizopt.right { border-color: var(--green); background: #ecfdf5; }
.quizopt.bad { border-color: #dc2626; background: #fef2f2; }

.toast {
  position: fixed; bottom: 18px; right: 50%; transform: translateX(50%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 10px 22px; font-weight: 700; z-index: 50; display: none;
}
.starbust { font-size: 60px; text-align: center; animation: pop .5s; }
@keyframes pop { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }

.badgechip {
  display: inline-block; background: #fff7ed; border: 2px solid var(--brand-soft);
  border-radius: 999px; padding: 4px 12px; margin: 3px; font-size: 14px; font-weight: 700;
}
.badgechip.off { opacity: .35; filter: grayscale(1); }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }
input[type=text], input[type=url], select {
  width: 100%; padding: 12px; border-radius: 12px; border: 2px solid #e5e7eb;
  font-size: 16px; margin: 6px 0; font-family: inherit;
}

/* الفيديو هو الدرس */
.video-first { border: 3px solid var(--brand); }
.video-head { color: var(--brand); font-size: 20px; margin-bottom: 4px; }

/* عجلة السن */
.agewheel-wrap { position: relative; height: 240px; overflow: hidden; margin: 10px 0; }
.agewheel {
  height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; padding: 96px 0;
}
.agewheel .age {
  height: 48px; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; font-size: 22px; font-weight: 700; color: #9ca3af;
  transition: all .15s;
}
.agewheel .age.sel { font-size: 34px; color: var(--brand); font-weight: 900; }
.agewheel-hl {
  position: absolute; top: 96px; left: 15%; right: 15%; height: 48px;
  border-top: 3px solid var(--brand); border-bottom: 3px solid var(--brand);
  border-radius: 8px; pointer-events: none;
}
.agewheel-fade {
  position: absolute; left: 0; right: 0; height: 90px; pointer-events: none;
}
.agewheel-fade.top { top: 0; background: linear-gradient(#fff, transparent); }
.agewheel-fade.bot { bottom: 0; background: linear-gradient(transparent, #fff); }

/* الحرف/الصورة نفسه زرار الصوت */
.tapletter { cursor: pointer; user-select: none; border-radius: 22px; transition: transform .08s; }
.tapletter:active { transform: scale(.93); }
.chip {
  background: #eff6ff; color: var(--blue); border: 2px solid var(--blue);
  border-radius: 999px; padding: 7px 18px; font-weight: 800; font-size: 14px;
  font-family: inherit; cursor: pointer;
}
.chip:active { transform: scale(.96); }

/* سطر التعليمات نفسه: بيتقرا بصوت لما الطفل يدوس عليه */
.tapinstr {
  text-align: center; font-weight: 800; font-size: 17px; color: var(--ink);
  background: #fff7ed; border: 2px dashed var(--brand-soft); border-radius: 14px;
  padding: 9px 12px; margin: 4px auto 10px; max-width: 300px;
  cursor: pointer; user-select: none; transition: transform .08s;
}
.tapinstr:active { transform: scale(.96); }

/* ===== برنامج التأسيس ===== */
.hero2 { background: linear-gradient(160deg,#eff6ff,#e0e7ff); border-radius: 18px; padding: 16px 18px; margin: 10px 0 14px; }
.hero2 h1 { font-size: 22px; margin: 0 0 6px; color: #1d4ed8; }
.hero2 p { margin: 0 0 10px; color: #374151; font-size: 13px; line-height: 1.7; }
.statrow { display: flex; gap: 8px; }
.stat { flex: 1; background: #fff; border-radius: 12px; padding: 8px 6px; text-align: center; }
.stat b { display: block; font-size: 18px; color: #b45309; }
.stat span { font-size: 11px; color: #6b7280; }
.stagebox { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.stagehead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stagenum { background: #1d4ed8; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.stagename { font-weight: 800; font-size: 14px; }
.stagecount { margin-inline-start: auto; font-size: 11px; color: #6b7280; }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; min-height: 54px; padding: 5px 4px; border-radius: 10px; border: 1px solid #dbeafe; background: #f8fbff; text-decoration: none; color: #1f2937; }
.lchip .num { font-size: 11px; font-weight: 800; color: #1d4ed8; }
.lchip .ttl { font-size: 10px; text-align: center; line-height: 1.25; margin-top: 2px; }
.lchip.done { background: #ecfdf5; border-color: #a7f3d0; }
.lchip.done .num { color: #047857; }
.lchip.next { border-color: #b45309; background: #fffbeb; }
.lchip.locked { opacity: .45; }
.rowline { padding: 6px 0; border-bottom: 1px dashed #e5e7eb; font-size: 13.5px; line-height: 1.7; }
.rowline:last-child { border-bottom: 0; }
.label { color: #b45309; font-weight: 800; }
.exline { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; flex-wrap: wrap; }
.exline .en { direction: ltr; font-weight: 700; }
.exline .ar { color: #6b7280; font-size: 12.5px; }
.dline { display: flex; gap: 8px; padding: 8px 10px; margin: 6px 0; border-radius: 12px; background: #f8fafc; }
.dline.b { background: #eff6ff; }
.dline .en { display: block; direction: ltr; font-weight: 700; }
.dline .ar { display: block; color: #6b7280; font-size: 12.5px; }
.say { background: #fff; border: 2px solid #bfdbfe; color: #1d4ed8; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
.say:active { transform: scale(.94); }
.gtab { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.gtab td { border: 1px solid #e5e7eb; padding: 6px 8px; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pair { display: flex; align-items: center; gap: 6px; background: #f8fafc; border-radius: 10px; padding: 6px 10px; }
.pair .vs { color: #9ca3af; }
.blist { padding-right: 18px; }
.blist li { margin: 4px 0; }
.model { background: #f8fafc; border-radius: 12px; padding: 8px 12px; margin-top: 6px; }
.cards.cols2 .tcard { width: 47%; }
.tcard .em { font-size: 30px; }
