/* لندینگ موبایل — تجربه اپلیکیشن */

:root,
html[data-theme="dark"] {
  --deep: #060A14;
  --page-bg: #060A14;
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-bright: #F0D080;
  --gold-rgb: 201, 168, 76;
  --gold-dark: #8a6910;
  --gold-pale: #fff4c8;
  --gold-deep: #3d2e0a;
  --atm: #C9A84C;
  --atm-rgb: 201, 168, 76;
  --atm-deep: #3d2e0a;
  --blue: #1A6EFF;
  --purple: #8B5CF6;
  --green: #10E87A;
  --ink-rgb: 255, 255, 255;
  --shade-rgb: 0, 0, 0;
  --fg: #ffffff;
  --fg-strong: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.7);
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --header-scrolled-bg: rgba(6, 10, 20, 0.92);
  --bg-shade: rgba(6, 10, 20, 0.68);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-fg-strong: #ffffff;
  --panel-theme-btn-bg: rgba(255, 255, 255, 0.06);
  --panel-theme-btn-hover: rgba(255, 255, 255, 0.1);
  --pad: clamp(0.9rem, 4.2vw, 1.35rem);
  --appbar-h: 44px;
  --tabbar-h: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shell-top: calc(var(--appbar-h) + var(--safe-top));
  --shell-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  --screen-h: calc(var(--app-vh, 100dvh) - var(--shell-top) - var(--shell-bottom));
  --scale: 1;
  --type-title: clamp(1.35rem, 4.8vh, 2rem);
  --type-title-xl: clamp(1.55rem, 5.8vh, 2.35rem);
  --type-lead: clamp(0.84rem, 2.2vh, 1rem);
  --type-meta: clamp(0.62rem, 1.6vh, 0.72rem);
  --logo-hero-size: min(42vw, 30vh);
}

html[data-theme="light"] {
  --page-bg: #eef1f7;
  --ink-rgb: 15, 23, 42;
  --fg: #1e293b;
  --fg-strong: #0f172a;
  --fg-muted: rgba(15, 23, 42, 0.65);
  --surface: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --header-scrolled-bg: rgba(255, 255, 255, 0.92);
  --bg-shade: rgba(238, 241, 247, 0.78);
  --green: #0a9f56;
  --panel-border: rgba(15, 23, 42, 0.1);
  --panel-fg-strong: #0f172a;
  --panel-theme-btn-bg: rgba(15, 23, 42, 0.05);
  --panel-theme-btn-hover: rgba(15, 23, 42, 0.09);
  color-scheme: light;
}

/* ── پالت‌های رنگی (accent) — جدا از دارک/لایت ── */
html[data-accent="blue"] {
  --gold: #4C8DD9;
  --gold-light: #8FC2F5;
  --gold-bright: #8FC2F5;
  --gold-rgb: 76, 141, 217;
  --gold-dark: #1d5a9e;
  --gold-pale: #e3f1ff;
  --gold-deep: #0a2440;
  --atm: #4C8DD9;
  --atm-rgb: 76, 141, 217;
  --atm-deep: #0a2440;
}
html[data-accent="green"] {
  --gold: #2FAE6F;
  --gold-light: #7FE0AC;
  --gold-bright: #7FE0AC;
  --gold-rgb: 47, 174, 111;
  --gold-dark: #17714a;
  --gold-pale: #e2ffee;
  --gold-deep: #06301c;
  --atm: #2FAE6F;
  --atm-rgb: 47, 174, 111;
  --atm-deep: #06301c;
}
html[data-accent="purple"] {
  --gold: #9B6DF0;
  --gold-light: #C9AAF8;
  --gold-bright: #C9AAF8;
  --gold-rgb: 155, 109, 240;
  --gold-dark: #6a3fc0;
  --gold-pale: #f1e8ff;
  --gold-deep: #2a1354;
  --atm: #9B6DF0;
  --atm-rgb: 155, 109, 240;
  --atm-deep: #2a1354;
}
html[data-accent="rose"] {
  --gold: #E0637E;
  --gold-light: #F5A0B2;
  --gold-bright: #F5A0B2;
  --gold-rgb: 224, 99, 126;
  --gold-dark: #a52947;
  --gold-pale: #ffe9ee;
  --gold-deep: #47101f;
  --atm: #E0637E;
  --atm-rgb: 224, 99, 126;
  --atm-deep: #47101f;
}

