/* ╔══════════════════════════════════════════════════╗
   ║                 Chess Page CSS                   ║
   ╚══════════════════════════════════════════════════╝ */

/* ════════════════════════════════════════
   Hero شطرنج
   ════════════════════════════════════════ */

.chess-hero {
  position: relative;
  padding: 60px 0 82px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(135deg, rgba(35, 55, 28, 0.96), rgba(86, 125, 60, 0.95)),
    linear-gradient(45deg, #eeeed2 25%, transparent 25%),
    linear-gradient(-45deg, #eeeed2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #769656 75%),
    linear-gradient(-45deg, transparent 75%, #769656 75%);
  background-size: auto, 80px 80px, 80px 80px, 80px 80px, 80px 80px;
  background-position: 0 0, 0 0, 0 40px, 40px -40px, -40px 0px;
}

.chess-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 25% 40%, white 0%, transparent 45%),
    radial-gradient(circle at 75% 55%, white 0%, transparent 45%);
}

.chess-hero-content {
  position: relative;
  text-align: center;
  animation: fadeInUp 0.8s ease backwards;
}

.chess-hero-icon {
  font-size: 3.5em;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25));
}

.chess-hero-title {
  font-size: clamp(2em, 5vw, 2.9em);
  font-weight: 900;
  margin-bottom: 12px;
}

.chess-hero-subtitle {
  font-size: clamp(0.92em, 2.4vw, 1.08em);
  font-weight: 300;
  opacity: 0.84;
  max-width: 550px;
  margin: 0 auto 32px;
  line-height: 1.9;
}

.chess-hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 17px 34px;
  backdrop-filter: blur(12px);
}

.chess-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.chess-stat-number {
  font-size: 1.6em;
  font-weight: 900;
  line-height: 1;
}

.chess-stat-label {
  font-size: 0.78em;
  opacity: 0.7;
}

.chess-stat-divider {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.22);
}

.chess-hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}

.chess-hero-wave svg {
  width: 100%;
  height: 60px;
}

/* ════════════════════════════════════════
   سکشن‌های سطح‌ها
   ════════════════════════════════════════ */

.term-section {
  margin-bottom: 52px;
  animation: fadeInUp 0.7s ease backwards;
}

.term-section:nth-child(1) { animation-delay: 0.08s; }
.term-section:nth-child(2) { animation-delay: 0.16s; }
.term-section:nth-child(3) { animation-delay: 0.24s; }
.term-section:nth-child(4) { animation-delay: 0.32s; }
.term-section:nth-child(5) { animation-delay: 0.40s; }

.term-section:last-child {
  margin-bottom: 0;
}

.term-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 20px 24px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-right: 5px solid var(--level-color);
  flex-wrap: wrap;
}

.term-section-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55em;
  flex-shrink: 0;
}

.term-section-title {
  font-size: 1.25em;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 3px;
}

.term-section-desc {
  font-size: 0.86em;
  color: var(--text-secondary);
  line-height: 1.75;
}

.term-section-badge {
  margin-right: auto;
  padding: 6px 15px;
  background: var(--bg);
  border-radius: 50px;
  font-size: 0.74em;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  direction: ltr;
}

/* ════════════════════════════════════════
   کارت‌های ترم
   ════════════════════════════════════════ */

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 20px;
}

.terms-grid.single-term {
  grid-template-columns: minmax(305px, 1fr);
  max-width: 420px;
}

.term-card {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.term-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  transition: var(--transition);
}

.term-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.term-card:hover::before {
  height: 6px;
}

.term-number {
  align-self: flex-start;
  padding: 4px 14px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50px;
  font-size: 0.78em;
  font-weight: 800;
  margin-bottom: 15px;
  transition: var(--transition);
}

.term-card:hover .term-number {
  background: var(--accent);
  color: white;
}

.term-title {
  font-size: 1.2em;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 10px;
  transition: var(--transition);
}

.term-card:hover .term-title {
  color: var(--accent);
}

.term-description {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 18px;
  flex-grow: 1;
}

.term-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.term-meta span {
  font-size: 0.78em;
  color: var(--text-muted);
  font-weight: 600;
}

.term-action {
  align-self: flex-start;
  font-size: 0.83em;
  font-weight: 800;
  color: var(--accent);
  opacity: 0;
  transform: translateY(6px);
  transition: var(--transition);
}

.term-card:hover .term-action {
  opacity: 1;
  transform: translateY(0);
}

.term-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 56%);
  pointer-events: none;
}

.term-card:hover::after {
  opacity: 0.65;
}

/* ════════════════════════════════════════
   Responsive
   ════════════════════════════════════════ */

@media (max-width: 768px) {
  .chess-hero {
    padding: 44px 0 66px;
  }

  .chess-hero-icon {
    font-size: 2.8em;
  }

  .chess-hero-stats {
    gap: 16px;
    padding: 15px 22px;
  }

  .chess-stat-number {
    font-size: 1.35em;
  }

  .term-section {
    margin-bottom: 42px;
  }

  .term-section-header {
    padding: 17px 18px;
    gap: 12px;
  }

  .term-section-badge {
    margin-right: 0;
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .terms-grid,
  .terms-grid.single-term {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 15px;
  }

  .term-card {
    padding: 23px 21px 21px;
    min-height: auto;
  }

  .term-action {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .chess-hero-stats {
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px;
  }

  .chess-stat-divider {
    width: 42px;
    height: 1px;
  }
}