/* ============================================================
   نقشینه — Theme (Clash Royale-style, gamified, RTL)
   بر مبنای app_ui/DESIGN.md و اسکرین‌های مرجع
   ============================================================ */

:root {
  /* --- Surface (Midnight Navy) --- */
  --surface: #0b1326;
  --surface-dim: #0b1326;
  --surface-bright: #31394d;
  --surface-c-lowest: #060e20;
  --surface-c-low: #131b2e;
  --surface-c: #171f33;
  --surface-c-high: #222a3d;
  --surface-c-highest: #2d3449;
  --surface-variant: #2d3449;

  /* --- On-surface (text) --- */
  --on-surface: #dae2fd;
  --on-surface-variant: #c3c6d7;
  --outline: #8d90a0;
  --outline-variant: #434655;

  /* --- Primary (Electric Blue) --- */
  --primary: #b4c5ff;
  --primary-container: #2563eb;
  --primary-strong: #3b82f6;
  --primary-dark: #0077b6;
  --primary-darker: #005a8f;
  --on-primary: #002a78;
  --on-primary-container: #eeefff;

  /* --- Secondary (Sunlight Yellow / Coins) --- */
  --secondary: #ffe083;
  --secondary-container: #eec200;
  --gold: #ffc016;
  --gold-dark: #cc7700;
  --on-secondary: #3c2f00;

  /* --- Tertiary (Royal Purple / Legendary) --- */
  --tertiary: #ddb8ff;
  --tertiary-container: #9637ed;
  --on-tertiary: #490080;

  /* --- Error --- */
  --error: #ffb4ab;
  --error-container: #93000a;

  /* --- Gem / diamond --- */
  --gem: #00d2ff;

  /* --- Organization colors (چهار تشکل) --- */
  --org-islamic: #10b981;      /* انجمن اسلامی — سبز */
  --org-islamic-dark: #047857;
  --org-pishtazan: #f59e0b;    /* پیشتازان — نارنجی/خاکی */
  --org-pishtazan-dark: #b45309;
  --org-basij: #ef4444;        /* بسیج — قرمز/مشکی */
  --org-basij-dark: #991b1b;
  --org-helal: #f43f5e;        /* هلال احمر — قرمز روشن */
  --org-helal-dark: #be123c;

  /* --- Category colors --- */
  --cat-competition: #ef4444;  /* مسابقه */
  --cat-festival: #a855f7;     /* جشنواره */
  --cat-role: #3b82f6;         /* نقش */

  /* --- Radius --- */
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-full: 9999px;

  /* --- Spacing --- */
  --gutter: 16px;
  --margin-mobile: 20px;

  /* --- Layout --- */
  --nav-h: 84px;
  --max-w: 480px;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  /* جلوگیری از بزرگ‌نمایی خودکار متن توسط مرورگر موبایل */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 15px;
  background-color: var(--surface);
  /* الگوی شطرنجی ملایم پس‌زمینه (بازی‌گونه) */
  background-image:
    linear-gradient(45deg, var(--surface-c-low) 25%, transparent 25%, transparent 75%, var(--surface-c-low) 75%, var(--surface-c-low)),
    linear-gradient(45deg, var(--surface-c-low) 25%, transparent 25%, transparent 75%, var(--surface-c-low) 75%, var(--surface-c-low));
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  background-attachment: fixed;
  color: var(--on-surface);
  min-height: 100vh;
  overscroll-behavior-y: none;
}

/* قاب موبایل مرکزی برای نمایش دسکتاپ */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  background-image: inherit;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

/* ============================================================
   Typography helpers
   ============================================================ */
.display-lg { font-size: 26px; font-weight: 900; line-height: 34px; letter-spacing: -0.02em; }
.headline-lg { font-size: 21px; font-weight: 800; line-height: 28px; }
.headline-md { font-size: 18px; font-weight: 700; line-height: 25px; }
.body-lg { font-size: 15px; font-weight: 600; line-height: 24px; }
.body-md { font-size: 13px; font-weight: 500; line-height: 21px; }
.label-lg { font-size: 13px; font-weight: 700; line-height: 18px; }
.label-sm { font-size: 11px; font-weight: 700; line-height: 15px; }

.text-shadow {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8), -1px -1px 2px rgba(0,0,0,0.8),
               1px -1px 2px rgba(0,0,0,0.8), -1px 1px 2px rgba(0,0,0,0.8);
}
.text-glow { text-shadow: 0 0 12px rgba(180,197,255,0.6); }
.text-gold { color: var(--gold); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--on-surface-variant); }