/* ── پالت‌های ترکیبی: اتمسفر (--atm) جدا از UI (--gold) ── */
html[data-accent="navy-gold"] {
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-bright: #F0D080;
  --gold-rgb: 201, 168, 76;
  --gold-dark: #8a6910;
  --gold-pale: #fff4c8;
  --gold-deep: #3d2e0a;
  --atm: #0A4DFF;
  --atm-rgb: 10, 77, 255;
  --atm-deep: #001A7A;
}
html[data-accent="forest-gold"] {
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-bright: #F0D080;
  --gold-rgb: 201, 168, 76;
  --gold-dark: #8a6910;
  --gold-pale: #fff4c8;
  --gold-deep: #3d2e0a;
  --atm: #1A5C3A;
  --atm-rgb: 26, 92, 58;
  --atm-deep: #0A2416;
}
html[data-accent="wine-gold"] {
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-bright: #F0D080;
  --gold-rgb: 201, 168, 76;
  --gold-dark: #8a6910;
  --gold-pale: #fff4c8;
  --gold-deep: #3d2e0a;
  --atm: #F0103C;
  --atm-rgb: 240, 16, 60;
  --atm-deep: #6A0018;
}
html[data-accent="ink-cyan"] {
  --gold: #00E8FF;
  --gold-light: #7AFAFF;
  --gold-bright: #5CF4FF;
  --gold-rgb: 0, 232, 255;
  --gold-dark: #0090A8;
  --gold-pale: #D6FBFF;
  --gold-deep: #003840;
  --atm: #0A2FFF;
  --atm-rgb: 10, 47, 255;
  --atm-deep: #000E66;
}

/* ── شارپ / جیغ ── */
html[data-accent="vivid-blaze"] {
  --gold: #FF0033;
  --gold-light: #FF5C7A;
  --gold-bright: #FF3360;
  --gold-rgb: 255, 0, 51;
  --gold-dark: #B00024;
  --gold-pale: #FFE0E8;
  --gold-deep: #4A0010;
  --atm: #0040FF;
  --atm-rgb: 0, 64, 255;
  --atm-deep: #0018AA;
}
html[data-accent="vivid-royal"] {
  --gold: #FFD000;
  --gold-light: #FFE566;
  --gold-bright: #FFEA7A;
  --gold-rgb: 255, 208, 0;
  --gold-dark: #B88600;
  --gold-pale: #FFF6C2;
  --gold-deep: #3D2E00;
  --atm: #0A2CFF;
  --atm-rgb: 10, 44, 255;
  --atm-deep: #00106A;
}
html[data-accent="chroma-wave"] {
  --gold: #FF2D55;
  --gold-light: #FF7A93;
  --gold-bright: #FF5C7A;
  --gold-rgb: 255, 45, 85;
  --gold-dark: #9E1030;
  --gold-pale: #FFE4EA;
  --gold-deep: #3A0A16;
  --atm: #1A6EFF;
  --atm-rgb: 26, 110, 255;
  --atm-deep: #061C4A;
}

