:root {
  --bg: #07070d;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --surface2: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f1fb;
  --muted: #9da3c2;
  --accent: #a78bfa;
  --accent-2: #ec4899;
  --accent-3: #22d3ee;
  --header-bg: rgba(7, 7, 13, 0.55);
  --grid-line: rgba(255, 255, 255, 0.025);
  --heading-gradient: linear-gradient(180deg, #fff 0%, #b8b8d5 100%);
  --gradient: linear-gradient(135deg, #a78bfa 0%, #ec4899 50%, #f97316 100%);
  --gradient-cool: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --glow: 0 0 60px rgba(167, 139, 250, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 8px 30px -10px rgba(0, 0, 0, 0.45);
  font-family: "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f5fb;
  --surface: rgba(0, 0, 0, 0.04);
  --surface-strong: rgba(0, 0, 0, 0.07);
  --surface2: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1a1a2e;
  --muted: #5a6178;
  --header-bg: rgba(244, 245, 251, 0.7);
  --grid-line: rgba(0, 0, 0, 0.05);
  --heading-gradient: linear-gradient(180deg, #1a1a2e 0%, #5a6178 100%);
  --glow: 0 0 60px rgba(167, 139, 250, 0.3);
  --shadow: 0 24px 60px -20px rgba(60, 60, 100, 0.25);
  --shadow-soft: 0 8px 30px -10px rgba(60, 60, 100, 0.18);
  color-scheme: light;
}

html[lang="fa"] {
  font-family: "Vazirmatn", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60vw 60vw at 10% 10%, rgba(167, 139, 250, 0.22), transparent 60%),
    radial-gradient(50vw 50vw at 90% 0%, rgba(236, 72, 153, 0.18), transparent 60%),
    radial-gradient(70vw 70vw at 80% 90%, rgba(34, 211, 238, 0.16), transparent 65%),
    radial-gradient(40vw 40vw at 20% 90%, rgba(99, 102, 241, 0.16), transparent 60%);
  filter: blur(20px) saturate(140%);
  animation: aurora-shift 28s ease-in-out infinite alternate;
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

@keyframes aurora-shift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}

.logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.powered {
  color: var(--muted);
  font-size: 0.85rem;
}

.np-link {
  color: #7dd3fc;
  font-weight: 600;
  text-decoration: none;
}

.np-link:hover {
  text-decoration: underline;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

.nav-btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-lang-wrap {
  position: relative;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  inset-inline-end: 0;
  background: #16161f;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 9.5rem;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.lang-popover.hidden {
  display: none;
}

.lang-option {
  background: transparent;
  border: none;
  color: var(--text);
  text-align: start;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.lang-option:hover {
  background: var(--surface);
}

.lang-option.active {
  background: var(--surface);
  font-weight: 600;
  color: var(--accent);
}

.theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-sun { display: block; }
html[data-theme="light"] .theme-icon-moon { display: none; }

html[data-theme="light"] .nav-btn {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 1px 3px rgba(60, 60, 100, 0.08);
}

html[data-theme="light"] .nav-btn:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 6px rgba(60, 60, 100, 0.12);
}

html[data-theme="light"] .lang-popover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .lang-option:hover,
html[data-theme="light"] .lang-option.active {
  background: rgba(0, 0, 0, 0.05);
}

/* ---------- light theme: panel + component overrides ---------- */
html[data-theme="light"] .developer-panel,
html[data-theme="light"] .donations-block,
html[data-theme="light"] .project-card,
html[data-theme="light"] .modal-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .developer-panel::before,
html[data-theme="light"] .project-card::before,
html[data-theme="light"] .donations-block::before {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.04));
}

html[data-theme="light"] .tabs {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .tab:hover {
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .tab.active {
  background: rgba(167, 139, 250, 0.18);
  color: #5b21b6;
  border-color: rgba(167, 139, 250, 0.5);
}

html[data-theme="light"] .tab-badge {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}

html[data-theme="light"] .tab.active .tab-badge {
  background: rgba(167, 139, 250, 0.3);
  color: #4c1d95;
}

html[data-theme="light"] .pay-btn-card {
  border-color: rgba(99, 91, 255, 0.55);
  background: rgba(99, 91, 255, 0.10);
  color: #4338ca;
}

html[data-theme="light"] .pay-btn-card:hover {
  background: rgba(99, 91, 255, 0.18);
  border-color: rgba(99, 91, 255, 0.8);
}

html[data-theme="light"] .donor-label input,
html[data-theme="light"] .donor-label textarea,
html[data-theme="light"] .custom-row input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .donor-label input::placeholder,
html[data-theme="light"] .donor-label textarea::placeholder,
html[data-theme="light"] .custom-row input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .amount-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

html[data-theme="light"] .amount-btn:hover {
  background: #ffffff;
  border-color: rgba(167, 139, 250, 0.5);
}

html[data-theme="light"] .amount-btn.active {
  background: rgba(167, 139, 250, 0.18);
  color: #5b21b6;
  border-color: rgba(167, 139, 250, 0.6);
}

html[data-theme="light"] .product-price {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .status-fulfilled { color: #3730a3; }
html[data-theme="light"] .status-rejected { color: #b91c1c; }
html[data-theme="light"] .status-active { color: #047857; }

html[data-theme="light"] .donations-table th,
html[data-theme="light"] .donations-table td {
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .donation-rank {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.35);
}

.intro-section {
  margin-bottom: 2.75rem;
  padding-top: 3rem;
}

.page-intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2rem;
}

.page-intro h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 1rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-thanks,
.page-support {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 0.75rem;
}

.page-support {
  margin-bottom: 0;
}

.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem 3rem;
  min-height: 12rem;
}

.page-loading.hidden {
  display: none;
}

.page-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: page-loading-spin 0.75s linear infinite;
  box-shadow: var(--glow);
}

@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}

.page-loading-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-content.hidden {
  display: none;
}

.developer-panel,
.donations-block,
.project-card,
.modal-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow);
}

.developer-panel::before,
.project-card::before,
.donations-block::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.developer-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
}

.developer-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.12), 0 12px 30px -10px rgba(167, 139, 250, 0.5);
}

