body {
  margin: 0;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  background: url("darknoise.png") repeat scroll 0% 0% rgb(34, 34, 34);
  color: rgb(245, 245, 245);
}

.memeboard {
  margin: 10px auto;
  max-width: calc(100% - 20px);
  display: grid;
  grid-gap: 10px;
  --tile-size: 200px;
  grid-template-columns: repeat(auto-fit, var(--tile-size));
  grid-auto-rows: var(--tile-size);
  grid-auto-flow: dense;
  justify-content: center;
}

@media (orientation: portrait) and (max-width: 640px) {
  .memeboard {
    --tile-size: calc((100vw - 40px) / 3);
  }
}

@media (orientation: landscape) and (max-height: 640px) {
  .memeboard {
    --tile-size: calc((100vh - 40px) / 3);
  }
}

.meme {
  position: relative;
  margin: 0;
}

.meme--wide {
  grid-column: span 2;
}

.meme--tall {
  grid-row: span 2;
}

.meme img {
  max-width: 100%;
  max-height: 100%;
  background-color: white;
}

.meme figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  background: rgba(54, 54, 54, 0.75);
  padding: 0.5rem;
  text-align: center;
}

.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: 0.2s ease;
  background-color: rgb(54, 54, 54);
  color: rgb(245, 245, 245);
}

.overlay:hover {
  opacity: 0.75;
}

.overlay--success {
  background-color: hsl(141, 100%, 30%);
}