html[data-accent="shine-royal"] {
  --gold: #E0AA3E;
  --gold-light: #F9F295;
  --gold-bright: #FAF398;
  --gold-rgb: 224, 170, 62;
  --gold-dark: #B88A44;
  --gold-pale: #F9F295;
  --gold-deep: #3d2a0a;
  --atm: #051650;
  --atm-rgb: 5, 22, 80;
  --atm-deep: #020B28;
  --shine-a: #F9F295;
  --shine-b: #E0AA3E;
  --shine-c: #FAF398;
  --shine-d: #B88A44;
}
html[data-accent="shine-royal"] .m-btn--primary,
html[data-accent="shine-royal"] .accent-picker__dot,
html[data-accent="shine-royal"] .m-title--gold,
html[data-accent="shine-royal"] .m-splash__title {
  background-image: linear-gradient(
    110deg,
    var(--shine-a) 0%,
    var(--shine-b) 22%,
    var(--shine-c) 44%,
    var(--shine-d) 66%,
    var(--shine-b) 82%,
    var(--shine-a) 100%
  );
  background-size: 240% 100%;
  animation: shine-gold-flow 3.2s linear infinite;
}
html[data-accent="shine-royal"] .m-title--gold,
html[data-accent="shine-royal"] .m-splash__title {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation-duration: 4s;
  animation-timing-function: ease-in-out;
}
@keyframes shine-gold-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-accent="shine-royal"] .m-btn--primary,
  html[data-accent="shine-royal"] .accent-picker__dot,
  html[data-accent="shine-royal"] .m-title--gold,
  html[data-accent="shine-royal"] .m-splash__title {
    animation: none !important;
    background-position: 30% 50%;
  }
}
html.accent-wave .accent-picker__dot {
  background: conic-gradient(from 0deg, #FF2D55, #FFB020, #14E8A8, #3B82F6, #A855F7, #FF2D55);
}
html.accent-wave [data-accent-logo] {
  filter:
    hue-rotate(var(--logo-hue, 0deg))
    saturate(var(--logo-sat, 1.3))
    drop-shadow(0 0 18px rgba(var(--gold-rgb), 0.4));
}
html[data-theme="light"].accent-wave [data-accent-logo] {
  filter:
    hue-rotate(var(--logo-hue, 0deg))
    saturate(var(--logo-sat, 1.25))
    drop-shadow(0 6px 16px rgba(15, 23, 42, 0.12));
}
/* در لایت، متن‌های accent باید تیره بمانند (بعد از پالت‌ها) */
html[data-theme="light"] {
  --gold-light: var(--gold-dark);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: clamp(13px, 3.6vw, 15px);
  height: 100%;
}

body.m-app {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--page-bg);
  color: var(--fg);
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  color-scheme: dark;
}

html[data-theme="light"] body.m-app {
  color-scheme: light;
}

body.is-splash {
  touch-action: none;
  overflow: hidden;
}

body.is-splash .m-shell,
body.is-splash .m-bg,
body.is-splash .m-desktop-link {
  visibility: hidden;
  pointer-events: none;
}

body.is-splash .m-splash {
  pointer-events: auto;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* ─── پس‌زمینه ─── */
.m-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.m-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.28) saturate(0.32) contrast(1.05);
}

.m-bg__shade {
  position: absolute;
  inset: 0;
  background: var(--bg-shade);
}

/* ─── اسپلش ─── */
.m-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--deep);
  cursor: pointer;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.m-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.m-splash__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.m-splash__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.32) saturate(0.35);
}

.m-splash__shade {
  position: absolute;
  inset: 0;
  background: var(--header-scrolled-bg);
}

.m-splash__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem var(--pad);
  animation: m-fade-up 0.85s ease both;
}

.m-splash__logo {
  width: var(--logo-hero-size);
  height: auto;
  margin-bottom: clamp(1rem, 3vh, 1.75rem);
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
}

.m-splash__title {
  font-size: var(--type-title-xl);
  font-weight: 800;
  line-height: 1.38;
  margin-bottom: 0.4rem;
  max-width: 12em;
}

.m-splash__tagline {
  font-size: var(--type-lead);
  color: rgba(var(--ink-rgb), 0.52);
  margin-bottom: clamp(1.25rem, 4vh, 2rem);
}

.m-splash__hint {
  font-size: clamp(0.72rem, 2vh, 0.85rem);
  color: rgba(var(--ink-rgb), 0.55);
  margin-top: clamp(1.5rem, 5vh, 2.5rem);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  background: rgba(var(--gold-rgb), 0.1);
  animation: m-splash-pulse 2s ease-in-out infinite;
}

@keyframes m-splash-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes m-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes m-loader {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(330%); }
}

