@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0F1720;
  --surface: #17212C;
  --surface-2: #1E2A38;
  --line: #2A3746;
  --brass: #C9975A;
  --brass-2: #E3B87C;
  --jade: #3FA88C;
  --jade-2: #57C4A6;
  --danger: #D97164;
  --text: #EDEAE3;
  --text-muted: #93A1AF;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(201,151,90,0.10), transparent 60%),
    radial-gradient(120% 60% at 0% 0%, rgba(63,168,140,0.08), transparent 55%),
    var(--bg);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}

.topbar .brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.topbar .brand span { color: var(--brass); }

.balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--jade-2);
  font-weight: 600;
}

/* ---------- Main content ---------- */
main {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 110px;
}

h1.page-title {
  font-size: 22px;
  font-weight: 800;
  margin: 8px 0 16px;
}

.section-label {
  font-size: 13px;
  color: var(--text-muted);
  margin: 22px 0 10px;
  font-weight: 500;
}

/* ---------- Wallet hero card (metaphor: a physical card) ---------- */
.wallet-card {
  border-radius: 20px;
  padding: 22px;
  /* کادر طلایی ثابت (بدون انیمیشن) */
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, #1B2A2A 0%, #14252A 55%, #101C22 100%) padding-box,
    linear-gradient(135deg, #F3D9A8 0%, #C9975A 35%, rgba(227, 184, 124, .45) 60%, #E3B87C 100%) border-box;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 32, .85), 0 4px 14px rgba(0, 0, 0, .4), 0 0 14px rgba(227, 184, 124, .18);
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}

.wallet-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 26px);
  pointer-events: none;
}

.wallet-card .label {
  font-size: 13px;
  color: var(--jade-2);
  font-weight: 600;
}

.wallet-card .amount {
  font-size: 32px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.wallet-card .amount small {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.wallet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--brass); color: #1B140B; }
.btn-jade { background: var(--jade); color: #0B1C17; }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: rgba(217,113,100,0.15); color: var(--danger); border: 1px solid rgba(217,113,100,0.3); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Product / list cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
}

.product-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.product-card .name { font-weight: 700; font-size: 15px; }
.product-card .serial-type { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-top: 6px; }
.product-card .desc { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
/* قیمت محصول: کادر نورانی که دور قیمت می‌چرخد */
@property --pt-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes ptPriceSpin { to { --pt-angle: 360deg; } }
.product-card .price {
  color: var(--brass-2); font-weight: 700; font-size: 13.5px; margin-top: 8px;
  display: inline-block;
  padding: 5px 12px;
  border: 2px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--pt-angle),
      rgba(227, 184, 124, .18) 0%,
      rgba(227, 184, 124, .18) 55%,
      rgba(227, 184, 124, .75) 88%,
      rgba(243, 217, 168, .9) 100%) border-box;
  animation: ptPriceSpin 14s linear infinite;
}
.stock-tag { font-size: 11px; color: var(--text-muted); }
.stock-tag.low { color: var(--danger); }

.row-between { display: flex; justify-content: space-between; align-items: center; }

.tx-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tx-row:last-child { border-bottom: none; }
.tx-amount.pos { color: var(--jade-2); font-weight: 700; }
.tx-amount.neg { color: var(--danger); font-weight: 700; }
.tx-meta { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }

/* ---------- Forms ---------- */
label { font-size: 13px; color: var(--text-muted); display: block; margin: 14px 0 6px; }
input, textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
textarea { resize: vertical; min-height: 70px; }

/* ---------- Bottom nav ---------- */
nav.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(23,33,44,0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}

nav.bottom-nav button {
  flex: 1;
  min-width: 0;
  text-align: center;
  line-height: 1.3;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  cursor: pointer;
}
nav.bottom-nav button .ic {
  font-size: 18px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  /* حلقه‌ی ثابت و ظریف دور آیکن (بدون هیچ انیمیشن) */
  background: radial-gradient(circle at 30% 25%, rgba(227, 184, 124, .16), rgba(30, 42, 56, .9) 70%);
  border: 1.5px solid rgba(227, 184, 124, .35);
  box-shadow: inset 0 0 0 2px rgba(15, 23, 32, .85), 0 2px 6px rgba(0, 0, 0, .35);
}
nav.bottom-nav button.active { color: var(--brass-2); }
nav.bottom-nav button.active .ic {
  border-color: var(--brass-2);
  background: radial-gradient(circle at 30% 25%, rgba(227, 184, 124, .32), rgba(30, 42, 56, .9) 72%);
  box-shadow: inset 0 0 0 2px rgba(15, 23, 32, .85), 0 0 8px rgba(227, 184, 124, .35);
}

