/* صفحه‌ی فرود دامنه‌ی اصلی (landing/serve.ts، از تیزچشم). رنگ‌ها و تصویر پس‌زمینه‌ی hero را هر بازی با سیستم طراحی
   خودش عوض می‌کند؛ فونت‌ها از build بازی (/fonts) می‌آیند. */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn[wght].woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Lalezar';
  src: url('/fonts/Lalezar.woff2') format('woff2');
  size-adjust: 115%;
  font-display: swap;
}

:root {
  --font: 'Vazirmatn', Tahoma, Arial, sans-serif;
  --font-display: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
  --blue: #087ff5;
  --blue-panel: #0752bd;
  --blue-deep: #00369d;
  --blue-navy: #00277d;
  --blue-pale: #e8f5ff;
  --blue-border: #8fc6ff;
  --green-bright: #6fd36a;
  --green: #45b85a;
  --green-dark: #2e8f45;
  --green-deep: #1d6634;
  --gold-bright: #ffe85a;
  --gold: #f9c134;
  --gold-orange: #f99703;
  --gold-dark: #824016;
  --cream: #fff8ea;
  --paper: #fffdf7;
  --ink: #17356f;
  --muted: #56709c;
  --line: #e4d9c2;
  --radius: 22px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}
/* Vazirmatn و لاله‌زار سیریلیک و چینی/ژاپنی/کره‌ای ندارند؛ مثل بازی فونت سیستم */
:lang(ru), :lang(zh), :lang(ja), :lang(ko) { --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif; --font-display: var(--font); }
:lang(ru) h1, :lang(ru) h2, :lang(ru) h3, :lang(ru) .btn,
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .btn,
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .btn,
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ko) .btn { font-weight: 800; }
[dir='ltr'] body { line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.3; margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

/* ---- سربرگ ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 248, 234, 0.92);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.top__brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.top__brand img { height: 40px; width: auto; }
.top nav { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 6px 12px; border-radius: 999px;
}
.top nav a:hover { background: var(--blue-pale); }

/* ---- انتخاب زبان ---- */
.langs { position: relative; margin-inline-start: 4px; }
.top nav + .langs { margin-inline-start: 0; }
.top__brand + .langs { margin-inline-start: auto; }
.langs summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 2px solid var(--blue-border); background: #fff;
  font-weight: 800; font-size: 14px; color: var(--blue-deep); white-space: nowrap;
}
.langs summary::-webkit-details-marker { display: none; }
.langs[open] summary { background: var(--blue-pale); }
.langs ul {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 20; margin: 0; padding: 6px;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 28px rgba(23, 53, 111, 0.18); min-width: 200px; max-height: 70vh; overflow-y: auto;
}
.langs li a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.langs li a:hover { background: var(--blue-pale); }
.langs li a[aria-current] { background: var(--blue); color: #fff; }
.langnames span { white-space: nowrap; }

/* ---- دکمه‌های براق، مثل بازی ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 8px 24px;
  border: 3px solid #fff; border-radius: 18px;
  font-family: var(--font-display); font-size: 21px; color: #fff; text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  box-shadow: 0 5px 0 var(--bevel), 0 9px 18px rgba(23, 53, 111, 0.22);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bevel); }
.btn--green { background: linear-gradient(#8ee58a, var(--green) 55%, var(--green-dark)); --bevel: var(--green-deep); }
.btn--blue { background: linear-gradient(#5cc6ff, var(--blue) 55%, var(--blue-panel)); --bevel: var(--blue-navy); }
.btn--gold { background: linear-gradient(var(--gold-bright), var(--gold) 50%, var(--gold-orange)); --bevel: var(--gold-dark); color: #fff; }
.btn--teal { background: linear-gradient(#7fe0e8, #1bb3c2 55%, #0e8796); --bevel: #075e6a; }
.btn__sub { font-family: var(--font); font-size: 13px; font-weight: 700; opacity: 0.92; }

/* ---- معرفی بالای صفحه ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 39, 125, 0.15), rgba(0, 39, 125, 0.55));
}
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; align-items: center; gap: 24px;
  padding-block: 56px 64px;
}
.hero__logo { width: min(340px, 80%); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)); }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin-block: 12px 8px; text-shadow: 0 3px 0 var(--blue-navy), 0 0 18px rgba(0, 0, 0, 0.35); }
.hero p { font-size: 18px; font-weight: 600; max-width: 34em; margin: 0 0 24px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__mascot { justify-self: center; width: min(320px, 100%); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35)); }

/* ---- بخش‌ها ---- */
section { padding-block: 64px; }
section:nth-of-type(even) { background: var(--paper); }
.sec-title { text-align: center; margin-block-end: 36px; }
.sec-title h2 { font-size: clamp(26px, 4vw, 36px); color: var(--blue-deep); }
.sec-title p { color: var(--muted); margin: 6px auto 0; max-width: 40em; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; text-align: center; box-shadow: 0 6px 18px rgba(23, 53, 111, 0.07);
}
.feature img { width: 76px; height: 76px; object-fit: contain; margin: 0 auto 12px; }
.feature h3 { font-size: 22px; color: var(--blue-deep); margin-block-end: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.chapters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.chapter { margin: 0; background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.chapter__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; overflow: hidden; }
.chapter__open:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.chapter img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--blue-pale); transition: transform 0.25s; }
.chapter__open:hover img { transform: scale(1.04); }
.chapter figcaption { padding: 8px 12px; font-weight: 800; font-size: 15px; }
.chapter figcaption span { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }

.platforms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.platform {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.platform h3 { font-size: 24px; color: var(--blue-deep); }
.platform p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.platform .btn { font-size: 19px; min-height: 50px; padding-inline: 14px; }
.platform__soon {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  border-radius: 16px; border: 2px dashed var(--blue-border); color: var(--muted); font-weight: 800;
}

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.how li {
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: relative; padding-block-start: 52px;
}
.how li::before {
  counter-increment: step; content: counter(step, persian);
  position: absolute; top: 14px; inset-inline-start: 20px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #fff; font-weight: 900; border: 2px solid #fff; box-shadow: 0 2px 0 var(--gold-dark);
}
.how h3 { font-size: 20px; color: var(--blue-deep); }
.how p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
ol.how { padding: 0; margin: 0; }

/* ---- درباره و تماس ---- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 24px; color: var(--blue-deep); margin-block-end: 8px; }
.card p { margin: 0 0 10px; }
.contact { list-style: none; margin: 0; padding: 0; }
.contact li { padding-block: 6px; border-block-end: 1px dashed var(--line); }
.contact li:last-child { border: 0; }
.contact b { display: inline-block; min-width: 7.5em; color: var(--muted); font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---- فصل‌های در راه ---- */
.soon {
  margin-block-start: 20px; display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, #fff4d6, #ffe7b0); border: 2px dashed var(--gold); border-radius: var(--radius);
  padding: 18px 24px;
}
.soon img { width: 96px; flex: none; }
.soon h3 { font-size: 24px; color: var(--gold-dark); }
.soon p { margin: 4px 0 0; color: #6b4a1c; }

/* ---- پنجره‌ی نمایش صحنه ---- */
.viewer {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; overflow: visible;
}
.viewer::backdrop { background: rgba(0, 20, 60, 0.82); }
.viewer img {
  max-width: min(96vw, 1400px); max-height: 84vh; width: auto; height: auto; margin-inline: auto;
  border-radius: 14px; border: 3px solid #fff; background: var(--blue-pale);
}
.viewer__caption { margin: 8px 0 0; text-align: center; color: #fff; font-weight: 800; }
.viewer__close {
  position: absolute; top: -14px; inset-inline-end: -10px; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid #fff; background: linear-gradient(#ff7a7a, #ef3038 55%, #b91525); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 #790d1c;
}

/* ---- پانویس ---- */
footer { background: var(--blue-navy); color: #dfe9ff; padding-block: 32px; font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
footer a { color: #fff; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.trust { display: flex; gap: 12px; align-items: center; }

/* ---- صفحه‌های متنی (قوانین، حریم خصوصی) ---- */
.doc { padding-block: 40px 64px; }
.doc .card { max-width: 820px; margin-inline: auto; }
.doc h1 { font-size: 34px; color: var(--blue-deep); margin-block-end: 6px; }
.doc h2 { font-size: 24px; color: var(--blue-deep); margin-block: 26px 6px; }
.doc .updated { color: var(--muted); font-size: 14px; margin-block-end: 18px; }
.doc li { margin-block-end: 6px; }

@media (max-width: 900px) {
  .features, .platforms { grid-template-columns: repeat(2, 1fr); }
  .viewer__close { top: 6px; inset-inline-end: 6px; }
  .chapters { grid-template-columns: repeat(3, 1fr); }
  .how, .about { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top nav { display: none; }
  .langs { margin-inline-start: auto; }
  .langs summary span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-block: 36px 44px; }
  .hero__logo { margin-inline: auto; }
  .hero p { margin-inline: auto; font-size: 16px; }
  .hero__cta { justify-content: center; }
  .hero__mascot { width: 150px; grid-row: 1; }
  .chapters { grid-template-columns: repeat(2, 1fr); }
  section { padding-block: 44px; }
  .soon { flex-direction: column; text-align: center; }
}
@media (max-width: 400px) {
  .features, .platforms { grid-template-columns: 1fr; }
  .btn { font-size: 19px; padding-inline: 18px; }
}

/* نام بازی به‌جای لوگو تا هر بازی لوگوی خودش را بگذارد */
.top__name { font-weight: 900; font-size: 1.25rem; color: inherit; text-decoration: none; }
.hero__name { font-weight: 900; font-size: 1.1rem; opacity: 0.85; margin: 0 0 0.25rem; }

/* قوانین و حریم خصوصی داخل بازی (?embed=1، ui/legal.ts): بی سربرگ و پانویس سایت؛ بازی نوار عنوان خودش را دارد */
.embed .top,
.embed footer { display: none; }
.embed .doc { padding-block: 16px 32px; }
.embed .doc .card { box-shadow: none; }
