/* ============================================================
   SINOX API — CONTEST.CSS («جدال پنجشنبه‌ها»)
   وابسته به tokens/base/components/chrome. موبایل‌اول؛ هدف‌های لمسی ≥ ۴۴px.
   ============================================================ */

.ct-main { overflow-x: clip; }

/* ---------- مدال‌ها (در هر دو تم یکسان؛ متن تیره روی زمینهٔ روشن) ---------- */
:root {
  --ct-gold: linear-gradient(135deg, #fde68a, #f59e0b);
  --ct-silver: linear-gradient(135deg, #f1f5f9, #94a3b8);
  --ct-bronze: linear-gradient(135deg, #fed7aa, #c2410c);
  --ct-medal-ink: #1a1a2e;
  --ct-me-bg: rgba(6, 182, 212, 0.12);
  --ct-me-border: rgba(6, 182, 212, 0.55);
}
:root[data-theme="light"] {
  --ct-me-bg: rgba(8, 145, 178, 0.09);
  --ct-me-border: rgba(8, 145, 178, 0.5);
}

/* ================= ۱. هیرو ================= */
.ct-hero {
  position: relative;
  padding-block: var(--space-14) var(--space-10);
  background:
    radial-gradient(760px 420px at 90% -10%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(560px 380px at 10% 110%, rgba(245, 158, 11, .07), transparent 65%);
}
.ct-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: radial-gradient(var(--dots) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 70%);
}
.ct-hero-grid { position: relative; display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: center; }
.ct-hero-grid > * { min-width: 0; }
@media (min-width: 960px) { .ct-hero-grid { grid-template-columns: 1.25fr 1fr; gap: var(--space-12); } }

.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 14px;
  border-radius: var(--radius-full); border: 1px solid var(--border-2); background: var(--elev-1);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2);
}
.ct-chip-live { border-color: var(--green-border-tint); background: var(--green-tint); color: var(--green-light); }
.ct-chip-live.is-frozen { border-color: var(--yellow-border-tint); background: var(--yellow-tint); color: var(--yellow-light); }
.ct-chip-live.is-frozen .ct-dot { background: var(--yellow); animation: none; }
.ct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: sx-pulse-ring 2.2s infinite; flex-shrink: 0; }

.ct-h1 {
  margin-top: var(--space-5);
  background: var(--grad-text-hero); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ct-lede { margin-top: var(--space-4); max-width: 560px; font-size: var(--fs-xl); line-height: var(--lh-loose); color: var(--text-muted); }
.ct-dates { margin-top: var(--space-3); font-size: var(--fs-md); color: var(--text-2); font-weight: var(--fw-semibold); }
@media (max-width: 640px) {
  .ct-hero { padding-block: var(--space-8) var(--space-6); }
  .ct-lede { font-size: var(--fs-md); line-height: var(--lh-relaxed); }
  .ct-dates { font-size: var(--fs-sm); }
}

/* شمارش معکوس */
.ct-count .card-gradient-inner { padding: var(--space-6); text-align: center; }
.ct-count-label { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-muted); }
.ct-count-grid { margin-top: var(--space-4); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); direction: rtl; }
.ct-count-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-4) var(--space-2);
  border-radius: var(--radius-xl); background: var(--elev-2); border: 1px solid var(--border-1);
}
.ct-count-cell b {
  font-size: clamp(30px, 4vw, 46px); font-weight: var(--fw-black); line-height: 1.1; font-variant-numeric: tabular-nums;
  background: var(--grad-text-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ct-count-cell span { font-size: var(--fs-sm); color: var(--text-muted); }
.ct-count-foot { margin-top: var(--space-4); font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.ct-count.is-done .ct-count-grid { opacity: .45; }

/* ================= اعلان‌ها ================= */
.ct-notice {
  margin-top: var(--space-6); padding: var(--space-4) var(--space-5); border-radius: var(--radius-xl);
  border: 1px solid var(--yellow-border-tint); background: var(--yellow-tint); color: var(--text-1); font-size: var(--fs-base);
}
.ct-past-banner {
  margin-top: var(--space-6); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); border: 1px solid var(--yellow-border-tint); background: var(--yellow-tint);
  font-size: var(--fs-base); color: var(--text-1);
}
.ct-past-banner .btn { margin-inline-start: auto; min-height: 44px; }
.ct-lottery {
  margin-top: var(--space-4); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-xl); border: 1px solid var(--primary-border-tint);
  background: linear-gradient(135deg, var(--primary-tint), transparent 70%), var(--card); font-size: var(--fs-md);
}
.ct-lot-name { font-family: var(--font-mono); font-weight: var(--fw-bold); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

/* ================= ۲. جدول‌ها ================= */
.ct-boards { margin-top: var(--space-8); display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.ct-boards > * { min-width: 0; }
@media (min-width: 960px) { .ct-boards { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }

.ct-board {
  background: var(--card); border: 1px solid var(--border-1); border-radius: var(--radius-2xl);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4);
}
@media (max-width: 640px) { .ct-board { padding: var(--space-4) var(--space-3); border-radius: var(--radius-xl); } }

.ct-board-head { display: flex; align-items: center; gap: var(--space-3); }
.ct-board-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center;
}
.ct-ic-req { background: var(--cyan-tint); color: var(--cyan-light); }
.ct-ic-tok { background: var(--primary2-tint); color: var(--primary2-light); }
.ct-board-titles { flex: 1; min-width: 0; }
.ct-board-titles h2 { font-size: var(--fh-h4); font-weight: var(--fw-black); }
.ct-board-titles p { font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-snug); margin-top: 2px; }
.ct-board-count { flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-muted); border: 1px solid var(--border-1); border-radius: var(--radius-full); padding: 3px 10px; white-space: nowrap; }
.ct-board-count:empty { display: none; }

