.shelf {
  container: shelf / inline-size;
  min-width: 0;
}

.shelf-games, .shelf-support {
  display: grid;
  gap: 10px;
}

.shelf .game-card > a {
  display: block;
  padding: 0;
}

.shelf .game-card img {
  width: 100%;
  height: auto;
  padding: 0;
  aspect-ratio: 1;
  border-radius: var(--radius) var(--radius) 0 0;
}

.shelf .game-card h3 {
  padding: 10px 12px;
}

.shelf--gallery .shelf-games,
.shelf--mosaic .shelf-games {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shelf--list .shelf-games {
  gap: 4px 18px;
}

.shelf--list .game-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

:is(.shelf--list, .shelf-support) .game-card > a {
  display: grid;
  grid-template-columns: clamp(44px, 12cqi, 64px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
}

:is(.shelf--list, .shelf-support) .game-card img {
  border-radius: min(var(--radius), 10px);
}

:is(.shelf--list, .shelf-support) .game-card h3 {
  padding: 0 4px 0 0;
}

.shelf--list .game-card a:hover {
  background: var(--soft);
}

.shelf-games > .shelf-lead {
  background: var(--header);
  color: #fff;
}

.shelf .shelf-lead > a {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 180px;
}

.shelf .shelf-lead img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  border-radius: inherit;
  object-position: center 42%;
}

.shelf-lead > a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(0deg, #100917f5, #10091700 75%);
}

.shelf .shelf-lead h3 {
  padding: 18px;
  font-family: var(--display);
  font-size: clamp(1.3rem, 5cqi, 2.35rem);
}

.shelf--mosaic .game-card:nth-child(-n+2) {
  background: var(--soft);
}

.shelf--mosaic .game-card:nth-child(-n+2) h3 {
  font-size: 1.08rem;
}

.shelf--mosaic .game-card:nth-child(n+3) img {
  aspect-ratio: 2 / 1;
}

.games .shelf--spotlight,
.games .shelf--mosaic {
  grid-column: 1 / -1;
}

@container shelf (min-width: 470px) {
  .shelf--gallery .shelf-games {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shelf--list .shelf-games, .shelf-support {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelf-support > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@container shelf (min-width: 550px) {
  .shelf--mosaic .shelf-games {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .shelf--mosaic .game-card {
    grid-column: span 3;
  }

  .shelf--mosaic .game-card:nth-child(-n+2) {
    grid-column: span 6;
  }

  .shelf--mosaic .game-card:nth-child(-n+2) img {
    aspect-ratio: 2 / 1;
  }

  .shelf--mosaic .game-card:nth-child(n+3) img {
    aspect-ratio: 4 / 3;
  }

  .gamer .shelf--mosaic .game-card:nth-child(n+3) {
    grid-column: span 4;
  }
}

@container shelf (min-width: 720px) {
  .shelf--spotlight .shelf-games {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  }

  .shelf--mosaic .game-card:nth-child(-n+2) img {
    aspect-ratio: 2.5 / 1;
  }
}

@container shelf (min-width: 850px) {
  .shelf--gallery .shelf-games {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .shelf--list .shelf-games {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gamer :is(.shelf--gallery, .shelf--list) .shelf-games {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gamer .shelf--mosaic .game-card:nth-child(n+3) {
    grid-column: span 2;
  }
}
