/* ==========================================================================
   سیستم طراحی: کاغذ و مدادرنگی
   ========================================================================== */
:root {
  --paper: #fffdf8;
  --paper-edge: #f4efe2;
  --card: #ffffff;
  --ink: #23283a;
  --ink-soft: #5a6076;
  --rule: #e3e9f5;

  --pencil-blue: #2d6bcb;
  --pencil-green: #22a06b;
  --pencil-yellow: #f5c542;
  --pencil-orange: #ff7a29;
  --pencil-pink: #ef5da8;
  --pencil-purple: #7b61ff;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --header-h: 62px;

  /* ------------------------------------------------------------------------
     پشته‌های فونت یک‌جا. نکته مهم: در هر پشته «Vazirmatn» بعد از فونت
     نمایشی می‌آید. قبلا `"Lalezar", sans-serif` بود و هر گلیفی که لاله‌زار
     نداشت به فونت پیش‌فرض گوشی می‌افتاد، نه به فونت خودمان.
     ------------------------------------------------------------------------ */
  --font-body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  /* فقط اسم سایت؛ جای دیگری استفاده نمی‌شود */
  --font-brand: "Koodak", "Lalezar", "Vazirmatn", system-ui, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.9;
  /* در حالت standalone آیفون، کشیده‌شدن صفحه پس‌زمینه سفید نشان ندهد */
  overscroll-behavior-y: none;

  /* --------------------------------------------------------------------
     فوتر چسبیده به پایین پنجره، نه به انتهای محتوا.

     باگی که این درست می‌کند: صفحه‌های کوتاه (تایید کد پیامکی، ورود،
     پیام موفقیت) به اندازه ارتفاع پنجره محتوا ندارند، پس فوتر می‌آمد
     زیر فرم می‌چسبید و وسط صفحه معلق می‌ماند. با این چیدمان، `main`
     فضای خالی را پر می‌کند و فوتر همیشه پایین است.
     -------------------------------------------------------------------- */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* واحد داینامیک برای مرورگر موبایل که نوار آدرسش جمع می‌شود */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}
/* هرچه بین هدر و فوتر است فضای اضافه را می‌گیرد */
body > main { flex: 1 0 auto; }
body > .app-footer { flex: 0 0 auto; margin-top: auto; }

h1, h2, h3, .display-font {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--pencil-blue); }