/* کارت «رتبهٔ شما» */
.ct-me:empty { display: none; }
.ct-me {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; min-height: 52px;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg);
  border: 1px solid var(--ct-me-border); background: var(--ct-me-bg); font-size: var(--fs-base); color: var(--text-1);
}
.ct-me-rank { font-weight: var(--fw-black); font-size: var(--fs-lg); }
.ct-me-score { color: var(--text-2); }
.ct-me-sub { flex-basis: 100%; font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.ct-me.is-guest { border-style: dashed; border-color: var(--border-2); background: var(--elev-1); justify-content: space-between; }
.ct-me.is-guest a { display: inline-flex; align-items: center; min-height: 44px; font-weight: var(--fw-bold); }
.ct-me.is-muted { border-color: var(--border-2); background: var(--elev-1); color: var(--text-muted); }

/* ردیف‌ها */
.ct-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-row {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); row-gap: 6px;
  min-height: 52px; padding: 8px var(--space-3); border-radius: var(--radius-lg); border: 1px solid transparent; background: var(--elev-1);
}
.ct-row-skel { display: block; }
.ct-row-skel .skeleton { display: block; margin-top: 12px; width: 70%; }
.ct-row.is-me { border-color: var(--ct-me-border); background: var(--ct-me-bg); }
.ct-row.is-me::after {
  content: 'شما'; position: absolute; top: -8px; inset-inline-end: 12px; padding: 0 8px; border-radius: var(--radius-full);
  background: var(--cyan); color: #fff; font-size: 11px; font-weight: var(--fw-bold); line-height: 18px;
}
.ct-rank {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-black); font-size: var(--fs-md); color: var(--text-muted); background: var(--elev-2); border: 1px solid var(--border-1);
  font-variant-numeric: tabular-nums;
}
.ct-rank.r1, .ct-rank.r2, .ct-rank.r3 { color: var(--ct-medal-ink); border: none; box-shadow: var(--shadow-ink); }
.ct-rank.r1 { background: var(--ct-gold); }
.ct-rank.r2 { background: var(--ct-silver); }
.ct-rank.r3 { background: var(--ct-bronze); }
.ct-row.top3 { background: linear-gradient(90deg, transparent, var(--surface-tint)), var(--elev-1); }
.ct-name {
  font-family: var(--font-mono); font-size: var(--fs-md); color: var(--text-1); direction: ltr; text-align: right;
  unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}
.ct-score { font-weight: var(--fw-extrabold); font-size: var(--fs-md); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-1); }
.ct-score small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.ct-namecell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ct-namecell .ct-name { min-width: 0; }
.ct-prize-tag { flex-shrink: 0; }
.ct-bar { grid-column: 2 / 4; height: 4px; border-radius: var(--radius-full); background: var(--border-soft); overflow: hidden; }
.ct-bar i { display: block; height: 100%; border-radius: inherit; min-width: 3px; }
[data-board="requests"] .ct-bar i { background: linear-gradient(270deg, var(--primary), var(--cyan)); }
[data-board="tokens"] .ct-bar i { background: linear-gradient(270deg, var(--primary), var(--primary2)); }
@media (max-width: 400px) {
  .ct-row { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 10px; padding-inline: 10px; }
  .ct-rank { width: 32px; height: 32px; font-size: var(--fs-base); }
  .ct-name, .ct-score { font-size: var(--fs-base); }
}

.ct-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center;
  padding: var(--space-10) var(--space-5); border: 1px dashed var(--border-2); border-radius: var(--radius-xl); background: var(--elev-1);
}
.ct-empty svg { color: var(--text-dim); }
.ct-empty b { font-size: var(--fs-lg); color: var(--text-1); }
.ct-empty p { font-size: var(--fs-sm); color: var(--text-muted); max-width: 320px; }

.ct-board-note { margin-top: var(--space-3); font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }

.ct-past { margin-top: var(--space-6); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-past-label { font-size: var(--fs-sm); color: var(--text-muted); margin-inline-end: 4px; }
.ct-past a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-full);
  border: 1px solid var(--border-2); background: var(--elev-1); color: var(--text-2); font-size: var(--fs-sm);
}
.ct-past a:hover, .ct-past a[aria-current="page"] { border-color: var(--primary); color: var(--text-1); }

