/* Strona Mechaniki Rozgrywki – style należące wyłącznie do tej strony */

.mechaniki-page {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-padding-mobile);
  padding-block: var(--space-2xl);
}

/* Wspólne nagłówki sekcji */
.section-heading {
  max-width: var(--container-default);
  margin-block-end: var(--space-xl);
}

.section-heading h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  margin-block-end: var(--space-sm);
  position: relative;
  padding-block-end: var(--space-sm);
}

.section-heading h2::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  background-color: var(--color-wheat);
  margin-block-start: var(--space-xs);
}

.section-lead {
  font-size: var(--text-body-large);
  line-height: var(--leading-body-large);
  color: var(--color-brown);
}

/* Hero */
.hero-section {
  margin-block-end: var(--space-4xl);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
  align-items: center;
}

.hero-copy {
  grid-column: 1 / 8;
  min-width: 0;
}

.hero-title {
  font-size: clamp(2rem, 5vw, var(--text-h1));
  line-height: var(--leading-h1);
  margin-block-end: var(--space-lg);
  position: relative;
  padding-block-end: var(--space-md);
}

.hero-title::after {
  content: "";
  display: block;
  width: 6rem;
  height: 3px;
  background-color: var(--color-rust);
  margin-block-start: var(--space-sm);
}

.hero-lead {
  font-size: var(--text-body-large);
  line-height: var(--leading-body-large);
  margin-block-end: var(--space-xl);
}

.hero-cta {
  min-width: 220px;
}

.hero-figure {
  grid-column: 8 / 13;
  min-width: 0;
  margin: 0;
}

.hero-image,
.prep-image,
.exploration-image {
  width: 100%;
  height: auto;
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  display: block;
}

.hero-figure figcaption,
.prep-figure figcaption,
.exploration-figure figcaption {
  margin-block-start: var(--space-xs);
}

/* Pętla rozgrywki */
.loop-section {
  margin-block-end: var(--space-4xl);
}

.loop-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--container-default);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.loop-step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.step-number {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-rust);
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
}

.step-content {
  min-width: 0;
  flex: 1;
}

.step-content h3 {
  margin-block-end: var(--space-xs);
}

.step-content p {
  margin: 0;
}

/* Przyjmowanie zadań i wybór ładunku */
.tasks-section {
  margin-block-end: var(--space-4xl);
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
}

.tasks-card {
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.tasks-card:first-child {
  grid-column: 1 / 8;
}

.tasks-card:last-child {
  grid-column: 8 / 13;
}

.tasks-card h3 {
  margin-block-end: var(--space-sm);
}

.tasks-card p {
  margin: 0;
}

/* Przygotowanie pickupa i ładunku */
.prep-section {
  margin-block-end: var(--space-4xl);
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
  align-items: center;
}

.prep-copy {
  grid-column: 1 / 8;
  min-width: 0;
}

.prep-copy h2 {
  margin-block-end: var(--space-md);
  position: relative;
  padding-block-end: var(--space-sm);
}

.prep-copy h2::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  background-color: var(--color-wheat);
  margin-block-start: var(--space-xs);
}

.prep-copy h3 {
  margin-block-start: var(--space-lg);
  margin-block-end: var(--space-xs);
}

.prep-copy p {
  margin-block-end: var(--space-md);
}

.prep-copy p:last-child {
  margin-block-end: 0;
}

.prep-figure {
  grid-column: 8 / 13;
  min-width: 0;
  margin: 0;
}

/* Jazda między lokacjami i zarządzanie czasem */
.driving-section {
  margin-block-end: var(--space-4xl);
}

.driving-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
}