/* ---------- Admin ---------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}
.admin-tabs button {
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.admin-tabs button.active { background: var(--brass); color: #1B140B; border-color: var(--brass); font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat-box .n { font-size: 22px; font-weight: 800; color: var(--brass-2); }
.stat-box .l { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-box.clickable { cursor: pointer; }
.stat-box.clickable:active { opacity: 0.8; }

.badge { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.badge.pending { background: rgba(201,151,90,0.15); color: var(--brass-2); }
.badge.approved { background: rgba(63,168,140,0.18); color: var(--jade-2); }
.badge.rejected { background: rgba(217,113,100,0.15); color: var(--danger); }

/* ---------- Chat (support) ---------- */
.chat-scroll { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; }
.bubble.user { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.bubble.admin { align-self: flex-end; background: rgba(201,151,90,0.16); border: 1px solid rgba(201,151,90,0.3); }
.chat-input-row { display: flex; gap: 8px; position: sticky; bottom: 0; padding-top: 10px; background: var(--bg); }

/* ---------- پشتیبانی سریع آنلاین (چت زنده با ادمین) ---------- */
.qs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qs-title { font-weight: 700; font-size: 15px; }
.qs-sub { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.qs-scroll { overflow-y: auto; max-height: calc(100dvh - 300px); min-height: 220px; padding: 4px 2px 10px; scroll-behavior: smooth; }
.bubble { overflow-wrap: anywhere; }
.bubble.system { align-self: center; max-width: 92%; text-align: center; background: transparent; border: 1px dashed var(--line); color: var(--text-muted); font-size: 12px; white-space: pre-line; }
.bubble .qs-name { font-size: 11.5px; font-weight: 700; color: var(--brass-2, var(--brass)); margin-bottom: 3px; }
.bubble .qs-text { white-space: pre-wrap; }
.bubble .qs-time { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; text-align: left; direction: ltr; }
.bubble .qs-media { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-bottom: 6px; cursor: zoom-in; }
.bubble video.qs-media { cursor: default; }
.bubble .qs-file { display: inline-block; margin: 2px 0 4px; color: var(--brass); font-size: 12.5px; word-break: break-all; }
.bubble .qs-serial { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; text-align: left; white-space: pre-wrap; user-select: all; background: rgba(0,0,0,0.18); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.qs-notice { text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 1.8; padding: 8px 6px; }
.qs-input .btn { flex: 0 0 auto; }
.qs-input input[type="text"], .qs-input input#qs-input { flex: 1 1 auto; min-width: 0; }
.qs-chip { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; margin-top: 6px; }
.qs-chip span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.qs-chip button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 10px; font-size: 13.5px; }
.toast {
  position: fixed;
  bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  z-index: 50; max-width: 90%; text-align: center;
}
.center-screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.auth-logo { text-align: center; font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-logo span { color: var(--brass); }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.link-btn { background: none; border: none; color: var(--jade-2); font-family: inherit; font-size: 13px; cursor: pointer; }

/* ---------- دکمه‌ی ریز «اطلاع بده» زیر دکمه‌ی ناموجود ---------- */
.btn-link-notify {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  color: var(--brass-2, #c9975a);
  cursor: pointer;
  text-align: center;
}
.btn-link-notify:hover { text-decoration: underline; }
.btn-link-notify:disabled { opacity: 0.6; cursor: default; text-decoration: none; }

/* ---------- Promo marquee banner (فروشگاه) ---------- */
.promo-marquee {
  display: flex;
  align-items: stretch;
  margin: 4px 0 16px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(201,151,90,0.22), rgba(227,184,124,0.12) 60%, rgba(63,168,140,0.14));
  border: 1px solid rgba(201,151,90,0.45);
  box-shadow: 0 0 0 0 rgba(201,151,90,0.5);
  animation: promo-glow 2.4s ease-in-out infinite;
}

.promo-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--brass);
  color: #1B140B;
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
  z-index: 2;
}

.promo-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  direction: ltr; /* جهت حرکت ثابت: از چپ وارد، از راست خارج */
  padding: 9px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.promo-track {
  display: flex;
  width: max-content;
  animation: promo-scroll var(--promo-dur, 20s) linear infinite;
  will-change: transform;
}

.promo-group { display: flex; flex-shrink: 0; align-items: center; }

.promo-item {
  direction: rtl;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brass-2);
  padding: 0 14px;
}

