#screen-formation {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 18px 16px 14px;
  background:
    radial-gradient(circle at 50% 0, rgba(30, 117, 48, .44), transparent 34%),
    linear-gradient(180deg, #063017 0%, #020906 100%);
}

#screen-formation.active {
  display: flex;
  flex-direction: column;
}

#screen-formation .screen-header {
  flex: 0 0 76px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: start;
  margin: 0;
  text-align: center;
}

#screen-formation .screen-header .icon-button {
  grid-column: 1;
  width: 34px;
  height: 34px;
  margin-top: 4px;
  font-size: 36px;
}

#screen-formation .screen-header > div {
  grid-column: 2;
}

#screen-formation .screen-header h2 {
  font-size: clamp(20px, 5.6vw, 24px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .55);
}

#screen-formation .screen-header p {
  margin-top: 8px;
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.15;
}

#formation-list.formation-list {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - 76px - 66px - 28px);
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
}

.formation-card {
  position: relative;
  display: grid;
  grid-template-columns: 38% 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(5, 38, 20, .92);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .03),
    0 12px 24px rgba(0, 0, 0, .2);
  overflow: hidden;
  cursor: pointer;
}

.formation-card.selected {
  border-color: var(--yellow);
  box-shadow:
    0 0 0 2px rgba(255, 210, 26, .22),
    0 14px 28px rgba(0, 0, 0, .26);
}

.formation-thumb {
  display: block;
  justify-self: center;
  align-self: center;
  width: auto;
  height: min(82%, 150px);
  max-width: 100%;
  max-height: 82%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #0b3b1b;
  border: 1px solid rgba(255, 255, 255, .15);
}

.formation-card > div {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  z-index: 2;
}

.formation-name {
  font-size: clamp(28px, 8.4vw, 38px);
  line-height: .95;
  color: #fff;
  font-weight: 950;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .8);
}

.formation-desc {
  margin: 7px 0 0;
  font-size: 0;
  line-height: 1;
  color: var(--yellow);
  font-weight: 950;
  text-align: left;
}

.formation-desc:after {
  font-size: clamp(13px, 4vw, 17px);
}

.formation-card[data-formation='4-2-4'] .formation-desc:after { content: 'Ofensivo'; }
.formation-card[data-formation='4-3-3'] .formation-desc:after { content: 'Equilibrado'; }
.formation-card[data-formation='4-2-3-1'] .formation-desc:after { content: 'Organizado'; }

#screen-formation .bottom-button {
  position: static;
  flex: 0 0 52px;
  transform: none;
  width: min(336px, 86%);
  min-height: 52px;
  margin: 12px auto 0;
  border-radius: 11px;
  z-index: 5;
}

@media (min-width: 431px) {
  #screen-formation {
    max-width: 430px;
    margin: 0 auto;
  }
}

@media (max-height: 760px) {
  #screen-formation {
    padding-top: 12px;
    padding-bottom: 10px;
  }

  #screen-formation .screen-header {
    flex-basis: 60px;
  }

  #screen-formation .screen-header h2 {
    font-size: 19px;
  }

  #screen-formation .screen-header p {
    margin-top: 4px;
    font-size: 12px;
  }

  #formation-list.formation-list {
    height: calc(100dvh - 60px - 58px - 24px);
    gap: 8px;
  }

  .formation-card {
    grid-template-columns: 36% 1fr;
    padding: 8px 12px;
    gap: 14px;
  }

  .formation-thumb {
    height: min(78%, 128px);
    max-height: 78%;
  }

  .formation-name {
    font-size: 28px;
  }

  .formation-desc:after {
    font-size: 13px;
  }

  #screen-formation .bottom-button {
    flex-basis: 48px;
    min-height: 48px;
    margin-top: 10px;
  }
}

@media (max-height: 680px) {
  .formation-thumb {
    height: min(72%, 108px);
    max-height: 72%;
  }

  .formation-name {
    font-size: 25px;
  }

  .formation-desc:after {
    font-size: 12px;
  }
}