/* ============================================================
   3D Buttons (Clash Royale style)
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-xl);
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
}
.btn:active { transform: translateY(4px); }

.btn-blue {
  background: linear-gradient(to bottom, #4facfe, var(--primary-strong));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 6px 0 var(--primary-dark), 0 8px 12px rgba(0,0,0,0.5);
  border: 2px solid var(--primary-darker);
}
.btn-blue:active { box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 2px 0 var(--primary-dark), 0 2px 6px rgba(0,0,0,0.5); }

.btn-yellow {
  background: linear-gradient(to bottom, #ffea00, #ffaa00);
  color: var(--on-secondary);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 6px 0 var(--gold-dark), 0 8px 12px rgba(0,0,0,0.5);
  border: 2px solid #b37700;
}
.btn-yellow:active { box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 2px 0 var(--gold-dark), 0 2px 6px rgba(0,0,0,0.5); }

.btn-green {
  background: linear-gradient(to bottom, #34d399, var(--org-islamic));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 6px 0 var(--org-islamic-dark), 0 8px 12px rgba(0,0,0,0.5);
  border: 2px solid var(--org-islamic-dark);
}
.btn-green:active { box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 2px 0 var(--org-islamic-dark), 0 2px 6px rgba(0,0,0,0.5); }

.btn-ghost {
  background: var(--surface-c-high);
  color: var(--on-surface);
  box-shadow: 0 4px 0 var(--surface-c-lowest);
  border: 2px solid var(--surface-bright);
}
.btn-ghost:active { box-shadow: 0 1px 0 var(--surface-c-lowest); }

.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: var(--r-lg); }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn.is-disabled { filter: grayscale(0.7); opacity: 0.6; pointer-events: none; }

/* ============================================================
   Cards (3D islands)
   ============================================================ */
