/* Deck Building page styles */

.deck-building-page {
  background-color: var(--color-parchment);
  color: var(--color-ink);
}

/* Section base */
.deck-section {
  padding-block: var(--space-8);
}

.deck-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block-end: var(--space-6);
}

.deck-section__header--center {
  justify-content: center;
}

.deck-section__header h2 {
  margin-block-end: 0;
}

/* Motifs */
.deck-motif {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-color: var(--color-ink);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.deck-motif--footprint {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c-2.5 0-4 2-4 4.5 0 1.5.5 3 1.5 4.5L12 13l2.5-2c1-1.5 1.5-3 1.5-4.5C16 4 14.5 2 12 2zM5 18c0 2 1.5 3 3.5 3h7c2 0 3.5-1 3.5-3v-4H5v4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c-2.5 0-4 2-4 4.5 0 1.5.5 3 1.5 4.5L12 13l2.5-2c1-1.5 1.5-3 1.5-4.5C16 4 14.5 2 12 2zM5 18c0 2 1.5 3 3.5 3h7c2 0 3.5-1 3.5-3v-4H5v4z'/%3E%3C/svg%3E");
}

.deck-motif--battlement {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 20h2v-4h3v4h2v-4h3v4h2v-4h3v4h2v-4h3v4h2V8H2v12z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 20h2v-4h3v4h2v-4h3v4h2v-4h3v4h2v-4h3v4h2V8H2v12z'/%3E%3C/svg%3E");
}

.deck-motif--wave {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12c2-4 4-4 6 0s4 4 6 0 4-4 6 0' fill='none' stroke='%232B2620' stroke-width='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12c2-4 4-4 6 0s4 4 6 0 4-4 6 0' fill='none' stroke='%232B2620' stroke-width='2'/%3E%3C/svg%3E");
}

.deck-motif--warning {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 5l7 12H5l7-12zm-1 4v5h2v-5h-2zm0 7v2h2v-2h-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 5l7 12H5l7-12zm-1 4v5h2v-5h-2zm0 7v2h2v-2h-2z'/%3E%3C/svg%3E");
}

/* Hero */
.deck-hero {
  padding-block: var(--space-9);
  border-block-end: 1px solid rgba(43, 38, 32, 0.28);
}

.deck-hero__inner {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--container-gutter-mobile);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.deck-hero__motif {
  display: flex;
  justify-content: center;
  margin-block-end: var(--space-2);
}

.deck-hero__battlement {
  display: block;
  width: 48px;
  height: 12px;
  background-color: var(--color-ink);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 12'%3E%3Cpath d='M0 12V4h6v4h4V4h6v4h4V4h6v4h4V4h6v4h4V4h6v8H0z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 12'%3E%3Cpath d='M0 12V4h6v4h4V4h6v4h4V4h6v4h4V4h6v4h4V4h6v8H0z'/%3E%3C/svg%3E");
}

.deck-hero__title {
  font-size: var(--text-display-size);
  line-height: var(--text-display-line-height);
  margin-block-end: 0;
}

.deck-hero__lead {
  font-size: var(--text-body-large-size);
  line-height: var(--text-body-large-line-height);
  max-width: 620px;
  margin-inline: auto;
  margin-block-end: 0;
}

.deck-hero__cta {
  display: flex;
  justify-content: center;
}

.deck-hero__button {
  min-width: 220px;
}

.deck-hero__note {
  text-align: start;
  max-width: 620px;
  margin-block-start: var(--space-4);
}

/* Why section */
.deck-why {
  background-color: var(--color-parchment-deep);
}

.deck-why__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.deck-why__text {
  min-width: 0;
}

.deck-why__diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.deck-why__card-stack {
  position: relative;
  width: 180px;
  height: 220px;
}

.deck-why__card {
  position: absolute;
  width: 120px;
  height: 160px;
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.35);
  border-radius: var(--radius-lg);
}

.deck-why__card--one {
  top: 20px;
  left: 10px;
  transform: rotate(-8deg);
}

.deck-why__card--two {
  top: 10px;
  left: 30px;
  transform: rotate(2deg);
}

.deck-why__card--three {
  top: 0;
  left: 50px;
  transform: rotate(10deg);
}

/* Mechanics section */
.deck-mechanics__intro {
  max-width: 720px;
  margin-block-end: var(--space-6);
}

.deck-mechanics__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-block-end: var(--space-6);
}

.deck-card-note {
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.28);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  min-width: 0;
  transition: border-color var(--transition-base);
}

.deck-card-note:hover {
  border-color: var(--color-ink);
}

.deck-card-note__label {
  display: inline-block;
  font-size: var(--text-label-size);
  line-height: var(--text-label-line-height);
  letter-spacing: var(--text-label-letter-spacing);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-moss);
  margin-block-end: var(--space-2);
}

.deck-card-note--lord .deck-card-note__label {
  color: var(--color-deep-blue);
}

.deck-card-note--ability .deck-card-note__label {
  color: var(--color-warning-red);
}

.deck-card-note--support .deck-card-note__label {
  color: var(--color-ink-soft);
}

.deck-card-note__title {
  margin-block-end: var(--space-2);
}

/* Balance steps */
.deck-balance__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
}

.deck-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.28);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.deck-step__badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-duck-feather);
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  border-radius: 50%;
}

.deck-step__content {
  min-width: 0;
}

.deck-step__content h3 {
  margin-block-end: var(--space-2);
}

