/* ═════ فونت وزیرمتن — خودمیزبان، پس آفلاین و داخل APK هم کار می‌کند ═════ */
@font-face {
  font-family:'Vazirmatn';
  src:local('Vazirmatn'), url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face {
  font-family:'Vazirmatn';
  src:local('Vazirmatn Bold'), url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight:700; font-style:normal; font-display:swap;
}

/* ═════ پالتِ «ترازوی داد» — مرمرِ روشن + لاجورد + برنج ═════
   هیچ بازی دیگری در کارگاه پس‌زمینه‌ی روشن ندارد؛ آزمونِ اسکرین‌شات (RULES §۲.۱) از همین‌جا رد می‌شود. */
:root{
  --marble:#ece3d2; --marble2:#dcd0b8; --marble3:#c9baa0;
  --ink:#2a2118; --ink2:#6b5c46;
  --lapis:#1e5b8a; --lapis-d:#123f61; --lapis-l:#3b83b8;
  --brass:#d8b551; --brass-d:#8f6f22; --gold:#e8b93b; --gold-d:#8a5f0e;
  --guilt:#a83a3a; --guilt-d:#7a2626;
  --free:#2f7f6a; --free-d:#1f5a4a;
}

/* ═════ آیکون رابط — اسپرایت فونت‌اوسام (کپیِ _kit/fa/icons.css · ALL-GAMES §۱۷.۸) ═════
   استفاده:  <svg class="ic"><use href="#i-gem"></use></svg>
   رنگ از currentColor می‌آید، پس با رنگِ متنِ دکمه هماهنگ می‌شود. */
.ic{ width:1em; height:1em; display:inline-block; vertical-align:-.125em;
     fill:currentColor; flex:0 0 auto; pointer-events:none; }
.ic.lg{ width:1.6em; height:1.6em; }
.ic.xl{ width:2.4em; height:2.4em; }
.ic.sm{ width:.85em; height:.85em; }
.ic.off{ opacity:.28; }

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; user-select:none; }
html,body{ width:100%; height:100%; overflow:hidden; background:var(--marble);
  font-family:'Vazirmatn','Segoe UI',Tahoma,sans-serif; color:var(--ink); }

.screen{ position:absolute; inset:0; display:none; flex-direction:column; }
.screen.active{ display:flex; }
.hidden{ display:none !important; }

/* ═════ دکمه‌ها ═════ */
.btn{ border:none; border-radius:14px; padding:12px 24px; margin:6px auto; font-size:18px; font-weight:bold;
  background:var(--lapis); color:#fff; cursor:pointer; box-shadow:0 4px 0 var(--lapis-d);
  display:block; font-family:inherit; }
