:root {
  --ink: #1d2447;
  --ink-soft: #5d6690;
  --card: #ffffff;
  --brand: #2e7dff;
  --brand-dark: #1957c9;
  --good: #1fb26b;
  --good-bg: #dbf7e8;
  --bad: #ee5a5a;
  --bad-bg: #ffe3e3;
  --warn: #ff9f1c;
  --gold: #ffb400;
  --line: #dde4fb;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 70% -10%, #3a4fb8 0%, #1a2150 55%, #10152f 100%) fixed;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
/* پس‌زمینهٔ میدان نبرد: کمرنگ و کمی محو تا محتوا خوب دیده شود */
body::before {
  content: ""; position: fixed; inset: -12px; z-index: -1; pointer-events: none;
  background: url(bg-battle.svg) center bottom / cover no-repeat;
  opacity: .38; filter: blur(2.5px);
}
@media (max-aspect-ratio: 3/4) { body::before { background-position: 18% bottom; } }  /* گوشی: تانک خودی و ماه در کادر بمانند */
@media print { body::before { display: none; } }
#app { width: 100%; max-width: 880px; margin: 0 auto; padding: 12px 12px 36px; flex: 1 0 auto; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ---------- دکمه‌ها ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 12px 22px; font-weight: 800; font-size: 1.05rem;
  background: var(--brand); color: #fff; box-shadow: 0 5px 0 var(--brand-dark);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn.big { width: 100%; padding: 15px; font-size: 1.2rem; }
.btn.good { background: var(--good); box-shadow: 0 5px 0 #14804d; }
.btn.good:active { box-shadow: 0 1px 0 #14804d; }
.btn.fire { background: linear-gradient(180deg, #ff7a3d, #ee3d3d); box-shadow: 0 5px 0 #a82a2a; }
.btn.fire:active { box-shadow: 0 1px 0 #a82a2a; }
.btn.ghost { background: #fff; color: var(--brand-dark); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.small { padding: 8px 14px; font-size: .9rem; border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 10px 30px rgba(0, 0, 20, .35); }
.muted { color: var(--ink-soft); }

/* ---------- شروع ---------- */
.welcome { text-align: center; padding-top: 20px; color: #fff; max-width: 520px; margin: 0 auto; }
.welcome h1 { font-size: 2.1rem; font-weight: 800; }
.welcome .sub { color: #c5cdf5; margin: 4px 0 18px; }
.welcome .card { color: var(--ink); text-align: right; display: grid; gap: 16px; }
.lbl { font-weight: 800; display: block; margin-bottom: 8px; }
.text-input { width: 100%; font: inherit; font-size: 1.15rem; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #f7f9ff; color: var(--ink); }
.text-input:focus { outline: 3px solid #b5ceff; border-color: var(--brand); }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice { border: 3px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 6px; text-align: center; font-weight: 600; }
.choice[aria-pressed="true"] { border-color: var(--brand); background: #eaf2ff; box-shadow: 0 0 0 3px #bcd5ff; }
.code-input { text-align: center; letter-spacing: .2em; font-weight: 800; }
.code-input::placeholder { letter-spacing: .1em; font-weight: 400; }
.msg { border-radius: 12px; padding: 8px 12px; font-weight: 600; }
.msg.bad { background: var(--bad-bg); color: #9b2b2b; }
.msg.good { background: var(--good-bg); color: #0f6b44; }
.welcome a { color: #fff; font-weight: 800; }

/* ---------- پانویس و دربارهٔ ما (about.html) ---------- */
.site-footer { text-align: center; color: #9aa5d8; font-size: .85rem; padding: 0 12px 18px; }
.site-footer a { color: #c5cdf5; font-weight: 600; }
body.in-battle .site-footer { display: none; }
@media print { .site-footer { display: none; } }
.about { max-width: 920px; margin: 0 auto; display: grid; gap: 18px; }
.about-head { text-align: center; color: #fff; padding-top: 16px; }
.about-head h1 { font-size: 1.9rem; font-weight: 800; }
.about-head .sub { color: #c5cdf5; }
.about .card { display: grid; gap: 10px; }
.about h2 { font-size: 1.2rem; font-weight: 800; color: var(--brand-dark); }
.about .footer-actions { margin-top: 4px; }
.about .btn { text-decoration: none; display: inline-block; text-align: center; }

/* ---------- پروفایل‌ها ---------- */
.profile-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.profile-pick { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; text-align: right; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 10px 14px; box-shadow: 0 6px 0 var(--line); }
.profile-row.active .profile-pick { border-color: var(--brand); box-shadow: 0 6px 0 var(--brand-dark); }
.profile-pick .av { width: 48px; height: 48px; border-radius: 50%; background: #eaf2ff; color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.profile-pick .t { font-weight: 800; font-size: 1.1rem; }
.profile-pick .s { color: var(--ink-soft); font-size: .9rem; }

/* ---------- همگام‌سازی و فصل‌ها ---------- */
.sync-line { text-align: center; color: #c5cdf5; font-size: .85rem; margin-top: 8px; }
/* انتخاب درس و فصل بدون اسکرول افقی: همهٔ درس‌ها در چند خط؛ انتخاب فصل در یک پنجرهٔ کوچک */
.picker { display: grid; gap: 10px; margin-bottom: 14px; }
.subj-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.subj-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink);
  border: 2px solid transparent; border-radius: 99px; padding: 8px 14px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 20, .22); transition: transform .08s, box-shadow .08s; }
.subj-pill .ci { font-size: 1.1em; line-height: 1; }
.subj-pill:active { transform: translateY(1px); }
.subj-pill.on { background: var(--brand); color: #fff; box-shadow: 0 3px 12px rgba(46, 125, 255, .55); }
.ch-current { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px;
  padding: 11px 14px; font-weight: 800; }
.ch-current .chev { color: #c5cdf5; font-size: .85rem; font-weight: 800; }
/* پنجرهٔ «کدام فصل؟» */
.chapter-pick {
  position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: 88vh;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; background: #fff; border-radius: 20px; padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 20, .5);
}
.chapter-pick .topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chapter-pick .topbar h2 { font-size: 1.1rem; }
.ch-opts { overflow-y: auto; display: grid; gap: 8px; align-content: start; padding: 2px; }
.ch-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: right;
  background: #f7f9ff; color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 700; }
.ch-opt .ch-s { color: var(--ink-soft); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.ch-opt.cur { border-color: var(--brand); background: #eaf2ff; }
.ch-opt:active { transform: translateY(1px); }
.small-note { font-size: .85rem; text-align: center; margin-top: 10px; }
.chk { display: flex; gap: 10px; align-items: center; padding: 8px 4px; font-weight: 600; cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--good); }

/* ---------- انتخاب مأموریت ---------- */
.missions h1 { color: #fff; font-size: 1.6rem; margin: 6px 0 2px; }
.missions .sub { color: #c5cdf5; margin-bottom: 14px; }
.mission-list { display: grid; gap: 12px; }
.mission {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; text-align: right; width: 100%;
  background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 12px 16px; box-shadow: 0 6px 0 var(--line);
}
.mission .ic { width: 56px; height: 56px; border-radius: 16px; background: #eaf2ff; display: grid; place-items: center; font-size: 1.9rem; }
.mission .t { font-weight: 800; font-size: 1.1rem; }
.mission .s { color: var(--ink-soft); font-size: .9rem; }
.mission.open { border-color: var(--brand); box-shadow: 0 6px 0 var(--brand-dark); }
.mission.done { border-color: var(--good); box-shadow: 0 6px 0 #14804d; }
.mission.locked { opacity: .55; filter: grayscale(.6); cursor: not-allowed; }
.stars { letter-spacing: 2px; color: var(--gold); font-size: 1.3rem; white-space: nowrap; }
.stars .off { color: #d3d9ef; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- نبرد ---------- */
.hud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; color: #fff; }
.hud .pill { background: rgba(255, 255, 255, .14); border-radius: 99px; padding: 2px 12px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.hud .title { font-weight: 800; margin-inline-end: auto; }
.shield { display: flex; align-items: center; gap: 6px; }
.shield .bar { width: 120px; height: 12px; background: rgba(255, 255, 255, .2); border-radius: 99px; overflow: hidden; }
.shield .bar i { display: block; height: 100%; background: linear-gradient(90deg, #4be3a0, #1fb26b); transition: width .4s; }
.shield .bar i.low { background: linear-gradient(90deg, #ffb347, #ee5a5a); }
.pip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); margin-inline-start: 3px; }
.pip.on { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.pill.armed { background: var(--warn); color: #3a2300; animation: glow 1s ease-in-out infinite; }
.stage { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 20, .45); border: 3px solid rgba(255, 255, 255, .25); }
#cv { display: block; width: 100%; height: auto; background: #8ad0ff; touch-action: none; }
#banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(20, 25, 60, .85); color: #fff;
  padding: 6px 20px; border-radius: 99px; font-weight: 800; pointer-events: none; opacity: 0; transition: opacity .25s; white-space: nowrap;
}
#banner.show { opacity: 1; }

#panel { margin-top: 10px; }
.qmeta { color: var(--ink-soft); font-size: .88rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qtag { background: #eaf2ff; color: var(--brand-dark); border-radius: 99px; padding: 0 10px; font-weight: 600; }
.qtag.again { background: var(--bad-bg); color: #b73636; }
.qtext { font-size: 1.35rem; font-weight: 800; margin: 4px 0 12px; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.opt {
  display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; text-align: right;
  background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 1.1rem; font-weight: 600;
  box-shadow: 0 4px 0 var(--line); transition: transform .08s;
}
.opt .k { width: 28px; height: 28px; border-radius: 8px; background: #eaf2ff; display: grid; place-items: center; font-size: .8rem; color: var(--brand-dark); }
.opt:hover:not(:disabled) { border-color: #8db4ff; }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt.right { background: var(--good-bg); border-color: var(--good); box-shadow: 0 4px 0 #14804d; }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); box-shadow: 0 4px 0 #c24141; animation: shake .4s; }
.opt:disabled { cursor: default; }
.opt.wrong.still { animation: none; }
.opt.wait { opacity: .6; }
.feedback.hint { margin: 0 0 12px; }
.feedback.still { animation: none; }
.feedback .blank { display: inline-block; min-width: 2.6em; height: 1.1em; vertical-align: -.15em; margin: 0 .15em; border-radius: 6px; background: #fff; border: 2px dashed var(--bad); }
.feedback { margin-top: 12px; border-radius: 14px; padding: 12px 14px; animation: rise .3s; display: grid; gap: 8px; }
.feedback.good { background: var(--good-bg); color: #0f6b44; }
.feedback.bad { background: var(--bad-bg); color: #9b2b2b; }
.feedback .head { font-weight: 800; font-size: 1.1rem; }
.feedback .why { color: var(--ink); }
.feedback .effect { font-weight: 600; }
.feedback .gloss { display: grid; gap: 4px; }
.feedback .gl-head { font-weight: 700; font-size: .9rem; }
.feedback .gl-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.feedback .gl { background: #fff; color: var(--ink); border-radius: 8px; padding: 2px 8px; font-size: .9rem; line-height: 1.5; }
.feedback .gl b { font-weight: 700; }

.aim { display: grid; gap: 12px; }
.aim .status { border-radius: 12px; padding: 8px 12px; font-weight: 600; }
.aim .status.good { background: var(--good-bg); color: #0f6b44; }
.aim .status.bad { background: var(--bad-bg); color: #9b2b2b; }
.aim .status.plain { background: #eaf2ff; color: var(--brand-dark); }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slider label { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 4px; }
.slider input[type=range] { width: 100%; height: 34px; accent-color: var(--brand); }
.hint { text-align: center; font-weight: 600; color: var(--ink-soft); padding: 10px 0; }

/* ---------- عبارت‌های ریاضی ---------- */
.code { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: pre; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.math { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-weight: 600; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .12em; line-height: 1.15; font-size: .92em; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .25em; }
.frac > span:last-child { padding: 0 .25em; }
.math sup { font-size: .65em; }
.qtext .math { font-size: 1.15em; }

/* ---------- نتیجه ---------- */
.result { text-align: center; padding: 8px 0; }
.result .big-em { font-size: 4rem; line-height: 1.2; }
.result h2 { font-size: 1.7rem; margin: 4px 0; }
.result .stars { font-size: 2.4rem; margin: 4px 0 8px; }
.result .note { color: var(--ink-soft); margin-bottom: 14px; }
.actions { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; }

/* ---------- گزارش ---------- */
.report h2 { margin-bottom: 12px; }
.report section { margin-bottom: 16px; }
.report h3 { margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: #eef3ff; border-radius: 14px; padding: 10px; text-align: center; }
.kpi b { display: block; font-size: 1.5rem; }
.stat-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: 10px; align-items: center; margin: 8px 0; }
.stat-row .bar { height: 12px; background: #e3eaff; border-radius: 99px; overflow: hidden; }
.stat-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, #4be3a0, #1fb26b); }
.stat-row .p { text-align: left; font-weight: 800; }
.weak { padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; margin: 8px 0; }
.weak .n { color: var(--bad); font-weight: 600; font-size: .9rem; }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
#confetti span { position: absolute; top: -40px; font-size: 1.6rem; animation: fall linear forwards; }

@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes glow { 50% { box-shadow: 0 0 14px var(--warn); } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) {
  .options, .sliders { grid-template-columns: 1fr; }
  .qtext { font-size: 1.15rem; }
  .mission { grid-template-columns: 52px 1fr; }
  .mission .stars { grid-column: 1 / -1; }
}

.qtag.review { background: #fff1d6; color: #9a5b00; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.pills .pill { background: rgba(255,255,255,.14); color: #fff; border-radius: 99px; padding: 2px 12px; font-weight: 600; font-size: .92rem; }

/* ---------- صفحهٔ عریض (لپ‌تاپ/دسکتاپ): نبرد بدون اسکرول؛ پنل سؤال کنار صحنه ---------- */
@media (min-width: 820px) and (min-aspect-ratio: 5/4) {
  .in-battle #app { max-width: 1400px; padding-bottom: 12px; }
  .battle { display: grid; grid-template-columns: 420px minmax(0, 1fr); grid-template-areas: "hud hud" "panel stage"; gap: 12px; align-items: start; }
  .battle .hud { grid-area: hud; margin-bottom: 0; }
  .battle .stage { grid-area: stage; }
  .battle #panel { grid-area: panel; margin-top: 0; max-height: calc(100vh - 100px); overflow-y: auto; }
  .battle #cv { max-height: calc(100vh - 100px); object-fit: contain; }
  .battle .sliders { grid-template-columns: 1fr; }
  .battle .options { gap: 8px; }
  .battle .opt { grid-template-columns: 26px 1fr; gap: 6px; }
  .battle .feedback { margin-top: 10px; padding: 10px 12px; gap: 6px; }
  .battle .feedback .btn { position: sticky; bottom: 0; }
  .battle .qtext { font-size: 1.2rem; margin-bottom: 10px; }
  .battle .opt { padding: 8px 12px; font-size: 1.05rem; }
}

/* ---------- گوشی ---------- */
.rotate-hint { display: none; }
@media (hover: none) { .kbd-hint { display: none; } }
/* عمودی: صحنه تا لبهٔ صفحه، و پیشنهاد چرخاندن گوشی */
@media (orientation: portrait) and (max-width: 640px) {
  .battle .stage { margin-inline: -12px; border-radius: 0; border-inline-width: 0; }
  .rotate-hint { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; color: #fff; font-size: .88rem; font-weight: 600; margin-bottom: 8px; text-align: center; }
  .rotate-hint .btn { box-shadow: 0 3px 0 var(--brand-dark); }
}
/* افقی: پنل سؤال کنار صحنه و صحنه به اندازهٔ ارتفاع صفحه (بعد از قاعدهٔ لپ‌تاپ تا آن را بازنویسی کند) */
@media (orientation: landscape) and (max-height: 540px) {
  .in-battle #app { max-width: none; min-height: 0; padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); }
  .battle { display: grid; grid-template-columns: minmax(210px, 30%) minmax(0, 1fr); grid-template-areas: "panel hud" "panel stage"; gap: 6px 8px; align-items: start; }
  .battle .hud { grid-area: hud; margin-bottom: 0; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .battle .hud .title { display: none; }
  .battle .hud .pill { font-size: .78rem; padding: 0 8px; }
  .battle .hud .btn.small { padding: 2px 10px; font-size: .78rem; white-space: nowrap; flex: none; }
  .battle .shield .bar { width: 60px; }
  .battle .stage { grid-area: stage; width: fit-content; max-width: 100%; justify-self: center; border-radius: 12px; border-width: 2px; }
  .battle #cv { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 48px); }
  .battle #panel { grid-area: panel; margin-top: 0; padding: 10px; max-height: calc(100dvh - 12px); overflow-y: auto; }
  .battle .qtext { font-size: 1rem; margin: 2px 0 8px; }
  .battle .options, .battle .sliders { grid-template-columns: 1fr; gap: 6px; }
  .battle .opt { grid-template-columns: 24px 1fr; gap: 6px; padding: 6px 10px; font-size: .95rem; }
  .battle .opt .k { width: 22px; height: 22px; }
  .battle .feedback { margin-top: 8px; padding: 8px 10px; gap: 4px; font-size: .9rem; }
  .battle .feedback .btn { position: sticky; bottom: 0; }
  .battle .aim { gap: 6px; }
  .battle .aim .status { font-size: .82rem; padding: 6px 10px; }
  .battle .slider input[type=range] { height: 30px; }
  .battle .btn.big { padding: 10px; font-size: 1.05rem; }
}

.hud .quit { box-shadow: 0 3px 0 var(--line); }

/* ---------- داستان یک‌ساله: کارت فصل، چالش‌ها، گشت مرور ---------- */
.campaign {
  position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 14px 16px; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 30px rgba(0, 0, 20, .35);
  text-shadow: 0 1px 3px rgba(0, 0, 30, .55);
}
.campaign h2 { font-size: 1.45rem; margin: 6px 0 8px; }
.campaign .s { font-size: .9rem; margin-top: 4px; }
.camp-top { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; }
.act-tag { background: rgba(0, 0, 30, .35); border-radius: 99px; padding: 2px 12px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.camp-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-shadow: none; }
.camp-actions .btn { padding-inline: 6px; white-space: nowrap; }
.xpbar { height: 14px; background: rgba(0, 0, 30, .3); border-radius: 99px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffe066, #ffb400); border-radius: 99px; transition: width .5s; }
.campaign .btn.fire { text-shadow: none; }
.quests { margin-bottom: 12px; padding: 12px 16px; }
.quests h3 { margin-bottom: 6px; }
.quest { display: grid; grid-template-columns: 1fr 90px auto; gap: 10px; align-items: center; padding: 4px 0; font-size: .95rem; }
.quest .qbar { height: 10px; background: #e3eaff; border-radius: 99px; overflow: hidden; }
.quest .qbar i { display: block; height: 100%; background: linear-gradient(90deg, #4be3a0, #1fb26b); }
.quest .rw { font-weight: 800; color: #9a6b00; font-size: .85rem; white-space: nowrap; }
.quest.done { color: var(--ink-soft); }
.quest.done .rw { color: var(--good); }
.event { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding: 10px 14px; background: #fff8e6; }
.event .ev-ic { font-size: 2rem; }
.event > div { flex: 1; }
.event .s { color: var(--ink-soft); font-size: .9rem; }
.mission.patrol { margin-bottom: 12px; border-color: #7c5cff; box-shadow: 0 6px 0 #5236c9; background: linear-gradient(90deg, #f3efff, #fff); }
.mission.patrol .ic { background: #e7e0ff; }

/* ---------- صحنهٔ داستان ---------- */
.story {
  max-width: 640px; margin: 10px auto 0; border-radius: 24px; padding: 18px 16px 20px; color: #fff; min-height: 70vh;
  display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(180deg, var(--c1), var(--c2) 70%, var(--c3)); box-shadow: 0 10px 30px rgba(0, 0, 20, .45);
}
.story-head { text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 30, .6); }
.story-head h1 { font-size: 1.7rem; margin-top: 6px; }
.story-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.speaker { display: flex; align-items: center; gap: 10px; text-shadow: 0 1px 3px rgba(0, 0, 30, .6); }
.speaker .face {
  font-size: 3.2rem; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .85); box-shadow: 0 6px 0 rgba(0, 0, 30, .25); animation: bob 2.4s ease-in-out infinite;
}
.speaker.villain .face { background: #e7d6ff; box-shadow: 0 6px 0 #5a2594; }
.speaker b { font-size: 1.2rem; }
.bubble {
  background: #fff; color: var(--ink); border-radius: 20px; padding: 16px 18px; font-size: 1.2rem; line-height: 1.9;
  box-shadow: 0 8px 0 rgba(0, 0, 30, .18); animation: pop .25s ease-out;
}
.bubble.narrator { background: rgba(10, 10, 30, .75); color: #fff; font-style: italic; text-align: center; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dots i.on { background: #fff; }
.story-actions { display: grid; gap: 10px; justify-items: center; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- نقشهٔ سفر ---------- */
.rank-card { margin-bottom: 14px; }
.rank-card .xpbar { background: #e3eaff; margin: 6px 0 2px; }
.rank-card .s { color: var(--ink-soft); font-size: .88rem; }
.rank-card > .btn { display: block; margin-top: 10px; }
.act-node {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; border-radius: 20px; padding: 12px 14px;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); text-shadow: 0 1px 3px rgba(0, 0, 30, .6);
  border: 3px solid rgba(255, 255, 255, .25);
}
.act-node .ic { font-size: 2.2rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 30, .25); }
.act-node .t { font-weight: 800; font-size: 1.1rem; }
.act-node .s { font-size: .88rem; }
.act-node.cur { border-color: #ffe066; box-shadow: 0 0 0 4px rgba(255, 224, 102, .45); }
.act-node.locked { background: #262c58; border-color: rgba(255, 255, 255, .12); opacity: .85; }
.node-actions { display: grid; gap: 6px; text-shadow: none; }
.journey .path { width: 6px; height: 22px; margin: 2px auto; border-radius: 3px; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .6) 0 6px, transparent 6px 11px); }

/* ---------- آشیانه ---------- */
.hangar { display: grid; gap: 10px; }
.hangar .topbar { display: flex; justify-content: space-between; align-items: center; }
.pill.gold { background: #fff1c2; color: #7a5200; border-radius: 99px; padding: 2px 12px; font-weight: 800; }
#tankPreview { width: 100%; max-width: 360px; height: auto; margin: 0 auto; display: block; border-radius: 16px; border: 3px solid var(--line); }
.hangar .s { font-size: .88rem; }
.up-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.up-row .ic { font-size: 1.7rem; }
.up-row .s { color: var(--ink-soft); }
.lv i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #dde4fb; margin-inline-start: 3px; }
.lv i.on { background: var(--gold); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.shop-item { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; text-align: center; }
.shop-item.on { border-color: var(--good); background: var(--good-bg); }
.shop-item.locked { opacity: .55; }
.shop-item .sw { width: 44px; height: 30px; border-radius: 10px; border: 2px solid rgba(0, 0, 0, .1); }
.shop-item .sw.em { border: 0; font-size: 1.6rem; line-height: 30px; }
.shop-item .nm { font-weight: 600; font-size: .9rem; }
.shop-item .s.on { color: var(--good); font-weight: 800; }
.shop-item .btn.small { padding: 4px 10px; font-size: .85rem; }

/* ---------- نبرد: معرفی دشمن تازه، جایزه ---------- */
.enemy-intro { display: grid; gap: 12px; }
.enemy-intro h2 { color: #b33; }
.enemy-intro .ei { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; background: #f6f0ff; border-radius: 14px; padding: 10px; }
.enemy-intro .ic { font-size: 2.4rem; text-align: center; }
.result .gain { font-weight: 800; color: #9a6b00; margin-top: 6px; }

/* ---------- نشان‌ها ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 8px 6px; border-radius: 14px; background: #f3f5fb; opacity: .6; }
.badge.got { background: #fff6d8; opacity: 1; box-shadow: inset 0 0 0 2px #ffd36a; }
.badge .ic { font-size: 1.8rem; }
.badge b { font-size: .9rem; }
.badge .s { font-size: .78rem; color: var(--ink-soft); }

/* ---------- پیام کوتاه ---------- */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 460px); pointer-events: none; }
.toast { background: rgba(20, 25, 60, .94); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); animation: pop .25s ease-out; transition: opacity .5s; text-align: center; }
.toast.out { opacity: 0; }

@media (max-width: 640px) {
  .quest { grid-template-columns: 1fr auto; }
  .quest .qbar { grid-column: 1 / -1; grid-row: 2; }
  .act-node { grid-template-columns: 48px 1fr; }
  .act-node .ic { width: 46px; height: 46px; font-size: 1.8rem; }
  .node-actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; }
  .bubble { font-size: 1.08rem; }
}

/* ---------- انتخاب فصل‌ها (خلاصه در صفحهٔ اصلی + پنجره) ---------- */
.chapters-sum {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: right; margin-bottom: 12px;
  background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px;
}
.chapters-sum .ic { font-size: 1.8rem; }
.chapters-sum .t { font-weight: 800; }
.chapters-sum .s { color: var(--ink-soft); font-size: .88rem; }
.chapters-sum .go { font-size: 1.2rem; }
.chapters-sum.empty { border: 3px solid var(--good); box-shadow: 0 6px 0 #14804d; animation: glow 1.6s ease-in-out infinite; }
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; background: rgba(8, 10, 30, .6); z-index: 40; }
.chapters-modal {
  position: fixed; z-index: 41; top: 4vh; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 92vh;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; background: #fff; border-radius: 20px; padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 20, .5);
}
.chapters-modal .topbar { display: flex; justify-content: space-between; align-items: center; }
.chapters-modal .s { font-size: .9rem; }
.subj-list { overflow-y: auto; display: grid; gap: 8px; align-content: start; padding: 2px; }
.subj { border: 2px solid var(--line); border-radius: 14px; }
.subj.some { border-color: #9be3bf; }
.subj-head { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 10px 12px; text-align: right; }
.subj-head .cnt { color: var(--ink-soft); font-size: .88rem; }
.subj.some .subj-head .cnt { color: #0f6b44; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.chip { border: 2px solid var(--line); background: #f7f9ff; border-radius: 99px; padding: 5px 12px; font-size: .9rem; font-weight: 600; text-align: right; }
.chip.on { background: var(--good-bg); border-color: var(--good); color: #0f6b44; }
.subj-tools { display: flex; gap: 8px; padding: 0 12px 10px; }

/* ---------- گزارش به تفکیک درس ---------- */
.report .s { font-size: .86rem; }
.subj-report { border: 2px solid var(--line); border-radius: 14px; margin: 8px 0; padding: 8px 12px; }
.subj-report summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.subj-report summary .nm { font-weight: 800; font-size: 1.05rem; }
.subj-report summary .s { color: var(--ink-soft); }
.subj-report summary .meter { grid-column: 1 / -1; }
.meter { display: grid; grid-template-columns: 44px 1fr 46px; gap: 8px; align-items: center; font-size: .85rem; }
.meter .bar { height: 10px; background: #e3eaff; border-radius: 99px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: linear-gradient(90deg, #4be3a0, #1fb26b); }
.meter b { text-align: left; }
.ch-row { display: grid; gap: 2px; padding: 8px 0 4px; border-top: 1px dashed var(--line); margin-top: 6px; }
.ch-row .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.ch-row .nm .s { color: var(--ink-soft); font-weight: 400; }
/* فصل بازشو: خلاصه درصد درست، و داخلش ریز مبحث‌ها */
.ch-det { border-top: 1px dashed var(--line); margin-top: 6px; padding: 8px 0 4px; }
.ch-det > summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; list-style: none; }
.ch-det > summary::-webkit-details-marker { display: none; }
.ch-det > summary .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.ch-det > summary .nm .s { color: var(--ink-soft); font-weight: 400; }
.ch-det > summary .meter { grid-column: 1 / -1; }
.ch-det > summary .chev { color: var(--ink-soft); font-size: .8rem; transition: transform .2s; }
.ch-det[open] > summary .chev { transform: rotate(180deg); }
.mis { display: grid; gap: 5px; padding: 8px 0 2px; }
.mi-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; padding: 6px 10px; border-radius: 9px; background: #f5f8ff; border-inline-start: 4px solid var(--line); }
.mi-row.good { border-inline-start-color: var(--good); background: #eefaf3; }
.mi-row.weak { border-inline-start-color: #e8a200; background: #fff6e8; }
.mi-row.hard { border-inline-start-color: var(--bad); background: #fdeeee; }
.mi-row .mi-nm { font-weight: 600; }
.mi-row .mi-n { color: var(--ink-soft); white-space: nowrap; }
.weak .w-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.weak .n { color: #9a5b00; }
.weak.hard .n { color: var(--bad); }

/* ---------- صفحهٔ اصلی: دکمهٔ بزرگ «شروع بازی»؛ صفحهٔ انتخاب مأموریت ---------- */
.start-btn {
  display: block; width: 100%; margin: 6px 0 14px; padding: 18px 16px; border-radius: 22px; font-size: 1.7rem; font-weight: 800; line-height: 1.4;
  background: linear-gradient(180deg, #34d27f, var(--good)); box-shadow: 0 7px 0 #14804d, 0 12px 28px rgba(31, 178, 107, .35);
  text-shadow: 0 1px 2px rgba(0, 60, 30, .35);
}
.start-btn:active { box-shadow: 0 2px 0 #14804d; }
.home .footer-actions { margin-top: 6px; }
/* سرِ همهٔ صفحه‌ها: عنوان راست، دکمهٔ «🏠 بازگشت» همیشه چپ بالا با یک شکل */
.page-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-top h1 { color: #fff; font-size: 1.6rem; font-weight: 800; line-height: 1.4; margin: 0; }
.back-btn { margin-inline-start: auto; flex: none; white-space: nowrap; text-decoration: none; }
.list-title { color: #fff; font-size: 1.05rem; margin: 2px 0 10px; }
.pick-foot { margin-top: 22px; }
.pick-foot .chapters-sum { margin-bottom: 0; }

/* ---------- نردبان درجه‌ها ---------- */
.rank-pill { border: 2px solid rgba(255, 255, 255, .45); cursor: pointer; font: inherit; font-weight: 600; }
.rank-pill:hover { background: rgba(255, 255, 255, .24); }
.rank-list { display: grid; gap: 10px; }
.rank-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px;
}
.rank-row .ic { width: 56px; height: 62px; border-radius: 14px; background: #eaf2ff; display: grid; place-items: center; font-size: 1.7rem; }
.rank-row .t { font-weight: 800; font-size: 1.05rem; }
.insignia { display: block; height: 52px; width: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.insignia.sm { display: inline-block; height: 22px; vertical-align: -6px; }
.rank-row .s { color: var(--ink-soft); font-size: .88rem; }
.rank-row.done { border-color: var(--good); }
.rank-row.done .ic { background: var(--good-bg); }
.rank-row.cur { border: 3px solid var(--gold); background: #fff8e0; box-shadow: 0 6px 0 #c98f00; }
.rank-row.cur .ic { background: #ffe9a8; }
.rank-row.cur .s { color: #7a5200; font-weight: 600; }
.rank-row.locked { background: #f1f3f9; }
.rank-row.locked .t, .rank-row.locked .s { opacity: .65; }

/* ---------- صفحهٔ معرفی (لندینگ، tpl-landing در index.html) ---------- */
.on-landing #app { max-width: 1120px; padding-inline: 16px; }
.landing { color: #fff; display: grid; gap: 48px; padding: 18px 0 8px; }
.ld-hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 36px; align-items: center; }
.ld-kicker { display: inline-block; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 99px; padding: 2px 14px; font-size: .9rem; font-weight: 600; color: #dfe5ff; }
.ld-hero h1 { font-size: clamp(2.5rem, 6vw, 3.8rem); font-weight: 800; line-height: 1.3; margin: 10px 0 6px; text-shadow: 0 4px 24px rgba(46, 125, 255, .45); }
.ld-lead { font-size: 1.2rem; color: #c5cdf5; max-width: 34em; }
.ld-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
.ld-cta .btn { text-decoration: none; }
.ld-start { font-size: 1.25rem; padding: 14px 34px; }
.ld-note { color: #9aa5d8; font-size: .9rem; }
.ld-art { margin: 0; border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 0 18px 50px rgba(0, 0, 20, .5); }
.ld-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ld-art.ph { display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #4a63d8, #222b6e 70%); }
.ld-art.ph::after { content: attr(data-ph); font-size: clamp(2.4rem, 7vw, 4.5rem); letter-spacing: .15em; }
.ld-sec h2 { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 18px; }
.ld-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ld-steps li { display: grid; gap: 4px; align-content: start; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); border-radius: 18px; padding: 14px 16px; }
.ld-steps .ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 4px; }
.ld-steps b { font-size: 1.08rem; }
.ld-steps span:last-child { color: #c5cdf5; font-size: .95rem; }
.ld-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld-shots img, .ld-phones img { display: block; width: 100%; height: auto; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .18); box-shadow: 0 12px 34px rgba(0, 0, 20, .45); }
.ld-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }   /* هر سه کارت هم‌قد */
.ld-features .card { color: var(--ink); display: grid; gap: 8px; align-content: start; }
.ld-features .ld-art, .ld-phones { aspect-ratio: 4 / 3; border-radius: 14px; box-shadow: none; margin-bottom: 4px; }
.ld-features h3 { font-size: 1.15rem; font-weight: 800; }
.ld-features p { color: var(--ink-soft); font-size: .95rem; }
.ld-phones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px 0; overflow: hidden; background: linear-gradient(160deg, #3a4fb8, #1a2150); }
.ld-phones img { border-radius: 12px 12px 0 0; border-bottom: 0; box-shadow: none; }
.ld-end { text-align: center; display: grid; justify-items: center; gap: 16px; }
.ld-subjects { color: #c5cdf5; max-width: 46em; }
.ld-about { color: #c5cdf5; }
.ld-about a { color: #fff; font-weight: 800; }
@media (max-width: 820px) {
  .landing { gap: 36px; }
  .ld-hero, .ld-steps, .ld-features { grid-template-columns: 1fr; }
  .ld-hero { gap: 22px; text-align: center; }
  .ld-cta { justify-content: center; }
  .ld-lead { margin-inline: auto; }
  .ld-shots { grid-template-columns: 1fr; }
  .ld-shots img + img { display: none; }   /* گوشی: یک تصویر نبرد کافی است */
}
@media (max-width: 820px) {
  .ld-steps li { grid-template-columns: 44px 1fr; column-gap: 12px; padding: 12px 14px; }
  .ld-steps .ic { grid-row: span 2; width: 44px; height: 44px; margin: 0; }
}
/* بزرگ‌نمایی تصویرهای صفحهٔ معرفی */
.landing img[data-act="zoom"] { cursor: zoom-in; transition: transform .15s; }
.landing img[data-act="zoom"]:hover { transform: scale(1.02); }
.landing img[data-act="zoom"]:focus-visible { outline: 3px solid #b5ceff; outline-offset: 2px; }
#zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 56px 16px 16px; background: rgba(8, 10, 30, .88); cursor: zoom-out; animation: zoom-in .15s ease-out; }
/* اندازه نسبت به خود پنجره، نه سلول grid (درصدِ ارتفاع آنجا اثری ندارد و تصویرهای بلندِ گوشی بیرون می‌زدند) */
#zoom img { width: auto; height: auto; max-width: min(1400px, calc(100vw - 32px)); max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
#zoom .btn { position: absolute; top: 12px; left: 12px; }
@keyframes zoom-in { from { opacity: 0; } }
/* سرِ صفحهٔ اصلی بازی: سلام در راست، «معرفی بازی» در چپ (هم‌جای دکمهٔ بازگشت صفحه‌های دیگر) */
.home-top { display: flex; align-items: center; gap: 10px; }
.home-top h1 { margin: 0; }
.avatar-btn { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.avatar { display: block; width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid #f2c94c; box-shadow: 0 3px 10px rgba(0, 0, 20, .35); }
.avatar-btn .avatar-rank { position: absolute; bottom: -6px; inset-inline-start: -8px; height: 30px; }
.profile-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.profile-card figure { margin: 0; text-align: center; }
.profile-photo { display: block; width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid #f2c94c; box-shadow: 0 4px 14px rgba(0, 0, 20, .25); }
.profile-card figcaption { margin-top: 6px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); max-width: 120px; }
.profile-card h2 { margin-bottom: 6px; }
.avatar.emoji, .profile-photo.emoji, .pick-img.emoji { display: grid; place-items: center; background: #eaf2ff; }
.avatar.emoji { font-size: 2rem; }
.profile-photo.emoji { font-size: 3.6rem; }
.edit-me { margin-top: 10px; }
.me-card { display: grid; gap: 14px; }
.me-card #mePreview { justify-self: center; margin: 0; display: grid; justify-items: center; text-align: center; }
.me-card #mePreview .profile-photo { margin: 0 auto; }
.me-card #mePreview figcaption { margin-top: 6px; font-weight: 700; color: var(--ink-soft); font-size: .9rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.avatar-pick { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.avatar-pick[aria-pressed="true"] { border-color: var(--good); background: var(--good-bg); box-shadow: 0 0 0 3px rgba(31, 178, 107, .25); }
.pick-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; font-size: 2.2rem; }
.avatar-pick .nm { font-size: .78rem; font-weight: 700; line-height: 1.35; text-align: center; }
@media (max-width: 480px) { .profile-photo { width: 84px; height: 84px; } .profile-card { gap: 10px; } }

/* ---------- دربارهٔ ما: سرصفحه با طرح مفهومی، بخش‌های دوستونه و سازندگان با فلش ---------- */
.ab-hero { text-align: center; color: #fff; display: grid; gap: 6px; }
.ab-hero .ab-banner { aspect-ratio: 951 / 363; margin-bottom: 10px; }
.ab-hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; }
.ab-hero .sub { color: #c5cdf5; font-size: 1.1rem; }
.about .card p { line-height: 1.9; }
.ab-split { grid-template-columns: 1.2fr 1fr; gap: 20px !important; align-items: center; }
.credits { display: grid; gap: 8px; font-size: .9rem; }
.credits ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.credits h2 { font-size: 1.1rem; }
.ab-split > div { display: grid; gap: 10px; }
.ab-split.rev > div { order: 2; }
.ab-split .ld-art { aspect-ratio: 4 / 3; border-radius: 16px; box-shadow: none; }
.ab-crew { text-align: center; }
.ab-crew > p { text-align: right; }
/* هر نفر یک «صحنه» به اندازهٔ عکس (‎--p‎): عکس در یک طرف، فلش از لبهٔ عکس پیچ می‌خورد و به اسم می‌رسد.
   اندازه‌ها نسبت به ‎--p‎ حساب شده‌اند تا ابتدای فلش درست کنار لبهٔ پایینِ عکس بیفتد. */
.crew { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: flex-start; gap: 8px; margin-top: 18px; }
.member { --p: 130px; position: relative; width: calc(var(--p) * 1.75); height: calc(var(--p) * 1.56 + 88px); }
.member.lead { --p: 170px; }
.member .photo {
  position: absolute; top: 0; right: 0; margin: 0; width: var(--p); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 5px solid #fff;
  box-shadow: 0 0 0 3px var(--gold), 0 12px 26px rgba(20, 30, 80, .3); transform: rotate(-4deg); background: #eaf2ff;
}
.member .photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.member .photo.ph { display: grid; place-content: center; justify-items: center; gap: 4px; background: radial-gradient(circle at 35% 30%, #fff8e0, #ffd98a); }
.member .photo.ph::before { content: attr(data-ph); font-size: calc(var(--p) * .3); line-height: 1; }
.member .photo.ph::after { content: "عکس به‌زودی"; font-size: .8rem; font-weight: 600; color: #7a5200; }
.member .curl { position: absolute; top: calc(var(--p) * .87); right: calc(var(--p) * .77); width: calc(var(--p) * .6); height: calc(var(--p) * .72); color: #ff8a3d; overflow: visible; }
.member .tag { position: absolute; top: calc(var(--p) * 1.56); right: calc(var(--p) * 1.18); transform: translateX(50%) rotate(-3deg); display: grid; justify-items: center; line-height: 1.35; white-space: nowrap; }
.member.flip .photo { right: auto; left: 0; transform: rotate(4deg); }
.member.flip .curl { right: auto; left: calc(var(--p) * .77); transform: scaleX(-1); }
.member.flip .tag { right: auto; left: calc(var(--p) * 1.18); transform: translateX(-50%) rotate(3deg); }
.member .tag .hand { font-family: "Lalezar", "Vazirmatn", sans-serif; color: #ff7a3d; font-size: 1.1rem; }
.member .tag b, .member .tag a { font-family: "Lalezar", "Vazirmatn", sans-serif; font-weight: 400; font-size: 1.5rem; color: var(--brand-dark); text-decoration: none; }
.member .tag small { color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 760px) {
  .ab-split { grid-template-columns: 1fr; }
  .ab-split.rev > div { order: 0; }
  .ab-hero .ab-banner { aspect-ratio: 16 / 9; }
  .crew { flex-direction: column; align-items: center; gap: 4px; }
  .member { --p: 120px; }
  .member.lead { --p: 150px; }
}