.promo-sep { color: var(--jade-2); font-size: 11px; opacity: 0.9; }

.promo-marquee:hover .promo-track,
.promo-marquee:active .promo-track { animation-play-state: paused; }

@keyframes promo-scroll {
  /* حرکت از چپ به راست: از چپ وارد می‌شود و از راست خارج می‌شود */
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

@keyframes promo-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,151,90,0.45); }
  50%      { box-shadow: 0 0 14px 2px rgba(201,151,90,0.28); }
}

@media (prefers-reduced-motion: reduce) {
  .promo-track { animation: none; }
  .promo-viewport { overflow-x: auto; }
  .promo-marquee { animation: none; }
}


/* چشمک‌زدنِ کاملِ متن مهلت فعال‌سازی (تا وقتی مهلت تموم نشده) */
@keyframes ptBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .2; }
}
.blink-warn { animation: ptBlink 1.1s ease-in-out infinite; }


/* کادر هشدار «احراز هویت نشده» بالای فروشگاه: کل کادر چشمک می‌زنه تا کاربر حتماً متوجه بشه */
@keyframes verifyBlink {
  0%, 100% {
    border-color: rgba(239,68,68,.35);
    background-color: rgba(239,68,68,.04);
    box-shadow: 0 0 0 0 rgba(239,68,68,0);
  }
  50% {
    border-color: #ef4444;
    background-color: rgba(239,68,68,.18);
    box-shadow: 0 0 16px 3px rgba(239,68,68,.55);
  }
}
.verify-blink {
  border: 2px solid #ef4444;
  animation: verifyBlink 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .verify-blink { animation: none; background-color: rgba(239,68,68,.12); }
}

/* ---------- انتخاب نوع سریال در صفحه‌ی خرید | قیمت ---------- */
.serial-chooser { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.serial-choice-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 16px 10px; border-radius: 16px; cursor: pointer;
  font-family: inherit; text-align: center; color: var(--text);
  /* همان کادر نورانیِ چرخانِ دور قیمت */
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--pt-angle),
      rgba(227, 184, 124, .18) 0%,
      rgba(227, 184, 124, .18) 55%,
      rgba(227, 184, 124, .75) 88%,
      rgba(243, 217, 168, .9) 100%) border-box;
  animation: ptPriceSpin 14s linear infinite;
  transition: transform .15s;
}
.serial-choice-card:active { transform: scale(0.96); }
.serial-choice-card .sc-ic { font-size: 34px; }
.serial-choice-card .sc-title { font-weight: 700; font-size: 14px; line-height: 1.6; }
.serial-choice-card .sc-count { font-size: 12px; color: var(--jade-2); }
@media (max-width: 340px) { .serial-chooser { grid-template-columns: 1fr; } }

@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); }  to { opacity: 1; transform: translateX(0); } }
.slide-in-left  { animation: slideInLeft .45s ease-out both; }
.slide-in-right { animation: slideInRight .45s ease-out both; }

.btn-first-deposit.is-locked { opacity: .5; filter: grayscale(.6); }

