/* ================= رحلة النور — Styles ================= */
:root {
  --sky1: #2b1d6b;
  --sky2: #5b3fb5;
  --sky3: #b86bd6;
  --sky4: #ffb4a2;
  --gold: #ffd23f;
  --gold2: #ffb703;
  --ink: #2d2250;
  --card: #fffdf7;
  --green: #22c55e;
  --red: #ff5d73;
  --u1: #ff9f1c;
  --u2: #2ec4b6;
  --u3: #9b5de5;
  --radius: 26px;
  --font: "Baloo Bhaijaan 2", "Segoe UI", Tahoma, "Arial", sans-serif;
  --quran: "Amiri", "Traditional Arabic", "Times New Roman", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky1);
  user-select: none;
  -webkit-user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; }
select { font-family: inherit; }
.hidden { display: none !important; }

/* ================= SKY ================= */
#sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 45%, var(--sky3) 78%, var(--sky4) 100%);
  background-size: 100% 140%;
  animation: skyShift 18s ease-in-out infinite alternate;
}
@keyframes skyShift { from { background-position: 0 0; } to { background-position: 0 100%; } }

#stars .st {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px #fff;
  animation: twinkle var(--d, 3s) ease-in-out infinite;
  animation-delay: var(--dl, 0s);
}
#stars .st.big { width: 7px; height: 7px; background: #fff7c2; box-shadow: 0 0 12px #ffe66d; }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.6);} 50% { opacity: 1; transform: scale(1.15);} }

.moon-bg {
  position: absolute; top: 9%; left: 7%;
  width: 90px; height: 90px; border-radius: 50%;
  box-shadow: -22px 10px 0 0 #fff1a8;
  filter: drop-shadow(0 0 20px rgba(255, 230, 120, .7));
  animation: floaty 6s ease-in-out infinite;
}

.cloud {
  position: absolute; background: rgba(255,255,255,.22); border-radius: 100px;
  filter: blur(1px);
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud.c1 { width: 180px; height: 50px; top: 22%; animation: drift 55s linear infinite; }
.cloud.c1::before { width: 80px; height: 80px; top: -40px; left: 25px; }
.cloud.c1::after { width: 60px; height: 60px; top: -28px; left: 90px; }
.cloud.c2 { width: 130px; height: 38px; top: 40%; animation: drift 75s linear infinite -30s; opacity: .7; }
.cloud.c2::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud.c2::after { width: 45px; height: 45px; top: -20px; left: 65px; }
.cloud.c3 { width: 220px; height: 60px; top: 60%; animation: drift 95s linear infinite -60s; opacity: .5; }
.cloud.c3::before { width: 100px; height: 100px; top: -50px; left: 40px; }
.cloud.c3::after { width: 70px; height: 70px; top: -34px; left: 120px; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }

#lanterns { position: absolute; top: 0; left: 0; right: 0; height: 0; }
.lantern {
  position: absolute; top: 0; transform-origin: top center;
  animation: swing var(--sw, 3.5s) ease-in-out infinite alternate;
}
.lantern .rope { width: 2px; margin: 0 auto; background: linear-gradient(#ffd23f, #c99a00); }
.lantern svg { display: block; filter: drop-shadow(0 0 10px rgba(255, 200, 60, .8)); }
@keyframes swing { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }

#skyline { position: absolute; bottom: 0; left: 0; width: 100%; height: 26vh; }

#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; width: 100%; height: 100%; }

/* ================= TOP BAR ================= */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
}
#topbar .spacer { flex: 1; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 18px; font-size: 26px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15);
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.off { opacity: .45; filter: grayscale(1); }
#scoreBox {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #fff6c9, #ffd23f); color: #7a4b00;
  padding: 6px 18px 6px 14px; border-radius: 30px; font-weight: 800; font-size: 26px;
  box-shadow: 0 5px 0 #d99a00, 0 8px 20px rgba(0,0,0,.25);
}
#scoreBox.bump { animation: bump .5s; }
.star-ico { display: inline-block; animation: spin 4s linear infinite; }
@keyframes bump { 0% { transform: scale(1);} 40% { transform: scale(1.35);} 100% { transform: scale(1);} }
@keyframes spin { to { transform: rotate(360deg);} }

/* ================= SCREENS ================= */
#app { position: relative; z-index: 10; height: 100%; }
.screen {
  position: absolute; inset: 0; padding: 76px 16px 16px;
  display: none; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: block; animation: screenIn .55s cubic-bezier(.2,1.4,.4,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(40px) scale(.96);} to { opacity: 1; transform: none;} }

/* ================= BUTTONS ================= */
.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: clamp(24px, 4.5vw, 36px); font-weight: 800; color: #fff;
  padding: 16px 44px; border-radius: 999px;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.big-btn.small { font-size: clamp(20px, 3.6vw, 28px); padding: 12px 30px; }
.big-btn.play { background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: 0 8px 0 #0f7a36, 0 14px 30px rgba(0,0,0,.3); }
.big-btn.alt { background: linear-gradient(180deg, #a78bfa, #7c3aed); box-shadow: 0 8px 0 #5b21b6, 0 14px 30px rgba(0,0,0,.3); }
.big-btn.check { background: linear-gradient(180deg, #38bdf8, #0284c7); box-shadow: 0 8px 0 #075985, 0 14px 30px rgba(0,0,0,.3); }
.big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.big-btn:disabled { filter: grayscale(1) brightness(.85); opacity: .6; cursor: not-allowed; }
.big-btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.06);} }

/* ================= MASCOT (Noor the moon) ================= */
.mascot { width: 170px; height: 170px; position: relative; animation: floaty 3.2s ease-in-out infinite; }
.mascot.small { width: 110px; height: 110px; }
.mascot svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 22px rgba(255, 220, 90, .65)); }
.mascot .eye { transform-origin: center; transform-box: fill-box; animation: blink 4.5s infinite; }
.mascot .mouth-sad, .mascot .mouth-wow { display: none; }
.mascot.happy { animation: jump .6s ease-in-out 3; }
.mascot.sad { animation: wobble .8s ease-in-out 2; }
.mascot.sad .mouth-happy { display: none; }
.mascot.sad .mouth-sad { display: inline; }
.mascot.wow .mouth-happy { display: none; }
.mascot.wow .mouth-wow { display: inline; }
.mascot.dance { animation: dance 1s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-12px);} }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1);} 95% { transform: scaleY(.1);} }
@keyframes jump { 0%,100% { transform: translateY(0) scale(1);} 30% { transform: translateY(-40px) scale(1.1) rotate(-8deg);} 60% { transform: translateY(0) scale(.95, 1.05);} }
@keyframes wobble { 0%,100% { transform: rotate(0);} 25% { transform: rotate(-10deg);} 75% { transform: rotate(10deg);} }
@keyframes dance { 0%,100% { transform: rotate(-12deg) translateY(0);} 50% { transform: rotate(12deg) translateY(-20px);} }