/* ─── شل اپ ─── */
.m-shell {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* ─── اپ‌بار ─── */
.m-appbar {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  overflow: visible;
  height: var(--shell-top);
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--pad);
  background: transparent;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.06);
}

/* blur روی ::before تا پاپ‌آور رنگ با backdrop-filter بریده نشود */
.m-appbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-scrolled-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.m-appbar__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.m-appbar__brand img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

html[data-theme="light"] .m-appbar__brand img {
  filter: invert(1) hue-rotate(180deg);
}

.m-appbar__title {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-appbar__progress {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.m-appbar__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.2);
  transition: width 0.3s ease, background 0.3s ease, border-radius 0.3s ease;
}

.m-appbar__dot.is-active {
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ─── اسکرولر صفحات ─── */
.m-scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.m-scroller::-webkit-scrollbar {
  display: none;
}

.m-screen {
  position: relative;
  min-height: var(--screen-h);
  height: var(--screen-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 1.5vh, 0.85rem) var(--pad);
}

.m-screen__inner {
  width: 100%;
  max-width: 26rem;
  max-height: 100%;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.45rem, 1.5vh, 0.85rem);
  animation: m-screen-in 0.5s ease both;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.m-screen__inner::-webkit-scrollbar {
  display: none;
}

.m-screen__inner--fill {
  width: 100%;
  max-width: 26rem;
}

.m-screen.is-visible .m-screen__inner {
  animation: m-screen-in 0.45s ease both;
}

@keyframes m-screen-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.m-screen--building .m-grid--fill {
  width: 100%;
  flex: 0 1 auto;
  align-content: center;
}

.m-screen--sky .m-visual--mayor {
  width: 100%;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-screen--wall .m-marquee {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.m-screen--login .m-credit {
  margin-top: 0;
}

/* صفحه‌های کوتاه */
body[data-density="compact"] {
  --type-title: clamp(1.2rem, 4.2vh, 1.65rem);
  --type-title-xl: clamp(1.35rem, 5vh, 1.9rem);
}

body[data-density="compact"] .m-grid--fill {
  gap: 0.35rem;
}

body[data-density="compact"] .m-card {
  padding-block: 0.55rem;
}

.m-swipe-hint {
  position: absolute;
  bottom: clamp(0.35rem, 1.2vh, 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: var(--type-meta);
  color: rgba(var(--ink-rgb), 0.28);
  animation: m-bounce 2s ease-in-out infinite;
  pointer-events: none;
}

.m-swipe-hint__chev {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid rgba(var(--ink-rgb), 0.35);
  border-bottom: 1.5px solid rgba(var(--ink-rgb), 0.35);
  transform: rotate(-135deg);
}

@keyframes m-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* ─── محتوا ─── */
.m-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0;
  font-size: var(--type-meta);
}

.m-meta__chapter {
  color: var(--gold);
  font-weight: 800;
  padding: 0.16rem 0.48rem;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  border-radius: 999px;
}

.m-meta__label {
  color: rgba(var(--ink-rgb), 0.42);
}

.m-logo {
  display: block;
  width: auto;
  height: auto;
}

.m-logo--hero {
  width: var(--logo-hero-size);
  height: auto;
  margin: 0 auto;
}

.m-title {
  font-size: var(--type-title);
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
  width: 100%;
}

.m-title--xl {
  font-size: var(--type-title-xl);
  line-height: 1.32;
}

.m-title--lg {
  font-size: clamp(1.4rem, 5.2vh, 2.1rem);
}

.m-title--sm {
  font-size: clamp(1.15rem, 3.8vh, 1.55rem);
}

.m-title--gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.m-lead {
  text-align: center;
  color: rgba(var(--ink-rgb), 0.58);
  font-size: var(--type-lead);
  line-height: 1.6;
  width: 100%;
  max-width: 24em;
  margin-inline: auto;
}

.m-lead--lg {
  font-size: clamp(0.9rem, 2.5vh, 1.08rem);
  display: inline-block;
  width: auto;
  max-width: 22em;
  padding: 0.5em 1em;
  border-radius: 10px;
  /* دارک مود: بک‌گراند روشن پالت، متن تیره */
  color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 22%, #fff 78%);
  text-shadow: none;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.m-lead--compact {
  margin-bottom: 0;
}

/* آمار بزرگ */
.m-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: clamp(1rem, 3.5vh, 1.75rem) var(--pad);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(var(--gold-rgb), 0.14), rgba(var(--ink-rgb), 0.03));
  border: 1px solid rgba(var(--gold-rgb), 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.m-stat__num {
  font-size: clamp(2.4rem, 10vh, 3.75rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold-light);
  letter-spacing: -0.02em;
}

.m-stat__label {
  font-size: clamp(0.82rem, 2.2vh, 1rem);
  color: rgba(var(--ink-rgb), 0.62);
}

.m-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.4rem, 1.5vh, 0.65rem);
  width: 100%;
}

.m-grid--fill {
  grid-template-rows: auto auto;
}

.m-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 1vh, 0.45rem);
  min-height: clamp(4.5rem, 13vh, 6.5rem);
  padding: clamp(0.55rem, 1.8vh, 0.9rem) 0.45rem;
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.05);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  text-align: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.m-card:active {
  transform: scale(0.96);
  background: rgba(var(--ink-rgb), 0.09);
}