.driving-card {
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.driving-card:first-child {
  grid-column: 1 / 8;
}

.driving-card:last-child {
  grid-column: 8 / 13;
}

.driving-card h3 {
  margin-block-end: var(--space-sm);
}

.driving-card p {
  margin: 0;
}

/* Wykonywanie zadań i interakcje z mieszkańcami */
.delivery-section {
  margin-block-end: var(--space-4xl);
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
}

.delivery-card {
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.delivery-card:first-child {
  grid-column: 1 / 8;
}

.delivery-card:last-child {
  grid-column: 8 / 13;
}

.delivery-card h3 {
  margin-block-end: var(--space-sm);
}

.delivery-card p {
  margin: 0;
}

/* System postępu i rozwoju przygody */
.progress-section {
  margin-block-end: var(--space-4xl);
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
}

.progress-card {
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.progress-card:first-child {
  grid-column: 1 / 8;
}

.progress-card:last-child {
  grid-column: 8 / 13;
}

.progress-card h3 {
  margin-block-end: var(--space-sm);
}

.progress-card p {
  margin: 0;
}

/* Zaawansowane wskazówki i typowe błędy */
.tips-section {
  margin-block-end: var(--space-4xl);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
}

.tips-card {
  background-color: var(--color-cream-muted);
  border: var(--border-forest-15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.tips-card--good {
  grid-column: 1 / 8;
  border-inline-start: 4px solid var(--color-forest);
}

.tips-card--bad {
  grid-column: 8 / 13;
  border-inline-start: 4px solid var(--color-rust);
}

.tips-card h3 {
  margin-block-end: var(--space-sm);
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tips-list li {
  position: relative;
  padding-inline-start: var(--space-lg);
  line-height: var(--leading-body);
}

.tips-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-wheat);
}

.tips-card--bad .tips-list li::before {
  background-color: var(--color-rust);
}

/* Eksploracja i tajemnica lasu */
.exploration-section {
  margin-block-end: var(--space-4xl);
}

.exploration-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-xl);
  align-items: center;
}

.exploration-copy {
  grid-column: 1 / 8;
  min-width: 0;
}

.exploration-copy h2 {
  margin-block-end: var(--space-md);
  position: relative;
  padding-block-end: var(--space-sm);
}

.exploration-copy h2::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  background-color: var(--color-wheat);
  margin-block-start: var(--space-xs);
}

.exploration-copy h3 {
  margin-block-start: var(--space-lg);
  margin-block-end: var(--space-xs);
}

.exploration-copy p {
  margin-block-end: var(--space-md);
}

.exploration-copy p:last-child {
  margin-block-end: 0;
}

.exploration-figure {
  grid-column: 8 / 13;
  min-width: 0;
  margin: 0;
}

/* Podsumowanie i dalsze kroki */
.summary-section {
  margin-block-end: 0;
}

.summary-copy {
  max-width: var(--container-default);
  margin-block-end: var(--space-xl);
}

.summary-copy h2 {
  margin-block-end: var(--space-md);
  position: relative;
  padding-block-end: var(--space-sm);
}

.summary-copy h2::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  background-color: var(--color-wheat);
  margin-block-start: var(--space-xs);
}

.summary-copy p {
  margin-block-end: var(--space-md);
}

.summary-copy p:last-child {
  margin-block-end: 0;
}

.summary-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  max-width: var(--container-default);
}

.summary-cta .btn {
  min-width: 180px;
}

/* Animacje pojawiania się ilustracji */
.hero-image,
.prep-image,
.exploration-image {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.hero-image.is-visible,
.prep-image.is-visible,
.exploration-image.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tablet */
@media (min-width: 48rem) and (max-width: 74.999rem) {
  .mechaniki-page {
    padding-inline: var(--container-padding-desktop);
  }

  .hero-copy,
  .prep-copy,
  .exploration-copy {
    grid-column: 1 / 7;
  }

  .hero-figure,
  .prep-figure,
  .exploration-figure {
    grid-column: 7 / 13;
  }

  .tasks-card:first-child,
  .driving-card:first-child,
  .delivery-card:first-child,
  .progress-card:first-child,
  .tips-card--good {
    grid-column: 1 / 7;
  }

  .tasks-card:last-child,
  .driving-card:last-child,
  .delivery-card:last-child,
  .progress-card:last-child,
  .tips-card--bad {
    grid-column: 7 / 13;
  }
}

/* Mobile */
@media (max-width: 47.999rem) {
  .mechaniki-page {
    padding-inline: var(--container-padding-mobile);
    padding-block: var(--space-xl);
  }

  .hero-grid,
  .tasks-grid,
  .prep-grid,
  .driving-grid,
  .delivery-grid,
  .progress-grid,
  .tips-grid,
  .exploration-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .hero-copy,
  .hero-figure,
  .prep-copy,
  .prep-figure,
  .exploration-copy,
  .exploration-figure,
  .tasks-card:first-child,
  .tasks-card:last-child,
  .driving-card:first-child,
  .driving-card:last-child,
  .delivery-card:first-child,
  .delivery-card:last-child,
  .progress-card:first-child,
  .progress-card:last-child,
  .tips-card--good,
  .tips-card--bad {
    grid-column: 1 / -1;
  }

  .hero-title {
    font-size: var(--text-h1);
  }

  .hero-lead {
    font-size: var(--text-body);
  }

  .hero-cta {
    width: 100%;
  }

  .loop-step {
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .step-number {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    font-size: var(--text-body);
  }

  .summary-cta {
    flex-direction: column;
  }

  .summary-cta .btn {
    width: 100%;
  }
}
