/* =========================================================
   تستیوا — Design System
   رنگ اصلی: سبزآبی عمیق | رنگ تأکید: زرد آفتابی | پس‌زمینه: کرم روشن
   ========================================================= */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2-variations"), url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #0d6e63;
  --brand-600: #0b5d54;
  --brand-50: #e6f4f1;
  --brand-100: #c9e9e2;
  --sun: #f5b400;
  --sun-50: #fff6d9;
  --coral: #e5533d;
  --coral-50: #fdecea;
  --ink: #15232c;
  --ink-2: #4a5a64;
  --ink-3: #8595a0;
  --line: #e7e2d8;
  --bg: #f8f5ee;
  --card: #ffffff;
  --ok: #15803d;
  --ok-50: #e8f6ec;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(21, 35, 44, .05), 0 6px 20px rgba(21, 35, 44, .06);
  --shadow-lg: 0 10px 40px rgba(13, 110, 99, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-feature-settings: "ss01";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 1rem }
.row { display: flex; gap: .75rem; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- برند ---------- */
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.35rem; color: var(--ink); letter-spacing: -.3px; }
.logo img { width: 36px; height: 36px; flex: none; border-radius: 9px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text small { font-size: .62rem; font-weight: 700; letter-spacing: 1.5px; color: var(--ink-3); direction: ltr; text-align: right; }
.side .logo-text small { color: #7f8f99; }
.logo b { color: var(--brand); }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.25rem; border-radius: var(--r-sm);
  border: 1.5px solid transparent; font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(13, 110, 99, .28); }
.btn-primary:hover { background: var(--brand-600); }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand-100); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--coral); color: #fff; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; font-weight: 600; }
.link-btn[disabled] { color: var(--ink-3); cursor: default; }

/* ---------- فرم‌ها ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: .92rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: .65rem .9rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--ink); transition: border .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input-ltr { direction: ltr; text-align: center; letter-spacing: 2px; font-size: 1.2rem; font-weight: 700; }
.otp-input { letter-spacing: 14px; font-size: 1.7rem; padding-inline-start: 22px; }
.hint { color: var(--ink-3); font-size: .82rem; margin-top: .3rem; }

/* انتخاب‌گر دکمه‌ای (به‌جای منوی کشویی، برای راحتی در موبایل) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: .5rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .4rem .6rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 600; cursor: pointer; text-align: center;
}
.choice input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-100); }

/* ---------- کارت ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }

/* ---------- پیام‌ها ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
.alert-error { background: var(--coral-50); color: #a52a17; }
.alert-success { background: var(--ok-50); color: var(--ok); }
.alert-info { background: var(--sun-50); color: #7a5600; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge svg, .floating-chip svg, .btn svg, .alert svg { width: 16px; height: 16px; flex: none; }
.floating-chip { white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--sun-50); color: #8a6100; }
.badge-off { background: #eef0f2; color: var(--ink-2); }
.badge-bad { background: var(--coral-50); color: #b42318; }

/* ---------- صفحه‌ی ورود ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-bg {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(245, 180, 0, .16), transparent 70%),
    radial-gradient(700px 400px at 0% 100%, rgba(13, 110, 99, .14), transparent 70%), var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 1.75rem 1.5rem; border-radius: var(--r-lg); }
.auth-head { text-align: center; margin-bottom: 1.25rem; }
.auth-head .logo { font-size: 1.7rem; }
.auth-head .logo img { width: 52px; height: 52px; border-radius: 13px; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: .8rem; margin-top: 1rem; }
.dev-code { direction: ltr; font-weight: 800; letter-spacing: 3px; }

/* ---------- قالب دانش‌آموز ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(248, 245, 238, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.main { max-width: 720px; margin: 0 auto; padding: 1.25rem 1rem 6.5rem; }

.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .55rem; color: var(--ink-3); font-size: .74rem; font-weight: 600; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--brand); }
@media (min-width: 900px) { .bottom-nav { max-width: 720px; margin: 0 auto; border-radius: 18px 18px 0 0; box-shadow: var(--shadow); } }

/* خوش‌آمد */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.hello h1 { font-size: 1.35rem; margin: 0; }
.hello .muted { font-size: .9rem; }