.m-card__emoji {
  font-size: clamp(1.35rem, 4.5vh, 1.85rem);
}

.m-card__label {
  font-size: clamp(0.68rem, 1.8vh, 0.8rem);
  color: rgba(var(--ink-rgb), 0.86);
  line-height: 1.35;
}

.m-card--blue { border-color: rgba(26, 110, 255, 0.35); }
.m-card--green { border-color: rgba(16, 232, 122, 0.35); }
.m-card--gold { border-color: rgba(201, 168, 76, 0.35); }
.m-card--purple { border-color: rgba(139, 92, 246, 0.35); }

.m-visual--mayor {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.m-mayor {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(38vh, 52vw);
  object-fit: cover;
  object-position: center top;
}

.m-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.45rem, 1.5vh, 0.7rem);
  width: 100%;
}

.m-lines--fill {
  padding: clamp(0.65rem, 2vh, 1rem);
  border-radius: 14px;
  background: rgba(var(--ink-rgb), 0.04);
  border: 1px solid rgba(var(--ink-rgb), 0.08);
}

.m-lines p {
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(0.82rem, 2.4vh, 0.98rem);
  color: rgba(var(--ink-rgb), 0.9);
}

.m-lines p::before {
  content: '• ';
  color: var(--green);
}

.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  width: 100%;
}

.m-chips--dense {
  flex-shrink: 0;
}

.m-chip {
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.06);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  font-size: clamp(0.62rem, 1.7vh, 0.72rem);
  color: rgba(var(--ink-rgb), 0.75);
}

/* ─── مارکوی ۴ خطی ایده‌ها ─── */
.m-marquee {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.32rem, 1.1vh, 0.5rem);
  width: 100%;
  overflow: hidden;
  --m-sway-amount: clamp(2rem, 16vw, 4.5rem);
}

.m-marquee__row {
  overflow: hidden;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.m-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  width: max-content;
  min-width: 100%;
  padding-inline: 0.2rem;
}

.m-marquee__row--sway .m-marquee__track {
  animation: m-marquee-sway var(--sway-duration, 9s) ease-in-out infinite alternate;
  will-change: transform;
}

.m-marquee__row--sway-alt .m-marquee__track {
  animation-direction: alternate-reverse;
}

@keyframes m-marquee-sway {
  from { transform: translate3d(var(--m-sway-amount), 0, 0); }
  to   { transform: translate3d(calc(-1 * var(--m-sway-amount)), 0, 0); }
}

.m-marquee-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: clamp(0.28rem, 0.9vh, 0.38rem) clamp(0.55rem, 1.6vw, 0.72rem);
  border-radius: 999px;
  background: rgba(var(--ink-rgb), 0.05);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  color: rgba(var(--ink-rgb), 0.88);
  font-family: inherit;
  font-size: clamp(0.68rem, 1.9vh, 0.78rem);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.25;
  pointer-events: none;
  user-select: none;
}