.btn:active{ transform:translateY(3px); box-shadow:0 1px 0 var(--lapis-d); }
.btn.gold{ background:linear-gradient(var(--gold),#c98f1c); color:#3a2503; box-shadow:0 4px 0 var(--gold-d); }
.btn.big{ font-size:23px; padding:15px 40px; }
.btn.small{ font-size:14px; padding:9px 16px; }
.btn.tiny{ font-size:13px; padding:6px 13px; margin:0; }
/* §۵.۷: هر دکمه‌ی آیکونی — به‌ویژه راهِ برگشت — دستِ‌کم ۴۴×۴۴ لمس‌پذیر است */
.btn.icon{ width:44px; height:44px; min-width:44px; min-height:44px; padding:0; font-size:20px; margin:0;
  border-radius:12px; flex:none; display:inline-flex; align-items:center; justify-content:center; }
/* دکمه‌ی برگشتِ نوار بالا — دیدنی، همیشه اولین چیزِ نوار */
.back-btn{ background:rgba(255,255,255,.9); color:var(--lapis-d); box-shadow:0 3px 0 var(--marble3); }
.back-btn .ic{ width:22px; height:22px; }
/* در RTL آیکونِ برگشت باید به سمتِ راست اشاره کند و در LTR به چپ */
[dir="rtl"] .back-btn .ic{ transform:scaleX(-1); }
.btn.ghost{ background:rgba(30,91,138,.14); color:var(--lapis-d); box-shadow:0 4px 0 rgba(18,63,97,.25); }
.btn:disabled{ filter:grayscale(.55); opacity:.6; }
.btn.pulse{ animation:pulse 1.1s infinite; }
@keyframes pulse{ 0%,100%{ transform:scale(1) } 50%{ transform:scale(1.06) } }

.field{ width:100%; border:2px solid var(--marble3); border-radius:12px; padding:10px 12px;
  font-family:inherit; font-size:16px; background:#fffdf7; color:var(--ink); margin:6px 0; }
.field:focus{ outline:none; border-color:var(--lapis-l); }
.field.code{ font-size:11px; direction:ltr; text-align:left; word-break:break-all; }

/* ═════ اسپلش ═════ */
#scr-splash{ align-items:center; justify-content:center;
  background:radial-gradient(circle at 50% 38%, #f6efe0 0%, var(--marble) 45%, #cfd8dd 100%);
  transition:opacity .45s ease; }
#scr-splash.fade{ opacity:0; }
.splash-inner{ text-align:center; animation:splashIn .7s ease both; }
@keyframes splashIn{ from{ opacity:0; transform:scale(.9) translateY(14px) } to{ opacity:1; transform:none } }
.logo-svg{ width:150px; height:150px; filter:drop-shadow(0 8px 14px rgba(40,60,80,.32)); }
.lg-beam{ transform-origin:60px 33px; animation:beamSway 2.6s ease-in-out infinite; }
@keyframes beamSway{ 0%,100%{ transform:rotate(-7deg) } 50%{ transform:rotate(7deg) } }
.splash-title{ font-size:32px; margin-top:6px; color:var(--lapis-d); }
.splash-sub{ color:var(--ink2); font-size:16px; margin-top:2px; }
.splash-bar{ width:150px; height:5px; border-radius:3px; background:rgba(30,91,138,.18); margin:18px auto 8px; overflow:hidden; }
.splash-bar i{ display:block; height:100%; background:linear-gradient(90deg,var(--brass),var(--lapis));
  animation:bar 1.5s ease-in-out forwards; }
@keyframes bar{ from{ width:6% } to{ width:100% } }
.splash-by{ color:var(--ink2); font-size:12px; letter-spacing:1px; }

/* ═════ منو ═════ */
#scr-menu{ align-items:center; justify-content:center; }
.menu-bg{ position:absolute; inset:0; z-index:-1;
  background:linear-gradient(#dfe9ee 0%, var(--marble) 42%, #e5d8bd 78%, #d4bd85 100%); }
.menu-bg::after{ content:''; position:absolute; inset:0;
  background:radial-gradient(circle at 50% 22%, rgba(255,255,255,.75), transparent 58%); }
.menu-inner{ text-align:center; padding:18px; position:relative; width:100%; max-width:420px; }
.logo-dome{ font-size:66px; filter:drop-shadow(0 6px 10px rgba(40,60,80,.3)); }
h1{ font-size:30px; margin:4px 0 2px; color:var(--lapis-d); text-shadow:0 2px 0 rgba(255,255,255,.6); }
.menu-sub{ color:var(--ink2); margin-bottom:18px; font-size:16px; }
.menu-row{ display:flex; gap:8px; justify-content:center; }
.menu-row .btn{ margin:5px 0; flex:1; min-width:0; }
/* منوی کودک‌پسند: شروع روشن، کارت‌های تصویری، بدون ردیف عددهای اقتصادی. */
#scr-menu .menu-inner{max-width:390px;padding:16px 18px 76px}
#scr-menu .menu-sub{margin-bottom:12px;font-weight:700}
#scr-menu #btn-play{width:100%;min-height:58px;border-radius:20px;font-size:21px;box-shadow:0 6px 0 #9b741f,0 14px 30px rgba(80,58,10,.18)}
#scr-menu #btn-new{font-size:12px;opacity:.75;margin-bottom:6px}
#scr-menu .menu-row:not(:last-of-type){display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#scr-menu .menu-row:not(:last-of-type) .btn{min-height:64px;padding:8px 5px;border-radius:17px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:12px;background:rgba(255,255,255,.82)}
#scr-menu .menu-row:not(:last-of-type) .btn .ic{width:22px;height:22px;color:var(--lapis)}
#scr-menu .wallet,#scr-menu .lives-chip{display:none!important}
.offer-badge{ position:absolute; top:-6px; inset-inline-end:2px; font-size:28px;
  background:linear-gradient(var(--gold),#c98f1c); border:none; border-radius:50%; width:56px; height:56px;
  cursor:pointer; box-shadow:0 4px 12px rgba(0,0,0,.28); animation:pulse 1.1s infinite; }

.wallet{ display:flex; gap:10px; justify-content:center; margin-top:12px; font-size:16px; font-weight:bold; }
.wallet span{ background:rgba(255,255,255,.72); border:1px solid var(--marble3); border-radius:20px; padding:4px 13px; }
.lives-chip{ background:rgba(255,255,255,.72); border:1px solid var(--marble3); border-radius:20px;
  padding:4px 13px; font-size:15px; font-weight:bold; display:inline-block; margin-top:8px; }
.lives-chip small{ color:var(--lapis); font-size:11px; }

/* ═════ نوار بالا ═════ */
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:6px; flex-wrap:wrap;
  padding:calc(8px + env(safe-area-inset-top)) 10px 8px; z-index:5;
  background:linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.35)); }
.topbar .lives-chip, .topbar .wallet{ margin-top:0; }
.goal-chip{ background:var(--lapis); color:#fff; border-radius:20px; padding:6px 11px; font-size:13px;
  font-weight:bold; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* نوار جلسه باید در یک ردیف جا شود (۳۷۵px) — وگرنه ارتفاعِ صحنه را می‌خورد */
#scr-court .topbar{ flex-wrap:nowrap; gap:4px; padding-inline:6px; }
#scr-court .topbar .btn.icon{ width:44px; height:44px; font-size:17px; border-radius:11px; }
#scr-court .topbar .btn.icon .ic{ width:19px; height:19px; }
#ct-case{ flex:1 1 auto; min-width:0; font-size:12px; padding:6px 8px; }
#ct-turn{ flex:0 0 auto; font-size:11px; padding:6px 7px; }
/* شمارنده‌ی روی دکمه‌ی مشورت (HINTS §۶) */
#ct-hint{ position:relative; }
#ct-hint i{ position:absolute; top:-4px; inset-inline-end:-4px; font-style:normal; font-size:11px;
  background:var(--brass); color:#3a2503; border-radius:9px; padding:1px 5px; box-shadow:0 1px 3px rgba(0,0,0,.3); }
#ct-hint.empty i{ background:var(--guilt); color:#fff; }
#ct-hint.off{ opacity:.45; }

/* ═════ تمِ باب — چشم هم باید بفهمد فصل عوض شده (ALL-GAMES §۸.۹.ه) ═════
   هر باب سه چیز عوض می‌کند: پس‌زمینه، پالتِ لهجه‌ای (--acc)، و رنگِ برچسبِ باب روی نقشه.
   پالتِ پایه‌ی بازی (مرمر/لاجورد/برنج) ثابت می‌ماند — §۳.۴. رنگ‌ها با CHAPTERS در cases.js می‌خوانند. */
[data-ch]{ --acc:#c98f57; --acc-d:#8f5f2c; --acc-l:#e8c193;
  --sky1:#efe6d2; --sky2:#e0cba6; --wall1:#2e6a90; --wall2:#1d5378; --wall3:#17415e; }
[data-ch="0"]{ --acc:#c98f57; --acc-d:#8f5f2c; --acc-l:#e8c193;   /* بابِ کوچه‌بازار — خاکِ کاهگل */
  --sky1:#efe6d2; --sky2:#e0cba6; --wall1:#2e6a90; --wall2:#1d5378; --wall3:#17415e; }
[data-ch="1"]{ --acc:#3f9d97; --acc-d:#276b67; --acc-l:#7fcac5;   /* بابِ کاروان‌سرا — فیروزه و شن */
  --sky1:#e3eee9; --sky2:#cfd8b8; --wall1:#2b6f6a; --wall2:#1c5450; --wall3:#133e3b; }
[data-ch="2"]{ --acc:#a678d2; --acc-d:#6d4593; --acc-l:#cba7e8;   /* بابِ دارالحکومه — ارغوانِ درباری */
  --sky1:#eae4f2; --sky2:#cfc3dd; --wall1:#4a3f7a; --wall2:#332a5c; --wall3:#241c44; }

#scr-map[data-ch]{ background:linear-gradient(var(--sky1), var(--marble) 42%, var(--sky2)); }
#scr-care[data-ch]{ background:linear-gradient(var(--sky1), var(--marble) 55%, var(--sky2)); }
#scr-court[data-ch]{ background:linear-gradient(var(--sky1), var(--marble) 55%); }
#scr-court[data-ch] .ct-wall{ background:linear-gradient(var(--wall1) 0%, var(--wall2) 55%, var(--wall3) 100%); }
/* لهجه‌ی باب روی ریزه‌کاری‌ها — نه روی کلِ رابط */
[data-ch] .goal-chip{ background:var(--acc-d); }
[data-ch] .map-title{ color:var(--acc-d); }
[data-ch] .map-node.open{ box-shadow:0 6px 0 var(--acc-d), 0 8px 14px rgba(60,50,30,.2); }
.chapter-label[data-ch="0"]{ background:rgba(201,143,87,.16); border-color:#c98f57; color:#8f5f2c; }
.chapter-label[data-ch="1"]{ background:rgba(63,157,151,.16); border-color:#3f9d97; color:#276b67; }
.chapter-label[data-ch="2"]{ background:rgba(166,120,210,.16); border-color:#a678d2; color:#6d4593; }
.chapter-label small{ display:block; font-weight:normal; font-size:11px; opacity:.85; }

/* ═════ پلکانِ عدالت (نقشه) ═════ */
#scr-map{ background:linear-gradient(#e7eef1, var(--marble) 40%, #ddcfae); }
.map-hero{ display:flex; align-items:center; gap:10px; justify-content:center; padding:0 12px; }
.map-hero span{ width:44px; height:44px; display:block; }
.map-hero span svg{ width:100%; height:100%; }
.map-hero b{ color:var(--lapis-d); font-size:14px; }
.map-title{ text-align:center; font-size:19px; color:var(--lapis-d); margin:0 0 4px; }
.map-path{ flex:1; min-height:0; overflow-y:auto; padding:4px 0 12px; display:flex;
  flex-direction:column; align-items:center; gap:clamp(4px,1.2vh,12px); scrollbar-width:none; }
.map-path::-webkit-scrollbar{ display:none; }
.chapter-label{ background:rgba(30,91,138,.1); border:1px solid var(--lapis-l); color:var(--lapis-d);
  border-radius:20px; padding:4px 16px; font-size:13px; font-weight:bold; margin-top:2px; }
/* پله‌ها: هر گره یک پله‌ی سنگی که بالا می‌رود — امضای بصریِ این بازی */
.map-node{ width:110px; height:clamp(40px,6.2vh,56px); border-radius:10px 10px 6px 6px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; font-size:22px; cursor:pointer; position:relative;
  background:linear-gradient(#fdf8ec,#d8c9ab); box-shadow:0 6px 0 var(--marble3), 0 8px 14px rgba(60,50,30,.18);
  border:1px solid #c2b191; }
.map-node .lvl-num{ font-size:12px; font-weight:bold; color:var(--lapis-d); }
.map-node .stars{ font-size:10px; letter-spacing:-2px; }
.map-node.locked{ filter:grayscale(.75) brightness(.94); cursor:default; }
.map-node.done{ background:linear-gradient(#fff3cf,var(--brass)); box-shadow:0 6px 0 var(--brass-d), 0 8px 14px rgba(60,50,30,.22); }
.map-node.care{ background:linear-gradient(#fde8ee,#e6b9c6); box-shadow:0 6px 0 #b98a99, 0 8px 14px rgba(60,50,30,.18); }
.map-node:nth-of-type(odd){ transform:translateX(-42px); }
.map-node:nth-of-type(even){ transform:translateX(42px); }
.chapter-label{ transform:none; }   /* برچسبِ باب هرگز جابه‌جا نشود */

/* ═════ جلسه‌ی دادگاه ═════ */
.game-screen{ background:linear-gradient(#e9eff2, var(--marble) 55%); }

/* صحنه‌ی شبه‌سه‌بعدی: دیوارِ دور + کفِ پرسپکتیوی + دو پیکره روی کف */
#scr-court{ overflow:hidden; }
.ct-stage{ position:relative; flex:1 1 auto; min-height:0; overflow:hidden;
  perspective:700px; perspective-origin:50% 20%; }
.ct-wall{ position:absolute; inset:0 0 30% 0; overflow:hidden;
  background:linear-gradient(#2e6a90 0%, #1d5378 55%, #17415e 100%); }
.ct-wall::after{ content:''; position:absolute; inset:0;
  background:radial-gradient(ellipse at 50% 120%, rgba(255,240,200,.35), transparent 62%); }
.ct-wall i{ position:absolute; bottom:0; width:22%; height:78%; border-radius:50% 50% 0 0 / 62% 62% 0 0;
  background:linear-gradient(#12384f,#0d2b3d); box-shadow:inset 0 6px 14px rgba(0,0,0,.4); }
.ct-wall i:nth-child(1){ inset-inline-start:6%; }
.ct-wall i:nth-child(2){ inset-inline-start:39%; width:24%; height:88%; }
.ct-wall i:nth-child(3){ inset-inline-start:72%; }
.ct-floor{ position:absolute; inset-inline:-40%; bottom:0; height:56%;
  transform:rotateX(64deg); transform-origin:bottom center;
  background:
    repeating-conic-gradient(#f3ead8 0% 25%, #cdbb9c 0% 50%) 0 0 / 62px 62px;
  box-shadow:inset 0 24px 40px rgba(80,60,30,.28); }
.ct-floor::after{ content:''; position:absolute; inset:0;
  background:linear-gradient(transparent 30%, rgba(20,45,65,.34)); }

.ct-actors{ position:absolute; inset:0; }
.ct-actor{ position:absolute; bottom:4%; display:flex; flex-direction:column; align-items:center;
  transition:transform .3s ease, filter .3s ease; }
.ct-actor .fig-holder{ height:min(30vh, 210px); transform-style:preserve-3d; }
.ct-actor .fig-holder svg{ height:100%; width:auto; display:block;
  filter:drop-shadow(0 8px 10px rgba(20,40,60,.4)); }
/* متهم: جلوی کرسی، بزرگ، با چرخشِ ملایمِ سه‌بعدی */
.ct-actor.def{ inset-inline-end:6%; bottom:1%; animation:defIdle 6s ease-in-out infinite; }
@keyframes defIdle{
  0%,100%{ transform:perspective(700px) rotateY(-7deg) translateZ(0) }
  50%    { transform:perspective(700px) rotateY(7deg)  translateZ(14px) } }
/* شاکی: عقب‌تر، کوچک‌تر، کم‌رنگ‌تر — عمقِ صحنه از همین می‌آید */
.ct-actor.pl{ inset-inline-start:4%; bottom:20%; filter:saturate(.75) brightness(.9);
  animation:plIdle 7.5s ease-in-out infinite; }
.ct-actor.pl .fig-holder{ height:min(20vh, 140px); }
@keyframes plIdle{
  0%,100%{ transform:perspective(700px) rotateY(6deg) scale(.98) }
  50%    { transform:perspective(700px) rotateY(-6deg) scale(1) } }
/* شاهد (بابِ دوم به بعد): وسطِ عقبِ صحنه، کوچک‌ترین پیکره — عمقِ سه‌لایه */
.ct-actor.wt{ inset-inline-start:39%; bottom:26%; filter:saturate(.7) brightness(.88);
  animation:plIdle 8.5s ease-in-out infinite; }
.ct-actor.wt .fig-holder{ height:min(16vh, 112px); }
.ct-stage.talk-wt .ct-actor.wt{ filter:none; }
.ct-stage.talk-wt .ct-actor.wt .fig-head{ animation:nod .42s ease-in-out 2; }
.ct-name{ font-size:11px; font-weight:bold; background:rgba(255,255,255,.86); color:var(--ink);
  border-radius:10px; padding:2px 8px; margin-top:2px; white-space:nowrap; }
.ct-name.accused{ background:var(--guilt); color:#fff; }
.ct-name.witness{ background:var(--lapis); color:#fff; font-size:10px; }

/* نفس کشیدن — CSS خالص، پس در پنلِ مخفی هم زنده می‌ماند (GAME-DESIGN §۷.۶) */
.fig-body{ animation:breathe 3.6s ease-in-out infinite; transform-box:fill-box; }
@keyframes breathe{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-2.5px) } }
.fig-head{ transform-origin:100px 78px; animation:sway 5.2s ease-in-out infinite; }
@keyframes sway{ 0%,100%{ transform:rotate(-1.4deg) } 50%{ transform:rotate(1.4deg) } }
.fig-sweat{ animation:sweat 1.8s ease-in-out infinite; }
@keyframes sweat{ 0%,70%{ opacity:0; transform:translateY(0) } 80%{ opacity:.9 } 100%{ opacity:0; transform:translateY(10px) } }

/* کسی که حرف می‌زند جلو می‌آید و سر تکان می‌دهد */
.ct-stage.talk-def .ct-actor.def{ animation:defTalk .9s ease-out both; }
@keyframes defTalk{ 0%{ transform:perspective(700px) rotateY(0) scale(1) }
  30%{ transform:perspective(700px) rotateY(0) scale(1.08) translateY(-5px) }
  100%{ transform:perspective(700px) rotateY(0) scale(1.04) } }
.ct-stage.talk-def .ct-actor.def .fig-head{ animation:nod .42s ease-in-out 2; }
.ct-stage.talk-pl  .ct-actor.pl { animation:plTalk .9s ease-out both; filter:none; }
@keyframes plTalk{ 0%{ transform:perspective(700px) scale(1) }
  30%{ transform:perspective(700px) scale(1.12) translateY(-5px) }
  100%{ transform:perspective(700px) scale(1.06) } }
.ct-stage.talk-pl  .ct-actor.pl .fig-head{ animation:nod .42s ease-in-out 2; }
@keyframes nod{ 0%,100%{ transform:rotate(0) } 50%{ transform:rotate(5deg) translateY(2px) } }
.ct-stage.gavel{ animation:shake .12s 4; }
@keyframes shake{ 0%,100%{ transform:translateX(-2px) } 50%{ transform:translateX(2px) } }

.ct-bubble{ position:absolute; top:5%; inset-inline-start:50%; transform:translateX(-50%) scale(.9);
  width:min(84%,330px); background:#fffdf6; color:var(--ink); border-radius:14px; padding:9px 13px;
  font-size:14px; font-weight:bold; line-height:1.55; box-shadow:0 6px 16px rgba(20,40,60,.35);
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s; }
.ct-bubble.on{ opacity:1; transform:translateX(-50%) scale(1); }
.ct-bubble::after{ content:''; position:absolute; bottom:-9px; inset-inline-start:50%;
  border:9px solid transparent; border-top-color:#fffdf6; border-bottom:0; }
.ct-bubble.pl::after{ inset-inline-start:22%; }
.ct-bubble.wt::after{ inset-inline-start:48%; }
.ct-bubble.def::after{ inset-inline-start:74%; }
.ct-bubble.narr{ background:rgba(255,253,246,.94); font-weight:normal; font-size:13px; }
.ct-bubble.narr::after{ display:none; }

/* قرینه‌ای که به سمتِ کفه پرواز می‌کند */
.ct-fly{ position:fixed; z-index:60; font-size:30px; pointer-events:none;
  transition:transform .55s cubic-bezier(.4,.1,.5,1), opacity .55s; }

/* دفترِ بازجویی */
.ct-noteswrap{ padding:2px 12px 0; }
.ct-notes-head{ display:flex; align-items:center; gap:6px; max-width:360px; margin:0 auto;
  font-size:12px; font-weight:bold; color:var(--lapis-d); }
.ct-notes-head .ct-note{ font-weight:normal; color:var(--ink2); font-size:11px; margin-inline-start:auto; }
.ct-notes{ max-width:360px; margin:2px auto 0; min-height:52px; max-height:96px; overflow-y:auto;
  background:rgba(255,255,255,.62); border:1px solid var(--marble3); border-radius:10px; padding:3px 9px; }
.ct-notes .nrow{ font-size:11px; line-height:1.65; padding:2.5px 0;
  border-bottom:1px dashed var(--marble3); }
.ct-notes .nrow:last-child{ border-bottom:0; }
.ct-notes .nrow b{ color:var(--lapis-d); }
.ct-notes .nrow.new{ animation:noteIn .6s ease; }
@keyframes noteIn { from{ background:#f6e7bd; } to{ background:transparent; } }

/* شرطِ باخت باید **دیده** شود (§۸.۹.الف): مهلتِ رو به پایان قرمز می‌شود و نبض می‌زند */
.goal-chip.warn{ background:var(--guilt); animation:pulse 1.1s infinite; }
/* «دفتر گویاست» — نشانه‌ی صادقانه‌ی اینکه همین‌قدر پرسش برای حکمِ درست بس است */
.ct-note.sure{ color:var(--free-d); font-weight:bold; }

/* دکمه‌ی «حکم می‌دهم» — همیشه پیدا، ولی جای کمی می‌گیرد */
.btn.rulebtn{ margin:4px auto 0; padding:9px 22px; font-size:15px; min-height:44px;
  background:linear-gradient(var(--gold),#c98f1c); color:#3a2503; box-shadow:0 4px 0 var(--gold-d);
  display:inline-flex; align-items:center; gap:8px; }
.ct-charge{ text-align:center; font-size:12px; color:var(--ink2); padding:3px 14px 0; line-height:1.5;
  flex:0 0 auto; }
.ct-charge b{ color:var(--guilt-d); }
.ct-prompt{ text-align:center; font-size:14px; font-weight:bold; color:var(--lapis-d);
  padding:4px 12px 2px; flex:0 0 auto; }

/* ═════ دو گزینه، دو رنگ — همیشه دقیقاً دو کارت، هرگز اسکرول ═════ */
.ct-choice{ flex:0 0 auto; display:flex; flex-direction:column; gap:9px;
  padding:2px 12px calc(12px + env(safe-area-inset-bottom)); }
.ct-card{ display:flex; align-items:center; gap:10px; width:100%; text-align:start;
  border:none; border-radius:16px; padding:13px 14px; min-height:60px;
  font-family:inherit; font-size:15px; font-weight:bold; color:#fff; cursor:pointer;
  animation:cardIn .32s ease both; }
.ct-card .ic{ font-size:22px; flex:none; filter:drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.ct-card .tx{ flex:1; line-height:1.5; }
.ct-card:active{ transform:translateY(3px); }
.ct-card:disabled{ filter:grayscale(.35) brightness(.95); }
.ct-card.a{ background:linear-gradient(150deg,#3b83b8,var(--lapis)); box-shadow:0 5px 0 var(--lapis-d); }
.ct-card.b{ background:linear-gradient(150deg,#e0a94a,#b8801f);      box-shadow:0 5px 0 #7a5410; }
.ct-choice.verdict .ct-card.a{ background:linear-gradient(150deg,#c95a5a,var(--guilt)); box-shadow:0 5px 0 var(--guilt-d); }
.ct-choice.verdict .ct-card.b{ background:linear-gradient(150deg,#43a68d,var(--free));  box-shadow:0 5px 0 var(--free-d); }
.ct-choice.verdict .ct-card{ justify-content:center; text-align:center; font-size:17px; }
.ct-choice.verdict .ct-card .tx{ flex:0 1 auto; }
.ct-card:nth-child(2){ animation-delay:.07s; }
@keyframes cardIn{ from{ opacity:0; transform:translateY(14px) scale(.97) } to{ opacity:1; transform:none } }
/* مدرک (بابِ ۳): کارتِ پرسش از سند/شیء رنگِ خودش را دارد */
.ct-card.ev{ background:linear-gradient(150deg,#7d6bb0,#4e3f80); box-shadow:0 5px 0 #322754; }
/* دکمه‌ی چکش وقتی دفتر قطعی شده نبض می‌زند: «همین حالا حکم بده، ستاره‌ات کامل است» */
/* در نوارِ بالا فقط آیکونِ چکش جا می‌شود؛ برچسبِ متنیِ موتور اینجا پنهان می‌ماند */
.topbar #ct-gavel span{ display:none; }
#ct-gavel.ready{ background:linear-gradient(var(--gold),#c98f1c); color:#3a2503;
  box-shadow:0 4px 0 var(--gold-d); animation:pulse 1.1s infinite; }
.ct-card.hinted{ outline:3px solid var(--gold); outline-offset:2px; animation:hintGlow 1s infinite; }
@keyframes hintGlow{ 0%,100%{ filter:brightness(1) } 50%{ filter:brightness(1.22) drop-shadow(0 0 14px rgba(232,185,59,.95)) } }

/* ═════ دیوان‌خانه (صحنه‌ی کمک) ═════ */
#scr-care{ background:linear-gradient(#e6eef2, var(--marble) 55%, #e0cfa8); }
.care-stage{ flex:1; position:relative; display:flex; align-items:flex-end; justify-content:center; }
.care-house{ font-size:104px; line-height:1; filter:drop-shadow(0 8px 10px rgba(60,50,30,.3)); }
.care-char{ position:absolute; bottom:4px; inset-inline-start:14%; height:132px; transition:transform .3s; }
.care-char svg{ height:100%; width:auto; filter:drop-shadow(0 6px 8px rgba(20,40,60,.3)); }
.care-char.happy{ animation:hop .5s 3; }
@keyframes hop{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-22px) } }
.care-bubble{ position:absolute; top:8%; inset-inline-end:6%; background:#fffdf6; color:var(--ink);
  border-radius:16px; padding:10px 14px; font-size:15px; font-weight:bold; max-width:64%;
  box-shadow:0 4px 12px rgba(20,40,60,.28); }
.care-bubble:empty{ display:none; }
.care-question{ text-align:center; font-size:17px; font-weight:bold; color:var(--lapis-d); padding:8px 16px; }
.care-options{ display:flex; justify-content:center; gap:9px; padding:0 12px calc(20px + env(safe-area-inset-bottom)); }
.care-opt{ flex:1; max-width:126px; background:#fffdf6; color:var(--ink); border:1.5px solid var(--marble3);
  border-radius:16px; padding:11px 5px; font-size:13px; font-weight:bold; cursor:pointer;
  box-shadow:0 5px 0 rgba(150,130,95,.5); font-family:inherit; }
.care-opt .em{ font-size:32px; display:block; }
.care-opt .price{ display:block; color:var(--brass-d); margin-top:3px; }
.care-opt:active{ transform:translateY(3px); box-shadow:0 2px 0 rgba(150,130,95,.5); }
.care-opt.wrong{ animation:shake .12s 4; background:#f4c9c9; }

/* ═════ خزانه / کرسی / خلعت / دفتر ═════ */
.shop-items{ flex:1; overflow-y:auto; padding:8px 14px calc(28px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:10px; }
.shop-card{ background:#fffdf6; border:1px solid var(--marble3); border-radius:16px; padding:12px 14px;
  display:flex; align-items:center; gap:12px; box-shadow:0 3px 8px rgba(90,75,45,.12); }
.shop-card.col{ flex-direction:column; align-items:stretch; gap:6px; }
.shop-card .em{ font-size:32px; }
.shop-card .info{ flex:1; min-width:0; }
.shop-card .info b{ font-size:15px; display:block; }
.shop-card .info small{ display:block; color:var(--ink2); font-size:12px; line-height:1.5; }
.shop-card.starter{ border:2px solid var(--gold); background:#fff8e4; animation:glow 1.5s infinite; }
.shop-card.piggy{ border:1px solid #a86ec6; background:#f7effa; }
.shop-card.locked{ opacity:.6; }
.shop-card .timer{ color:var(--guilt); font-weight:bold; }
@keyframes glow{ 0%,100%{ box-shadow:0 0 4px rgba(232,185,59,.4) } 50%{ box-shadow:0 0 16px rgba(232,185,59,.85) } }
.pips{ display:block; color:var(--brass-d); letter-spacing:2px; font-size:13px; margin-top:2px; }

.hero-stage{ display:flex; flex-direction:column; align-items:center; gap:4px; padding:4px; }
.hero-avatar{ height:120px; }
.hero-avatar svg{ height:100%; width:auto; filter:drop-shadow(0 6px 10px rgba(20,40,60,.3)); }
.hero-avatar.flash{ animation:flash .7s; }
@keyframes flash{ 0%{ filter:brightness(2.4) drop-shadow(0 0 18px var(--gold)) } 100%{ filter:none } }
.hero-level{ font-size:14px; color:var(--lapis-d); }

/* ═════ طومارِ احکام ═════ */
.pass-progress{ text-align:center; font-size:16px; font-weight:bold; color:var(--lapis-d); margin:2px 0 4px; }
#pass-gold-btn{ margin:0 auto 6px; }
.pass-items{ flex:1; overflow-y:auto; padding:4px 12px calc(28px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:7px; }
.pass-row{ display:flex; gap:7px; align-items:stretch; }
.pass-row.locked{ opacity:.45; }
.pass-tier{ width:60px; background:rgba(30,91,138,.1); border-radius:12px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; font-size:14px; font-weight:bold; color:var(--lapis-d); }
.pass-tier small{ font-size:10px; color:var(--ink2); }
.pass-cell{ flex:1; border-radius:12px; padding:8px; text-align:center; font-size:14px; font-weight:bold;
  cursor:pointer; border:1px solid var(--marble3); background:#fffdf6; }
.pass-cell.gold{ background:#fff6df; border-color:var(--brass); }
.pass-cell.taken{ opacity:.5; }
.pass-cell small{ display:block; font-size:11px; color:var(--ink2); }

/* ═════ چرخِ داد ═════ */
.wheel-mark{ text-align:center; font-size:44px; filter:drop-shadow(0 4px 6px rgba(60,50,30,.3)); }
.wheel-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:10px 14px; }
.wheel-cell{ background:#fffdf6; border:1.5px solid var(--marble3); border-radius:14px; padding:10px 4px;
  text-align:center; font-size:12px; font-weight:bold; }
.wheel-cell .em{ font-size:26px; display:block; }
.wheel-cell.on{ background:linear-gradient(#fff3cf,var(--brass)); border-color:var(--brass-d);
  transform:scale(1.07); box-shadow:0 0 14px rgba(216,181,81,.8); }

/* ═════ اورلی‌ها ═════ */
.overlay{ position:fixed; inset:0; z-index:70; background:rgba(20,35,50,.62);
  display:flex; align-items:center; justify-content:center; padding:20px; }
.overlay-card,.story-card{ background:var(--marble); border:2px solid var(--brass); border-radius:22px;
  padding:26px 18px 20px; text-align:center; width:100%; max-width:360px; max-height:88vh; overflow-y:auto;
  box-shadow:0 14px 40px rgba(0,0,0,.4); animation:pop .28s ease both; position:relative; }
/* §۵.۷ راه ۱ — ضربدرِ گوشه‌ی هر اورلی، لمس‌پذیر ۴۴px */
.ov-x{ position:absolute; top:6px; inset-inline-end:6px; width:44px; height:44px; border:none; padding:0;
  background:rgba(30,91,138,.12); color:var(--lapis-d); border-radius:12px; cursor:pointer; z-index:2;
  display:flex; align-items:center; justify-content:center; font-family:inherit; }
.ov-x .ic{ width:18px; height:18px; }
.ov-x:active{ transform:scale(.92); }
@keyframes pop{ from{ transform:scale(.86); opacity:0 } to{ transform:none; opacity:1 } }
.ov-emoji{ font-size:52px; line-height:1; }
.overlay-card h2,.story-card h2{ font-size:21px; margin:6px 0; color:var(--lapis-d); }
.overlay-card p,.story-card p{ font-size:15px; color:var(--ink); line-height:1.85; white-space:pre-line; margin:6px 0; }
.ov-stars{ margin:6px 0; }
.big-stars{ font-size:30px; letter-spacing:2px; display:block; }
.ov-stars small{ color:var(--ink2); font-size:12px; }
.ov-reward{ font-size:17px; font-weight:bold; color:var(--brass-d); margin:6px 0; }
.cont-card{ border-color:var(--guilt); }
.ad-card{ max-width:280px; }

.prep-list{ display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.prep-row{ display:flex; align-items:center; gap:10px; background:#fffdf6; border:1px solid var(--marble3);
  border-radius:14px; padding:9px 11px; text-align:start; }
.prep-row.bought{ border-color:var(--free); background:#eaf6f1; }
.prep-row .em{ font-size:26px; }
.prep-row .info{ flex:1; min-width:0; }
.prep-row .info b{ font-size:14px; display:block; }
.prep-row .info small{ font-size:11px; color:var(--ink2); }

.login-days{ display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin:10px 0; }
.login-day{ background:#fffdf6; border:1px solid var(--marble3); border-radius:12px; padding:8px 3px;
  font-size:12px; font-weight:bold; }
.login-day small{ display:block; color:var(--ink2); font-size:10px; }
.login-day.on{ background:linear-gradient(#fff3cf,var(--brass)); border-color:var(--brass-d);
  box-shadow:0 0 12px rgba(216,181,81,.7); }
.login-day.past{ opacity:.45; }
.login-days{grid-template-columns:repeat(7,1fr);gap:5px}
.login-day{min-height:62px;display:grid;place-items:center;padding:6px 2px}
.login-day .login-gift{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#eef7fb;color:var(--lapis)}
.login-day .login-gift .ic{width:18px;height:18px}.login-day.on{transform:scale(1.06)}
.login-day.on small{font-size:8px;color:var(--ink);line-height:1.2}.login-day.past .login-gift{background:#e4f2e8;color:#348451}

.toast{ position:fixed; z-index:90; bottom:calc(22px + env(safe-area-inset-bottom)); inset-inline:0;
  margin:0 auto; width:fit-content; max-width:86%; background:rgba(20,35,50,.92); color:#fff;
  border-radius:14px; padding:10px 18px; font-size:14px; font-weight:bold; text-align:center;
  animation:pop .2s ease both; }

#ad-banner{ height:50px; }

/* ═════ چهره‌ی شخصیت (img/chars/<id>.png → SVG/ایموجی) — ASSETS §۲.۲ ═════ */
.cface{ position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:1.35em; height:1.35em; }
.cface img{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:none; }
.cface.has-img img{ display:block; }
.cface.has-img .cf-em{ visibility:hidden; }

/* ═════ راهنمای گام‌به‌گام (کپیِ _kit/tutor.css — RULES §۱: کپی، نه لینک) ═════ */
.tut{ position:fixed; inset:0; z-index:80; display:none; pointer-events:none; }
.tut.on{ display:block; }
.tut-mask{ position:fixed; background:rgba(0,0,0,.66); pointer-events:auto; }
.tut-ring{ position:fixed; border:3px solid var(--gold); border-radius:16px; pointer-events:none;
  box-shadow:0 0 18px rgba(255,217,122,.9); animation:tutPulse 1.1s infinite; }
.tut-ring.dim{ border-color:rgba(255,217,122,.55); box-shadow:none; animation:none; }
@keyframes tutPulse{ 0%,100%{ transform:scale(1); opacity:1 } 50%{ transform:scale(1.06); opacity:.75 } }
.tut-arrow{ position:fixed; width:28px; height:28px; pointer-events:none; color:var(--gold);
  font-size:28px; line-height:28px; text-align:center; animation:tutBob .9s infinite; }
.tut-arrow::before{ content:'▼'; }
@keyframes tutBob{ 0%,100%{ margin-top:0 } 50%{ margin-top:8px } }
/* نشانه‌ی لمس: دو حلقه‌ی CSS — بدون ایموجی و بدون آیکون در اسپرایت (§۱۷.۱ · §۱۷.۸) */
.tut-hand{ position:fixed; width:34px; height:34px; margin:-17px 0 0 -17px; pointer-events:none;
  border-radius:50%; background:radial-gradient(circle at 50% 42%, rgba(255,255,255,.95), rgba(255,217,122,.85) 58%, rgba(232,185,59,.25) 100%);
  box-shadow:0 0 0 3px rgba(255,217,122,.75), 0 3px 8px rgba(0,0,0,.45); }
.tut-hand.tap{ animation:tutTap 1.2s infinite; }
.tut-hand.drag{ animation:tutDrag 1.8s infinite; }
@keyframes tutTap{ 0%,100%{ transform:scale(1) } 45%{ transform:scale(.78) } }
@keyframes tutDrag{ 0%{ transform:translate(0,0) scale(1) } 15%{ transform:translate(0,0) scale(.8) }
  70%{ transform:translate(var(--dx),var(--dy)) scale(.8) }
  85%,100%{ transform:translate(var(--dx),var(--dy)) scale(1); opacity:0 } }
.tut-bubble{ position:fixed; width:240px; background:#fff; color:#222; border-radius:14px;
  padding:10px 14px; font-size:16px; font-weight:bold; text-align:center;
  pointer-events:none; box-shadow:0 6px 18px rgba(0,0,0,.5); }
.tut-skip{ position:fixed; bottom:14px; inset-inline-end:14px; background:rgba(255,255,255,.9);
  color:var(--ink); border:none; border-radius:12px; padding:7px 14px; font-size:13px;
  font-family:inherit; cursor:pointer; pointer-events:auto; }

/* ═════ رنگِ آیکون‌ها در جای‌های مختلف (§۱۷.۸: آیکون رنگ را از currentColor می‌گیرد) ═════ */
.logo-dome{ color:var(--brass-d); line-height:1; }
.ov-emoji{ color:var(--lapis-d); }
.offer-badge{ color:#5a3c05; display:none; align-items:center; justify-content:center; }
.wheel-mark{ color:var(--brass-d); }
.care-house{ color:#b08a4e; }
.care-opt .em{ color:var(--lapis); }
.shop-card .em, .prep-row .em{ color:var(--lapis); }
.wheel-cell .em{ color:var(--brass-d); }
.map-node .ic{ color:var(--lapis-d); }
.map-node.done .ic{ color:var(--brass-d); }
.stage-new-badge{position:absolute;inset-inline-start:calc(100% + 8px);top:50%;transform:translateY(-50%);width:118px;padding:5px 7px;border-radius:10px;background:rgba(255,255,255,.92);border:1px solid var(--brass);box-shadow:0 5px 14px rgba(40,60,80,.12);font-size:9px;line-height:1.35;color:var(--ink2);text-align:start}
.stage-new-badge b{display:block;color:var(--lapis);font-size:9px}
[dir="ltr"] .stage-new-badge{inset-inline-start:auto;inset-inline-end:calc(100% + 8px)}
@media(max-width:360px){.stage-new-badge{width:96px;font-size:8px}}
.map-node.care .ic{ color:#b0566d; }
.map-node .stars .ic{ color:var(--gold); width:11px; height:11px; }
.big-stars .ic{ color:var(--gold); width:30px; height:30px; margin:0 2px; }
.wallet .i-coin{ color:var(--brass-d); }
.wallet .i-gem{ color:var(--lapis); }
.lives-chip .ic{ color:var(--guilt); }
.ct-fly{ color:var(--lapis-d); }
.pass-tier .ic{ color:var(--gold); }
.ct-notes-head .ic{ color:var(--lapis-d); }

/* ═════ صفحه‌های کوتاه ═════ */
@media (max-height:640px){
  .ct-actor .fig-holder{ height:min(26vh,150px); }
  .ct-card{ min-height:52px; padding:10px 12px; font-size:14px; }
  .ct-notes{ max-height:74px; }
  .logo-dome{ font-size:52px; }
  h1{ font-size:25px; }
  .btn.big{ font-size:20px; padding:12px 30px; }
}

/* ═════ هنرِ کارفرما — پس‌زمینه‌ی صحنه‌ها (ALL-GAMES §۱۷.۲) — ساختِ _kit/art-all.py ═════
   متغیرِ --art-bg را js/art.js فقط وقتی ست می‌کند که فایل واقعاً لود شده باشد.
   نبودِ فایل ⇒ متغیر خالی ⇒ همان پس‌زمینه‌ی قبلی (بازی نمی‌شکند). */
.screen::before, [id^="scr-"]::before {
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:var(--art-bg, none); background-size:cover; background-position:center;
  opacity:.38;
}
.screen > *, [id^="scr-"] > * { position:relative; z-index:1; }