/* Synergy section */
.deck-synergy {
  background-color: var(--color-parchment-deep);
}

.deck-synergy__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.deck-synergy__text {
  min-width: 0;
}

.deck-synergy__list {
  margin-block-end: 0;
}

.deck-synergy__diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.deck-synergy__board {
  position: relative;
  width: 260px;
  height: 260px;
  background-color: var(--color-wood);
  border: 1px solid var(--color-wood-dark);
  border-radius: var(--radius-lg);
}

.deck-synergy__note {
  position: absolute;
  width: 70px;
  height: 90px;
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.35);
  border-radius: var(--radius-md);
}

.deck-synergy__note--tower {
  top: 20px;
  left: 95px;
}

.deck-synergy__note--shield {
  bottom: 20px;
  left: 20px;
}

.deck-synergy__note--bolt {
  bottom: 20px;
  right: 20px;
}

.deck-synergy__string {
  position: absolute;
  height: 2px;
  background-color: var(--color-warning-red);
  transform-origin: left center;
}

.deck-synergy__string--one {
  top: 65px;
  left: 130px;
  width: 80px;
  transform: rotate(55deg);
}

.deck-synergy__string--two {
  top: 65px;
  left: 130px;
  width: 80px;
  transform: rotate(-55deg);
}

.deck-synergy__string--three {
  bottom: 65px;
  left: 90px;
  width: 80px;
  transform: rotate(0deg);
}

.deck-synergy__footprint {
  position: absolute;
  top: 115px;
  left: 115px;
  width: 30px;
  height: 30px;
  background-color: var(--color-moss);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c-2.5 0-4 2-4 4.5 0 1.5.5 3 1.5 4.5L12 13l2.5-2c1-1.5 1.5-3 1.5-4.5C16 4 14.5 2 12 2zM5 18c0 2 1.5 3 3.5 3h7c2 0 3.5-1 3.5-3v-4H5v4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c-2.5 0-4 2-4 4.5 0 1.5.5 3 1.5 4.5L12 13l2.5-2c1-1.5 1.5-3 1.5-4.5C16 4 14.5 2 12 2zM5 18c0 2 1.5 3 3.5 3h7c2 0 3.5-1 3.5-3v-4H5v4z'/%3E%3C/svg%3E");
}

/* Archetypes */
.deck-archetypes__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.deck-archetype {
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.28);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  min-width: 0;
  transition: border-color var(--transition-base);
}

.deck-archetype:hover {
  border-color: var(--color-ink);
}

.deck-archetype--aggro {
  border-block-start: 3px solid var(--color-moss);
}

.deck-archetype--control {
  border-block-start: 3px solid var(--color-deep-blue);
}

.deck-archetype--combo {
  border-block-start: 3px solid var(--color-warning-red);
}

/* Adapt section */
.deck-adapt {
  background-color: var(--color-parchment-deep);
}

.deck-adapt__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.deck-adapt__text {
  min-width: 0;
}

.deck-adapt__diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.deck-adapt__wave {
  position: relative;
  width: 240px;
  height: 160px;
}

.deck-adapt__arrow {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--color-ink);
}

.deck-adapt__arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -5px;
  width: 0;
  height: 0;
  border-inline-start: 12px solid var(--color-warning-red);
  border-block-start: 6px solid transparent;
  border-block-end: 6px solid transparent;
}

.deck-adapt__arrow--one {
  top: 20px;
}

.deck-adapt__arrow--two {
  top: 70px;
  transform: scaleX(0.8);
}

.deck-adapt__arrow--three {
  top: 120px;
  transform: scaleX(0.6);
}

/* Mistakes */
.deck-mistakes__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.deck-mistake {
  background-color: var(--color-parchment);
  border: 1px solid rgba(43, 38, 32, 0.28);
  border-inline-start: 4px solid var(--color-warning-red);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  min-width: 0;
}

/* Advanced */
.deck-advanced__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.deck-advanced__grid .callout {
  margin-block-end: 0;
}

/* Reference table */
.deck-reference__intro {
  max-width: 720px;
  margin-block-end: var(--space-5);
}

.deck-reference__table-wrap {
  max-width: 720px;
  overflow-x: auto;
}

.deck-reference__table {
  min-width: 480px;
}

/* Continue section */
.deck-continue {
  padding-block-start: 0;
  padding-block-end: var(--space-9);
}

.deck-continue__separator {
  height: 8px;
  background-color: var(--color-wood);
  margin-block-end: var(--space-8);
}

.deck-continue__inner {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--container-gutter-mobile);
  text-align: center;
}

.deck-continue__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.deck-continue__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-block-end: 0;
}

.deck-continue__links a {
  font-weight: 600;
}

.deck-continue__cta {
  display: flex;
  justify-content: center;
}

.deck-continue__button {
  min-width: 220px;
}

/* Tablet and desktop */
@media (min-width: 768px) {
  .deck-hero__inner,
  .deck-continue__inner {
    padding-inline: var(--container-gutter-tablet);
  }

  .deck-why__grid,
  .deck-synergy__grid,
  .deck-adapt__grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .deck-mechanics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-archetypes__grid,
  .deck-mistakes__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deck-advanced__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .deck-hero__inner,
  .deck-continue__inner {
    padding-inline: var(--container-gutter-desktop);
  }

  .deck-mechanics__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck-card-note,
  .deck-archetype {
    transition: none;
  }
}