.card {
  background: var(--surface-c);
  border-radius: var(--r-xl);
  border: 2px solid rgba(255,255,255,0.05);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.card-flat {
  background: var(--surface-c-low);
  border: 1px solid var(--surface-bright);
  border-radius: var(--r-lg);
}
.glass {
  background: rgba(23, 31, 51, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ribbon (برچسب گوشه کارت) */
.ribbon {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 9px;
  border-bottom-inline-start-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.ribbon .material-symbols-outlined { font-size: 12px; }

/* آیکون حباب (icon bubble) */
.bubble {
  width: 60px; height: 60px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-bottom: 4px solid rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25);
}
.bub-competition { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.bub-festival    { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.bub-role        { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bub-islamic     { background: linear-gradient(135deg, #10b981, #047857); }
.bub-pishtazan   { background: linear-gradient(135deg, #f59e0b, #b45309); }
.bub-basij       { background: linear-gradient(135deg, #ef4444, #7f1d1d); }
.bub-helal       { background: linear-gradient(135deg, #fb7185, #be123c); }

/* ============================================================
   Progress bars (liquid / battery)
   ============================================================ */
.progress {
  background-color: var(--surface-c-lowest);
  border: 2px solid var(--surface-bright);
  border-radius: var(--r-full);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  height: 20px;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gem), #3a7bd5);
  border-radius: var(--r-full);
  position: relative;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent 50%);
}
.progress-fill.gold { background: linear-gradient(to right, #ffea00, #ffaa00); }
.progress-thin { height: 6px; border-width: 0; border-radius: 0; }

/* ============================================================
   Chips / pills / badges
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  background: var(--surface-c-high);
  border: 1px solid var(--surface-bright);
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: var(--r-full);
  padding: 4px 10px;
  border: 1px solid var(--surface-bright);
  font-weight: 800; font-size: 13px;
}
.pill .coin { width: 22px; height: 22px; border-radius: 50%; background: var(--secondary);
  border: 2px solid var(--secondary-container); display: flex; align-items: center;
  justify-content: center; color: var(--on-secondary); font-size: 11px; font-weight: 900; }

/* filter tabs (اسکرول افقی) */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: var(--r-md);
  background: var(--surface-c-high); color: var(--on-surface-variant);
  font-weight: 700; font-size: 14px; border: none;
  border-bottom: 4px solid var(--surface-c-lowest); cursor: pointer;
}
.tab.active { background: var(--primary-container); color: #fff; border-bottom-color: var(--primary-dark); }

/* ============================================================
   Top status bar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface-c);
  border-bottom: 1px solid var(--surface-bright);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.topbar-titles { display: flex; flex-direction: column; justify-content: center; }
.topbar-title {
  font-size: 15px; font-weight: 900; color: var(--on-surface);
  line-height: 1.15; margin: 0;
}
.topbar-sub {
  font-size: 10.5px; font-weight: 600; color: var(--on-surface-variant);
  line-height: 1.15; margin: 1px 0 0;
}

/* ============================================================
   Bottom navigation (Mission Control dock)
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: var(--max-w); margin: 0 auto;
  height: var(--nav-h);
  background: var(--surface-c);
  border-top: 1px solid rgba(59,130,246,0.4);
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 8px 8px 20px;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--on-surface-variant); background: none; border: none;
  font-family: inherit; font-size: 10px; font-weight: 700; cursor: pointer;
  padding: 6px 8px; text-decoration: none; transition: color 0.2s, transform 0.2s;
}
.nav-item .material-symbols-outlined { font-size: 26px; }
.nav-item.active { color: var(--gold); transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(255,192,22,0.5)); }
.nav-item:not(.active):hover { color: var(--on-surface); }

/* دکمه مرکزی برجسته (خانه) */
.nav-center {
  position: relative; top: -18px;
}
.nav-center .fab {
  width: 62px; height: 62px; border-radius: var(--r-lg);
  background: linear-gradient(to bottom, #4facfe, var(--primary-strong));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 6px 0 var(--primary-dark), 0 8px 14px rgba(0,0,0,0.5);
  border: 2px solid var(--primary-darker);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
}
.nav-center.active .fab { background: linear-gradient(to bottom, #ffea00, #ffaa00);
  border-color: #b37700; box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 6px 0 var(--gold-dark), 0 8px 14px rgba(0,0,0,0.5); color: var(--on-secondary); }

/* ============================================================
   Utility
   ============================================================ */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- utility مینیمال (مورد استفاده در app.js برای هدر/کارت) --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.relative { position: relative; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-black { font-weight: 900; }
.text-lg { font-size: 15px; line-height: 22px; }
.text-on-surface { color: var(--on-surface); }
.page { flex: 1; padding: 16px; padding-bottom: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; }

/* --- سرصفحه‌ی داخل صفحه (کامپکت، هم‌راستا با متن) --- */
.page-head { display: flex; flex-direction: column; gap: 2px; }
.page-head h1 {
  font-size: 20px; font-weight: 900; line-height: 27px; margin: 0;
  color: var(--on-surface); letter-spacing: -0.01em;
}
.page-head p { font-size: 12px; font-weight: 600; line-height: 18px; margin: 0; color: var(--on-surface-variant); }
.locked { position: relative; opacity: 0.6; }
.locked-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(1px);
}

/* آواتار */
.avatar { border-radius: 50%; border: 2px solid var(--primary); object-fit: cover;
  box-shadow: 0 0 15px rgba(37,99,235,0.5); }

/* انیمیشن‌ها */
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.floaty { animation: floaty 3s ease-in-out infinite; }
@keyframes shine { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* حالت‌های خالی */
.empty-state { text-align: center; padding: 40px 20px; color: var(--on-surface-variant); }
.empty-state .material-symbols-outlined { font-size: 64px; opacity: 0.4; }

/* ============================================================
   کامپوننت‌های ساخته‌شده در app.js (نوار بالا، کارت مأموریت، ناوبری)
   ============================================================ */

/* --- نوار بالا: XP، اعلان، آواتار --- */
/* نشان سطح داخل صفحه (کارت هویت خانه) */
.lvl-badge {
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: linear-gradient(to bottom, #4facfe, var(--primary-strong));
  border: 2px solid var(--primary-darker);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 3px 0 var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 14px;
}

/* قرص امتیاز تجربه (تنها منبع پیشرفت) */
.xp-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--surface-bright);
  border-radius: var(--r-full); padding: 4px 12px 4px 8px;
}
.xp-pill .xp-ico {
  font-size: 18px; color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(255,192,22,0.6));
}
.xp-pill .xp-num { font-size: 13px; font-weight: 800; color: var(--on-surface); letter-spacing: 0.02em; }

/* آواتار کاربر در هدر (با نشان سطح) */
.topbar-avatar {
  position: relative; width: 36px; height: 36px; flex-shrink: 0;
  display: block; text-decoration: none;
}
.topbar-avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 0 10px rgba(37,99,235,0.4);
}
.topbar-lvl {
  position: absolute; bottom: -3px; inset-inline-start: -3px;
  min-width: 17px; height: 17px; padding: 0 3px; border-radius: var(--r-full);
  background: linear-gradient(to bottom, #ffea00, #ffaa00);
  border: 1.5px solid var(--surface-c);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-secondary); font-size: 10px; font-weight: 900; line-height: 1;
}
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-c-high); border: 1px solid var(--surface-bright);
  color: var(--on-surface); text-decoration: none; cursor: pointer;
}
.icon-btn .material-symbols-outlined { font-size: 20px; }
.notif-dot {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--error); border: 1px solid var(--surface-c);
}

/* --- ناوبری پایین: برچسب --- */
.nav-label { line-height: 1; }

/* --- کارت مأموریت --- */
.mission-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface-c); border-radius: var(--r-xl);
  border: 2px solid rgba(255,255,255,0.05);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.mission-card .mc-body {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px;
}
.mc-icon {
  width: 48px; height: 48px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 4px solid rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25);
}
.mc-icon .material-symbols-outlined { font-size: 26px; color: #fff; }
.mc-content { flex: 1; min-width: 0; }
.mc-content h3 { font-size: 14px; font-weight: 800; color: var(--on-surface); line-height: 19px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-content p { font-size: 11px; font-weight: 600; color: var(--on-surface-variant); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-content .rewards { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.reward-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--surface-c-high); border: 1px solid var(--surface-bright);
  border-radius: var(--r-md); padding: 2px 7px; font-size: 10px; font-weight: 800; color: var(--on-surface);
}
.reward-chip .rc-xp { color: var(--primary); font-size: 10px; }
.reward-chip .coin { color: var(--gold); font-size: 15px; }
.reward-chip .badge-ic { color: var(--tertiary); font-size: 15px; }
.mc-progress { height: 6px; background: var(--surface-c-lowest); width: 100%; }
.mc-progress-fill { height: 100%; background: linear-gradient(to right, var(--gem), #3a7bd5);
  box-shadow: 0 0 8px rgba(59,130,246,0.8); border-radius: 0 4px 4px 0; }

/* دسته‌بندی آیکون مأموریت (هم‌نام با bub-*) */
.cat-competition { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.cat-festival    { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.cat-role        { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.cat-skill       { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.cat-org         { background: linear-gradient(135deg, #10b981, #047857); }
.grayscale { filter: grayscale(1); }

/* قفل کارت */
.lock-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(1px);
}
.lock-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-c-high); color: var(--on-surface-variant);
  border: 1px solid var(--surface-bright); border-radius: var(--r-full);
  padding: 8px 16px; font-size: 13px; font-weight: 800;
}

/* --- مسیر بلوغ (۰..۴) در صفحه خانه --- */
.maturity-track { display: flex; align-items: center; }
.mt-step {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-c-lowest); border: 2px solid var(--surface-bright);
  color: var(--outline);
}
.mt-step .material-symbols-outlined { font-size: 18px; }
.mt-step.done {
  background: var(--c, var(--primary-container));
  border-color: rgba(255,255,255,0.3); color: #fff;
  box-shadow: 0 0 10px color-mix(in srgb, var(--c, var(--primary-strong)) 60%, transparent);
}
.mt-line { flex: 1; height: 4px; background: var(--surface-bright); border-radius: 2px; }

/* --- شبکه‌ی دسترسی سریع --- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 4px; border-radius: var(--r-lg); text-decoration: none;
  background: var(--surface-c); border: 1px solid var(--surface-bright);
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
  color: var(--on-surface); font-size: 11px; font-weight: 700;
}
.quick-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.quick-tile .material-symbols-outlined { font-size: 28px; }

/* --- کارت رویداد --- */
.event-card {
  display: block; text-decoration: none; color: inherit;
  border-radius: var(--r-xl); overflow: hidden; position: relative;
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.3);
  background: var(--surface-c);
}
.event-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.3); }
.event-card .ev-cover {
  position: relative; height: 76px;
  background: linear-gradient(135deg, var(--ev, #a855f7), var(--ev-dark, #7e22ce));
  display: flex; align-items: center; justify-content: center;
  border-bottom: 3px solid rgba(0,0,0,0.3);
}
.event-card .ev-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent 55%);
}
.event-card .ev-icon { font-size: 42px; color: rgba(255,255,255,0.92);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.35)); }
.event-card .ev-tag {
  position: absolute; top: 8px; inset-inline-end: 8px;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--r-full); padding: 2px 10px;
  font-size: 10px; font-weight: 800; color: #fff;
}
.event-card .ev-body { padding: 12px 14px; }
.event-card h3 { font-size: 15px; font-weight: 900; color: var(--on-surface); line-height: 20px; }
.event-card p { font-size: 11px; font-weight: 600; color: var(--on-surface-variant); margin-top: 3px; }
.event-card .ev-meta { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

.chip.chip-live  { background: rgba(34,197,94,0.18);  color: #4ade80; border-color: rgba(34,197,94,0.35); }
.chip.chip-soon  { background: rgba(59,130,246,0.18); color: #60a5fa; border-color: rgba(59,130,246,0.35); }
.chip.chip-ended { background: rgba(148,163,184,0.15); color: #94a3b8; border-color: rgba(148,163,184,0.3); }

/* رویداد پایان‌یافته: کم‌رنگ و خاکستری تا بصری متمایز شود */
.event-card.is-past { opacity: 0.72; }
.event-card.is-past .ev-cover { filter: grayscale(0.7) brightness(0.8); }

/* --- کنترل بخش‌بندی زمانی (Segmented) --- */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-lg);
  background: var(--surface-c-high); border: 1px solid rgba(255,255,255,0.06); }
.seg-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 4px; border: none; cursor: pointer; border-radius: var(--r-md);
  background: transparent; color: var(--on-surface-variant);
  font-weight: 800; transition: background 0.15s, color 0.15s; }
.seg-btn .seg-label { font-size: 12px; font-weight: 800; white-space: nowrap; }
.seg-btn .seg-count { flex-shrink: 0; min-width: 18px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; border-radius: var(--r-full);
  background: rgba(255,255,255,0.12); }
.seg-btn.active { background: var(--primary-container); color: #fff;
  box-shadow: 0 2px 0 var(--primary-dark), 0 3px 8px rgba(0,0,0,0.3); }
.seg-btn.active .seg-count { background: rgba(255,255,255,0.24); }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-c-high); color: var(--on-surface);
  border: 2px solid var(--primary-strong); border-radius: var(--r-full);
  padding: 12px 22px; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5); z-index: 100;
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
  max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- صفحه جزئیات: hero و مراحل --- */
.detail-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 24px 16px; position: relative;
  border-bottom: 3px solid rgba(0,0,0,0.3);
}
.detail-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}
.detail-hero .mc-icon { border: 2px solid rgba(255,255,255,0.25); }
.event-countdown {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-full); padding: 4px 12px;
  font-size: 12px; font-weight: 800; color: #fff; margin-top: 8px;
}
.event-countdown .material-symbols-outlined { font-size: 16px; }
.step-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--surface-bright);
  font-size: 14px; font-weight: 700; color: var(--on-surface-variant);
}
.step-row:last-child { border-bottom: none; }
.step-row .material-symbols-outlined { font-size: 24px; color: var(--outline); }
.step-row.done { color: var(--on-surface); }
.step-row.done .material-symbols-outlined { color: var(--org-islamic); }

/* --- کارت تشکل (org card) --- */
.org-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface-c); border-radius: var(--r-xl);
  border: 2px solid rgba(255,255,255,0.05);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.org-card .org-stripe {
  height: 6px; background: linear-gradient(to left, var(--org), var(--org-dark));
}
.org-card .org-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.org-badge {
  width: 46px; height: 46px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--org), var(--org-dark));
  border-bottom: 4px solid rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25);
}
.org-badge .material-symbols-outlined { font-size: 26px; color: #fff; }
.org-info { flex: 1; min-width: 0; }
.org-info h3 { font-size: 14px; font-weight: 800; color: var(--on-surface); line-height: 18px; }
.org-info p { font-size: 11px; font-weight: 600; color: var(--on-surface-variant); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-status {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 11px; font-weight: 800; color: var(--st);
}
.org-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st); box-shadow: 0 0 6px var(--st); }
.org-arrow { color: var(--outline); flex-shrink: 0; }