:focus-visible {
  outline: 3px solid var(--pencil-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- هدر ----- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  /* ناچ آیفون: ارتفاع نوار وضعیت به بالای هدر اضافه می‌شود */
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-left: var(--safe-left);
}

.app-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ریل رنگی مدادها؛ امضای بصری سایت */
.pencil-rail {
  height: 5px;
  display: flex;
}
.pencil-rail span { flex: 1; }
.pencil-rail span:nth-child(1) { background: var(--pencil-blue); }
.pencil-rail span:nth-child(2) { background: var(--pencil-green); }
.pencil-rail span:nth-child(3) { background: var(--pencil-yellow); }
.pencil-rail span:nth-child(4) { background: var(--pencil-orange); }
.pencil-rail span:nth-child(5) { background: var(--pencil-pink); }
.pencil-rail span:nth-child(6) { background: var(--pencil-purple); }

/* --------------------------------------------------------------- اسم سایت --
   قاعده: اسم سایت **هرجا** با کودک و ضخیم نوشته می‌شود و هیچ چیز دیگری با
   این فونت نوشته نمی‌شود. برای همین یک کلاس مشترک دارد تا هدر و فوتر و
   کاربرگ چاپی از هم جدا نیفتند.
   -------------------------------------------------------------------------- */
.site-name,
.brand {
  font-family: var(--font-brand);
  /* کودک وزن ضخیم ندارد؛ مرورگر خودش ضخیمش می‌کند */
  font-weight: 700;
}

.brand {
  font-size: 25px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand:hover { color: var(--ink); }
.brand img { height: 34px; width: auto; }

.nav-link-top {
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.nav-link-top:hover { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--rule); }

/* ---------------------------------------------------------------- چیدمان -- */
.layout {
  display: grid;
  gap: 22px;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 16px calc(28px + var(--safe-bottom));
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .promo-col { display: none; }
  /* ستونی که جدول رکورد دارد پنهان نمی‌شود، فقط بنرهایش؛ وگرنه روی گوشی
     جدول کامل ناپدید می‌شد. زیر محتوا می‌نشیند چون grid ردیفی می‌شود. */
  .promo-col--board { display: block; position: static; }
  .promo-col--board .promo-slot { display: none; }
}

.promo-col { position: sticky; top: calc(var(--header-h) + var(--safe-top) + 18px); align-self: start; }
.promo-slot {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.promo-slot img { width: 100%; border-radius: var(--radius-sm); display: block; }
.promo-slot--empty {
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
  padding: 26px 10px;
}

/* ---------------------------------------------------------------- هیرو ---- */
.hero {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 30px 44px 30px 26px;
  /* خط حاشیه دفتر مشق، سمت راست */
  background-image: linear-gradient(to left, var(--pencil-pink) 0 2px, transparent 2px);
  background-repeat: no-repeat;
  background-position: right 26px top;
  background-size: 2px 100%;
}
.hero h1 { font-size: clamp(27px, 5vw, 40px); margin: 0 0 10px; }
.hero p { color: var(--ink-soft); max-width: 62ch; margin: 0; }

/* ---------------------------------------------------------------- دسته‌ها -- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}
.cat-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-bottom: 5px solid var(--tile-color, var(--pencil-blue));
  border-radius: var(--radius);
  padding: 18px 14px 15px;
  text-align: center;
  transition: transform 0.14s ease;
}
.cat-tile:hover, .cat-tile:focus-visible { transform: translateY(-3px); color: var(--ink); }
.cat-tile__mark {
  width: 46px; height: 46px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tile-color) 15%, #fff);
  color: var(--tile-color);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px;
}
.cat-tile__mark img { width: 30px; height: 30px; object-fit: contain; }
.cat-tile__title { display: block; font-family: var(--font-display); font-size: 17px; }
.cat-tile__count { display: block; font-size: 12px; color: var(--ink-soft); }

.tile-blue { --tile-color: var(--pencil-blue); }
.tile-green { --tile-color: var(--pencil-green); }
.tile-yellow { --tile-color: var(--pencil-yellow); }
.tile-orange { --tile-color: var(--pencil-orange); }
.tile-pink { --tile-color: var(--pencil-pink); }
.tile-purple { --tile-color: var(--pencil-purple); }

/* ---------------------------------------------------------------- کاربرگ -- */
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 34px 0 14px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.sheet-card { display: block; }
.sheet-card__paper {
  position: relative;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--rule);
}
.sheet-card__paper img { width: 100%; height: 100%; object-fit: cover; }
.sheet-card:hover .sheet-card__paper { border-color: var(--pencil-blue); }
.sheet-card__title { font-weight: 500; font-size: 14px; margin-top: 8px; display: block; }
.sheet-card__meta { font-size: 12px; color: var(--ink-soft); }

.badge-free, .badge-price {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.badge-free { background: var(--pencil-green); color: #fff; }
.badge-price { background: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- دکمه‌ها -- */
.btn-pencil {
  background: var(--pencil-blue);
  color: #fff;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 0 3px 0 #1f4f99;
}
.btn-pencil:hover { color: #fff; filter: brightness(1.05); }
.btn-pencil:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f4f99; }

.btn-ghost {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 500;
}

/* ---------------------------------------------------------------- فوتر ---- */
.app-footer {
  background: #fff;
  border-top: 1px solid var(--rule);
  padding: 26px 16px calc(26px + var(--safe-bottom));
  color: var(--ink-soft);
  font-size: 13px;
}

/* ------------------------------------------------- نوار پایین موبایل (PWA) - */
/* --------------------------------------------------------------------------
   نوار پایین موبایل: قرص شیشه‌ای شناور، مثل نوار تلگرام.

   از لبه صفحه جدا است (نه چسبیده به پایین) و پشتش تار می‌شود، پس محتوای
   صفحه از زیرش دیده می‌شود و نوار سبک به نظر می‌رسد.

   دو نکته که راحت می‌شکنند:

   ۱. `backdrop-filter` روی سافاری قدیمی نیست. برای همین پس‌زمینه‌اش یک
      رنگ نیمه‌شفاف **است** نه شفاف کامل؛ بدون تاری هم نوار خوانا می‌ماند.
      با `@supports` وقتی تاری هست، شفافیت بیشتر می‌شود.
   ۲. فاصله پایین از `--safe-bottom` می‌آید، وگرنه روی آیفون روی نوار
      خانه (home indicator) می‌نشست.
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  /* شناور: از هر سه طرف فاصله دارد */
  inset-inline: 12px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 1040;
  display: none;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 253, 248, 0.88);
  box-shadow:
    0 10px 30px rgba(35, 40, 58, 0.16),
    0 2px 8px rgba(35, 40, 58, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar {
    background: rgba(255, 253, 248, 0.6);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
  }
}

.tabbar__inner { display: flex; }
.tabbar a {
  flex: 1;
  text-align: center;
  padding: 9px 0 8px;
  font-size: 10.5px;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.18s ease;
}
.tabbar a i {
  display: block;
  font-size: 19px;
  line-height: 1.25;
  margin-bottom: 1px;
}
.tabbar svg { display: block; margin: 0 auto 2px; }

/* آیتم فعال: قرص رنگی پشتش، مثل نوار تلگرام.

   z-index منفی اینجا کار نمی‌کند: `.tabbar` با position:fixed و z-index خودش
   یک stacking context می‌سازد، پس فرزند با z-index منفی پشت **پس‌زمینه خود
   نوار** می‌رفت و دیده نمی‌شد. به‌جایش قرص روی صفر می‌نشیند و محتوای لینک
   یک لایه بالاتر. */
.tabbar a.is-active { color: var(--pencil-blue); font-weight: 700; }
.tabbar a.is-active::before {
  content: "";
  position: absolute;
  inset: 3px 6px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--pencil-blue) 13%, transparent);
  z-index: 0;
}
.tabbar a > * { position: relative; z-index: 1; }
.tabbar a:active { transform: scale(0.94); }

@media (max-width: 767px) {
  .tabbar { display: block; }
  /* جای نوار شناور + فاصله‌اش از لبه */
  body { padding-bottom: calc(78px + var(--safe-bottom)); }
}

/* ---------------------------------------------------- راهنمای نصب آیفون --- */
.install-sheet {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 1050;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(35, 40, 58, 0.16);
  padding: 16px 18px;
  display: none;
}
.install-sheet.is-open { display: block; }
.install-sheet__close {
  background: none; border: 0; color: var(--ink-soft); font-size: 20px; line-height: 1;
}

/* ==========================================================================
   فیلم و انیمیشن
   ========================================================================== */
.hero--video {
  background-image: linear-gradient(to left, var(--pencil-purple) 0 2px, transparent 2px);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 15px;
  font-weight: 500;
  font-size: 14px;
}
.chip span { color: var(--ink-soft); font-size: 12px; }
.chip:hover { border-color: var(--chip-color, var(--pencil-purple)); color: var(--ink); }
.chip--blue { --chip-color: var(--pencil-blue); }
.chip--green { --chip-color: var(--pencil-green); }
.chip--yellow { --chip-color: var(--pencil-yellow); }
.chip--orange { --chip-color: var(--pencil-orange); }
.chip--pink { --chip-color: var(--pencil-pink); }
.chip--purple { --chip-color: var(--pencil-purple); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.video-card__poster {
  position: relative;
  background: #eef1f8;
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #b9c2d6;
}
.video-card__poster img { width: 100%; height: 100%; object-fit: cover; }
.video-card__play {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--pencil-purple);
  display: grid; place-items: center;
}
.video-card:hover .video-card__play { background: var(--pencil-purple); color: #fff; }
.video-card__time {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-start: 10px;
  background: rgba(35, 40, 58, 0.78);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-lock {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  background: var(--pencil-purple); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}

/* ---------------------------------------------------------------- پخش‌کننده */
.player-wrap { max-width: 900px; margin-inline: auto; }
.player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #10131c;
  border-radius: var(--radius);
  display: block;
}
.player--locked { position: relative; overflow: hidden; display: grid; place-items: center; }
.player--locked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(0.5); }
.player__gate { position: relative; text-align: center; color: #fff; padding: 22px; }
.player__gate .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

.quality-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.quality-btn {
  background: #fff; border: 1px solid var(--rule); border-radius: 999px;
  padding: 4px 13px; font-size: 13px;
}
.quality-btn.is-active { background: var(--pencil-purple); color: #fff; border-color: var(--pencil-purple); }

/* ==========================================================================
   اشتراک‌ها
   ========================================================================== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}
.plan-card--featured { border-color: var(--pencil-blue); box-shadow: 0 0 0 3px rgba(45, 107, 203, 0.1); }
.plan-card__badge {
  position: absolute; inset-block-start: -11px; inset-inline-start: 20px;
  background: var(--pencil-blue); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px;
}
.plan-card__title { font-size: 21px; margin: 0 0 4px; }
.plan-card__desc { color: var(--ink-soft); font-size: 13px; margin: 0 0 12px; }
.plan-card__price { font-size: 15px; white-space: nowrap; }
.plan-card__was-row { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.plan-card__price strong { font-family: var(--font-display); font-size: 28px; }
.plan-card__was { text-decoration: line-through; color: var(--ink-soft); font-size: 13px; margin-inline-end: 6px; }
.plan-card__off { background: #ffe9e0; color: var(--pencil-orange); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.plan-card__unit { color: var(--ink-soft); font-size: 12px; margin-bottom: 14px; }

.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.plan-features li { display: flex; align-items: center; gap: 8px; }
.plan-features .is-on { color: var(--ink); }
.plan-features .is-off { color: #a4abbd; text-decoration: line-through; }
.plan-features .is-on svg { color: var(--pencil-green); }
.plan-features .is-off svg { color: #cdd3e0; }
.plan-features--inline { grid-auto-flow: column; grid-template-columns: none; gap: 14px; font-size: 13px; flex-wrap: wrap; }
.plan-features--inline li::before { content: "•"; color: currentColor; }

.org-box {
  background: #fff;
  border: 1px solid var(--rule);
  border-inline-start: 5px solid var(--pencil-green);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.org-box__cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.phone-link {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--pencil-green);
  direction: ltr;
  unicode-bidi: embed;
}
.info-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; height: 100%; }
.info-card h3 { font-size: 18px; margin: 0 0 6px; }
.info-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.checkout-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.checkout-row--total { border-bottom: 0; font-size: 18px; }

.note-box { background: #fff8e6; border: 1px solid #f4e0a8; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; }
.note-box--error { background: #ffeceb; border-color: #f6c3bf; }
.note-inline { color: var(--ink-soft); font-size: 13px; }

.auth-card { max-width: 420px; margin-inline: auto; }
.otp-input { letter-spacing: 10px; font-family: var(--font-display); }

.sub-status { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-top: 14px; }
.list-plain { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.list-plain__row { display: flex; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.list-plain__row:last-child { border-bottom: 0; }
.list-plain__row:hover { background: #fafbfe; color: var(--ink); }

.form-control { border-radius: var(--radius-sm); border-color: var(--rule); padding: 10px 14px; }
.form-control:focus { border-color: var(--pencil-blue); box-shadow: 0 0 0 3px rgba(45, 107, 203, 0.12); }

.footer-phone { color: var(--pencil-green); font-weight: 700; }

/* ================================================================ فرم‌ها == */
.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
}
.panel + .panel { margin-top: 16px; }
.panel h2, .panel h3 { margin-top: 0; }

.form-field { margin-bottom: 14px; }
.form-field label { font-weight: 500; display: block; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  background: #fff;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--pencil-blue); outline: none; }
.form-field input[type="number"] { max-width: 190px; }
.form-field select { max-width: 260px; }
.form-field--check label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
}
.form-field--check input { width: auto; accent-color: var(--pencil-blue); }
.form-error { color: #d13b3b; font-size: 13px; }
.otp-input { letter-spacing: 10px; text-align: center; font-size: 22px; font-weight: 700; }

.flash {
  border-radius: 14px;
  padding: 11px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--rule);
  background: #fff;
}
.flash-success { border-color: var(--pencil-green); }
.flash-error { border-color: #e2725b; }

/* ================================================================ پلن‌ها == */
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plan-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex; flex-direction: column;
}
.plan-card--highlight { border: 2px solid var(--pencil-blue); box-shadow: 0 10px 30px rgba(45,107,203,.12); }
.plan-card__badge {
  align-self: flex-start; background: var(--pencil-yellow); color: #4a3a00;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 12px; margin-bottom: 10px;
}
.plan-card__name { font-family: var(--font-display); font-size: 21px; }
.plan-card__price { font-family: var(--font-display); font-size: 30px; line-height: 1.3; }
.plan-card__old { text-decoration: line-through; color: var(--ink-soft); font-size: 14px; }
.plan-features { list-style: none; padding: 0; margin: 14px 0 20px; font-size: 14px; }
.plan-features li { padding-right: 24px; position: relative; margin-bottom: 6px; }
.plan-features li::before {
  content: "✓"; position: absolute; right: 0; color: var(--pencil-green); font-weight: 700;
}
.plan-features li.off { color: #a9aebd; }
.plan-features li.off::before { content: "×"; color: #c9ced9; }
.plan-card .btn-pencil { margin-top: auto; text-align: center; }

/* ============================================================== انیمیشن == */
.poster-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.poster-card__img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #e9edf7, #f7f4ec);
  display: grid; place-items: center; color: #b9c0d2;
}
.poster-card__img img { width: 100%; height: 100%; object-fit: cover; }
.poster-card__title { display: block; font-weight: 500; margin-top: 8px; font-size: 14px; }
.poster-card__meta { display: block; font-size: 12px; color: var(--ink-soft); }
.poster-card:hover .poster-card__img { outline: 3px solid var(--pencil-purple); outline-offset: 2px; }

.pill {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.pill-free { background: var(--pencil-green); color: #fff; }
.pill-lock { background: rgba(35,40,58,.82); color: #fff; }

.progress-strip { height: 4px; background: var(--rule); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-strip span { display: block; height: 100%; background: var(--pencil-orange); }

.featured-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(120deg, #2d6bcb, #7b61ff);
  color: #fff;
  padding: 34px 28px;
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.featured-banner img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45;
}
.featured-banner > * { position: relative; }
.featured-banner h2 { font-size: 30px; margin: 0 0 6px; }

/* پخش‌کننده */
.player-shell {
  background: #10131c;
  border-radius: var(--radius);
  overflow: hidden;
}
.player-shell video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }
.player-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; color: #e8ebf3; font-size: 13px;
}
.quality-btn {
  background: rgba(255,255,255,.1); color: #e8ebf3; border: 0;
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-family: inherit;
}
.quality-btn.is-active { background: var(--pencil-blue); color: #fff; font-weight: 700; }

.episode-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: #fff; margin-bottom: 8px;
}
.episode-row.is-current { border-color: var(--pencil-blue); background: #f5f8ff; }
.episode-row__thumb {
  width: 92px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover;
  background: #eef1f8; flex: none;
}
.episode-row__num {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: #f0f3fa; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* جدول ساده */
.simple-table { width: 100%; font-size: 14px; }
.simple-table th, .simple-table td { padding: 9px 6px; border-bottom: 1px solid var(--rule); text-align: right; }

/* ================================================================ بلاگ ==== */
.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--pencil-blue); }

.post-card {
  display: block; background: #fff; border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden;
}
.post-card__cover { aspect-ratio: 16/9; background: #eef1f8; object-fit: cover; width: 100%; display: block; }
.post-card__body { padding: 14px 16px 16px; }
.post-card__title { font-family: var(--font-display); font-size: 18px; display: block; margin-bottom: 5px; }
.post-card__meta { font-size: 12px; color: var(--ink-soft); }
.post-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tag-chip {
  background: #fff; border: 1px solid var(--rule); border-radius: 999px;
  padding: 4px 14px; font-size: 13px;
}
.tag-chip.is-active { background: var(--pencil-blue); color: #fff; border-color: var(--pencil-blue); }

.prose { max-width: 68ch; }
.prose h2 { font-size: 24px; margin: 30px 0 10px; }
.prose h3 { font-size: 20px; margin: 24px 0 8px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin-bottom: 14px; padding-right: 22px; }
.prose ol { list-style-type: persian; }
.prose li { margin-bottom: 5px; }
.prose img { max-width: 100%; border-radius: var(--radius-sm); margin: 10px 0; }
.prose blockquote {
  border-right: 4px solid var(--pencil-yellow);
  background: #fffdf3; margin: 16px 0; padding: 12px 16px; border-radius: 0 12px 12px 0;
}
.prose code { background: #f2f4fa; border-radius: 6px; padding: 1px 6px; font-size: 13px; }

/* ============================================================== مولد ====== */
.gen-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gen-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--rule);
  border-bottom: 5px solid var(--gen-color, var(--pencil-blue));
  border-radius: var(--radius); padding: 20px 18px;
  transition: transform .14s ease;
}
.gen-card:hover { transform: translateY(-3px); color: var(--ink); }
.gen-card--math { --gen-color: var(--pencil-orange); }
.gen-card--letters { --gen-color: var(--pencil-blue); }
.gen-card--numbers { --gen-color: var(--pencil-green); }
.gen-card__title { font-family: var(--font-display); font-size: 19px; }
.gen-card__lead { font-size: 13.5px; color: var(--ink-soft); }
.gen-card__go { color: var(--gen-color); font-weight: 700; font-size: 14px; margin-top: 4px; }

.letter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--rule); border-radius: 12px; padding: 10px; background: #fff;
}
.letter-grid label {
  display: flex; align-items: center; gap: 6px; font-weight: 500;
  border: 1px solid var(--rule); border-radius: 10px; padding: 5px 8px; margin: 0;
}
.letter-grid input { width: auto; }

/* ============================================================== مولد ====== */
.letter-picker {
  max-height: 210px; overflow-y: auto;
  border: 1px solid var(--rule); border-radius: 12px; padding: 10px; background: #fff;
}
/* جنگو هر گزینه را در یک div می‌گذارد؛ ظرف بیرونی را flex می‌کنیم */
.letter-picker > div { display: flex; flex-wrap: wrap; gap: 6px; }
.letter-picker > div > div { margin: 0; }
.letter-picker ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.letter-picker li { margin: 0; }
.letter-picker label {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--rule); border-radius: 10px;
  padding: 4px 10px; font-size: 16px; cursor: pointer; margin: 0;
}
.letter-picker input { accent-color: var(--pencil-blue); }

.sheet-frame {
  border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; background: #f2f3f7;
}
.sheet-frame iframe { width: 100%; height: 78vh; border: 0; display: block; background: #f2f3f7; }

/* ============================================================ فیلتر ====== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.filter-bar select, .filter-bar input[type="search"] {
  border: 1px solid var(--rule); border-radius: 12px; padding: 9px 14px;
  font-family: inherit; background: #fff; font-size: 14px;
}
.filter-bar select { min-width: 160px; }
.filter-search { flex: 1; min-width: 190px; }
.filter-check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; margin: 0; }
.filter-check input { accent-color: var(--pencil-blue); }

.notice {
  background: #fffaf0;
  border: 1px solid var(--pencil-yellow);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.notice p { font-size: 14px; margin-bottom: 8px; }

/* ========================================================= پنل سازمان ==== */
.seat-meter { margin-top: 14px; }
.seat-meter__bar {
  height: 10px; background: var(--rule); border-radius: 999px; overflow: hidden;
}
.seat-meter__bar span { display: block; height: 100%; background: var(--pencil-green); }
.seat-meter__text { font-size: 13px; color: var(--ink-soft); display: block; margin-top: 6px; }

/* ==========================================================================
   فرم مشخصات: دو ستونه روی دسکتاپ، تک‌ستونه روی موبایل
   ========================================================================== */
.panel--narrow { max-width: 640px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid > .form-field { grid-column: 1 / -1; }
.form-grid > .form-field--half { grid-column: span 1; }
.form-grid .form-field select { max-width: none; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid > .form-field--half { grid-column: 1 / -1; }
}

/* ==========================================================================
   فهرست کاربرگ: ستون فیلتر + شبکه نتیجه‌ها
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}
@media (max-width: 880px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr); }
}

.filters {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 14px 6px;
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top) + 16px);
}
.filters__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filters__title { font-family: var(--font-display); font-size: 18px; margin: 0 0 6px; }
.filters__clear { font-size: 12px; color: var(--pencil-pink); }

.filters__search { display: flex; gap: 6px; margin: 4px 0 12px; }
.filters__search input {
  flex: 1; min-width: 0;
  border: 1px solid var(--rule); border-radius: 12px;
  padding: 8px 11px; font: inherit; font-size: 13px; background: var(--paper);
}
.filters__search input:focus { border-color: var(--pencil-blue); outline: none; }
.filters__search button {
  border: 0; background: var(--pencil-blue); color: #fff;
  border-radius: 12px; width: 36px; display: grid; place-items: center; cursor: pointer;
}

.filters__group { border-top: 1px solid var(--rule); padding: 8px 0; }
.filters__group summary {
  cursor: pointer; font-weight: 500; font-size: 14px; padding: 4px 0;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.filters__group summary::-webkit-details-marker { display: none; }
.filters__group summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg); transition: transform 0.15s ease;
}
.filters__group[open] summary::after { transform: rotate(-135deg); }

.filters__list { list-style: none; margin: 4px 0 2px; padding: 0; max-height: 260px; overflow: auto; }
.filters__option {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 2px; font-size: 13.5px; color: var(--ink-soft); border-radius: 8px;
}
.filters__option:hover { background: var(--paper); color: var(--ink); }
.filters__box {
  flex: none; width: 16px; height: 16px;
  border: 1.6px solid var(--rule); border-radius: 5px; background: #fff;
  position: relative;
}
.filters__option--radio .filters__box { border-radius: 50%; }
.filters__option.is-on { color: var(--ink); font-weight: 500; }
.filters__option.is-on .filters__box { background: var(--pencil-blue); border-color: var(--pencil-blue); }
.filters__option.is-on .filters__box::after {
  content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 5px;
  width: 4px; height: 8px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
.filters__option--radio.is-on .filters__box::after {
  inset: 3px; width: auto; height: auto; border: 0; background: #fff; border-radius: 50%; transform: none;
}
.filters__label { flex: 1; min-width: 0; }
.filters__count { font-size: 11px; color: var(--ink-soft); opacity: 0.75; }
.filters__badge {
  display: inline-grid; place-items: center;
  width: 19px; height: 19px; border-radius: 6px; font-size: 11px;
  background: color-mix(in srgb, var(--tile-color, var(--pencil-purple)) 18%, #fff);
  color: var(--tile-color, var(--pencil-purple));
}
.filters__badge--blue { --tile-color: var(--pencil-blue); }
.filters__badge--green { --tile-color: var(--pencil-green); }
.filters__badge--yellow { --tile-color: var(--pencil-yellow); }
.filters__badge--orange { --tile-color: var(--pencil-orange); }
.filters__badge--pink { --tile-color: var(--pencil-pink); }
.filters__badge--purple { --tile-color: var(--pencil-purple); }

.catalog-results__bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-soft); margin-bottom: 12px;
}
.catalog-results__toggle { display: none; }
@media (max-width: 880px) {
  .filters { position: static; }
  .catalog-results__toggle {
    display: inline-block; border: 1px solid var(--rule); border-radius: 999px;
    padding: 4px 13px; background: var(--card);
  }
}

/* ------------------------------------------------------------- مجموعه‌ها - */
.collection-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.collection-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-inline-start: 5px solid var(--tile-color, var(--pencil-purple));
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: transform 0.14s ease;
}
.collection-card:hover { transform: translateY(-3px); color: var(--ink); }
.collection-card__mark {
  flex: none; width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--tile-color, var(--pencil-purple)) 15%, #fff);
  color: var(--tile-color, var(--pencil-purple));
  font-family: var(--font-display); font-size: 24px;
}
.collection-card__mark img { width: 100%; height: 100%; object-fit: cover; }
.collection-card__body { display: block; min-width: 0; }
.collection-card__title { display: block; font-family: var(--font-display); font-size: 17px; }
.collection-card__sub { display: block; font-size: 12.5px; color: var(--ink-soft); }
.collection-card__count { display: block; font-size: 12px; color: var(--ink-soft); opacity: 0.8; }

.hero--collection { display: flex; align-items: center; gap: 18px; }
.hero__mark {
  flex: none; width: 76px; height: 76px; border-radius: 22px;
  display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--tile-color, var(--pencil-purple)) 16%, #fff);
  color: var(--tile-color, var(--pencil-purple));
  font-family: var(--font-display); font-size: 34px;
}
.hero__mark img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   بازی‌ها
   ========================================================================== */
.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px;
}
.game-card {
  display: block; background: var(--card);
  border: 1px solid var(--rule);
  border-bottom: 5px solid var(--tile-color, var(--pencil-purple));
  border-radius: var(--radius);
  padding: 16px 15px 13px;
  transition: transform 0.14s ease;
}
.game-card:hover { transform: translateY(-3px); color: var(--ink); }
.game-card__icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 15px; margin-bottom: 9px;
  background: color-mix(in srgb, var(--tile-color, var(--pencil-purple)) 15%, #fff);
  color: var(--tile-color, var(--pencil-purple));
  font-family: var(--font-display); font-size: 23px;
}
.game-card__title { display: block; font-family: var(--font-display); font-size: 18px; }
.game-card__desc { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.game-card__meta { display: block; font-size: 11.5px; color: var(--ink-soft); opacity: 0.8; margin-top: 6px; }

/* ------------------------------------------------------------ صفحه بازی -- */
.game-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.game-head__icon {
  flex: none; width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--tile-color, var(--pencil-purple)) 15%, #fff);
  color: var(--tile-color, var(--pencil-purple));
  font-family: var(--font-display); font-size: 27px;
}
.game-head__text { flex: 1; min-width: 200px; }
.game-head__text h1 { font-size: 25px; margin: 0; }
.game-head__text p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.game-head__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.game-pill {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--rule); color: var(--ink-soft);
}
.game-pill--ok { border-color: var(--pencil-green); color: var(--pencil-green); }
.game-pill--warn { border-color: var(--pencil-orange); color: var(--pencil-orange); }

.game-levels { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.game-levels__item {
  font-size: 13px; padding: 5px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--rule); color: var(--ink-soft);
}
.game-levels__item.is-on {
  background: var(--tile-color, var(--pencil-purple)); border-color: transparent; color: #fff;
}

.game-shell { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 18px; align-items: start; }
@media (max-width: 920px) { .game-shell { grid-template-columns: minmax(0, 1fr); } }

.game-stage {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 16px; position: relative;
}
.game-hud {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--rule); padding-bottom: 11px; margin-bottom: 14px;
  font-size: 13.5px; color: var(--ink-soft);
}
.game-hud b { color: var(--ink); font-size: 16px; }
.game-hud__restart { margin-inline-start: auto; font-size: 13px; padding: 4px 12px; }