/* ================= بخش‌ها ================= */
.ct-section { margin-top: var(--space-16); }
@media (max-width: 640px) { .ct-section { margin-top: var(--space-10); } }
.ct-sec-head { margin-bottom: var(--space-5); }
.ct-sec-head h2 { font-size: var(--fh-h3); }
.ct-sec-head p { margin-top: 6px; color: var(--text-muted); font-size: var(--fs-base); }

/* ۳. جایزه‌ها: دو کارت جدول کنار هم + کارت قرعه تمام‌عرض */
.ct-prizes { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.ct-prizes > * { min-width: 0; }
@media (min-width: 760px) {
  .ct-prizes { grid-template-columns: 1fr 1fr; }
  .ct-prizes .ct-prize:nth-child(3):last-child { grid-column: 1 / -1; }
}
.ct-prize {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border-1);
  border-radius: var(--radius-2xl); padding: var(--space-5);
}
.ct-prize::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: linear-gradient(180deg, var(--primary), var(--cyan)); }
.ct-prize:nth-child(2)::before { background: linear-gradient(180deg, var(--primary2), var(--primary)); }
.ct-prize:nth-child(3)::before { background: var(--ct-gold); }
.ct-prize h3 { font-size: var(--fh-h4); margin-bottom: var(--space-3); }
.ct-prize ul, .ct-prize ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: ctp; }
.ct-prize li {
  counter-increment: ctp; display: flex; align-items: center; gap: var(--space-3); min-height: 48px;
  padding: 8px var(--space-3); border-radius: var(--radius-lg); background: var(--elev-1); color: var(--text-1); font-size: var(--fs-md);
}
.ct-prize li::before {
  content: counter(ctp, persian); flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-black); font-size: var(--fs-sm); color: var(--ct-medal-ink); background: var(--elev-3);
}
.ct-prize li:nth-child(1)::before { background: var(--ct-gold); }
.ct-prize li:nth-child(2)::before { background: var(--ct-silver); }
.ct-prize li:nth-child(3)::before { background: var(--ct-bronze); }
.ct-prize:nth-child(3):last-child li::before { content: '★'; background: var(--grad-brand); color: #fff; }
.ct-prize li strong { color: var(--text-muted); font-weight: var(--fw-semibold); }
.ct-prize p { color: var(--text-2); }

/* ۴. قوانین */
.ct-rules { background: var(--card); border: 1px solid var(--border-1); border-radius: var(--radius-2xl); padding: var(--space-6) var(--space-8); }
@media (max-width: 640px) { .ct-rules { padding: var(--space-5) var(--space-4); } }
.ct-rules h2, .ct-rules h3, .ct-rules h4 { font-size: var(--fs-xl); margin: var(--space-6) 0 var(--space-3); }
.ct-rules > :first-child { margin-top: 0; }
.ct-rules ul { list-style: disc; }
.ct-rules ol { list-style: decimal; }
.ct-rules ul, .ct-rules ol { margin: 0; padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.ct-rules li { color: var(--text-2); line-height: var(--lh-body); }
.ct-rules li::marker { color: var(--primary-light); }
.ct-rules p { margin: 0 0 var(--space-3); }
.ct-rules strong { color: var(--text-1); }

/* ۵. کانال تلگرام */
.ct-cta {
  margin-top: var(--space-16); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap;
  padding: var(--space-8); border-radius: var(--radius-2xl); border: 1px solid var(--primary-border-tint);
  background: radial-gradient(500px 240px at 0% 0%, rgba(6, 182, 212, .14), transparent 70%), linear-gradient(135deg, var(--primary-tint), var(--primary2-tint)), var(--card);
}
.ct-cta h2 { font-size: var(--fh-h3); }
.ct-cta p { margin-top: 6px; color: var(--text-muted); }
.ct-cta-copy { flex: 1 1 320px; min-width: 0; }
.ct-tg-btn { min-height: 56px; --btn-h: 56px; padding-inline: var(--space-8); font-size: var(--fs-lg); }
@media (max-width: 640px) { .ct-cta { margin-top: var(--space-10); padding: var(--space-5); } .ct-tg-btn { width: 100%; } }

/* ۶. اشتراک‌گذاری */
.ct-share { margin-top: var(--space-8); margin-bottom: var(--space-16); text-align: center; }
.ct-share-title { font-weight: var(--fw-bold); color: var(--text-2); margin-bottom: var(--space-3); }
.ct-share-row { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; max-width: 640px; margin-inline: auto; }
.ct-share-row input {
  flex: 1 1 240px; min-width: 0; height: 44px; padding: 0 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-2);
  background: var(--elev-1); color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-sm);
}
.ct-share-row .btn { min-height: 44px; }
@media (max-width: 640px) { .ct-share-row .btn { flex: 1 1 40%; } }