.m-marquee-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip-color, var(--green));
  flex-shrink: 0;
  box-shadow: 0 0 6px color-mix(in srgb, var(--chip-color, var(--green)) 55%, transparent);
}

.m-marquee-chip__text {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── دکمه ورود ─── */
.m-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 18rem;
  min-height: clamp(3rem, 8vh, 3.5rem);
  margin-inline: auto;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--deep);
  font-size: clamp(0.92rem, 2.6vh, 1.05rem);
  font-weight: 800;
  box-shadow: 0 10px 32px rgba(var(--gold-rgb), 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.m-app-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(var(--gold-rgb), 0.2);
}

.m-app-btn__note {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: rgba(var(--ink-rgb), 0.38);
  text-align: center;
}

.m-credit {
  font-size: var(--type-meta);
  color: rgba(var(--ink-rgb), 0.28);
  padding-bottom: 0.15rem;
}

.m-credit a {
  color: rgba(var(--gold-rgb), 0.55);
}

/* ─── تب‌بار پایین ─── */
.m-tabbar {
  flex-shrink: 0;
  height: var(--shell-bottom);
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  background: var(--header-scrolled-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(var(--ink-rgb), 0.07);
}

.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: var(--tabbar-h);
  padding: 0.3rem 0.15rem;
  color: rgba(var(--ink-rgb), 0.42);
  transition: color 0.2s ease;
}

.m-tab:active {
  color: rgba(var(--ink-rgb), 0.7);
}

.m-tab.is-active {
  color: var(--gold-light);
}

.m-tab--cta.is-active {
  color: var(--gold-light);
}

.m-tab__icon {
  width: clamp(20px, 5.5vw, 24px);
  height: clamp(20px, 5.5vw, 24px);
}

.m-tab__label {
  font-size: clamp(0.54rem, 1.5vh, 0.62rem);
  font-weight: 600;
}

/* ─── لینک دسکتاپ (فقط مرورگر) ─── */
.m-desktop-link {
  position: fixed;
  left: 0.65rem;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 0.5rem);
  z-index: 50;
  font-size: 0.6rem;
  color: rgba(var(--ink-rgb), 0.22);
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  background: var(--bg-shade);
}

@media (display-mode: standalone) {
  .m-desktop-link {
    display: none;
  }
}

