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

:root {
  --cosmic-bg: #050810;
  --surface: #121826;
  --teal-soft: #4a9b8c;
  --teal-mid: #2a6b5f;
  --text: #e8eef5;
  --muted: #a0aec0;
}

html { scroll-behavior: smooth; background: var(--cosmic-bg); }
body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: var(--text);
  background: transparent;
  direction: rtl;
  line-height: 1.65;
}
a { color: var(--teal-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-wrap { position: relative; min-height: 100vh; display: flex; flex-direction: column; z-index: 1; }
.site-main { flex: 1; }
.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem 5rem; }
.container--narrow { max-width: 48rem; }
.page-pad { padding-top: 4rem; padding-bottom: 4rem; }

#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgb(42 107 95 / 0.3);
  background: rgb(18 24 38 / 0.6); backdrop-filter: blur(12px);
}
.site-header__inner {
  max-width: 72rem; margin: 0 auto; padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.site-logo-wrap { background: #fff; border-radius: 0.75rem; padding: 0.35rem 0.65rem; box-shadow: 0 2px 8px rgb(0 0 0 / 0.2); }
.site-logo { height: 2.25rem; width: auto; display: block; }
.nav-desktop { display: none; gap: 0.15rem; flex-wrap: wrap; }
@media (min-width: 1024px) { .nav-desktop { display: flex; } .mahgard-mobile-nav { display: none; } }
.nav-desktop a {
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem;
  color: var(--muted); transition: background 0.15s, color 0.15s;
}
.nav-desktop a:hover { background: rgb(255 255 255 / 0.05); color: var(--teal-soft); text-decoration: none; }

.site-footer {
  margin-top: auto; border-top: 1px solid rgb(42 107 95 / 0.25);
  background: rgb(18 24 38 / 0.55); backdrop-filter: blur(12px);
}
.site-footer__grid {
  max-width: 72rem; margin: 0 auto; padding: 3rem 1rem;
  display: grid; gap: 2.5rem;
}
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: repeat(3, 1fr); } }
.site-footer__copy {
  border-top: 1px solid rgb(42 107 95 / 0.2); text-align: center;
  font-size: 0.75rem; color: rgb(160 174 192 / 0.6); padding: 1rem;
}

.card {
  border-radius: 1rem; border: 1px solid rgb(42 107 95 / 0.25);
  background: rgb(18 24 38 / 0.7); overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: rgb(74 155 140 / 0.5); box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); }
.card__img { aspect-ratio: 16/9; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card__img img { transform: scale(1.04); }
.card__body { padding: 1rem 1.25rem 1.25rem; }
.card__date { font-size: 0.75rem; color: var(--teal-soft); margin-bottom: 0.35rem; }
.card__title { font-size: 1.05rem; font-weight: 600; margin: 0; color: var(--text); }
.card__excerpt { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.btn {
  display: inline-block; padding: 0.65rem 1.25rem; border-radius: 0.5rem;
  background: var(--teal-soft); color: #fff; font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn--outline {
  background: transparent; border: 1px solid rgb(74 155 140 / 0.5); color: var(--teal-soft);
}
.btn--ghost { background: transparent; color: var(--teal-soft); padding-inline: 0.5rem; }
.btn-primary { display: inline-block; padding: 0.65rem 1.25rem; border-radius: 0.5rem;
  background: var(--teal-soft); color: #fff; font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; text-decoration: none; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; text-align: center; }

.input {
  display: block; width: 100%; box-sizing: border-box;
  padding: 0.6rem 0.75rem; border-radius: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(0 0 0 / 0.28); color: var(--text);
  font-family: inherit; font-size: 0.9375rem;
}
.input:focus {
  outline: none; border-color: rgb(74 155 140 / 0.65);
  box-shadow: 0 0 0 2px rgb(74 155 140 / 0.2);
}
.form-error {
  margin: 0.75rem 0 0; padding: 0.65rem 0.85rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: #fecaca;
  background: rgb(220 53 69 / 0.12); border: 1px solid rgb(220 53 69 / 0.35);
}

.hero { text-align: center; padding: 4rem 0 3rem; animation: fade-up 0.6s ease-out both; }
.hero__logo { display: inline-block; background: #fff; padding: 1.25rem 2rem; border-radius: 1rem; box-shadow: 0 16px 40px rgb(0 0 0 / 0.4); }
.hero__logo img { height: 6rem; width: auto; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 3rem); margin: 1.5rem 0 0.75rem; }
.hero p { color: var(--muted); font-size: 1.125rem; max-width: 42rem; margin: 0 auto 1.5rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.section { margin-bottom: 5rem; }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.section__head h2 { margin: 0; font-size: 1.5rem; }

.panel {
  border-radius: 1rem; border: 1px solid rgb(42 107 95 / 0.25);
  background: rgb(18 24 38 / 0.6); padding: 2rem;
}

.prose { max-width: none; color: var(--muted); }
.prose h1, .prose h2, .prose h3 { color: var(--text); }
.prose a { color: var(--teal-soft); }
.prose img { max-width: 100%; border-radius: 1rem; }

.blocks { display: flex; flex-direction: column; gap: 2rem; }
.blocks h1, .blocks h2, .blocks h3 { color: var(--text); font-weight: 700; }
.blocks table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.blocks th, .blocks td { padding: 0.75rem; text-align: right; border-top: 1px solid rgb(42 107 95 / 0.2); }
.blocks thead { background: rgb(30 74 66 / 0.4); }
.blocks figure img { width: 100%; border-radius: 1rem; border: 1px solid rgb(42 107 95 / 0.25); }
.blocks figcaption { text-align: center; font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }

.seat-home {
  margin-bottom: 5rem; overflow: hidden; border-radius: 1rem;
  border: 1px solid rgb(74 155 140 / 0.3); background: rgb(18 24 38 / 0.55);
  padding: 1.5rem; backdrop-filter: blur(8px);
}
.seat-home__grid { display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 1024px) { .seat-home__grid { flex-direction: row; } }
.seat-home__poster { max-width: 240px; margin: 0 auto; }
.seat-home__poster img { width: 100%; border-radius: 0.75rem; border: 1px solid rgb(42 107 95 / 0.35); }
.seat-home__actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  margin-top: 1.25rem;
}
.seat-home__actions .btn { margin: 0; }
.seat-poster-placeholder {
  aspect-ratio: 3/4; border: 1px dashed rgb(42 107 95 / 0.4); border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem;
}

.alert { border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; margin-bottom: 1rem; }
.alert--error { background: rgb(220 53 69 / 0.15); border: 1px solid rgb(220 53 69 / 0.4); }
.alert--success { background: rgb(74 155 140 / 0.15); border: 1px solid rgb(74 155 140 / 0.4); }
.alert--warn { border: 1px solid rgb(251 191 36 / 0.35); background: rgb(69 26 3 / 0.35); color: #fef3c7; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.875rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.55rem 0.75rem; border-radius: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.15); background: rgb(0 0 0 / 0.25); color: var(--text);
  font-family: inherit;
}

.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.leaderboard-table th, .leaderboard-table td { padding: 0.75rem; text-align: right; border-top: 1px solid rgb(42 107 95 / 0.15); }
.leaderboard-table thead { background: rgb(11 15 26 / 0.9); color: var(--muted); }
.rank-badge {
  display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: 700;
}
.rank-badge--top { background: rgb(245 158 11 / 0.2); color: #fde68a; }

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