/* ================= HOME ================= */
.home-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding-bottom: 12vh; }
.mascot-stage { display: flex; align-items: center; gap: 10px; flex-direction: row; }
.bubble {
  background: #fff; color: var(--ink); padding: 14px 20px; border-radius: 24px;
  font-size: clamp(18px, 3.4vw, 24px); font-weight: 700; position: relative; max-width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: pop .6s .4s both cubic-bezier(.2,1.6,.4,1);
}
.bubble::after {
  content: ""; position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  border: 10px solid transparent; border-left-color: #fff; border-right: 0;
}
@keyframes pop { from { transform: scale(0); opacity: 0;} to { transform: scale(1); opacity: 1;} }

.title { margin: 0; line-height: 1.1; font-size: clamp(56px, 13vw, 120px); font-weight: 800; position: relative; }
.title .t1 { color: #fff; text-shadow: 0 6px 0 #6b3fd1, 0 12px 30px rgba(0,0,0,.35); display: inline-block; animation: letterIn .8s both; }
.title .t2 {
  display: inline-block; animation: letterIn .8s .15s both, glow 2.5s ease-in-out infinite 1s;
  background: linear-gradient(180deg, #fff6b0, #ffd23f 50%, #ff9f1c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 #b45309);
}
.title .sparkle { position: absolute; top: -10px; left: -30px; font-size: .45em; animation: spin 3s linear infinite; }
@keyframes letterIn { from { transform: translateY(-120px) rotate(-20deg); opacity: 0;} 60% { transform: translateY(10px);} to { transform: none; opacity: 1;} }
@keyframes glow { 0%,100% { filter: drop-shadow(0 6px 0 #b45309) drop-shadow(0 0 0 #ffd23f);} 50% { filter: drop-shadow(0 6px 0 #b45309) drop-shadow(0 0 25px #ffd23f);} }
.subtitle { margin: 0 0 10px; color: #fff; font-size: clamp(16px, 3vw, 22px); opacity: .9; }
.teacher-badge {
  background: linear-gradient(90deg, #ffd6e8, #fff1f7, #ffd6e8); color: #9d174d; font-weight: 800;
  font-size: clamp(20px, 4vw, 28px); padding: 8px 26px; border-radius: 999px; margin-bottom: 8px;
  box-shadow: 0 5px 0 #f9a8d4, 0 10px 25px rgba(0,0,0,.25); animation: pop .6s .7s both cubic-bezier(.2,1.6,.4,1), floaty 4s ease-in-out infinite 1.3s;
}
.res-teacher { margin: 4px 0 0; font-size: clamp(20px, 4vw, 26px); font-weight: 800; color: #ffd6e8; }
.home-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; color: #fff; font-size: 18px; }
.home-badges .hb { background: rgba(255,255,255,.18); padding: 6px 14px; border-radius: 20px; }

/* ================= PICKER ================= */
#screen-pick { padding-bottom: 130px; }
.pick-head { text-align: center; color: #fff; max-width: 1000px; margin: 0 auto; }
.pick-head h2 { margin: 0; font-size: clamp(30px, 6vw, 44px); text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.pick-head .hint { margin: 4px 0 12px; opacity: .9; font-size: clamp(15px, 2.6vw, 19px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.chip {
  font-size: 18px; font-weight: 700; padding: 8px 18px; border-radius: 999px;
  background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.18);
  transition: transform .12s;
}
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip.u1 { background: var(--u1); color: #fff; }
.chip.u2 { background: var(--u2); color: #fff; }
.chip.u3 { background: var(--u3); color: #fff; }
.chip.all { background: linear-gradient(90deg, #ffd23f, #ff9f1c); color: #5a3300; }
.chip.clear { background: rgba(255,255,255,.25); color: #fff; }
.chip.go { background: #22c55e; color: #fff; }
.range-row {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.15); padding: 8px 14px; border-radius: 22px; margin-bottom: 8px;
}
.range-label { font-weight: 800; font-size: 18px; }
.range-row select {
  font-size: 16px; padding: 6px 10px; border-radius: 14px; border: none; max-width: 42vw;
  background: #fff; color: var(--ink); font-weight: 700;
}

#units { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.unit {
  background: rgba(255,255,255,.12); border-radius: 30px; padding: 14px; position: relative;
  border: 3px solid rgba(255,255,255,.25);
  animation: screenIn .6s both;
}
.unit-title {
  display: inline-flex; align-items: center; gap: 8px; margin: -32px auto 8px; position: relative;
  color: #fff; font-weight: 800; font-size: clamp(20px, 4vw, 26px); padding: 6px 22px; border-radius: 999px;
  box-shadow: 0 5px 0 rgba(0,0,0,.2);
}
.unit-head { text-align: center; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lesson {
  position: relative; background: var(--card); border-radius: 24px; padding: 12px 8px 10px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .18s cubic-bezier(.2,1.6,.4,1), box-shadow .18s;
  border: 4px solid transparent; color: var(--ink);
}
.lesson .ic { font-size: 44px; line-height: 1.1; transition: transform .3s; }
.lesson .nm { font-size: 16px; font-weight: 700; line-height: 1.5; min-height: 48px; display: flex; align-items: center; }
.lesson .num {
  position: absolute; top: -8px; right: -6px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 800; display: grid; place-items: center;
}
.lesson .best { font-size: 14px; letter-spacing: 1px; min-height: 18px; }
.lesson .check {
  position: absolute; top: -10px; left: -8px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 22px; display: grid; place-items: center;
  transform: scale(0); transition: transform .3s cubic-bezier(.2,1.8,.4,1);
  box-shadow: 0 3px 0 #15803d;
}
.lesson:active { transform: scale(.94); }
.lesson.sel { border-color: var(--green); transform: translateY(-4px); box-shadow: 0 10px 0 #15803d, 0 0 0 6px rgba(34,197,94,.3); }
.lesson.sel .check { transform: scale(1); }
.lesson.sel .ic { animation: wiggle .6s; }
@keyframes wiggle { 0%,100% { transform: rotate(0);} 25% { transform: rotate(-15deg) scale(1.2);} 75% { transform: rotate(15deg) scale(1.2);} }

.pick-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  padding: 12px; background: linear-gradient(180deg, rgba(43,29,107,0), rgba(43,29,107,.92) 35%);
}
.count-pick { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 18px; }
.seg { display: flex; background: rgba(255,255,255,.2); border-radius: 999px; padding: 4px; }
.seg button {
  min-width: 48px; height: 44px; border-radius: 999px; font-size: 20px; font-weight: 800;
  background: transparent; color: #fff; transition: background .2s, transform .2s;
}
.seg button.on { background: #fff; color: var(--ink); transform: scale(1.05); }

/* ================= QUIZ ================= */
#screen-quiz { display: none; flex-direction: column; }
#screen-quiz.active { display: flex; }
.quiz-top { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trail { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 900px; }
.trail .dot {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 16px; transition: transform .3s;
  border: 2px solid rgba(255,255,255,.35);
}
.trail .dot.cur { background: #fff; transform: scale(1.25); box-shadow: 0 0 0 4px rgba(255,210,63,.6); animation: pulse 1.2s infinite; }
.trail .dot.ok { background: var(--gold); border-color: #fff; }
.trail .dot.no { background: rgba(255,255,255,.4); }
.lesson-tag {
  background: rgba(255,255,255,.2); color: #fff; font-weight: 700; padding: 4px 16px; border-radius: 999px; font-size: 17px;
}
.quiz-body { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 0 8vh; }
.mascot-side { align-self: flex-start; margin-top: 40px; }
.q-card {
  width: min(820px, 100%); background: var(--card); border-radius: 34px; padding: 22px 22px 26px;
  box-shadow: 0 12px 0 rgba(0,0,0,.15), 0 30px 60px rgba(0,0,0,.3);
  position: relative; animation: cardIn .6s cubic-bezier(.2,1.5,.4,1);
}
.q-card.out { animation: cardOut .35s forwards; }
@keyframes cardIn { from { transform: translateX(-60vw) rotate(-10deg); opacity: 0;} to { transform: none; opacity: 1;} }
@keyframes cardOut { to { transform: translateX(60vw) rotate(10deg); opacity: 0;} }
.q-head { display: flex; justify-content: space-between; align-items: flex-start; }
.q-emoji { font-size: 64px; line-height: 1; margin-top: -54px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); animation: bounceIn .8s .2s both; }
@keyframes bounceIn { 0% { transform: scale(0) rotate(-180deg);} 70% { transform: scale(1.2) rotate(10deg);} 100% { transform: scale(1);} }
.speak-btn {
  width: 56px; height: 56px; border-radius: 50%; font-size: 26px; background: #ede7ff;
  box-shadow: 0 4px 0 #c4b5fd; transition: transform .15s;
}
.speak-btn:active { transform: scale(.9); }
.speak-btn.talking { animation: pulse .6s infinite; background: #ffd23f; box-shadow: 0 4px 0 #d99a00; }
.q-text { font-size: clamp(24px, 4.6vw, 36px); font-weight: 800; line-height: 1.9; text-align: center; margin: 4px 0 14px; }
.ayah {
  font-family: var(--quran); font-size: clamp(28px, 5.2vw, 42px); line-height: 2.1; text-align: center;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5); border: 3px double #10b981; border-radius: 22px;
  padding: 10px 16px; margin: 0 auto 18px; color: #064e3b; position: relative;
}
.ayah::before, .ayah::after { content: "۞"; color: #10b981; font-size: .7em; margin: 0 8px; }
.ayah .blank {
  display: inline-block; min-width: 110px; color: #b45309; line-height: 1.3; vertical-align: middle;
  background: #fff7d6; border: 3px dashed #f59e0b; border-radius: 14px; padding: 0 10px 6px;
  animation: blankBlink 1.2s ease-in-out infinite;
}
@keyframes blankBlink { 50% { border-color: transparent; } }

.options { display: grid; grid-template-columns: 1fr; gap: 12px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; font-size: clamp(21px, 3.9vw, 30px); font-weight: 800; color: #fff; line-height: 1.6;
  padding: 14px 18px; border-radius: 22px; min-height: 74px;
  box-shadow: 0 7px 0 var(--sh), 0 10px 20px rgba(0,0,0,.15);
  background: var(--bg);
  transition: transform .15s, box-shadow .15s, opacity .3s, filter .3s;
  animation: optIn .5s both cubic-bezier(.2,1.6,.4,1);
}
.opt:nth-child(2) { animation-delay: .08s; } .opt:nth-child(3) { animation-delay: .16s; } .opt:nth-child(4) { animation-delay: .24s; }
@keyframes optIn { from { transform: scale(.3); opacity: 0;} to { transform: scale(1); opacity: 1;} }
.opt:hover { filter: brightness(1.07); }
.opt:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--sh); }
.opt.chosen { transform: scale(1.05); box-shadow: 0 0 0 6px #fff, 0 0 0 12px var(--gold), 0 10px 30px rgba(0,0,0,.3); animation: chosen .8s ease-in-out infinite; }
.opt.speaking { transform: scale(1.04); box-shadow: 0 0 0 5px #fff, 0 0 0 10px #ffd23f, 0 0 30px 10px rgba(255,210,63,.6); }
.opt.speaking::after { content: "🔊"; position: absolute; top: -14px; left: -10px; font-size: 26px; animation: pulse .6s infinite; }
.opt.dim { opacity: .35; filter: grayscale(.6); }
.opt.right { --bg: linear-gradient(180deg, #4ade80, #16a34a) !important; --sh: #0f7a36 !important; opacity: 1; filter: none; }
.opt.wrong { --bg: linear-gradient(180deg, #fda4af, #f43f5e) !important; --sh: #be123c !important; }
@keyframes chosen { 50% { transform: scale(1.08); } }
.opt.tf { font-size: clamp(28px, 6vw, 44px); min-height: 120px; }
.opt.tf .big { font-size: 1.5em; display: block; line-height: 1.1; }

.o0 { --bg: linear-gradient(180deg, #60a5fa, #2563eb); --sh: #1e40af; }
.o1 { --bg: linear-gradient(180deg, #f472b6, #db2777); --sh: #9d174d; }
.o2 { --bg: linear-gradient(180deg, #fbbf24, #f59e0b); --sh: #b45309; }
.o3 { --bg: linear-gradient(180deg, #a78bfa, #7c3aed); --sh: #5b21b6; }
.tf-yes { --bg: linear-gradient(180deg, #4ade80, #16a34a); --sh: #0f7a36; }
.tf-no { --bg: linear-gradient(180deg, #fb7185, #e11d48); --sh: #9f1239; }

/* Order question */
.order-area { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.slots { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.slot {
  display: flex; align-items: center; gap: 10px; min-height: 58px; border-radius: 18px;
  border: 3px dashed #c4b5fd; background: #f5f3ff; padding: 4px 8px;
}
.slot .n {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: #7c3aed; color: #fff;
  font-weight: 800; font-size: 22px; display: grid; place-items: center;
}
.slot.filled { border-style: solid; border-color: #7c3aed; background: #ede9fe; }
.pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile {
  font-size: clamp(18px, 3.2vw, 24px); font-weight: 800; color: #fff; padding: 10px 16px; border-radius: 16px; line-height: 1.6;
  background: linear-gradient(180deg, #fb923c, #ea580c); box-shadow: 0 5px 0 #9a3412;
  animation: optIn .4s both cubic-bezier(.2,1.6,.4,1);
}
.slot .tile { flex: 1; background: linear-gradient(180deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 0 #4c1d95; text-align: right; }
.tile:active { transform: scale(.95); }
.slot.ok { border-color: var(--green); background: #dcfce7; }
.slot.ok .n { background: var(--green); }
.slot.bad { border-color: var(--red); background: #ffe4e6; }
.slot.bad .n { background: var(--red); }

.streak {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 45;
  font-size: clamp(26px, 5vw, 40px); font-weight: 800; color: #fff; padding: 8px 26px; border-radius: 999px;
  background: linear-gradient(90deg, #ff006e, #fb5607, #ffbe0b, #3a86ff, #8338ec); background-size: 300% 100%;
  animation: streakIn 2.2s forwards, rainbow 1s linear infinite;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
@keyframes streakIn { 0% { transform: translateX(-50%) scale(0) rotate(-20deg);} 15% { transform: translateX(-50%) scale(1.2) rotate(5deg);} 25% { transform: translateX(-50%) scale(1);} 85% { opacity: 1;} 100% { opacity: 0; transform: translateX(-50%) translateY(-40px);} }
@keyframes rainbow { to { background-position: 300% 0; } }

/* ================= REVEAL ================= */
#reveal {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(30,15,80,.72), rgba(15,5,40,.93));
  animation: fadeIn .3s;
  touch-action: none;
}
@keyframes fadeIn { from { opacity: 0; } }
.reveal-hint {
  color: #fff; font-size: clamp(24px, 5vw, 38px); font-weight: 800; text-align: center; margin-bottom: 14px;
  text-shadow: 0 4px 0 rgba(0,0,0,.3); animation: pulse 1.2s infinite;
}
.reveal-stage { position: relative; width: min(420px, 86vw); height: min(420px, 60vh); display: grid; place-items: center; }

/* Gift */
.gift { position: relative; width: 220px; height: 220px; cursor: pointer; animation: giftIdle 1.4s ease-in-out infinite; }
.gift .box { position: absolute; bottom: 0; left: 10px; width: 200px; height: 150px; border-radius: 14px; background: linear-gradient(180deg, #f43f5e, #be123c); box-shadow: inset 0 -12px 0 rgba(0,0,0,.15); }
.gift .box::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; transform: translateX(-50%); background: linear-gradient(180deg, #fde047, #f59e0b); }
.gift .lid { position: absolute; top: 40px; left: 0; width: 220px; height: 50px; border-radius: 12px; background: linear-gradient(180deg, #fb7185, #e11d48); z-index: 2; transition: transform .7s cubic-bezier(.2,1.4,.4,1), opacity .7s; }
.gift .lid::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; transform: translateX(-50%); background: linear-gradient(180deg, #fef08a, #fbbf24); }
.gift .bow { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 56px; }
.gift.shake { animation: shake .35s; }
.gift.open { animation: none; }
.gift.open .lid { transform: translateY(-260px) rotate(-35deg); opacity: 0; }
@keyframes giftIdle { 0%,100% { transform: rotate(-3deg);} 50% { transform: rotate(3deg) scale(1.03);} }
@keyframes shake { 0%,100% { transform: translateX(0) rotate(0);} 20% { transform: translateX(-14px) rotate(-8deg);} 40% { transform: translateX(14px) rotate(8deg);} 60% { transform: translateX(-10px) rotate(-5deg);} 80% { transform: translateX(10px) rotate(5deg);} }

/* Balloon */
.balloon { position: relative; cursor: pointer; animation: balloonUp 1.2s cubic-bezier(.2,1.2,.4,1), bob 2s ease-in-out infinite 1.2s; }
.balloon .b {
  width: 190px; height: 230px; border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 32% 28%, #fff9 0 12%, transparent 13%), linear-gradient(160deg, #38bdf8, #6366f1);
  display: grid; place-items: center; font-size: 90px; color: #fff; font-weight: 800;
  box-shadow: inset -18px -20px 0 rgba(0,0,0,.12);
}
.balloon .k { width: 0; height: 0; margin: -4px auto 0; border: 12px solid transparent; border-bottom: 18px solid #6366f1; transform: rotate(180deg); }
.balloon .str { width: 2px; height: 110px; margin: 0 auto; background: #fff8; }
.balloon.popped { animation: popped .25s forwards; }
@keyframes balloonUp { from { transform: translateY(70vh);} to { transform: none;} }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-16px) rotate(3deg);} }
@keyframes popped { to { transform: scale(1.6); opacity: 0; } }

/* Egg */
.egg-wrap { position: relative; width: 200px; height: 250px; cursor: pointer; }
.egg {
  position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fff 0 10%, transparent 11%), radial-gradient(circle at 60% 70%, #fde68a 0 12%, transparent 13%), radial-gradient(circle at 30% 65%, #a7f3d0 0 9%, transparent 10%), linear-gradient(180deg, #fef3c7, #fcd34d);
  box-shadow: inset -14px -18px 0 rgba(0,0,0,.08), 0 20px 40px rgba(0,0,0,.3);
  animation: eggIdle 1.6s ease-in-out infinite; transform-origin: bottom center;
}
.egg .crack { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
.egg.c1 .crack.k1, .egg.c2 .crack.k1, .egg.c2 .crack.k2 { opacity: 1; }
.egg.tap { animation: shake .3s; }
.egg.open { animation: eggOpen .5s forwards; }
@keyframes eggIdle { 0%,100% { transform: rotate(-4deg);} 50% { transform: rotate(4deg);} }
@keyframes eggOpen { to { transform: scale(1.4); opacity: 0; } }

/* Scratch */
.scratch-wrap { position: relative; width: min(360px, 82vw); height: 230px; border-radius: 28px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.4); touch-action: none; }
.scratch-under { position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; background: #fff; }
.scratch-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }

/* Chest */
.chest { position: relative; width: 240px; height: 200px; cursor: pointer; animation: giftIdle 1.6s ease-in-out infinite; }
.chest .base { position: absolute; bottom: 0; width: 240px; height: 120px; border-radius: 10px 10px 20px 20px; background: linear-gradient(180deg, #b45309, #78350f); border: 6px solid #fbbf24; }
.chest .lid { position: absolute; top: 20px; width: 240px; height: 80px; border-radius: 120px 120px 10px 10px; background: linear-gradient(180deg, #d97706, #92400e); border: 6px solid #fbbf24; transform-origin: bottom center; transition: transform .6s cubic-bezier(.2,1.5,.4,1); z-index: 2; }
.chest .lock { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); font-size: 44px; z-index: 3; transition: transform .4s, opacity .4s; }
.chest .glow { position: absolute; top: 60px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%); border-radius: 50%; box-shadow: 0 0 0 0 #ffd23f; transition: box-shadow .6s; }
.chest.open { animation: none; }
.chest.open .lid { transform: rotateX(70deg) translateY(-40px); }
.chest.open .lock { transform: translate(-50%, 60px) rotate(60deg); opacity: 0; }
.chest.open .glow { box-shadow: 0 0 80px 70px rgba(255,210,63,.9); }
.taps { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.taps span { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background .2s, transform .2s; }
.taps span.on { background: var(--gold); transform: scale(1.3); }

/* ================= FEEDBACK ================= */
#feedback {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center;
  background: rgba(15,5,40,.55); padding: 16px; animation: fadeIn .2s;
}
.fb-card {
  width: min(620px, 100%); background: var(--card); border-radius: 34px; padding: 20px 22px 26px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); animation: fbIn .6s cubic-bezier(.2,1.6,.4,1);
  border: 6px solid var(--green); max-height: 92vh; overflow-y: auto;
}
.fb-card.bad { border-color: #fb923c; }
@keyframes fbIn { from { transform: scale(.2) rotate(-12deg); opacity: 0;} to { transform: none; opacity: 1;} }
.fb-icon { font-size: 96px; line-height: 1.1; animation: bounceIn .8s; }
.fb-title { font-size: clamp(32px, 7vw, 50px); font-weight: 800; color: #16a34a; }
.fb-card.bad .fb-title { color: #ea580c; font-size: clamp(26px, 5.5vw, 38px); }
.fb-answer { font-size: clamp(20px, 4vw, 28px); font-weight: 800; margin: 8px 0; line-height: 1.8; }
.fb-answer .pill { display: inline-block; background: #dcfce7; color: #166534; border: 3px solid #22c55e; padding: 4px 16px; border-radius: 18px; }
.fb-answer ol { text-align: right; display: inline-block; margin: 4px 0; padding-right: 34px; list-style: arabic-indic; }
.fb-explain { font-size: clamp(17px, 3.3vw, 22px); color: #5b4a8a; margin: 6px 0 14px; line-height: 1.8; }
.fb-explain:empty { display: none; }

/* ================= RESULT ================= */
.result-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; gap: 8px; padding-bottom: 14vh; }
.trophy-stage { position: relative; width: 240px; height: 220px; display: grid; place-items: center; }
.rays {
  position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,230,120,.35) 0 10deg, transparent 10deg 20deg);
  animation: spin 12s linear infinite; mask-image: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
}
.trophy { font-size: 150px; position: relative; animation: trophyIn 1s cubic-bezier(.2,1.6,.4,1), floaty 3s ease-in-out infinite 1s; filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)); }
@keyframes trophyIn { from { transform: scale(0) rotate(-360deg);} to { transform: scale(1) rotate(0);} }
.stars3 { display: flex; gap: 10px; font-size: 64px; }
.stars3 .s { filter: grayscale(1) brightness(.6); opacity: .5; transform: scale(.7); transition: all .5s cubic-bezier(.2,1.8,.4,1); }
.stars3 .s.on { filter: drop-shadow(0 0 14px #ffd23f); opacity: 1; transform: scale(1.15) rotate(360deg); }
#resTitle { margin: 0; font-size: clamp(34px, 8vw, 56px); text-shadow: 0 5px 0 rgba(0,0,0,.25); }
.res-score { margin: 0; font-size: clamp(22px, 4.5vw, 30px); font-weight: 700; }
.res-lessons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 800px; }
.res-lessons .rl { background: rgba(255,255,255,.18); padding: 6px 14px; border-radius: 16px; font-size: 16px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 10px; }

/* Flying star */
.fly-star { position: fixed; z-index: 70; font-size: 54px; pointer-events: none; transition: all .9s cubic-bezier(.5,-0.3,.6,1); }

/* ================= HOME MENU + PROFILE CHIP ================= */
.home-menu { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; max-width: 760px; }
.home-menu:empty { display: none; }
.home-tile {
  width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px;
  border-radius: 24px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff;
  border: 2px solid rgba(255,255,255,.3); box-shadow: 0 6px 0 rgba(0,0,0,.18);
  animation: pop .5s both cubic-bezier(.2,1.6,.4,1); transition: transform .15s;
}
.home-tile:nth-child(2) { animation-delay: .06s; } .home-tile:nth-child(3) { animation-delay: .12s; } .home-tile:nth-child(4) { animation-delay: .18s; }
.home-tile:nth-child(5) { animation-delay: .24s; } .home-tile:nth-child(6) { animation-delay: .3s; } .home-tile:nth-child(7) { animation-delay: .36s; }
.home-tile:hover { transform: translateY(-4px) scale(1.05); }
.home-tile:active { transform: scale(.94); }
.home-tile .hi { font-size: 38px; line-height: 1.1; }
.home-tile .hl { font-size: 15px; font-weight: 800; }
.home-tile .badge-dot { position: absolute; }
.profile-chip {
  display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 14px 0 8px; border-radius: 26px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px); color: #fff; font-size: 18px; font-weight: 800;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15);
}
.profile-chip .pa { font-size: 30px; }
.profile-chip:active { transform: scale(.95); }
.res-extras { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.res-extras:empty { display: none; }

/* ================= MINI-GAMES HOST ================= */
.mg-hub { max-width: 1000px; margin: 0 auto; text-align: center; color: #fff; padding-bottom: 14vh; }
.mg-hub h2 { margin: 0; font-size: clamp(30px, 6vw, 44px); text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.mg-hub p { margin: 4px 0 16px; font-size: 18px; opacity: .9; }
.mg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mg-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 14px;
  border-radius: 28px; background: var(--card); color: var(--ink); border: 5px solid var(--c);
  box-shadow: 0 8px 0 var(--c), 0 14px 30px rgba(0,0,0,.25); animation: optIn .5s both cubic-bezier(.2,1.6,.4,1);
  transition: transform .15s;
}
.mg-card:hover { transform: translateY(-6px) rotate(-1deg); }
.mg-card:active { transform: scale(.95); }
.mg-ic { font-size: 64px; line-height: 1.1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.mg-t { font-size: 22px; font-weight: 800; }
.mg-l { font-size: 14px; color: #6b5fa0; }
.mg-got { position: absolute; top: -10px; left: -8px; width: 38px; height: 38px; border-radius: 50%; background: var(--green); display: grid; place-items: center; font-size: 18px; box-shadow: 0 3px 0 #15803d; }
#screen-mini { display: none; flex-direction: column; padding-top: 70px; }
#screen-mini.active { display: flex; }
.mg-head { display: flex; align-items: center; gap: 10px; padding: 0 6px 6px; }
.mg-back { font-size: 18px; font-weight: 800; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; }
.mg-title { flex: 1; text-align: center; color: #fff; font-size: clamp(22px, 4.5vw, 34px); font-weight: 800; text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.mg-mascot { width: 70px !important; height: 70px !important; }
.mg-stage { position: relative; flex: 1; min-height: 0; }
.mg-win { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; background: rgba(15,5,40,.6); padding: 16px; animation: fadeIn .3s; }
.mg-win-card { width: min(520px, 100%); background: var(--card); border-radius: 34px; padding: 22px; text-align: center; border: 6px solid var(--gold); animation: fbIn .6s cubic-bezier(.2,1.6,.4,1); }
.mg-win-ic { font-size: 90px; animation: bounceIn .8s; }
.mg-win-card h2 { margin: 0; font-size: 44px; color: #16a34a; }
.mg-win-stars { font-size: 54px; letter-spacing: 6px; }
.mg-win-stars .off { filter: grayscale(1); opacity: .3; }
.mg-win-sticker { display: inline-block; background: #fef3c7; color: #92400e; font-weight: 800; font-size: 20px; padding: 6px 18px; border-radius: 999px; margin: 6px 0; animation: pulse 1.2s infinite; }
.mg-win-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; }

/* ================= TEACHER PANEL ================= */
body[data-screen="teacher"] #topbar, body[data-screen="report"] #topbar { background: rgba(43,29,107,.92); backdrop-filter: blur(8px); box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.teacher-btn {
  position: absolute; bottom: 14px; left: 14px; z-index: 5;
  font-size: 16px; font-weight: 700; color: #fff; padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.3);
}
.teacher-btn:active { transform: scale(.95); }
#screen-teacher { padding-bottom: 30px; }
.t-wrap { max-width: 1200px; margin: 0 auto; color: var(--ink); }
.t-wrap input, .t-wrap textarea, .t-modal input, .t-modal textarea, .t-modal select { user-select: text; -webkit-user-select: text; }
.t-head { text-align: center; color: #fff; margin-bottom: 12px; }
.t-head h2 { margin: 0; font-size: clamp(28px, 5vw, 40px); }
.t-head p { margin: 4px 0 0; opacity: .9; font-size: 17px; }
.t-layout { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; }
.t-lessons {
  background: rgba(255,255,255,.95); border-radius: 22px; padding: 10px; position: sticky; top: 0;
  max-height: calc(100vh - 110px); overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.t-unit { font-weight: 800; color: #6d28d9; font-size: 15px; margin: 10px 6px 4px; }
.t-unit:first-child { margin-top: 2px; }
.t-lesson {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: right; padding: 8px 10px; border-radius: 14px;
  background: transparent; font-size: 15px; font-weight: 700; color: var(--ink); position: relative;
}
.t-lesson:hover { background: #f3f0ff; }
.t-lesson.on { background: #7c3aed; color: #fff; }
.t-lesson .ic { font-size: 22px; }
.t-lesson .nm { flex: 1; line-height: 1.5; }
.t-lesson .ct { background: #ede9fe; color: #5b21b6; border-radius: 999px; padding: 0 9px; font-size: 13px; }
.t-lesson.on .ct { background: #fff; }
.t-lesson .mod { font-size: 13px; }
.t-main { background: rgba(255,255,255,.95); border-radius: 22px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); min-height: 300px; }
.t-main-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 2px solid #ede9fe; padding-bottom: 10px; margin-bottom: 10px; }
.t-main-head h3 { margin: 0; font-size: 22px; }
.t-main-head small { color: #7c6fa8; font-weight: 600; }
.t-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.t-btn {
  font-size: 16px; font-weight: 800; padding: 9px 18px; border-radius: 14px; color: #fff;
  background: #7c3aed; box-shadow: 0 4px 0 #5b21b6; transition: transform .1s;
}
.t-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5b21b6; }
.t-btn.green { background: #16a34a; box-shadow: 0 4px 0 #0f7a36; }
.t-btn.ghost { background: #f3f0ff; color: #5b21b6; box-shadow: 0 4px 0 #ddd6fe; }
.t-btn.danger { background: #e11d48; box-shadow: 0 4px 0 #9f1239; }
.t-btn.small { font-size: 14px; padding: 6px 14px; margin-top: 6px; }
.t-list { display: flex; flex-direction: column; gap: 10px; }
.t-empty { text-align: center; padding: 40px 10px; color: #7c6fa8; font-size: 18px; }
.t-q { display: flex; gap: 10px; align-items: flex-start; background: #faf8ff; border: 2px solid #ede9fe; border-radius: 16px; padding: 10px; }
.t-q.flash { animation: flashRow 1.6s; }
@keyframes flashRow { 0%, 60% { background: #dcfce7; border-color: #22c55e; } }
.t-q-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #7c3aed; color: #fff; display: grid; place-items: center; font-weight: 800; }
.t-q-body { flex: 1; min-width: 0; }
.t-q-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.badge { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: #e0e7ff; color: #3730a3; }
.badge.tf { background: #dcfce7; color: #166534; }
.badge.order { background: #ffedd5; color: #9a3412; }
.badge.novoice { background: #fef9c3; color: #854d0e; }
.badge.voice { background: #e0f2fe; color: #075985; }
.t-voicebar { max-width: 1200px; margin: 0 auto 12px; padding: 10px 16px; border-radius: 16px; font-size: 16px; font-weight: 700; line-height: 1.9; text-align: center; }
.t-voicebar:empty { display: none; }
.t-voicebar.ok { background: #dcfce7; color: #166534; }
.t-voicebar.off { background: #fef9c3; color: #713f12; }
.t-voicebar.busy { background: #e0f2fe; color: #075985; animation: pulse 1.4s infinite; }
.t-voicebar .t-btn.small { margin: 0 8px; }
.t-q-text { font-size: 18px; font-weight: 800; line-height: 1.7; }
.t-q-ayah { font-family: var(--quran); font-size: 20px; color: #065f46; background: #ecfdf5; border-radius: 10px; padding: 2px 10px; display: inline-block; margin: 2px 0; }
.t-q-ans { font-size: 15px; color: #166534; line-height: 1.8; }
.dimtxt { color: #8b80b0; font-size: 13px; }
.t-q-act { display: flex; flex-wrap: wrap; gap: 4px; max-width: 120px; justify-content: flex-end; }
.t-ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 2px solid #ede9fe; font-size: 16px; }
.t-ic:hover { background: #f3f0ff; }
.t-ic:disabled { opacity: .3; cursor: default; }
.t-ic.del:hover { background: #ffe4e6; border-color: #fda4af; }
.t-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.t-note { text-align: center; color: #fff; opacity: .9; font-size: 15px; line-height: 1.8; max-width: 900px; margin: 12px auto 0; }
.t-note code { background: rgba(255,255,255,.2); padding: 1px 6px; border-radius: 6px; direction: ltr; display: inline-block; }

.t-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15,5,40,.6); display: flex; align-items: center; justify-content: center; padding: 14px; animation: fadeIn .2s; }
.t-card {
  width: min(760px, 100%); max-height: 94vh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); animation: fbIn .4s cubic-bezier(.2,1.4,.4,1); color: var(--ink);
}
.t-card.small { width: min(380px, 100%); text-align: center; }
.t-card h3 { margin: 0 0 6px; font-size: 22px; }
.t-card h3 small { color: #7c6fa8; font-size: 15px; }
.t-card.small p { font-size: 26px; font-weight: 800; margin: 8px 0; }
.t-card input[type=text], .t-card input[type=password], .t-card textarea, .t-card select {
  width: 100%; font-family: var(--font); font-size: 18px; padding: 8px 12px; border-radius: 12px; border: 2px solid #ddd6fe; background: #faf8ff; color: var(--ink);
}
.t-card textarea { resize: vertical; line-height: 1.7; }
.t-card textarea.quran { font-family: var(--quran); font-size: 22px; }
.t-card input:focus, .t-card textarea:focus, .t-card select:focus { outline: none; border-color: #7c3aed; background: #fff; }
.t-card.small input { text-align: center; font-size: 22px; }
.t-card.small .f-lbl { text-align: right; }
.t-pass { display: flex; gap: 6px; align-items: center; }
.t-pass input { flex: 1; }
.t-pass .t-ic { flex: none; width: 46px; height: 46px; }
.f-lbl { display: block; font-weight: 800; font-size: 15px; color: #5b21b6; margin: 12px 0 4px; }
.f-help { font-size: 13px; color: #7c6fa8; margin-top: 3px; }
.f-types { display: flex; gap: 8px; flex-wrap: wrap; }
.f-type { flex: 1; min-width: 140px; padding: 10px; border-radius: 14px; font-size: 16px; font-weight: 800; background: #f3f0ff; color: #5b21b6; border: 3px solid transparent; }
.f-type.on { background: #7c3aed; color: #fff; border-color: #5b21b6; }
.f-grid { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: end; }
.f-emoji { text-align: center; font-size: 26px !important; }
.f-emojis { display: flex; flex-wrap: wrap; gap: 4px; }
.f-em { width: 36px; height: 36px; border-radius: 10px; background: #faf8ff; font-size: 20px; }
.f-em:hover { background: #ede9fe; transform: scale(1.1); }
.f-opts { display: flex; flex-direction: column; gap: 6px; }
.f-opt { display: flex; align-items: center; gap: 6px; }
.f-opt input { flex: 1; }
.f-opt.right input { border-color: #22c55e; background: #f0fdf4; }
.f-radio { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #c4b5fd; background: #fff; font-size: 18px; }
.f-opt.right .f-radio { border-color: #22c55e; background: #dcfce7; }
.f-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #ea580c; color: #fff; display: grid; place-items: center; font-weight: 800; }
.f-tf { display: flex; gap: 10px; }
.f-tfb { flex: 1; padding: 14px; border-radius: 16px; font-size: 22px; font-weight: 800; background: #f3f4f6; color: #6b7280; border: 3px solid transparent; }
.f-tfb.yes.on { background: #dcfce7; color: #166534; border-color: #22c55e; }
.f-tfb.no.on { background: #ffe4e6; color: #9f1239; border-color: #f43f5e; }
.f-adv { margin-top: 12px; background: #ecfdf5; border-radius: 14px; padding: 8px 12px; }
.f-adv summary { cursor: pointer; font-weight: 800; color: #047857; }
.f-adv textarea { margin-top: 8px; }
.t-err { color: #e11d48; font-weight: 800; min-height: 24px; margin-top: 8px; }
.t-row-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 700px) {
  .mascot-side { display: none; }
  .mascot-stage { flex-direction: column-reverse; }
  .bubble::after { right: 50%; top: auto; bottom: -14px; transform: translateX(50%); border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
  .options.two { grid-template-columns: 1fr; }
  .options.two.tfwrap { grid-template-columns: 1fr 1fr; }
  .lessons { grid-template-columns: repeat(2, 1fr); }
  #screen-pick { padding-bottom: 180px; }
  .t-layout { grid-template-columns: 1fr; }
  .t-lessons { position: static; max-height: 220px; }
  .t-q { flex-wrap: wrap; }
  .t-q-act { max-width: none; width: 100%; justify-content: flex-start; }
  .f-grid { grid-template-columns: 1fr; }
  .q-emoji { font-size: 52px; margin-top: -46px; }
  .trail .dot { width: 22px; height: 22px; font-size: 12px; }
  .icon-btn { width: 46px; height: 46px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