/* --- صفحه‌ی اختصاصی تشکل (Hero با پوسته) --- */
.org-hero {
  padding: 28px 16px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: relative;
}
.org-hero-badge {
  width: 88px; height: 88px; border-radius: var(--r-xl);
  background: rgba(0,0,0,0.22); border-bottom: 5px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.org-status-pill {
  display: inline-flex; align-items: center; padding: 4px 14px;
  border-radius: var(--r-full); color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --- گالری نشان‌ها (کارنامه) --- */
.badge-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.badge-medal {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 4px solid rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), 0 4px 10px rgba(0,0,0,0.3);
}
.badge-medal .material-symbols-outlined { font-size: 36px; color: #fff; }
.badge-item .label-sm { color: var(--on-surface-variant); font-weight: 700; }
.badge-item.locked { opacity: 0.45; }
.badge-item.locked .badge-medal { background: var(--surface-c-high) !important; }

/* ============================================================
   Splash (صفحه‌ی راه‌اندازی)
   ============================================================ */
body.splash { display: flex; align-items: center; justify-content: center; }
.splash-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center; padding: 24px;
}
.splash-logo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.splash-logo .material-symbols-outlined {
  font-size: 96px; color: var(--primary);
  filter: drop-shadow(0 0 24px rgba(180,197,255,0.6));
  animation: floaty 3s ease-in-out infinite;
}
.splash-logo b { font-size: 34px; font-weight: 900; color: var(--on-surface);
  text-shadow: 0 0 16px rgba(180,197,255,0.5); }
.splash-tag { font-size: 14px; font-weight: 700; color: var(--on-surface-variant); }
.splash-loader {
  width: 140px; height: 8px; border-radius: var(--r-full);
  background: var(--surface-c-lowest); border: 1px solid var(--surface-bright);
  overflow: hidden; margin-top: 6px;
}
.splash-loader i {
  display: block; height: 100%; width: 40%; border-radius: var(--r-full);
  background: linear-gradient(to right, var(--gem), var(--primary-strong));
  animation: splash-slide 1.1s ease-in-out infinite;
}
@keyframes splash-slide {
  0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; }
}