@media (min-width: 769px) {
  .m-shell {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid rgba(var(--ink-rgb), 0.06);
    border-right: 1px solid rgba(var(--ink-rgb), 0.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-splash__content,
  .m-splash__tap,
  .m-swipe-hint,
  .m-screen__inner,
  .m-marquee__row--sway .m-marquee__track {
    animation: none;
  }

  .m-splash,
  .m-appbar__dot,
  .m-card,
  .m-app-btn {
    transition: none;
  }
}

/* Theme toggle + light surfaces */
.m-appbar__trailing {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* ─── انتخاب رنگ‌بندی (accent picker) ─── */
.accent-picker {
  position: relative;
  flex-shrink: 0;
  z-index: 60;
}

.accent-picker__dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 0 1.5px rgba(var(--ink-rgb), 0.25);
}

.accent-picker__pop {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: max-content;
  max-width: min(220px, calc(100vw - 2rem));
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: var(--header-scrolled-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(var(--shade-rgb), 0.3);
  z-index: 61;
}

.accent-picker.is-open .accent-picker__pop { display: flex; }

.accent-picker__swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.accent-picker__swatch--dual {
  background: linear-gradient(135deg, var(--swatch) 50%, var(--swatch2) 50%);
}
.accent-picker__swatch--wave {
  background: conic-gradient(from 0deg, #FF2D55, #FFB020, #14E8A8, #3B82F6, #A855F7, #FF2D55);
}
.accent-picker__swatch--shine {
  background: linear-gradient(135deg, #051650 42%, #F9F295 42%, #E0AA3E 62%, #FAF398 78%, #B88A44 100%);
}
.accent-picker__swatch--sharp {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.accent-picker__swatch:active { transform: scale(1.12); }

.accent-picker__swatch.is-active {
  border-color: var(--fg-strong);
  box-shadow: 0 0 0 2px rgba(var(--ink-rgb), 0.2);
}

.panel-theme-btn {
  flex-shrink: 0;
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel-theme-btn-bg);
  color: var(--panel-fg-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  padding: 0;
}

.panel-theme-btn:hover {
  background: var(--panel-theme-btn-hover);
  border-color: rgba(var(--gold-rgb), 0.35);
}

.panel-theme-btn:active { transform: scale(0.96); }

.panel-theme-btn svg {
  width: 16px;
  height: 16px;
  position: absolute;
  inset: 0;
  margin: auto;
}

.panel-theme-btn .icon-sun { display: none; }
.panel-theme-btn .icon-moon { display: block; }
html[data-theme="light"] .panel-theme-btn .icon-sun { display: block; }
html[data-theme="light"] .panel-theme-btn .icon-moon { display: none; }

html[data-theme="light"] .m-bg img,
html[data-theme="light"] .m-splash__bg img {
  filter: brightness(1.08) saturate(0.55) contrast(0.95);
  opacity: 0.5;
}

html[data-theme="light"] .m-splash__title {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--gold) 66%, #1a1204) 0%,
    color-mix(in srgb, var(--gold) 85%, #2a1d06) 24%,
    var(--gold-bright) 44%,
    var(--gold-pale) 50%,
    var(--gold) 58%,
    color-mix(in srgb, var(--gold) 76%, #1a1204) 78%,
    color-mix(in srgb, var(--gold) 66%, #1a1204) 100%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  animation: m-light-hero-gold-flow 4.5s ease-in-out infinite;
}

@keyframes m-light-hero-gold-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

html[data-theme="light"] .m-title--gold,
html[data-theme="light"] .m-title--xl {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--gold) 66%, #1a1204) 0%,
    color-mix(in srgb, var(--gold) 85%, #2a1d06) 24%,
    var(--gold-bright) 44%,
    var(--gold-pale) 50%,
    var(--gold) 58%,
    color-mix(in srgb, var(--gold) 76%, #1a1204) 78%,
    color-mix(in srgb, var(--gold) 66%, #1a1204) 100%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  animation: m-light-hero-gold-flow 4.5s ease-in-out infinite;
}

html[data-theme="light"] .m-splash__hint {
  color: rgba(15, 23, 42, 0.7);
  border-color: rgba(var(--gold-rgb), 0.4);
  background: rgba(var(--gold-rgb), 0.12);
}

html[data-theme="light"] .m-appbar::before {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .accent-picker__pop {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .m-appbar__title {
  color: var(--fg-strong);
}

html[data-theme="light"] .m-chip {
  color: var(--gold-dark);
  background: color-mix(in srgb, var(--gold-bright) 30%, transparent);
  border-color: rgba(var(--gold-rgb), 0.38);
}

html[data-theme="light"] .m-splash__tagline,
html[data-theme="light"] .m-lead:not(.m-lead--lg),
html[data-theme="light"] .m-meta__label {
  color: rgba(15, 23, 42, 0.62);
  text-shadow: none;
}

html[data-theme="light"] .m-lead--lg {
  color: #fff;
  background: color-mix(in srgb, var(--gold) 55%, #0a0610 45%);
  text-shadow: none;
}
html.accent-wave .m-lead--lg {
  transition: none;
}

html[data-theme="light"] .m-card,
html[data-theme="light"] .m-app-btn:not(.m-app-btn--primary):not(#mLoginBtn) {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] #mLoginBtn {
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 82%, #fff) 0%, var(--gold-bright) 45%, var(--gold-pale) 100%);
  color: var(--gold-deep);
  border-color: transparent;
  box-shadow: 0 2px 14px rgba(var(--gold-rgb), 0.45);
}

html[data-theme="light"] .m-tabbar {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: var(--border);
}