/* ---------- بنر تکمیل فرایند (سریال کددار) ---------- */
.imei-notice { background: #fff; border-radius: var(--radius); padding: 22px 16px 18px; margin-bottom: 12px; text-align: center; color: #444; }
.imei-notice-ic { width: 84px; height: 84px; display: block; margin: 0 auto 12px; }
.imei-notice-title { font-size: 20px; font-weight: 800; color: #444; margin-bottom: 14px; }
.imei-notice-text { font-size: 13px; color: #555; line-height: 1.9; text-align: right; }
.imei-notice-warn { padding-top: 26px; padding-bottom: 22px; }
.imei-notice-warn .imei-notice-ic { margin-bottom: 26px; }
.imei-notice-warn .imei-notice-text { text-align: center; font-size: 14px; }
.imei-notice-hl { color: #e8923a; }
.imei-notice-dialog { border: 1px solid #eee; margin-bottom: 10px; }

/* کارت‌های انتخاب نوع سریال: زیر هم تا بنرها هم‌اندازه‌ی اصلی بمانند */
.serial-chooser { grid-template-columns: 1fr !important; }
.serial-choice-card { min-height: 0; }
.serial-choice-card .imei-notice-choice { width: 100%; margin-bottom: 0; }
.serial-choice-card .imei-notice-choice .imei-notice-text { text-align: center; }

/* قاب طلایی ثابت (همانند کادر کیف پول) */
.card.gold-frame {
  border-radius: 20px;
  padding: 22px;
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, #1B2A2A 0%, #14252A 55%, #101C22 100%) padding-box,
    linear-gradient(135deg, #F3D9A8 0%, #C9975A 35%, rgba(227, 184, 124, .45) 60%, #E3B87C 100%) border-box;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 32, .85), 0 4px 14px rgba(0, 0, 0, .4), 0 0 14px rgba(227, 184, 124, .18);
}

/* ---------- نشانگر «در انتظار تایید ادمین» بالای کیف پول ---------- */
.deposit-waiting {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin: 6px 0 12px;
  border-radius: 16px;
  background: rgba(227, 184, 124, .08);
  border: 1px solid rgba(227, 184, 124, .35);
}
.dw-spinner { position: relative; width: 46px; height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.dw-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(227, 184, 124, .22);
  border-top-color: var(--brass-2);
  animation: dwSpin 1.1s linear infinite;
}
.dw-ic { font-size: 20px; }
.dw-title { font-weight: 700; font-size: 14px; color: var(--brass-2); }
.dw-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.7; }
@keyframes dwSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dw-ring { animation-duration: 3s; } }

/* نوار ثابت وضعیت‌های در انتظار تایید (بالای همه‌ی صفحات) */
/* کادر اطلاعیه: بالاترین بخش، بالای «سریال وان» و موجودی، ثابت */
#promo-global { position: sticky; top: 0; z-index: 61; padding: 0 18px; background: var(--bg); }
#promo-global .promo-marquee { margin: 6px 0; }
/* نوار «در انتظار تایید»: ثابت و چسبیده‌ی زیر کادر اطلاعیه */
#status-bar { position: sticky; top: calc(var(--promo-h, 0px) + var(--topbar-h, 0px)); z-index: 59; padding: 0 18px; background: var(--bg); }
/* هدر (سریال وان + موجودی + حساب کاربری) ثابت، زیر کادر اطلاعیه */
.topbar { position: sticky; top: 0; z-index: 60; background: var(--bg); padding: 10px 18px 8px; gap: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-actions .btn-sm { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
.topbar-actions .balance-chip { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
#status-bar .deposit-waiting { margin: 6px 0; }
#status-bar .deposit-waiting { padding: 8px 12px; gap: 12px; background: linear-gradient(rgba(227, 184, 124, .10), rgba(227, 184, 124, .10)), var(--surface); }
#status-bar .dw-spinner { width: 38px; height: 38px; }
#status-bar .dw-ic { font-size: 16px; }

/* ---------- جشن شارژ موفق ---------- */
#charged-celebrate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 18, .72); overflow: hidden; animation: ccFade .3s ease-out both; }
.cc-confetti { position: absolute; inset: 0; pointer-events: none; }
.cc-confetti i { position: absolute; top: -20px; border-radius: 2px; opacity: .95; animation-name: ccFall; animation-timing-function: linear; animation-iteration-count: 1; animation-fill-mode: both; }
@keyframes ccFall { to { top: 105%; transform: translateX(30px) rotate(540deg); } }
@keyframes ccFade { from { opacity: 0; } to { opacity: 1; } }
.cc-sticker { position: relative; text-align: center; padding: 22px 26px; border-radius: 22px; background: linear-gradient(135deg, #1B2A2A, #101C22); border: 2px solid #C9975A; box-shadow: 0 0 30px rgba(227, 184, 124, .35); animation: ccPop .6s cubic-bezier(.2, 1.4, .4, 1) both; max-width: 86%; }
@keyframes ccPop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.cc-badge { position: relative; width: 110px; height: 110px; margin: 0 auto 10px; }
.cc-badge svg { width: 100%; height: 100%; }
.cc-badge path { stroke-dasharray: 90; stroke-dashoffset: 90; animation: ccDraw .6s .4s ease-out forwards; }
@keyframes ccDraw { to { stroke-dashoffset: 0; } }
.cc-spark { position: absolute; font-size: 22px; animation: ccTwinkle 1.2s ease-in-out infinite; }
.cc-s1 { top: -6px; right: -8px; } .cc-s2 { bottom: 4px; left: -10px; animation-delay: .4s; } .cc-s3 { top: 6px; left: -6px; animation-delay: .8s; font-size: 18px; }
@keyframes ccTwinkle { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.2); opacity: 1; } }
.cc-title { font-weight: 800; font-size: 19px; color: var(--brass-2); }
.cc-amount { margin-top: 8px; font-weight: 800; font-size: 22px; color: var(--jade-2); }

/* ---------- فلش‌های قبلی/بعدی پایین لیست محصولات ---------- */
.serial-bottom-nav { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.serial-arrow {
  flex: 1; padding: 11px 10px; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; color: var(--brass-2);
  background: var(--surface); border: 1px solid rgba(227, 184, 124, .4);
}
.serial-arrow:active { transform: scale(0.97); }
.cc-amount.cc-sub { font-size: 14px; font-weight: 600; }

/* اندازه‌ی کادر اطلاعیه ثابت است؛ تعداد/طول کلمات روی ارتفاع و عرض آن اثری ندارد */
#promo-global { overflow: hidden; contain: layout paint; max-width: 100%; }
.promo-marquee { height: 40px; max-width: 100%; contain: layout paint; }
.promo-badge { max-width: 38%; overflow: hidden; text-overflow: ellipsis; }
.promo-viewport { padding: 0; display: flex; align-items: center; }
.promo-track { flex-shrink: 0; height: 100%; align-items: center; }
.promo-item { line-height: 1.2; white-space: nowrap; }

/* چیدمان هدر: مبلغ (چپ) | سریال وان (وسط) | حساب کاربری (راست)؛ زیرش اطلاعیه؛ همه ثابت */
.topbar.topbar-user {
  position: sticky; top: 0; z-index: 62;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  direction: ltr; gap: 6px; padding: 10px 14px 8px;
}
.topbar-user .brand { justify-self: center; direction: rtl; font-size: 19px; }
.topbar-user .balance-chip { justify-self: start; direction: rtl; max-width: 100%; padding: 6px 9px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.topbar-user #btn-my-account { justify-self: end; direction: rtl; max-width: 100%; padding: 6px 9px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#promo-global { top: var(--topbar-h, 0px); z-index: 61; }
#status-bar { z-index: 60; }

/* ---------- دکمه‌ی ماه/خورشید ---------- */
.topbar-user .topbar-right { justify-self: end; display: flex; align-items: center; gap: 6px; direction: rtl; min-width: 0; }
.theme-toggle {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-2); background: var(--surface-2); border: 1.5px solid rgba(227, 184, 124, .45);
}
.theme-toggle:active { transform: scale(0.94); }

/* ---------- حالت روز ---------- */
html[data-theme="light"] {
  --bg: #F4F1EA; --surface: #FFFFFF; --surface-2: #F0ECE3; --line: #E0D9CA;
  --brass: #B07B2F; --brass-2: #9A6A22; --jade: #1F8A6F; --jade-2: #17725C;
  --danger: #C0453A; --text: #1F2933; --text-muted: #5F6C7B;
}
html[data-theme="light"] nav.bottom-nav { background: rgba(255, 255, 255, .94); }
html[data-theme="light"] nav.bottom-nav button .ic {
  background: radial-gradient(circle at 30% 25%, rgba(176, 123, 47, .14), #FBF8F1 70%);
  box-shadow: inset 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .12);
  border-color: rgba(176, 123, 47, .45);
}
html[data-theme="light"] nav.bottom-nav button.active .ic {
  background: radial-gradient(circle at 30% 25%, rgba(176, 123, 47, .28), #FBF3E3 72%);
  border-color: var(--brass-2);
  box-shadow: inset 0 0 0 2px #fff, 0 0 8px rgba(176, 123, 47, .3);
}
html[data-theme="light"] .wallet-card,
html[data-theme="light"] .card.gold-frame {
  background:
    linear-gradient(135deg, #FFFDF7 0%, #F8F1E2 55%, #F1E8D2 100%) padding-box,
    linear-gradient(135deg, #E9C98F 0%, #B07B2F 35%, rgba(201, 151, 90, .5) 60%, #D6A862 100%) border-box;
  box-shadow: inset 0 0 0 2px #fff, 0 4px 14px rgba(0, 0, 0, .1), 0 0 12px rgba(176, 123, 47, .18);
}
html[data-theme="light"] .wallet-card::after { background-image: none; }
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .btn-jade { color: #fff; }
html[data-theme="light"] .promo-marquee,
html[data-theme="light"] #promo-global .promo-marquee { box-shadow: none; }
html[data-theme="light"] .deposit-waiting { background: linear-gradient(rgba(176, 123, 47, .10), rgba(176, 123, 47, .10)), var(--surface); }
html[data-theme="light"] #status-bar .deposit-waiting { background: linear-gradient(rgba(176, 123, 47, .10), rgba(176, 123, 47, .10)), var(--surface); }
html[data-theme="light"] .theme-toggle { background: #fff; border-color: rgba(176, 123, 47, .5); }
html[data-theme="light"] .imei-notice { box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
/* ---------- بنر «ادمین آنلاین شد» (بالای صفحه، در همه‌ی بخش‌ها) ---------- */
.admin-online-banner {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%;
  transform: translateX(-50%); z-index: 9999;
  width: calc(100% - 24px); max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--jade-2, #57C4A6);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.7;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  animation: aobIn .35s ease-out;
}
.admin-online-banner .aob-ico { font-size: 20px; animation: aobRing 1s ease-in-out 3; }
.admin-online-banner .aob-text { flex: 1 1 auto; min-width: 0; }
.admin-online-banner .aob-go { background: var(--jade-2, #57C4A6); color: #0F1720; border: none; border-radius: 8px; padding: 5px 10px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.admin-online-banner .aob-x { background: none; border: none; color: var(--text-muted); font-size: 15px; cursor: pointer; }
@keyframes aobIn { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes aobRing { 0%,100% { transform: rotate(0); } 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }

/* ---------- حالت چت: صفحه‌ی ثابت، فقط لیست پیام‌ها اسکرول میشه؛ کادر تایپ همیشه پایین ---------- */
body.qs-chat-open { overflow: hidden; }
body.qs-chat-open #app {
  height: var(--vvh, 100dvh); min-height: 0; overflow: hidden;
  position: relative; top: var(--vvt, 0px);
}
body.qs-chat-open main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; padding-bottom: 0; }
body.qs-chat-open #qs-chat { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body.qs-chat-open .qs-scroll { flex: 1 1 auto; max-height: none; min-height: 0; scroll-behavior: auto; overscroll-behavior: contain; }
body.qs-chat-open .qs-input { position: static; padding: 8px 0 6px; flex: 0 0 auto; }
body.qs-chat-open nav.bottom-nav { position: static; flex: 0 0 auto; }
body.qs-chat-open.qs-kbd nav.bottom-nav { display: none; }
body.qs-chat-open #qs-input { font-size: 16px; } /* جلوگیری از زوم خودکار iOS هنگام فوکوس */

/* ---------- کادر تایپ چت: فلش سبز ارسال داخل کادر + دکمه‌ی بازگشت ---------- */
.qs-field { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.qs-field input#qs-input { width: 100%; padding-inline-end: 50px; box-sizing: border-box; }
.qs-send-arrow {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(135deg, #3FA88C, #57C4A6); box-shadow: 0 2px 8px rgba(63,168,140,.45);
  transition: transform .12s ease, opacity .15s ease;
}
.qs-send-arrow:active { transform: translateY(-50%) scale(.92); }
.qs-send-arrow:disabled { opacity: .55; }
.qs-send-arrow.sending svg { animation: qsPulse .8s ease-in-out infinite; }
@keyframes qsPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.qs-back { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; white-space: nowrap; font-size: 12.5px; }