.developer-profile {
  min-width: 0;
  text-align: start;
}

.developer-name {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.developer-bio {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.developer-github {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.developer-github:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.developer-donate.pay-actions {
  flex-shrink: 0;
  min-width: 12rem;
  margin: 0;
}

.section-title {
  font-size: 1.55rem;
  margin: 0 0 0.4rem;
  color: var(--text);
  letter-spacing: -0.015em;
  font-weight: 600;
}

.section-lead {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 640px;
  line-height: 1.55;
}

.pay-btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pay-btn-outline:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.1);
}

@media (max-width: 768px) {
  .developer-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .developer-profile {
    text-align: center;
  }

  .developer-donate.pay-actions {
    width: 100%;
    max-width: 280px;
  }
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.repo-card {
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.repo-card-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.repo-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.repo-card:hover {
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 50%, var(--border));
  transform: translateY(-3px);
  background: var(--surface-strong);
}

.repo-card strong {
  font-size: 1rem;
}

.repo-short {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.projects-section {
  margin-top: 3rem;
  padding-bottom: 1rem;
}

.tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab.active {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.15);
  color: #e9d5ff;
  box-shadow: 0 4px 14px -4px rgba(167, 139, 250, 0.45);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tab.active .tab-badge {
  background: rgba(167, 139, 250, 0.35);
}

.tab-badge--zero {
  opacity: 0.5;
}

.repo-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.status-badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-active {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-fulfilled {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-rejected {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.progress-wrap {
  margin: 0.75rem 0 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.55);
}

.history-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  padding: 1.75rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

html[dir="rtl"] .modal-close {
  right: auto;
  left: 0.85rem;
}

.modal-panel--donate {
  max-width: 480px;
}

.modal-project-summary {
  padding-inline-end: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-project-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.modal-project-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.modal-project-text {
  min-width: 0;
  flex: 1;
}

.modal-tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-progress {
  margin-top: 0.85rem;
}

.modal-donate-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-remaining {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.remaining-value {
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.progress-label {
  color: var(--muted);
  font-weight: 500;
}

.card-donate-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 12px;
  background: var(--gradient);
  background-size: 200% 200%;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-position 0.4s;
  box-shadow: 0 8px 24px -8px rgba(167, 139, 250, 0.6);
}

.card-donate-btn:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 12px 32px -8px rgba(236, 72, 153, 0.7);
}

.modal-repo-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-inline-end: 2rem;
}

.modal-repo-img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-repo-text {
  min-width: 0;
  flex: 1;
}

.modal-title {
  margin: 0 0 0.5rem;
}

.modal-desc {
  color: var(--muted);
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-actions .amount-btn {
  width: auto;
  flex: 1;
  min-width: 140px;
}

.modal-support-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.modal-payments {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 0;
}

.project-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.35);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-header-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.project-repo-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.card-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.card-tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.repo-link {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.repo-link:hover {
  text-decoration: underline;
}

.stats-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.stats-label {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.stats-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.amount-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.amount-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amount-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.amount-btn:hover {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.08);
  transform: translateY(-1px);
}

.amount-btn.active {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.18);
  color: #e9d5ff;
  box-shadow: 0 4px 14px -4px rgba(167, 139, 250, 0.4);
}

.custom-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.custom-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font: inherit;
  min-width: 0;
  transition: border-color 0.2s, background 0.2s;
}

.custom-row input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
}

.donor-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.donor-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.required-mark {
  color: #ef4444;
  margin-inline-start: 0.15rem;
  font-weight: 700;
}

.donor-label input,
.donor-label textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 2.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.donor-label input:focus,
.donor-label textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
}

.pay-methods-label {
  margin-top: 0.25rem;
}

.pay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s, background 0.2s, border-color 0.2s;
}

.pay-btn:hover {
  transform: translateY(-2px);
}

.pay-btn-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
}