/* ============================================================
   Login (ورود با SSO)
   ============================================================ */
.login-bg {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px 20px;
}
.login-main {
  width: 100%; max-width: 380px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.login-logo {
  width: 88px; height: 88px; border-radius: var(--r-xl);
  background: linear-gradient(to bottom, #4facfe, var(--primary-strong));
  border: 2px solid var(--primary-darker);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 6px 0 var(--primary-dark), 0 8px 16px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  animation: floaty 3s ease-in-out infinite;
}
.login-logo .material-symbols-outlined { font-size: 48px; color: #fff; }
.login-title { font-size: 32px; font-weight: 900; margin: 0; color: var(--on-surface); }
.login-sub { font-size: 14px; font-weight: 600; color: var(--on-surface-variant); margin: 0; }

.panel {
  width: 100%;
  background: var(--surface-c);
  border-radius: var(--r-xl);
  border: 2px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 8px 20px rgba(0,0,0,0.4);
  padding: 22px 20px;
}
.login-card { display: flex; flex-direction: column; gap: 14px; }
.login-card-title { font-size: 18px; font-weight: 800; margin: 0; color: var(--on-surface); }
.login-card-desc { font-size: 13px; font-weight: 600; line-height: 21px; color: var(--on-surface-variant); margin: 0; }
.btn-lg { padding: 15px 24px; font-size: 17px; border-radius: var(--r-xl); }

.sso-chain {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 0 4px; flex-wrap: wrap;
}
.sso-node {
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--surface-c-low); border: 1px solid var(--surface-bright);
  font-size: 12px; font-weight: 800; color: var(--on-surface-variant);
}
.sso-node.on {
  background: var(--primary-container); border-color: var(--primary-dark);
  color: #fff; box-shadow: 0 0 10px rgba(37,99,235,0.5);
}
.sso-chain .arr { font-size: 18px; color: var(--outline); }

.login-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface-c-low); border: 1px solid var(--surface-bright);
  border-radius: var(--r-lg); padding: 12px;
  font-size: 12px; font-weight: 600; line-height: 19px; color: var(--on-surface-variant);
}
.login-note .material-symbols-outlined { font-size: 18px; color: var(--org-islamic); flex-shrink: 0; }

/* --- مرحله‌ی شبیه‌سازی SSO (overlay) --- */
.sso-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6,14,32,0.86); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.sso-overlay[hidden] { display: none; }
.sso-box { width: 100%; max-width: 340px; }
.sso-steps { display: flex; flex-direction: column; gap: 12px; }
.sso-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--on-surface);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.sso-step.in { opacity: 1; transform: translateY(0); }
.sso-step .material-symbols-outlined { font-size: 22px; color: var(--gem); }

@media (min-width: 500px) { body { padding: 0; } }