/* سه دکمه‌ی بزرگ */
.big-actions { display: grid; gap: .85rem; }
.big-action {
  position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.15rem; border-radius: var(--r-lg);
  color: var(--ink); background: #fff; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.big-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.big-action .ic { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.big-action .ic svg { width: 30px; height: 30px; }
.big-action h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.big-action p { margin: 0; font-size: .86rem; color: var(--ink-2); line-height: 1.6; }
.big-action .arrow { margin-inline-start: auto; color: var(--ink-3); }
.big-action.primary { background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand) 100%); color: #fff; }
.big-action.primary p { color: rgba(255, 255, 255, .85); }
.big-action.primary .arrow { color: rgba(255, 255, 255, .7); }
.big-action.primary .ic { background: rgba(255, 255, 255, .16); color: #fff; }
.big-action.primary::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; inset-inline-end: -60px; top: -80px;
  background: radial-gradient(circle, rgba(245, 180, 0, .45), transparent 65%);
}
.ic-sun { background: var(--sun-50); color: #b07d00; }
.ic-coral { background: var(--coral-50); color: var(--coral); }
.ic-brand { background: var(--brand-50); color: var(--brand); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.mini-stat { background: #fff; border-radius: var(--r); padding: .8rem .5rem; text-align: center; box-shadow: var(--shadow); }
.mini-stat b { display: block; font-size: 1.2rem; font-weight: 900; color: var(--ink); }
.mini-stat span { font-size: .75rem; color: var(--ink-3); }

.section-title { font-weight: 800; font-size: 1rem; margin: 1.6rem 0 .7rem; display: flex; align-items: center; gap: .4rem; }

.empty { text-align: center; padding: 2.5rem 1rem; }
.empty .ic { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; }
.empty .ic svg { width: 38px; height: 38px; }

.sub-banner { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--sun-50); border: 1px dashed #e9c766; margin-top: 1rem; }
.sub-banner .grow { font-size: .88rem; font-weight: 600; color: #6e4f00; }

.kv { display: flex; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 700; }

/* ---------- صفحه‌ی اصلی (معرفی) ---------- */
.landing-nav { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.hero { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr .9fr; padding-top: 3.5rem; } }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.35; font-weight: 900; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; inset-inline: 0; bottom: .1em; height: .28em; background: var(--sun); opacity: .45; z-index: -1; border-radius: 4px; }
.hero p.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 520px; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-art { position: relative; }
.mock-phone { max-width: 320px; margin: 0 auto; background: var(--ink); border-radius: 36px; padding: 12px; box-shadow: 0 30px 60px rgba(21, 35, 44, .25); transform: rotate(-3deg); }
.mock-screen { background: var(--bg); border-radius: 26px; padding: 1rem; }
.mock-q { background: #fff; border-radius: 14px; padding: .8rem; font-size: .82rem; box-shadow: var(--shadow); }
.mock-opt { margin-top: .45rem; padding: .45rem .7rem; border-radius: 10px; border: 1.5px solid var(--line); font-size: .78rem; }
.mock-opt.on { border-color: var(--brand); background: var(--brand-50); font-weight: 700; }
.mock-timer { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 800; margin-bottom: .6rem; }
.mock-timer span { background: var(--sun); padding: .1rem .6rem; border-radius: 999px; }
.floating-chip { position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: .55rem .8rem; font-size: .8rem; font-weight: 700; display: flex; gap: .4rem; align-items: center; }
.features { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature .ic { width: 50px; height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; margin-bottom: .6rem; }
.feature .ic svg { width: 26px; height: 26px; }
.steps { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: s; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--r); padding: 1.1rem 1.1rem 1.1rem 1.1rem; box-shadow: var(--shadow); display: flex; gap: .8rem; align-items: flex-start; }
.steps li::before { content: counter(s, persian); width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--ink); color: var(--sun); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.site-foot { border-top: 1px solid var(--line); padding: 1.5rem 1.25rem; text-align: center; color: var(--ink-3); font-size: .85rem; }

/* ---------- پنل مدیریت ---------- */
.admin { display: grid; min-height: 100vh; }
@media (min-width: 960px) { .admin { grid-template-columns: 250px 1fr; } }
.side { background: var(--ink); color: #c9d3d9; padding: 1rem; }
.side .logo { color: #fff; margin: .25rem .25rem 1.25rem; }
.side .logo b { color: var(--sun); }
.side nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; color: #c9d3d9; font-weight: 600; font-size: .92rem; }
.side nav a svg, .side nav button svg { width: 20px; height: 20px; opacity: .85; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.active { background: var(--brand); color: #fff; }
.side .nav-group { font-size: .72rem; color: #7f8f99; margin: 1rem .75rem .3rem; font-weight: 700; }
@media (max-width: 959px) {
  .side { padding: .6rem 1rem; }
  .side .logo { margin: 0; }
  .side nav { display: none; padding-top: .6rem; }
  .side.open nav { display: block; }
  .side-head { display: flex; justify-content: space-between; align-items: center; }
}
@media (min-width: 960px) { .side-toggle { display: none; } }
.side-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .45rem .9rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; color: #fff; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.side-toggle svg { width: 22px; height: 22px; flex: none; }
.side.open .side-toggle { background: var(--brand); border-color: var(--brand); }
@media (max-width: 959px) {
  .side { position: sticky; top: 0; z-index: 40; }
  .side.open nav { max-height: calc(100vh - 70px); overflow-y: auto; }
}
.admin-main { padding: 1.25rem; min-width: 0; }
@media (min-width: 960px) { .admin-main { padding: 2rem 2.25rem; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.4rem; }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat span { color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.stat b { display: block; font-size: 1.6rem; font-weight: 900; margin-top: .15rem; }
.stat.accent { background: var(--ink); color: #fff; }
.stat.accent span { color: #b8c4cb; }
.stat.accent b { color: var(--sun); }

.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; background: #faf8f3; color: var(--ink-2); font-weight: 700; padding: .75rem 1rem; font-size: .8rem; white-space: nowrap; }
.table td { padding: .75rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fcfbf8; }

/* ---------- خطا ---------- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.error-page .code { font-size: 4.5rem; font-weight: 900; color: var(--brand); line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- انگیزه: شمارش معکوس، پیوستگی، نصب اپ ---------- */
.pulse-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.countdown { background: var(--ink); color: #fff; border-radius: var(--r); padding: .8rem 1rem; position: relative; overflow: hidden; }
.countdown b { display: block; font-size: 2rem; font-weight: 900; color: var(--sun); line-height: 1.15; }
.countdown span { font-size: .82rem; color: #c9d3d9; font-weight: 600; position: relative; z-index: 1; }
.countdown::after { content: ""; position: absolute; inset-inline-start: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(13,110,99,.6), transparent 70%); }
.streak { background: #fff; border-radius: var(--r); padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem; box-shadow: var(--shadow); }
.streak .flame { font-size: 1.6rem; filter: grayscale(1); opacity: .45; }
.streak.on .flame { filter: none; opacity: 1; animation: flick 1.6s ease-in-out infinite; }
.streak b { display: block; font-weight: 900; line-height: 1.3; }
.streak span { font-size: .78rem; color: var(--ink-2); }
@keyframes flick { 50% { transform: scale(1.12) rotate(-4deg); } }
.install-banner { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1.5px solid var(--brand-100); border-radius: var(--r); padding: .75rem 1rem; margin-top: 1rem; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner b { display: block; font-size: .92rem; }
.install-banner span { font-size: .8rem; color: var(--ink-2); }

/* ---------- فرم‌ها و ابزار پنل مدیریت ---------- */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input { min-height: 42px; width: auto; flex: 1; min-width: 180px; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 340px 1fr; align-items: start; } }
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1; min-width: 120px; }
.input-sm { min-height: 40px !important; padding: .35rem .7rem !important; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .45rem 1rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; color: var(--ink-2); font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .dot { width: 9px; height: 9px; border-radius: 50%; }
.chapter { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: .75rem; background: #fff; }
.chapter-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #faf8f3; border-radius: var(--r-sm) var(--r-sm) 0 0; flex-wrap: wrap; }
.chapter-head b { flex: 1; }
.topic { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-top: 1px solid var(--line); font-size: .92rem; }
.topic .grow { min-width: 0; }
.chip { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .75rem; font-weight: 700; }
.inline-edit { display: none; gap: .4rem; align-items: center; flex: 1; }
.editing .inline-edit { display: flex; }
.editing .view-mode { display: none; }
.icon-btn { background: none; border: 0; padding: .25rem; color: var(--ink-3); cursor: pointer; border-radius: 8px; display: inline-flex; }
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { background: var(--coral-50); color: var(--coral); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .4rem; }
.check { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 700; color: var(--ink-2); }
.pager span.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.color-input { width: 46px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.dot { display: inline-block; flex: none; }

/* ---------- بانک سؤال ---------- */
@media (min-width: 960px) { .q-grid { grid-template-columns: 320px 1fr; } }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.opt-radio input { position: absolute; opacity: 0; }
.opt-radio span { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-3); cursor: pointer; flex: none; transition: all .15s; }
.opt-radio input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 0 4px var(--ok-50); }
.opt-radio input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-100); }
.q-card { margin-bottom: 1rem; }
.q-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.q-check { width: 20px; height: 20px; accent-color: var(--brand); }
.q-body { font-weight: 600; line-height: 2; }
.q-img { display: block; max-height: 320px; border-radius: 12px; margin: .6rem 0; border: 1px solid var(--line); }
.q-opts { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .4rem; }
@media (min-width: 720px) { .q-opts { grid-template-columns: 1fr 1fr; } }
.q-opts li { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; font-size: .92rem; }
.q-opts li span { font-weight: 800; color: var(--ink-3); }
.q-opts li.correct { border-color: var(--ok); background: var(--ok-50); }
.q-opts li.correct span { color: var(--ok); }
.q-exp { margin-top: .6rem; background: #faf8f3; border-radius: 10px; padding: .5rem .8rem; font-size: .9rem; }
.q-exp summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.q-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.q-foot form { margin: 0; }
.reject-box { position: relative; }
.reject-box summary { list-style: none; }
.reject-box .card { position: absolute; inset-inline-end: 0; bottom: 110%; width: 280px; z-index: 5; }
details > summary::-webkit-details-marker { display: none; }

/* ===================== مرحله ۴: آزمون ===================== */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.exam-list { display: grid; gap: .75rem; }
.exam-item { display: flex; align-items: center; gap: .75rem; color: inherit; padding: 1rem 1.1rem; }
.exam-item .arrow { color: var(--ink-3); display: flex; }
.exam-item.state-resume { border: 2px solid var(--sun); }
.exam-item.state-open { border-inline-start: 4px solid var(--brand); }
.exam-item.state-locked, .exam-item.state-closed { opacity: .75; }
.pct-pill { background: var(--brand-50); color: var(--brand-600); border-radius: 999px; padding: .25rem .7rem; font-weight: 800; white-space: nowrap; }
.rules { padding-inline-start: 1.2rem; color: var(--ink-2); font-size: .9rem; margin: 1rem 0; }
.rules li { margin-bottom: .35rem; }

/* صفحه‌ی آزمون: تمام‌صفحه، بدون منو، تمرکز کامل */
.exam { min-height: 100vh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; background: var(--bg); }
.exam-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.exam-title { flex: 1; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-timer { display: flex; align-items: center; gap: .3rem; background: var(--brand-50); color: var(--brand-600); padding: .25rem .7rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.exam-timer b { font-size: 1.05rem; font-weight: 800; direction: ltr; }
.exam-timer svg { width: 18px; height: 18px; }
.exam-timer.warn { background: var(--coral-50); color: var(--coral); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.05); } }
.save-state { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--ok); white-space: nowrap; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.save-state[data-s="saving"], .save-state[data-s="queued"] { color: var(--ink-3); }
.save-state[data-s="off"] { color: var(--coral); }
.net-banner { background: var(--coral); color: #fff; padding: .55rem 1rem; font-size: .85rem; display: flex; gap: .5rem; align-items: center; }
.net-banner svg { width: 18px; height: 18px; flex: none; }
.exam-progress { height: 4px; background: var(--line); }
.exam-progress span { display: block; height: 100%; background: var(--sun); transition: width .3s; width: 0; }
.exam-q { flex: 1; padding: 1rem 1rem 6rem; }
.q-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.q-text { font-size: 1.08rem; line-height: 2; white-space: pre-line; margin-bottom: 1rem; font-weight: 500; }
.opts { display: grid; gap: .6rem; margin-bottom: .75rem; }
.opt { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: start; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; min-height: 56px; }
.opt:hover { border-color: var(--brand-100); }
.opt .opt-n { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; color: var(--ink-2); }
.opt .opt-t { flex: 1; white-space: pre-line; }
.opt.on, .opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.opt.on .opt-n, .opt:has(input:checked) .opt-n { background: var(--brand); color: #fff; }
label.opt input { position: absolute; opacity: 0; pointer-events: none; }
.exam-bar { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; display: flex; gap: .5rem; padding: .6rem max(1rem, calc((100vw - 760px) / 2 + 1rem)); padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.exam-bar .btn { flex: 1; padding-inline: .5rem; gap: .35rem; font-size: .85rem; }
.exam-bar #prev, .exam-bar #next { flex: 0 0 56px; }
.exam-bar #next.to-sheet { flex: 0 0 auto; }
.exam-bar #prev svg { transform: scaleX(-1); }
.exam-bar button:disabled { opacity: .35; }
.flag-btn.on { background: var(--sun-50); border-color: var(--sun); color: #8a6500; }

.sheet-wrap, .modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(21, 35, 44, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal-wrap { align-items: center; padding: 1rem; }
.sheet { background: var(--card); width: 100%; max-width: 760px; max-height: 85vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.modal { width: 100%; max-width: 420px; }
.legend { display: flex; gap: 1rem; margin: .5rem 0; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; border: 2px solid var(--line); }
.legend .lg-ans { background: var(--brand); border-color: var(--brand); }
.legend .lg-flag { border-color: var(--sun); background: var(--sun-50); }
.sheet-subj { font-weight: 800; font-size: .85rem; margin: .75rem 0 .35rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .4rem; }
.cell { border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: .25rem 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.3; color: var(--ink-2); }
.cell b { font-size: .9rem; }
.cell small { font-size: .7rem; }
.cell.ans { background: var(--brand); border-color: var(--brand); color: #fff; }
.cell.flag { border-color: var(--sun); box-shadow: inset 0 0 0 2px var(--sun); }
.cell.ans.flag { box-shadow: inset 0 0 0 3px var(--sun); }
.cell.cur { outline: 3px solid var(--ink); outline-offset: 1px; }
.sheet-sum { margin: 1rem 0 .6rem; text-align: center; }

/* کارنامه */
.report-hero { text-align: center; }
.report-pct { font-size: 3.6rem; font-weight: 900; color: var(--brand); line-height: 1.2; margin: .3rem 0; }
.report-pct small { font-size: 1.4rem; }
.report-pct.neg, .neg { color: var(--coral); }
.report-rank { font-size: 1rem; margin-bottom: .75rem; }
.report-rank b { color: var(--brand); font-size: 1.25rem; }
.mini-stat.ok b { color: var(--ok); }
.mini-stat.bad b { color: var(--coral); }
.bar-row { margin-bottom: .9rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: .3rem 0 .2rem; }
.bar.sm { height: 6px; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.weak-list { display: grid; gap: .1rem; }
.weak-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.weak-item:last-of-type { border-bottom: 0; }
.weak-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.weak-n { width: 30px; height: 30px; border-radius: 50%; background: var(--coral-50); color: var(--coral); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.rv { margin-bottom: .75rem; }
.rv-correct { border-inline-start: 4px solid var(--ok); }
.rv-wrong { border-inline-start: 4px solid var(--coral); }
.rv-blank { border-inline-start: 4px solid var(--line); }
.q-opts li.mine-wrong { background: var(--coral-50); border-color: var(--coral); }
.explain { background: var(--brand-50); border-radius: var(--r-sm); padding: .75rem .9rem; margin-top: .75rem; white-space: normal; }
.author { display: flex; align-items: flex-start; gap: .4rem; margin-top: .6rem; color: var(--ink-2); }
.author svg { width: 16px; height: 16px; flex: none; margin-top: .3rem; }
.share-img { max-height: 60vh; border-radius: var(--r); box-shadow: var(--shadow); }
.trend-bars { display: flex; align-items: flex-end; gap: .5rem; height: 110px; margin-top: .5rem; direction: ltr; }
.trend-bars .tb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.trend-bars .tb span { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 0 0; }
.trend-bars .tb:last-child span { background: var(--sun); }
.trend-bars small { font-size: .7rem; color: var(--ink-2); }
.quiz { max-width: 760px; }

/* سازنده‌ی آزمون (مدیر) */
.bp-row { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr 90px auto 36px; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.bp-avail { white-space: nowrap; color: var(--ok); font-weight: 700; }
.bp-avail.low { color: var(--coral); }
@media (max-width: 760px) { .bp-row { grid-template-columns: 1fr 1fr; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); } }
.report-hero .mini-stats { grid-template-columns: repeat(4, 1fr); }
.report-hero .mini-stat { box-shadow: none; background: var(--bg); }
.q-opts em.mine { font-style: normal; font-size: .72rem; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 .5rem; margin-inline-start: auto; white-space: nowrap; align-self: center; }
.inline-ic svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ===================== مرحله ۵: اشتراک و پرداخت ===================== */
.code-box { display: grid; gap: .35rem; margin-bottom: 1rem; }
.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.plan { position: relative; display: grid; gap: .5rem; border: 2px solid transparent; }
.plan.featured { border-color: var(--sun); box-shadow: var(--shadow-lg); }
.plan-tag { position: absolute; top: -12px; inset-inline-start: 1rem; background: var(--sun); color: var(--ink); font-weight: 800; font-size: .75rem; padding: .15rem .7rem; border-radius: 999px; }
.plan-price b { font-size: 1.6rem; font-weight: 900; color: var(--brand); }
.plan-feat { list-style: none; padding: 0; margin: .25rem 0; color: var(--ink-2); }
.plan-feat li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.gw-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.gw input { position: absolute; opacity: 0; }
.gw span { display: inline-block; border: 1.5px solid var(--line); border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; cursor: pointer; }
.gw input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.gw input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.pay-result { max-width: 480px; margin: 1rem auto; }
.big-ic { width: 64px; height: 64px; margin: 0 auto .75rem; font-size: 1.8rem; font-weight: 900; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.big-ic svg { width: 32px; height: 32px; }
.plan-admin { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.gw-admin { display: grid; gap: .5rem; margin-bottom: .75rem; }
.gw-admin .check { display: flex; align-items: center; gap: .5rem; }
.terms { max-width: 820px; }
.terms h3 { margin-top: 1rem; }
.terms ul { padding-inline-start: 1.2rem; }

/* موبایل پنل مدیر: کارت‌های آمار دوتایی */
@media (max-width: 959px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .stat { padding: .85rem .9rem; }
  .stat b { font-size: 1.25rem; }
}
.portal-switch { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); text-align: center; font-size: .88rem; color: var(--ink-2); }
.portal-switch a { font-weight: 700; }

/* ===================== تمرین مبحثی ===================== */
.practice-today { margin-bottom: 1rem; }
.practice-quick { margin-bottom: .5rem; }
.practice-quick .big-action[disabled] { opacity: .55; cursor: not-allowed; }
.practice-subject { margin-bottom: .75rem; }
.practice-subject summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none; }
.practice-subject summary::-webkit-details-marker { display: none; }
.practice-subject summary .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.practice-subject summary b { flex: 1; }
.topic-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.topic-row:first-of-type { margin-top: .5rem; }
.practice .opt.right { border-color: var(--ok); background: var(--ok-50); }
.practice .opt.right .opt-n { background: var(--ok); color: #fff; }
.practice .opt.wrong { border-color: var(--coral); background: var(--coral-50); }
.practice .opt.wrong .opt-n { background: var(--coral); color: #fff; }
.practice .opt:disabled { cursor: default; opacity: 1; }
.feedback { margin-top: 1rem; }
.fb-title { font-weight: 800; font-size: 1.05rem; margin-bottom: .5rem; }
.feedback[data-ok="1"] .fb-title { color: var(--ok); }
.feedback[data-ok="0"] .fb-title { color: var(--coral); }
.report-box { margin-top: .75rem; }
.report-box summary { cursor: pointer; color: var(--ink-2); display: inline-flex; gap: .3rem; align-items: center; }
.report-box summary svg { width: 14px; height: 14px; }
.report-form { display: grid; gap: .5rem; margin-top: .5rem; max-width: 460px; }
.small.ok, .ok-text { color: var(--ok); font-weight: 700; }
.rv .report-box { margin-top: .6rem; }
.report-list { margin: 0; padding-inline-start: 1.1rem; line-height: 1.9; }
.report-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.nav-badge { margin-inline-start: auto; background: var(--coral); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 0 .5rem; min-width: 1.4rem; text-align: center; }

/* دعوت دوستان */
.invite-link { background: var(--bg); border: 1.5px dashed var(--brand); border-radius: var(--r-sm); padding: .6rem .8rem; font-weight: 700; word-break: break-all; text-align: center; color: var(--brand-600); }

/* مقایسه با میانگین در کارنامه */
.avg-line { margin: .6rem 0; padding: .55rem .8rem; border-radius: var(--r-sm); font-size: .92rem; background: var(--bg); }
.avg-line.up { background: var(--ok-50); color: #176b34; }
.avg-line.down { background: var(--coral-50); color: #a52a17; }
.bar-wrap { position: relative; }
.bar-wrap .avg-mark { position: absolute; top: -3px; height: 16px; width: 3px; background: var(--ink); border-radius: 2px; opacity: .75; transform: translateX(50%); }
html[dir=rtl] .bar-wrap .avg-mark { transform: translateX(50%); }
.bottom-nav { display: grid !important; grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none; }
.practice .exam-bar #next { flex: 1 1 auto; }

/* خانه‌ی دبستان و پیش‌دبستانی */
.kids-hello h1 { font-size: 1.5rem; }
.kids-actions .big-action { padding: 1.25rem; }
.kids-actions .big-action h3 { font-size: 1.25rem; }
.big-action.soon { opacity: .55; cursor: default; box-shadow: none; }
.big-action.soon:hover { transform: none; box-shadow: none; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.feature-opt { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; cursor: pointer; }
.feature-opt input[type=checkbox] { margin-top: .3rem; }

.opt-img { max-width: 100%; max-height: 120px; display: block; margin: 0 auto; border-radius: 10px; }
.opt .opt-t:has(.opt-img) { flex: 1; text-align: center; }

/* بازی آفلاین */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.lesson { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem .5rem; background: #fff; border: 2px solid #e2e8f0; border-radius: 18px; color: inherit; text-align: center; box-shadow: var(--shadow); }
.lesson.soon { opacity: .5; box-shadow: none; }
.lesson .stars { font-size: 1.05rem; letter-spacing: 2px; }
.play-q { font-size: 1.35rem; text-align: center; }
.play-img { max-height: 220px; margin: .5rem auto; display: block; }
.play-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.play-opt { min-height: 5.5rem; justify-content: center; font-size: 1.5rem; font-weight: 700; border-radius: 18px; }
.play-opt .opt-t { text-align: center; width: 100%; }
.play-opt .opt-img { max-height: 110px; }
.opt.right { background: #dcfce7; border-color: #16a34a; }
.opt.wrong { background: #fee2e2; border-color: #dc2626; }
.big-stars { font-size: 3rem; letter-spacing: 6px; }

.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .5rem 0; border-top: 1px solid #eef2f5; }
.quick-level { min-width: 9rem; }
.quick-grade label { padding: .25rem .6rem; background: #f1f5f9; border-radius: 999px; font-size: .9rem; cursor: pointer; }

/* نوار بازگشت */
.backbar { max-width: 720px; margin: 0 auto; padding: .5rem 1rem 0; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.admin-main > .backbar { padding: 0 0 .75rem; max-width: none; }
.auth-card > .backbar { padding: 0 0 .75rem; }
.bb-btn { display: inline-flex; align-items: center; gap: .3rem; background: #fff; border: 1.5px solid #e1d9f5; color: #5b46a8; font-weight: 700; font-size: .85rem; padding: .35rem .85rem; border-radius: 99px; text-decoration: none; }
.bb-btn:hover { background: #f1ecff; }
.bb-home { border-color: #cfeadc; color: #1d6b43; } .bb-home:hover { background: #e8f8ef; }
.bb-grade { margin-inline-start: auto; border-color: #ffd9a8; color: #8a5200; } .bb-grade:hover { background: #fff3e0; }

/* ===== رنگ‌بندی مخصوص هر مقطع (متناسب با سن) ===== */
body.theme-preschool { --brand: #d6407a; --brand-600: #b8326a; --brand-50: #ffe3ee; --brand-100: #ffc7dd; --sun: #ffb703; --sun-50: #fff1c2; --bg: #fff5fa; --line: #ffd6e6; --r: 22px; --r-lg: 30px; font-size: 112%; }
body.theme-primary   { --brand: #1f8a4c; --brand-600: #187a42; --brand-50: #e0f6e8; --brand-100: #bfeccf; --sun: #ffb703; --sun-50: #fff1c2; --bg: #f5fff7; --line: #cfeedb; --r: 20px; --r-lg: 28px; font-size: 108%; }
body.theme-middle    { --brand: #3b6fe0; --brand-600: #2f5cc4; --brand-50: #e5edff; --brand-100: #c8d9ff; --sun: #f59e0b; --sun-50: #fff1d6; --bg: #f3f7ff; --line: #d6e1fb; --r: 16px; }
body.theme-preschool .topbar { background-color: rgba(255, 245, 250, .95); }
body.theme-primary .topbar { background-color: rgba(245, 255, 247, .95); }
body.theme-middle .topbar { background-color: rgba(243, 247, 255, .95); border-bottom-color: var(--line); }
body.theme-preschool .card, body.theme-primary .card { border: 2px solid var(--line); }
body.theme-preschool .btn, body.theme-primary .btn { border-radius: 99px; font-weight: 800; }
body.theme-preschool .bottom-nav, body.theme-primary .bottom-nav { border-top: 3px solid var(--brand-100); }
body.theme-preschool .bb-btn { border-color: #ffc7dd; color: #b8326a; } body.theme-primary .bb-btn { border-color: #bfeccf; color: #187a42; } body.theme-middle .bb-btn { border-color: #c8d9ff; color: #2f5cc4; }
body.theme-preschool .kids-actions .big-action:not(.primary), body.theme-primary .kids-actions .big-action:not(.primary), body.theme-middle .kids-actions .big-action:not(.primary) { border: 0; }
.kids-actions .big-action:not(.primary):nth-child(2) { background: #ffe0ec; }
.kids-actions .big-action:not(.primary):nth-child(3) { background: #e5dcff; }
.kids-actions .big-action:not(.primary):nth-child(4) { background: #fff1b8; }
.kids-actions .big-action:not(.primary):nth-child(5) { background: #d3f2d8; }

/* ===== تم شاد و رنگی کلاس اول تا سوم (فقط دبستان اول تا سوم) ===== */
body.theme-early { --brand: #e8590c; --brand-600: #c2410c; --brand-50: #fff1e6; --brand-100: #ffd9b8; --sun: #ffc400; --sun-50: #fff4c2; --bg: #f1faff; --line: #b9e3ff; --r: 24px; --r-lg: 32px; font-size: 110%;
  background-image: radial-gradient(circle at 12% 18%, #ffe38a 0 5px, transparent 6px), radial-gradient(circle at 82% 10%, #ffb3d1 0 6px, transparent 7px), radial-gradient(circle at 70% 55%, #b6e8c0 0 5px, transparent 6px), radial-gradient(circle at 25% 80%, #c9d8ff 0 6px, transparent 7px);
  background-size: 260px 260px; background-attachment: fixed; }
body.theme-early .topbar { background: rgba(255, 248, 224, .96); border-bottom: 2px solid #ffe08a; }
body.theme-early .card { border: 3px solid var(--line); border-radius: var(--r-lg); }
body.theme-early .btn { border-radius: 99px; font-weight: 800; }
body.theme-early .bottom-nav { border-top: 4px solid #ffd27a; background: #fffaf0; }
body.theme-early .bb-btn { border-color: #ffd27a; color: #a94b00; }
body.theme-early .kids-hello h1 { color: #c2410c; font-size: 1.7rem; }
body.theme-early .kids-actions .big-action { border: 3px solid rgba(255, 255, 255, .85); border-radius: 28px; box-shadow: 0 6px 0 rgba(0, 0, 0, .08); }
body.theme-early .kids-actions .big-action:hover { transform: translateY(-3px) rotate(-.4deg); }
body.theme-early .kids-actions .big-action.primary { background: linear-gradient(135deg, #ff8a3d 0%, #ffb02e 100%); box-shadow: 0 6px 0 #d9731c; }
body.theme-early .kids-actions .big-action:not(.primary):nth-child(2) { background: #d6ecff; box-shadow: 0 6px 0 #9fcdf2; }
body.theme-early .kids-actions .big-action:not(.primary):nth-child(3) { background: #ffd9ea; box-shadow: 0 6px 0 #f0a8c8; }
body.theme-early .kids-actions .big-action:not(.primary):nth-child(4) { background: #fff0a8; box-shadow: 0 6px 0 #e6cf5c; }
body.theme-early .kids-actions .big-action:not(.primary):nth-child(5) { background: #cff3d6; box-shadow: 0 6px 0 #92d4a1; }
body.theme-early .big-action .ic { width: 66px; height: 66px; border-radius: 50%; background: rgba(255, 255, 255, .75); }
body.theme-early .big-action.primary .ic { background: rgba(255, 255, 255, .3); }
body.theme-early .opt { border-width: 3px; border-radius: 22px; }
body.theme-early .streak.on { background: #fff0a8; }
.deer-hero { margin: 0 0 1rem; border-radius: 28px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 8px 0 rgba(255, 160, 60, .35), 0 12px 24px rgba(0, 0, 0, .1); background: #cfeaff; }
.deer-hero img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) { .deer-hero { animation: fx-in-big .6s cubic-bezier(.2, .9, .3, 1.25) backwards; } }

/* ===== سکه و ستاره و مدال و نقشه‌ی ماجراجویی (پیش‌دبستانی و اول تا سوم) ===== */
.rw-strip { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 .8rem; }
.rw-item { display: flex; align-items: center; gap: .55rem; background: #fff; border: 3px solid #ffe08a; border-radius: 22px; padding: .55rem .8rem; box-shadow: 0 4px 0 rgba(255, 160, 60, .25); }
.rw-item b { display: block; font-size: 1.25rem; line-height: 1.2; color: #7a3d00; }
.rw-item span { font-size: .78rem; color: var(--ink-2); }
.rw-ic { width: 38px; height: 38px; flex: none; }
.rw-star { color: #ffb300; }
.rw-level { grid-column: 1 / -1; border-color: #bfe0ff; box-shadow: 0 4px 0 rgba(90, 160, 230, .25); }
.rw-level > div { flex: 1; }
.rw-bar { height: 12px; border-radius: 99px; background: #e6eef7; margin: .3rem 0; overflow: hidden; }
.rw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb300, #ff7a1a); border-radius: 99px; min-width: 8px; }
.rw-medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.rw-medal { text-align: center; border-radius: 20px; padding: .55rem .3rem; background: #fff; border: 3px solid #eee; }
.rw-medal svg { width: 44px; height: 44px; color: #c3c9d1; }
.rw-medal b { display: block; font-size: .8rem; line-height: 1.4; }
.rw-medal span { font-size: .74rem; color: var(--ink-2); }
.rw-medal.lock svg { opacity: .55; filter: grayscale(1); }
.rw-medal.got.bronze { border-color: #e0a06a; } .rw-medal.got.bronze svg { color: #cd7f32; }
.rw-medal.got.silver { border-color: #c9d2dc; } .rw-medal.got.silver svg { color: #aab4c0; }
.rw-medal.got.gold { border-color: #ffd54a; } .rw-medal.got.gold svg { color: #ffb300; }
.adv-map { max-width: 440px; margin: 0 auto 1.5rem; border-radius: 30px; border: 4px solid #fff; background: linear-gradient(#cfeeff 0, #eaf8ff 22%, #e6f7d9 60%, #d4efbd 100%); box-shadow: 0 8px 0 rgba(120, 190, 120, .3); overflow: hidden; }
.adv-map svg { display: block; width: 100%; height: auto; font-family: inherit; }
.mp-road-b { fill: none; stroke: #fff; stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; }
.mp-road { fill: none; stroke: #f3c77a; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 22; }
.mp-start text, .mp-goal text { font-size: 15px; font-weight: 800; fill: #7a3d00; }
.mp-node { cursor: pointer; outline: none; }
.mp-c { fill: var(--mc, #e8590c); stroke: #fff; stroke-width: 5; }
.mp-node.done .mp-c { fill: #2fa84f; }
.mp-node.soon .mp-c { fill: #aeb7c2; }
.mp-node.soon { cursor: default; }
.mp-lock { color: #fff; }
.mp-n { font-size: 30px; font-weight: 800; fill: #fff; }
.mp-s.on { color: #ffb300; } .mp-s.off { color: #fff; opacity: .9; }
.mp-t { font-size: 14px; font-weight: 700; fill: #3b2a14; paint-order: stroke; stroke: rgba(255, 255, 255, .9); stroke-width: 4px; stroke-linejoin: round; }
.mp-pulse { fill: none; stroke: #ff7a1a; stroke-width: 4; opacity: .55; }
.mp-node:focus-visible .mp-c, .mp-node:hover .mp-c { stroke: #ffb300; stroke-width: 7; }
@media (prefers-reduced-motion: no-preference) {
  .mp-pulse { animation: mp-pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes mp-pulse { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.18); opacity: 0; } }
}
.big-stars svg { width: 54px; height: 54px; margin: 0 .1rem; }
.big-stars .on { color: #ffb300; } .big-stars .off { color: #dfe5ec; }
.done-coins { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; color: #7a3d00; background: #fff4c2; border-radius: 99px; padding: .35rem 1rem; margin-bottom: .6rem; }
.done-coins svg { width: 26px; height: 26px; }

/* ===== تم زرد و بنفش کلاس دوم (طبق طرح مالک) ===== */
body.theme-early.theme-sun { --brand: #6b3fa0; --brand-600: #55308a; --brand-50: #efe7fb; --brand-100: #dccbf5; --sun: #ffa31a; --sun-50: #fff1c2; --bg: #ffd84d; --line: #ffe08a; --ink: #3a2358; --ink-2: #5d4a78;
  background-color: #ffd84d;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 300'><g fill='%23fff' fill-opacity='.55'><ellipse cx='110' cy='70' rx='60' ry='24'/><ellipse cx='150' cy='54' rx='34' ry='26'/><ellipse cx='80' cy='60' rx='30' ry='20'/><ellipse cx='660' cy='140' rx='64' ry='24'/><ellipse cx='700' cy='122' rx='34' ry='26'/><ellipse cx='628' cy='130' rx='30' ry='20'/></g></svg>"), url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 200' preserveAspectRatio='none'><path d='M0 120 C120 60 240 70 360 110 C480 150 600 120 800 70 L800 200 L0 200Z' fill='%23ffc233'/><path d='M0 160 C140 110 300 130 440 160 C580 190 700 150 800 130 L800 200 L0 200Z' fill='%23ffa31a' fill-opacity='.55'/></svg>");
  background-size: 100% auto, 100% 220px; background-position: top, bottom; background-repeat: no-repeat; background-attachment: fixed; color: var(--ink); }
body.theme-early.theme-sun .topbar { background: rgba(255, 216, 77, .92); border-bottom: 0; }
body.theme-early.theme-sun .bottom-nav { background: #fff; border-top: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -4px 18px rgba(107, 63, 160, .18); }
body.theme-early.theme-sun .bb-btn { background: #fff; border-color: #fff; color: #6b3fa0; }
body.theme-early.theme-sun .kids-hello h1 { color: #4a2a6a; }
body.theme-early.theme-sun .card { background: #fff; border-color: #fff; box-shadow: 0 6px 0 rgba(255, 163, 26, .35); }
body.theme-early.theme-sun .btn-primary { background: #6b3fa0; border-color: #6b3fa0; color: #fff; box-shadow: 0 5px 0 #4a2a78; }
body.theme-early.theme-sun .kids-actions .big-action { background: #fff; border: 0; box-shadow: 0 6px 0 rgba(255, 163, 26, .45); }
body.theme-early.theme-sun .kids-actions .big-action.primary { background: #6b3fa0; box-shadow: 0 6px 0 #4a2a78; }
body.theme-early.theme-sun .kids-actions .big-action:not(.primary):nth-child(n) { background: #fff; box-shadow: 0 6px 0 rgba(255, 163, 26, .45); }
body.theme-early.theme-sun .kids-actions .big-action:not(.primary):nth-child(2) .ic { background: #ffe9c2; color: #d97706; }
body.theme-early.theme-sun .kids-actions .big-action:not(.primary):nth-child(3) .ic { background: #ffe0ec; color: #d6407a; }
body.theme-early.theme-sun .kids-actions .big-action:not(.primary):nth-child(4) .ic { background: #e5dcff; color: #6b3fa0; }
body.theme-early.theme-sun .kids-actions .big-action:not(.primary):nth-child(5) .ic { background: #d3f2d8; color: #1f8a4c; }
body.theme-early.theme-sun .big-action.primary .ic { background: rgba(255, 255, 255, .18); }
body.theme-early.theme-sun .rw-item { background: #fff; border-color: #fff; box-shadow: 0 4px 0 rgba(255, 163, 26, .4); }
body.theme-early.theme-sun .rw-medal { border-color: #fff; }
body.theme-early.theme-sun .rw-bar i { background: linear-gradient(90deg, #8a5cc8, #6b3fa0); }
body.theme-early.theme-sun .streak.on { background: #fff; }
body.theme-early.theme-sun .deer-hero { border-color: #fff; box-shadow: 0 8px 0 rgba(107, 63, 160, .3); }
body.theme-early.theme-sun .adv-map { background: linear-gradient(#fff2b3 0, #ffe27a 45%, #ffc233 100%); border-color: #fff; box-shadow: 0 8px 0 rgba(107, 63, 160, .25); }
body.theme-early.theme-sun .mp-road { stroke: #fff; }
body.theme-early.theme-sun .mp-road-b { stroke: rgba(107, 63, 160, .25); }
body.theme-early.theme-sun .mp-node.done .mp-c { fill: #6b3fa0; }
body.theme-early.theme-sun .mp-pulse { stroke: #6b3fa0; }
body.theme-early.theme-sun .mp-t, body.theme-early.theme-sun .mp-start text, body.theme-early.theme-sun .mp-goal text { fill: #3a2358; }

/* ===== چیدمان کوچک‌ترها: پیش‌دبستانی و اول و دوم ===== */
body.young { font-size: 114%; }
body.young .main { padding-bottom: 7rem; }
.yh-hello { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .9rem; }
.yh-bear { flex: none; width: 104px; }
.yh-bear .mascot { margin: 0; }
.yh-bear .mascot.can-say::after { display: none; }
.yh-bear .dr-body { width: 100%; }
.yh-bubble { position: relative; flex: 1; background: #fff; border: 3px solid var(--line); border-radius: 24px; padding: .6rem .9rem; }
.yh-bubble::before { content: ""; position: absolute; inset-inline-start: -11px; top: 50%; width: 18px; height: 18px; background: #fff; border: 3px solid var(--line); border-top: 0; border-inline-end: 0; transform: translateY(-50%) rotate(45deg); }
.yh-bubble h1 { margin: 0; font-size: 1.3rem; line-height: 1.5; color: var(--brand-600); }
.yh-bubble p { margin: 0; font-size: 1rem; color: var(--ink-2); }
.yh-streak { flex: none; display: flex; flex-direction: column; align-items: center; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: .3rem .6rem; min-width: 56px; }
.yh-streak .flame { font-size: 1.5rem; filter: grayscale(1); opacity: .5; } .yh-streak.on .flame { filter: none; opacity: 1; }
.yh-streak b { font-size: 1.1rem; color: #7a3d00; }
.yh-play { display: flex; align-items: center; gap: .9rem; min-height: 112px; padding: 1rem 1.1rem; border-radius: 32px; background: linear-gradient(135deg, var(--brand-600), var(--brand)); color: #fff; box-shadow: 0 8px 0 rgba(0, 0, 0, .18); margin-bottom: 1rem; text-decoration: none; }
.yh-play:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.yh-play-ic { flex: none; width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; }
.yh-play-ic svg { width: 44px; height: 44px; }
.yh-play-tx { flex: 1; display: flex; flex-direction: column; }
.yh-play-tx b { font-size: 1.75rem; line-height: 1.3; }
.yh-play-tx small { font-size: .95rem; opacity: .92; }
.yh-play-go svg { width: 30px; height: 30px; }
.yh-rw { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: .5rem; margin-bottom: 1rem; }
.yh-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: .5rem .3rem; text-align: center; min-height: 82px; }
.yh-chip svg { width: 32px; height: 32px; } .yh-chip b { font-size: 1.15rem; color: #7a3d00; line-height: 1.3; } .yh-chip span { font-size: .78rem; color: var(--ink-2); }
.yh-star { color: #ffb300; }
.yh-lv { padding-inline: .6rem; } .yh-lv .rw-bar { width: 100%; margin: .35rem 0 0; }
.yh-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.yh-tiles.n1 { grid-template-columns: 1fr; } .yh-tiles.n3 .yh-tile:last-child { grid-column: 1 / -1; flex-direction: row; justify-content: center; min-height: 92px; }
.yh-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 140px; background: #fff; border: 0; border-radius: 28px; box-shadow: 0 6px 0 rgba(0, 0, 0, .1); text-decoration: none; color: var(--ink); }
.yh-tile:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.yh-tile b { font-size: 1.3rem; }
.yh-tile-ic { width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.yh-tile-ic svg { width: 36px; height: 36px; }
.yh-tile:nth-child(2) .yh-tile-ic { background: #ffe0ec; color: #d6407a; } .yh-tile:nth-child(3) .yh-tile-ic { background: #d3f2d8; color: #1f8a4c; }
.yh-medals { display: flex; justify-content: space-around; gap: .4rem; margin-bottom: 1rem; }
.yh-medal { display: flex; flex-direction: column; align-items: center; gap: .15rem; flex: 1; }
.yh-medal svg { width: 46px; height: 46px; color: #c3c9d1; } .yh-medal span { font-size: .75rem; color: var(--ink-2); }
.yh-medal.lock svg { opacity: .5; filter: grayscale(1); }
.yh-medal.got.bronze svg { color: #cd7f32; } .yh-medal.got.silver svg { color: #aab4c0; } .yh-medal.got.gold svg { color: #ffb300; }
.yh-banner { margin-top: .5rem; }
/* منوی پایین درشت‌تر برای انگشت کوچک */
body.young .bottom-nav a { min-height: 66px; justify-content: center; font-size: .82rem; font-weight: 800; gap: 3px; }
body.young .bottom-nav a svg { width: 30px; height: 30px; }
body.young .bottom-nav a.active { color: var(--brand); background: var(--brand-50); border-radius: 18px; margin: .25rem .2rem; }
/* کتاب‌ها دو ستونه و درشت */
body.young .book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
body.young .book-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 150px; padding: .8rem; background: #fff; border-radius: 28px; box-shadow: 0 6px 0 rgba(0, 0, 0, .1); text-align: center; text-decoration: none; color: var(--ink); border-top: 10px solid var(--bk, var(--brand)); }
body.young .book-card .ic { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
body.young .book-card .ic svg { width: 34px; height: 34px; }
body.young .book-card b { font-size: 1.2rem; line-height: 1.4; } body.young .book-card small { font-size: .8rem; color: var(--ink-2); }
body.young .book-card:active { transform: translateY(3px); }
@media (prefers-reduced-motion: no-preference) { .yh-play { animation: fx-in-big .5s cubic-bezier(.2, .9, .3, 1.25) backwards; } .yh-tile { animation: fx-in-mid .45s ease backwards; } .yh-tile:nth-child(2) { animation-delay: .07s; } .yh-tile:nth-child(3) { animation-delay: .14s; } }

/* ---------- حالت‌های بازی (بازی آفلاین) ---------- */
.gm-pick { max-width: 560px; margin: 1.2rem auto; padding: 0 1rem; text-align: center; }
.gm-cards { display: grid; gap: .7rem; margin-top: .8rem; }
.gm-card { display: flex; flex-direction: column; gap: .2rem; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: .9rem 1rem; font: inherit; cursor: pointer; }
.gm-card b { font-size: 1.15rem; color: var(--ink); }
.gm-card span { color: var(--ink-2); font-size: .9rem; }
.gm-card:hover, .gm-card.on { border-color: var(--brand); }
.gm-modes { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem .75rem; justify-content: center; flex-wrap: wrap; }
.gm-modes button { border: 2px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: .35rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.gm-modes button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.gm-race, .gm-speed { display: none; margin: .25rem auto .5rem; width: 100%; max-width: 520px; padding: 0 1rem; box-sizing: border-box; align-self: center; }
.play[data-mode="race"] .gm-race { display: block; position: relative; }
.play[data-mode="speed"] .gm-speed { display: block; }
.gm-lane { position: relative; width: 100%; height: 34px; margin: 4px 0; background: repeating-linear-gradient(90deg, #e8eef0 0 18px, #f4f7f8 18px 36px); border-radius: 10px; }
.gm-car { position: absolute; top: 3px; inset-inline-start: 0; width: 44px; height: 28px; border-radius: 8px 14px 8px 8px; transition: inset-inline-start .6s ease; }
.gm-car.me { background: var(--brand); }
.gm-car.rv { background: #f2994a; }
.gm-car::before, .gm-car::after { content: ""; position: absolute; bottom: -4px; width: 10px; height: 10px; border-radius: 50%; background: #333; }
.gm-car::before { inset-inline-start: 6px; } .gm-car::after { inset-inline-end: 6px; }
.gm-flag { position: absolute; inset-inline-end: 1rem; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(0deg, #222 0 6px, #fff 6px 12px); border-radius: 3px; }
.gm-clock { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.gm-clock span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e86a4a, #f2c94c, #27ae60); transition: width .1s linear; }
.gm-pts { display: flex; justify-content: space-between; margin-top: .3rem; font-weight: 800; }
.gm-pts span { color: #e2592b; font-weight: 700; font-size: .9rem; }
/* بادکنک */
.play[data-mode="balloon"] .play-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: .5rem; }
.play[data-mode="balloon"] .play-opt { aspect-ratio: .85; border: 0; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; color: #fff; font-weight: 800; position: relative; animation: gm-bob 3s ease-in-out infinite; box-shadow: inset -10px -12px 0 rgba(0,0,0,.12); justify-content: center; text-align: center; }
.play[data-mode="balloon"] .play-opt::after { content: ""; position: absolute; bottom: -14px; left: 50%; width: 2px; height: 14px; background: #888; }
.play[data-mode="balloon"] .play-opt:nth-child(1) { background: #ef6f8c; animation-delay: 0s; }
.play[data-mode="balloon"] .play-opt:nth-child(2) { background: #f2a54a; animation-delay: .6s; }
.play[data-mode="balloon"] .play-opt:nth-child(3) { background: #4aa3df; animation-delay: 1.2s; }
.play[data-mode="balloon"] .play-opt:nth-child(4) { background: #7bc86c; animation-delay: 1.8s; }
.play[data-mode="balloon"] .play-opt .opt-t { color: #fff; }
.play[data-mode="balloon"] .play-opt.right { animation: gm-pop .5s forwards; }
.play[data-mode="balloon"] .play-opt.wrong { animation: gm-shake .4s; opacity: .45; }
.play[data-mode="balloon"] .play-opt:disabled:not(.right):not(.wrong) { opacity: .5; animation: none; }
@keyframes gm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes gm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1.05); box-shadow: 0 0 0 6px var(--ok-50); } }
@keyframes gm-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .play[data-mode="balloon"] .play-opt, .gm-car { animation: none; transition: none; } }
.gm-pts b::after { content: " امتیاز"; font-weight: 600; font-size: .85rem; color: var(--ink-3); }

/* ---------- موشن بخش دانش‌آموز (شدت بر اساس سن) ---------- */
.fx-sound { position: fixed; inset-inline-start: .8rem; bottom: 5rem; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.fx-sound.off { color: var(--ink-3); }
body:not([class*=theme-]) .fx-sound { bottom: auto; top: .6rem; inset-inline-start: auto; inset-inline-end: .8rem; width: 40px; height: 40px; }
@keyframes fx-in-big { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fx-in-mid { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fx-in-low { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes fx-pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes fx-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fx-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes fx-fall { 0% { transform: translate(0, -20px) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx, 0), 105vh) rotate(540deg); opacity: .9; } }
.fx-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.fx-confetti i { position: absolute; top: 0; width: 9px; height: 14px; border-radius: 2px; animation: fx-fall 2s linear forwards; }
.fx .btn, .fx .big-action, .fx .opt, .fx .hm-level, .fx .hm-grade { transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
.fx .btn:active, .fx .big-action:active, .fx .opt:active, .fx .hm-level:active, .fx .hm-grade:active { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) {
  .fx-little :is(main > *, .big-action, .card, .exam-q, .stat, .hm-level) { animation: fx-in-big .5s cubic-bezier(.2, .9, .3, 1.25) backwards; }
  .fx-kid :is(main > *, .big-action, .card, .exam-q, .stat, .hm-level) { animation: fx-in-big .42s cubic-bezier(.2, .9, .3, 1.15) backwards; }
  .fx-teen :is(main > *, .big-action, .card, .exam-q, .stat) { animation: fx-in-mid .35s ease backwards; }
  .fx-formal :is(main > *, .big-action, .card, .exam-q, .stat) { animation: fx-in-low .28s ease backwards; }
  .fx :is(.big-action, .stat, .hm-level):nth-child(2) { animation-delay: .06s; }
  .fx :is(.big-action, .stat, .hm-level):nth-child(3) { animation-delay: .12s; }
  .fx :is(.big-action, .stat, .hm-level):nth-child(4) { animation-delay: .18s; }
  .fx :is(.big-action, .stat, .hm-level):nth-child(n+5) { animation-delay: .24s; }
  .fx-little .big-action:hover .ic, .fx-kid .big-action:hover .ic { animation: fx-wiggle .6s ease; }
  .fx .opt.right { animation: fx-pop .45s ease; }
  .fx .opt.wrong, .fx .opt.mine-wrong { animation: fx-shake .38s ease; }
  .fx .exam-progress span, .fx #prog-bar { transition: width .4s ease; }
}

/* ---------- گوزن تستیوا ---------- */
.mascot { display: flex; justify-content: center; margin: .2rem 0 .3rem; position: relative; z-index: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.mascot:focus-visible .dr-body { outline: 3px solid var(--brand); outline-offset: 6px; border-radius: 24px; }
.dr-body { position: relative; width: 170px; aspect-ratio: 400 / 422; transform-origin: 50% 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.dr-f { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.mascot[data-mood=idle] .dr-happy, .mascot[data-mood=talk][data-mouth="0"] .dr-happy { opacity: 1; }
.mascot[data-mood=talk][data-mouth="1"] .dr-open { opacity: 1; }
.mascot[data-mood=think] .dr-happy { opacity: 1; }
.mascot[data-mood=happy] .dr-wink { opacity: 1; }
.mascot[data-mood=sad] .dr-happy { opacity: 1; }
.mascot[data-mood=sad] .dr-body { filter: saturate(.7) brightness(.97) drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.mascot[data-mood=think] .dr-body::after { content: "؟"; position: absolute; top: -6px; inset-inline-end: 4px; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid #f0c040; color: #c27a00; font-weight: 900; font-size: 1.5rem; line-height: 32px; text-align: center; }
.mascot.blink[data-mood=idle] .dr-happy { opacity: 0; } .mascot.blink[data-mood=idle] .dr-wink { opacity: 1; }
.mascot.can-say::after { content: ""; position: absolute; top: 2px; inset-inline-end: calc(50% - 108px); width: 30px; height: 30px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23166d5b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4h4l5 4V6L8 10H4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.mascot.hearts { position: relative; }
.dr-heart { position: absolute; bottom: 55%; left: 50%; width: 22px; height: 22px; color: #ff4d79; pointer-events: none; opacity: 0; }
.dr-say { position: fixed; z-index: 60; inset-inline: 14px; bottom: 92px; max-width: 440px; margin-inline: auto; background: #fff; color: var(--ink); border: 3px solid var(--line); border-radius: 26px; padding: .8rem 1.1rem; font-size: 1.1rem; line-height: 1.9; text-align: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); }
.dr-say[hidden] { display: none; }
.q-text.has-mascot { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 1rem 1.1rem; margin-top: .4rem; }
.q-text.has-mascot::before { content: ""; position: absolute; top: -11px; left: 50%; width: 20px; height: 20px; background: #fff; border-top: 2px solid var(--line); border-inline-start: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .dr-body { animation: deer-breathe 3.6s ease-in-out infinite; }
  .mascot[data-mood=talk] .dr-body { animation: deer-talk .9s ease-in-out infinite; }
  .mascot[data-mood=happy] .dr-body { animation: deer-jump .6s ease-out 2; }
  .mascot[data-mood=sad] .dr-body { animation: deer-sad 2.2s ease-in-out infinite; }
  .mascot[data-mood=think] .dr-body { animation: deer-think 1.6s ease-in-out infinite; }
  .mascot:active .dr-body { transform: scale(.96, 1.04); }
  .dr-heart { animation: deer-heart 1.6s ease-out forwards; }
  .dr-say:not([hidden]) { animation: fx-in-big .35s cubic-bezier(.2, .9, .3, 1.25); }
}
@keyframes deer-breathe { 0%, 100% { transform: scale(1, 1) rotate(-.5deg); } 50% { transform: scale(1.01, 1.02) rotate(.5deg); } }
@keyframes deer-talk { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@keyframes deer-jump { 0%, 100% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(0) scale(1.05, .93); } 60% { transform: translateY(-60px) scale(.97, 1.05) rotate(2deg); } }
@keyframes deer-sad { 0%, 100% { transform: translateY(0) scale(1, .975) rotate(-2deg); } 50% { transform: translateY(6px) scale(1, .96) rotate(2deg); } }
@keyframes deer-think { 0%, 100% { transform: rotate(-3deg) scale(1.01); } 50% { transform: rotate(3deg) scale(1.02); } }
@keyframes deer-heart { 0% { transform: translate(var(--hx, 0), 0) scale(.4); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--hx, 0), -120px) scale(1.15); opacity: 0; } }

/* گزینه‌ی انتخاب‌شده با لمس اول (پیش‌دبستانی و اول) */
.opt.armed { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); transform: scale(1.02); }

/* ===== فوتر متقارن: منوی پایین با ستون‌های برابر و دکمه‌ی صدا در بالا کنار آواتار (نه روی منو) ===== */
body:has(.bottom-nav) .fx-sound { bottom: auto; top: .6rem; inset-inline-start: auto; inset-inline-end: auto; left: 64px; width: 40px; height: 40px; z-index: 40; }
.bottom-nav a { text-align: center; }
.bottom-nav a > span, .bottom-nav a > b { text-align: center; }

/* ===== پیش‌دبستانی: خانه‌ی ساده، کتاب‌های تصویری، جواب بدون شکست، رنگ‌های ملایم و کادرهای بزرگ ===== */
body.pre { --brand: #d9693c; --brand-600: #b9532b; --brand-50: #fff1ea; --brand-100: #ffd9c7; --bg: #fffaf4; --line: #f3dcc8; --r: 28px; --r-lg: 34px; font-size: 118%; }
body.pre .topbar { background: rgba(255, 250, 244, .96); border-bottom: 2px solid #f6e3cf; }
body.pre .bottom-nav { background: #fffdf9; border-top: 3px solid #f6e3cf; }
body.pre .bottom-nav a { min-height: 76px; justify-content: center; font-size: .95rem; font-weight: 800; gap: 4px; }
body.pre .bottom-nav a svg { width: 34px; height: 34px; }
body.pre .bb-btn { min-height: 52px; font-size: 1rem; padding-inline: 1.1rem; border-color: #f3dcc8; color: #a8532b; }
body.pre .btn { min-height: 72px; font-size: 1.25rem; border-radius: 99px; }
body.pre .opt { min-height: 88px; border-width: 3px; border-radius: 28px; }
body.pre .play-opts { gap: .9rem; }
body.pre .play-opt { min-height: 110px; font-size: 1.7rem; background: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .07); }
body.pre .play-opt.armed { border-color: var(--brand); background: var(--brand-50); }
body.pre .play-opt.faded { opacity: .28; filter: grayscale(.6); box-shadow: none; }
body.pre .play-opt.right { background: #d9f2e6; border-color: #3aa76d; }
body.pre .play-q { font-size: 1.6rem; line-height: 2; }
body.pre #p-count, body.pre .exam-progress { display: none; }
body.pre .exam-top .exam-title { font-size: 1.05rem; }
body.pre #feedback .fb-title { font-size: 1.6rem; text-align: center; }
body.pre .exam-bar .btn { font-size: 1.4rem; }
body.pre #change-mode, body.pre #done.pre-done #done-score, body.pre #done.pre-done #done-msg { display: none; }
body.pre .big-stars svg { width: 76px; height: 76px; }
.ph-hello { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: .4rem 0 1.2rem; text-align: center; }
.ph-hello.ph-small { flex-direction: row; gap: .7rem; text-align: start; }
.ph-deer { flex: none; width: 190px; }
.ph-small .ph-deer { width: 104px; }
.ph-deer .mascot { margin: 0; }
.ph-deer .mascot.can-say::after { display: none; }
.ph-deer .dr-body { width: 100%; }
.ph-bubble { position: relative; background: #fff; border: 3px solid #f3dcc8; border-radius: 28px; padding: .7rem 1.1rem; display: flex; align-items: center; gap: .6rem; }
.ph-small .ph-bubble { flex: 1; }
.ph-bubble h1 { margin: 0; font-size: 1.45rem; line-height: 1.6; color: var(--brand-600); }
.ph-hear { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ph-hear:active { transform: scale(.94); }
.ph-play { display: flex; align-items: center; justify-content: center; gap: 1rem; min-height: 150px; border-radius: 40px; background: linear-gradient(135deg, #e8845a, #f2a65a); color: #fff; box-shadow: 0 10px 0 #c26a3f; text-decoration: none; margin: 0 0 1.4rem; }
.ph-play:active { transform: translateY(5px); box-shadow: 0 5px 0 #c26a3f; }
.ph-play b { font-size: 2.6rem; line-height: 1.3; }
.ph-play-ic { width: 92px; height: 92px; border-radius: 50%; background: rgba(255, 255, 255, .3); display: flex; align-items: center; justify-content: center; }
.ph-play-ic svg { width: 56px; height: 56px; }
.ph-stars { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.ph-stars svg { width: 54px; height: 54px; color: #ffb300; }
.ph-stars b { font-size: 2rem; color: #7a3d00; }
.pre-books { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pre-book { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 200px; padding: 1rem .6rem; background: var(--pb, #fff); border-radius: 34px; box-shadow: 0 8px 0 rgba(0, 0, 0, .09); text-decoration: none; color: var(--ink); text-align: center; }
.pre-book:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0, 0, 0, .09); }
.pre-book b { font-size: 1.3rem; line-height: 1.5; }
.pre-art { width: 118px; height: 118px; }
body.pre .adv-map .mp-t { font-size: 15px; }
body.pre .fx-sound { width: 48px; height: 48px; }
body:has(.bottom-nav).pre .fx-calm { left: 118px; }
body.pre .fx-calm.off { opacity: .75; }
@media (prefers-reduced-motion: no-preference) { .ph-play { animation: fx-in-big .5s cubic-bezier(.2, .9, .3, 1.25) backwards; } .pre-book { animation: fx-in-mid .45s ease backwards; } .pre-book:nth-child(2) { animation-delay: .07s; } .pre-book:nth-child(3) { animation-delay: .14s; } .pre-book:nth-child(4) { animation-delay: .21s; } }
/* حالت بی‌حرکت: دکمه‌ی والدین */
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }
.ph-stars.none svg { color: #e3d9cc; }
body.pre:not(:has(.bottom-nav)) .fx-calm { inset-inline-end: 4.2rem; }
body.pre .play-img { max-height: 300px; width: auto; max-width: 100%; border: 0; border-radius: 0; margin: .6rem auto; }
body.pre .play-opt .opt-img { max-height: 120px; }
body.pre .play-opt { font-size: 2rem; }
body.pre #q .dr-body { width: 112px; }
.play-opts.wide { grid-template-columns: 1fr; }
.play-opts.wide .play-opt { min-height: 0; padding: .45rem .6rem; }
body.pre .play-opts.wide .play-opt .opt-img { max-height: 96px; }