.pay-btn-np,
.donate-btn.pay-btn-np {
  border: none;
  background: linear-gradient(135deg, #00c26f 0%, #00a85d 100%);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(0, 194, 111, 0.55);
}

.pay-btn-np:hover:not(:disabled),
.donate-btn.pay-btn-np:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 12px 32px -8px rgba(0, 194, 111, 0.7);
}

.donate-btn.pay-btn-np:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.pay-btn-card {
  border: 1px solid rgba(99, 91, 255, 0.45);
  background: rgba(99, 91, 255, 0.12);
  color: #c7c2ff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pay-btn-card:hover {
  background: rgba(99, 91, 255, 0.22);
  border-color: rgba(99, 91, 255, 0.7);
  box-shadow: 0 8px 24px -8px rgba(99, 91, 255, 0.5);
}

.stats-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.np-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.np-badge a {
  color: #7dd3fc;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stats-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.stats-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  align-items: center;
}

.stats-label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.stats-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--heading-gradient, linear-gradient(135deg, #a78bfa, #60a5fa));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stats-value {
    font-size: 1.6rem;
  }
}

.donations-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-bottom: 3rem;
}

.donations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.donations-block {
  padding: 1.5rem;
}

.donations-block-title {
  margin: 0 0 1.1rem;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.01em;
  font-weight: 600;
}

.donations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.donation-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.donation-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}

.donation-row-start {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex-shrink: 0;
}

.donation-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
  background: rgba(167, 139, 250, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.donation-payment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  flex-shrink: 0;
}

.donation-payment-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.donation-amount {
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.donation-donor {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  text-align: end;
}

html[dir="rtl"] .donation-donor {
  text-align: start;
  align-items: flex-start;
}

.donation-name {
  font-weight: 600;
  font-size: 0.95rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donation-comment {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.donation-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.donations-empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.75rem 0;
  text-align: center;
}

.projects-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 2.5rem 1rem;
  margin: 0;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.delivery-message {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

.delivery-error {
  color: #fca5a5;
}

.delivery-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

.delivery-link-hint {
  word-break: break-all;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  opacity: 0.7;
}

.product-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.product-price-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.product-price-value {
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 720px) {
  .donations-grid {
    grid-template-columns: 1fr;
  }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0.4rem 0;
}

.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 18, 38, 0.85);
  border: 1px solid var(--border-strong);
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 250;
  max-width: 90vw;
  text-align: center;
  font-weight: 500;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

html[dir="rtl"] .toast {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.toast.hidden {
  display: none;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: var(--shadow), 0 0 30px rgba(16, 185, 129, 0.25);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: var(--shadow), 0 0 30px rgba(239, 68, 68, 0.25);
}

@media (max-width: 520px) {
  .card-header {
    flex-direction: column;
  }

  .developer-panel {
    padding: 1.5rem;
  }

  .project-card {
    padding: 1.4rem;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
  background-clip: padding-box;
}

::selection {
  background: rgba(167, 139, 250, 0.4);
  color: #fff;
}