.game-board { min-height: 220px; display: grid; place-items: center; }

.game-result {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(255, 253, 248, 0.96);
  border-radius: var(--radius-lg);
  display: grid; place-content: center; text-align: center; gap: 8px; padding: 20px;
}
.game-result h2 { font-size: 24px; margin: 0; }
.game-result__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.game-result__note { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.game-result__link { color: var(--pencil-blue); text-decoration: underline; }

.game-side { display: grid; gap: 12px; }
.game-side__box {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 13px 14px;
}
.game-side__box h2 { font-size: 16px; margin: 0 0 6px; }
.game-side__box p { font-size: 13.5px; color: var(--ink-soft); }
.game-side__best { font-family: var(--font-display); font-size: 30px; color: var(--pencil-blue); margin: 0; }
.game-top { list-style: none; padding: 0; margin: 0 0 10px; counter-reset: top; }
.game-top li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--rule);
}
.game-top li:last-child { border-bottom: 0; }
.game-top__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-top__meta { font-size: 11.5px; color: var(--ink-soft); }

/* ----------------------------------------------------------- بازی حافظه - */
.memory-grid {
  display: grid; grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  gap: 9px; width: 100%; max-width: 480px;
}
.memory-card {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; cursor: pointer;
  background: transparent; border-radius: 14px;
}
.memory-card__back, .memory-card__face {
  position: absolute; inset: 0; border-radius: 14px;
  display: grid; place-items: center; font-size: clamp(20px, 6vw, 30px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.memory-card__back {
  background: linear-gradient(135deg, var(--pencil-blue), var(--pencil-purple));
  opacity: 1;
}
.memory-card__face { background: #fff; border: 2px solid var(--rule); opacity: 0; transform: scale(0.9); }
.memory-card.is-open .memory-card__back, .memory-card.is-done .memory-card__back { opacity: 0; }
.memory-card.is-open .memory-card__face, .memory-card.is-done .memory-card__face { opacity: 1; transform: scale(1); }
.memory-card.is-done .memory-card__face { border-color: var(--pencil-green); background: #eafaf2; }

/* --------------------------------------------------- ریاضی و چندگزینه‌ای - */
.quiz { width: 100%; max-width: 420px; text-align: center; }
/*
  عبارت ریاضی چپ‌چین است، نه راست‌چین: «۵ + ۳ = ؟» در جهت RTL وارونه
  خوانده می‌شود و علامت سوال می‌افتد سمت چپ. عددها از چپ خوانده می‌شوند.
*/
.quiz__question {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 42px);
  margin: 10px 0 18px;
  direction: ltr;
  unicode-bidi: isolate;
}
.quiz__form { display: flex; gap: 8px; justify-content: center; }
.quiz__input {
  width: 140px; text-align: center; font-size: 22px; font-family: inherit;
  border: 2px solid var(--rule); border-radius: 14px; padding: 8px 10px;
  direction: ltr;
}
.quiz__input:focus { border-color: var(--pencil-blue); outline: none; }
.quiz__feedback { min-height: 26px; margin: 12px 0 0; font-size: 14px; }
.quiz__feedback.is-ok { color: var(--pencil-green); }
.quiz__feedback.is-bad { color: #d13b3b; }

/* --------------------------------------------------------- پازل کشویی --- */
.sliding {
  display: grid; grid-template-columns: repeat(var(--size, 3), minmax(0, 1fr));
  gap: 7px; width: min(100%, 360px);
}
.sliding__tile {
  aspect-ratio: 1; border: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(160deg, #fff, #eef3fd);
  border: 1.5px solid var(--rule);
  font-family: var(--font-display); font-size: clamp(20px, 6vw, 30px); color: var(--ink);
}
.sliding__tile:hover { border-color: var(--pencil-blue); }
.sliding__tile.is-empty { background: transparent; border-style: dashed; cursor: default; }

/* --------------------------------------------------------- پازل تصویری -- */
.jigsaw { width: 100%; display: grid; gap: 12px; justify-items: center; }
.jigsaw__hint { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.jigsaw__hint img { width: 62px; height: 62px; object-fit: cover; border-radius: 10px; border: 1px solid var(--rule); }
.jigsaw__grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
  gap: 3px; width: min(100%, 420px); aspect-ratio: 1;
  background: var(--rule); padding: 3px; border-radius: 12px;
  /* لایه جشن یک فرزند absolute از همین کادر است */
  position: relative;
}
.jigsaw__piece {
  background-repeat: no-repeat; border-radius: 6px; cursor: grab;
  outline: 2px solid transparent;
  transition: outline-color 0.12s ease, border-radius 0.3s ease;
}
.jigsaw__piece.is-picked { outline-color: var(--pencil-blue); }
.jigsaw__piece.is-home { outline-color: var(--pencil-green); }

/* حل شد: خطوط بین تکه‌ها محو می‌شود و تصویر یکپارچه به نظر می‌رسد */
.jigsaw__grid.is-solved {
  gap: 0;
  padding: 0;
  transition: gap 0.3s ease, padding 0.3s ease;
}
.jigsaw__grid.is-solved .jigsaw__piece {
  border-radius: 0;
  outline-color: transparent;
  cursor: default;
}

/* ---------------------------------------------------- جشن پایان پازل ----- */
.jigsaw__win {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: end stretch;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.jigsaw__win.is-open { opacity: 1; }

/* تصویر کامل، روی تکه‌ها. همان عکسی که کاربر ساخته. */
.jigsaw__win-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jigsaw__win-badge {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: #fff;
  /* خوانا روی هر عکسی، روشن یا تاریک */
  background: linear-gradient(to top, rgba(20, 24, 38, 0.92), rgba(20, 24, 38, 0));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.jigsaw__win-badge strong {
  font-family: var(--font-display);
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1.4;
}
.jigsaw__win-badge span { font-size: 12.5px; opacity: 0.95; }

@media (prefers-reduced-motion: reduce) {
  .jigsaw__win { transition: none; }
  .jigsaw__grid.is-solved { transition: none; }
}

/* ------------------------------------------------------------ بازی کلمه - */
.wordgame { width: 100%; max-width: 520px; text-align: center; }
.wordgame__clue, .wordgame__prompt { font-size: 17px; color: var(--ink-soft); margin: 4px 0 16px; }
.wordgame__prompt { font-family: var(--font-display); font-size: clamp(26px, 7vw, 40px); color: var(--ink); direction: ltr; }
.sequence__strip {
  font-family: var(--font-display); font-size: clamp(22px, 5vw, 32px); margin: 8px 0 18px;
  direction: ltr; unicode-bidi: isolate;
}

.wordgame__slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.wordgame__slot {
  width: 34px; height: 44px; border-bottom: 3px solid var(--rule);
  display: grid; place-items: center; font-size: 24px; font-family: var(--font-display);
}
.wordgame__slot.is-open { border-bottom-color: var(--pencil-green); }
.wordgame__slot.is-space { border-bottom-color: transparent; width: 16px; }

.wordgame__keys { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.wordgame__key {
  min-width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--rule); background: #fff; font: inherit; font-size: 15px;
}
.wordgame__key:hover:not(:disabled) { border-color: var(--pencil-blue); }
.wordgame__key.is-used { opacity: 0.4; cursor: default; }
.wordgame__key.is-hit { background: #eafaf2; border-color: var(--pencil-green); opacity: 1; }

.wordgame__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.wordgame__option {
  padding: 12px 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--rule); background: #fff; font: inherit; font-size: 15px;
}
.wordgame__option:hover:not(:disabled) { border-color: var(--pencil-blue); }
.wordgame__option.is-ok { background: #eafaf2; border-color: var(--pencil-green); }
.wordgame__option.is-bad { background: #fdeaea; border-color: #d13b3b; }

/* ------------------------------------------------------- جدول امتیازات -- */
.board-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.board-filters label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }
.board-filters select, .board-filters input {
  border: 1px solid var(--rule); border-radius: 12px; padding: 7px 11px;
  font: inherit; font-size: 14px; background: #fff; min-width: 150px;
}
.table-scroll { overflow-x: auto; }
.board-table th { font-weight: 500; color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.board-table td { white-space: nowrap; }
.board-table tr.is-me { background: #fff8e6; }
.board-rank {
  font-family: var(--font-display); font-size: 16px; width: 44px; text-align: center;
}
.board-rank--1 { color: #c9a227; }
.board-rank--2 { color: #8a8f9c; }
.board-rank--3 { color: #b9744a; }

/* ------------------------------------------------- تب انفرادی / مدرسه --- */
.audience-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px;
}
.audience-tabs__item {
  padding: 7px 18px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
}
.audience-tabs__item.is-on { background: var(--pencil-blue); color: #fff; }
.plan-card__seats {
  font-size: 12.5px; color: var(--pencil-purple);
  background: color-mix(in srgb, var(--pencil-purple) 12%, #fff);
  border-radius: 999px; padding: 2px 11px; align-self: flex-start;
}

/* ==========================================================================
   هدر دوردیفه: ردیف بخش‌ها + ردیف موضوع‌ها
   ========================================================================== */
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 2000;
  background: var(--pencil-blue); color: #fff; padding: 9px 16px; border-radius: 0 0 10px 10px;
}
.skip-link:focus { inset-inline-start: 12px; color: #fff; }

.header-search { display: flex; gap: 6px; flex: 1; max-width: 420px; margin-inline: auto; }
.header-search input {
  flex: 1; min-width: 0;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-size: 14px; background: #fff;
}
.header-search input:focus { border-color: var(--pencil-blue); outline: none; }
.header-search button {
  border: 0; background: var(--pencil-blue); color: #fff; cursor: pointer;
  width: 38px; border-radius: 999px; display: grid; place-items: center; flex: none;
}
.header-search--block { max-width: none; margin: 0 0 14px; }
@media (max-width: 767px) { .header-search { display: none; } }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ردیف اصلی */
.mega { background: var(--pencil-blue); }
.mega__row { display: flex; align-items: stretch; gap: 2px; flex-wrap: wrap; }
.mega__item { position: relative; }
.mega__item > a {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 15px; color: rgba(255, 255, 255, 0.92); font-size: 14.5px; font-weight: 500;
}
.mega__item > a:hover, .mega__item:focus-within > a {
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.mega__caret {
  width: 6px; height: 6px; display: inline-block;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.mega__panel {
  position: absolute; inset-inline-start: 0; top: 100%;
  min-width: 230px; max-height: 70vh; overflow: auto;
  background: var(--card); border: 1px solid var(--rule); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 14px 30px rgba(35, 40, 58, 0.14);
  padding: 8px; z-index: 1040;
  display: none;
}
.mega__item:hover .mega__panel, .mega__item:focus-within .mega__panel { display: block; }
.mega__panel a {
  display: block; padding: 7px 11px; border-radius: 9px;
  font-size: 14px; color: var(--ink-soft);
}
.mega__panel a:hover { background: var(--paper); color: var(--pencil-blue); }

/* ردیف موضوع‌ها */
.topics { background: var(--card); border-bottom: 1px solid var(--rule); }
.topics__row {
  display: flex; gap: 4px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px;
}
.topics__item {
  font-size: 13.5px; padding: 5px 13px; border-radius: 999px;
  color: var(--ink-soft); border: 1px solid transparent;
}
.topics__item:hover {
  border-color: var(--topic-color, var(--pencil-blue));
  color: var(--topic-color, var(--pencil-blue));
  background: color-mix(in srgb, var(--topic-color, var(--pencil-blue)) 8%, #fff);
}
.topics__item--blue { --topic-color: var(--pencil-blue); }
.topics__item--green { --topic-color: var(--pencil-green); }
.topics__item--yellow { --topic-color: var(--pencil-yellow); }
.topics__item--orange { --topic-color: var(--pencil-orange); }
.topics__item--pink { --topic-color: var(--pencil-pink); }
.topics__item--purple { --topic-color: var(--pencil-purple); }

/* منوی موبایل */
.menu-list { display: grid; gap: 2px; }
.menu-list > a, .menu-list summary, .menu-list details a {
  display: block; padding: 9px 10px; border-radius: 10px; font-size: 15px;
}
.menu-list > a:hover, .menu-list summary:hover { background: var(--paper); }
.menu-list summary { cursor: pointer; font-weight: 500; list-style: none; }
.menu-list summary::-webkit-details-marker { display: none; }
.menu-list summary::after {
  content: "+"; float: left; color: var(--ink-soft); font-size: 18px; line-height: 1;
}
.menu-list details[open] summary::after { content: "−"; }
.menu-list details a { padding-inline-start: 24px; font-size: 14px; color: var(--ink-soft); }
.menu-list__all { color: var(--pencil-blue) !important; }
.menu-list hr { border: 0; border-top: 1px solid var(--rule); margin: 8px 0; }

/* راهنمای زنده فرم مولد */
.sheet-limit {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0 0 14px;
}
.sheet-limit.is-over {
  color: #b3261e;
  border-color: #f0c0bc;
  background: #fdeceb;
}

/* ------------------------------------------------- گالری پازل تصویری --- */
.puzzle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.puzzle-card {
  display: block; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 10px; transition: transform 0.14s ease;
}
.puzzle-card:hover { transform: translateY(-3px); color: var(--ink); }
.puzzle-card__shot {
  position: relative; display: block; aspect-ratio: 1;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--paper);
}
.puzzle-card__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.puzzle-card.is-done .puzzle-card__shot img { opacity: 0.55; }
.puzzle-card__badge {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  background: var(--pencil-green); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.puzzle-card__title { display: block; font-family: var(--font-display); font-size: 16px; margin-top: 8px; }
.puzzle-card__meta { display: block; font-size: 12px; color: var(--ink-soft); }

/* --------------------------------------------- «همه را ببینید» کنار تیتر -- */
.section-more {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  margin-top: 34px;
}
.section-more:hover { color: var(--pencil-blue); }

/* ------------------------------------------- جدول کوچک رکورد (صفحه اصلی) -- */
.mini-board {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 10px 10px;
  margin-bottom: 14px;
}
.mini-board__title {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.5;
}
.mini-board__cup { font-size: 16px; }
.mini-board__list { list-style: none; margin: 0; padding: 0; }
.mini-board__row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px dashed var(--rule);
  font-size: 12px;
}
.mini-board__row:first-child { border-top: 0; }
/* ردیف خود کاربر پررنگ می‌شود؛ همین باعث می‌شود جدول را دنبال کند */
.mini-board__row.is-me { background: #f3f7ff; border-radius: var(--radius-sm); }
.mini-board__rank {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-edge);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}
.mini-board__rank--1 { background: var(--pencil-yellow); color: #4a3a00; }
.mini-board__rank--2 { background: #dfe4ee; color: #3d4557; }
.mini-board__rank--3 { background: #f0c9a4; color: #5a3a17; }
.mini-board__who { min-width: 0; display: block; line-height: 1.6; }
.mini-board__who b { display: block; font-weight: 600; }
/* اسم مدرسه بلند است و ستون باریک؛ بدون این، کارت کشیده می‌شود */
.mini-board__who b,
.mini-board__who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-board__who small { color: var(--ink-soft); font-size: 10.5px; }
.mini-board__score { font-weight: 700; font-size: 13px; color: var(--pencil-blue); }
.mini-board__empty { font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.mini-board__hint { font-size: 11px; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.6; }
.mini-board__more {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--pencil-blue);
  border-top: 1px solid var(--rule);
  padding-top: 7px;
}

/* ------------------------------------------ نوار کشویی هدر روی موبایل --- */
.hdrawer {
  /* اندازه لبه دیده‌شده در حالت بسته؛ محتوای نوار حدود ۲۰۰ پیکسل است، پس
     این تقریبا همان «۱۰ درصد» خواسته‌شده است. یک متغیر است تا سایه محو و
     ارتفاع همیشه با هم بخوانند. */
  --peek: 22px;
  position: relative;
  border-top: 1px solid var(--rule);
  background: var(--card);
  padding-bottom: 15px;
}
.hdrawer__body {
  max-height: var(--peek);
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.hdrawer.is-open .hdrawer__body {
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* لبه پایینِ همان نوار باریک محو می‌شود تا «ادامه دارد» خوانده شود، نه
   «چیزی نصفه چاپ شده». بالای گرادیان شفاف است و پایینش رنگ کارت. */
.hdrawer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: var(--peek);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 35%, var(--card) 100%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hdrawer.is-open::before { opacity: 0; }

.hdrawer__rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 14px;
  scrollbar-width: none;
}
.hdrawer__rail::-webkit-scrollbar { display: none; }
.hdrawer__rail > * { flex: 0 0 auto; }

.hdrawer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 14px 10px;
  border-top: 1px dashed var(--rule);
  margin-top: 6px;
}
.hdrawer__link {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-edge);
  color: var(--ink);
}

/* فلش وسط لبه؛ تنها راه باز کردن نوار */
.hdrawer__arrow {
  position: absolute;
  /* left/transform فیزیکی‌اند و در RTL هم همین‌جا وسط می‌مانند */
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 62px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: var(--card);
  color: var(--ink-soft);
  padding: 0;
  cursor: pointer;
}
.hdrawer__arrow svg { transition: transform 0.28s ease; }
.hdrawer__arrow.is-open svg { transform: rotate(180deg); }

/* ======================================================= پنل و کارت‌ها === */
.panel__title {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 12px;
  line-height: 1.5;
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.req { color: #d13b3b; }

/* ====================================================== پنل کاربری ====== */
.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-bottom: 5px solid var(--pencil-blue);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.account-head__avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pencil-blue) 15%, #fff);
  color: var(--pencil-blue);
  font-family: var(--font-display);
  font-size: 26px;
}
.account-head__text { flex: 1 1 200px; min-width: 0; }
.account-head__text h1 {
  font-family: var(--font-display);
  font-size: 23px;
  margin: 0;
  line-height: 1.4;
}
.account-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.account-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.account-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.account-stat {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  color: var(--ink);
}
.account-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--pencil-blue);
  line-height: 1.3;
}
.account-stat span { font-size: 12.5px; color: var(--ink-soft); }
a.account-stat:hover { border-color: var(--pencil-blue); color: var(--ink); }

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
}
.account-main > .panel + .panel { margin-top: 16px; }
.account-side > .panel + .panel { margin-top: 16px; }

.account-nav { display: flex; flex-direction: column; }
.account-nav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
}
.account-nav a:hover { background: var(--paper-edge); color: var(--ink); }

.sub-box__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.sub-box__top strong { font-size: 20px; }
.sub-box__days {
  font-size: 12px;
  background: color-mix(in srgb, var(--pencil-green) 14%, #fff);
  color: #14764c;
  border-radius: 999px;
  padding: 3px 11px;
}

.best-list { list-style: none; margin: 0; padding: 0; }
.best-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--rule);
  font-size: 13.5px;
}
.best-list li:first-child { border-top: 0; }
.best-list b { color: var(--pencil-blue); }

.dot-badge {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pencil-orange);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}

/* =========================================================== تیکت ======= */
.ticket-list { list-style: none; margin: 0 0 12px; padding: 0; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.ticket-row:first-child { border-top: 0; }
.ticket-row__main { flex: 1 1 auto; min-width: 0; }
.ticket-row__subject { display: block; font-weight: 500; }
.ticket-row__meta { display: block; font-size: 12px; color: var(--ink-soft); }
/* نوبت کاربر است: یک خط رنگی کنار ردیف، بدون شلوغ کردن */
.ticket-row.is-new { box-shadow: inset 3px 0 0 var(--pencil-orange); padding-inline-start: 10px; }

.ticket-badge {
  flex: 0 0 auto;
  font-size: 11.5px;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--paper-edge);
  color: var(--ink-soft);
  white-space: nowrap;
}
.ticket-badge--open { background: #fff3e2; color: #9a5300; }
.ticket-badge--answered { background: #e6f7ef; color: #14764c; }
.ticket-badge--waiting { background: #eaf1fd; color: #1c4f9c; }
.ticket-badge--closed { background: var(--paper-edge); color: var(--ink-soft); }

.ticket-thread { list-style: none; margin: 16px 0; padding: 0; }
.ticket-msg {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
}
/* پاسخ پشتیبانی باید در یک نگاه از پیام کاربر جدا باشد */
.ticket-msg--staff {
  background: #f7faff;
  border-color: color-mix(in srgb, var(--pencil-blue) 30%, var(--rule));
}
.ticket-msg__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.ticket-msg__body { font-size: 14px; line-height: 1.95; }
.ticket-msg__file { display: block; margin-top: 8px; }
.ticket-msg__file img {
  max-width: 260px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  display: block;
}
.ticket-reply { border-top: 1px dashed var(--rule); padding-top: 14px; }

/* ==================================================== تماس با ما ======== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
.contact-side > .panel + .panel { margin-top: 16px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--rule);
  font-size: 14px;
}
.contact-list li:first-child { border-top: 0; }
.contact-list__label { color: var(--ink-soft); }

/* ================================================= مجوزها در فوتر ====== */
.licence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.licence {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px;
  line-height: 1;
  font-size: 12px;
}
.licence img { height: 62px; width: auto; display: block; }

.footer-licences { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 14px; }
.footer-licences > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  list-style: none;
}
.footer-licences > summary::-webkit-details-marker { display: none; }
.footer-licences > summary::after { content: " ▾"; }
.footer-licences[open] > summary::after { content: " ▴"; }
.footer-licences > summary:hover { color: var(--pencil-blue); }
.footer-licences .licence-row { margin-top: 12px; }

/* ------------------------------------- جدول زنده کنار صفحه بازی --------- */
.game-side__live {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  color: #14764c;
  background: #e6f7ef;
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 3px;
}
/* ردیف خود بازیکن در جدول کنار صفحه */
.game-top li.is-me {
  background: #f3f7ff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* آیکون‌های Bootstrap Icons کنار متن: کمی پایین‌تر می‌نشینند */
.account-nav .bi,
.contact-list .bi {
  color: var(--ink-soft);
  margin-inline-end: 3px;
}
.account-nav a:hover .bi { color: var(--pencil-blue); }
