html,
body {
  height: 100dvh;
  margin: 0;
  background-color: hsl(0, 0%, 20%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.container {
  width: min(1000px, 100%);
  margin: 0 auto;
  columns: 4 min(300px, 100px);
  column-gap: clamp(0.2rem, 2vw, 1rem);
  padding: clamp(0.2rem, 2vw, 1.5rem);
}

.item {
  position: relative;
}

.item .name {
  display: block;
  position: absolute;
  text-align: center;
  font-size: clamp(1rem, 1.5vw, 2rem);
  font-weight: bold;
  text-shadow: 2px 0 white, -2px 0 white, 0 2px white, 0 -2px white,
    1px 1px white, -1px -1px white, 1px -1px white, -1px 1px white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  color: black;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-in-out, visibility 0s ease-in-out 0.2s;
}

.item img {
  display: block;
  margin-bottom: clamp(0.2rem, 2vw, 1rem);
  width: 100%;
  height: auto;
  object-fit: cover;
  user-select: none;
  border-radius: 0.5rem;
  border: clamp(0.1rem, 1vw, 0.2rem) solid hsl(0, 0%, 35%);
}

.item:hover .name {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease-in-out, visibility 0s ease-in-out 0s;
}

.item:hover img {
  border: clamp(0.1rem, 1vw, 0.2rem) solid white;
}
