* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #000;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.stage {
  display: grid;
  width: 100vw;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 1.25rem;
  overflow: hidden;
}

.meme-control {
  position: relative;
  width: min(82vw, 58svh, 620px);
  transform: translateY(clamp(1.8rem, 10svh, 5rem));
  animation: appear 700ms ease-out both;
}

.meme-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meme-button:focus-visible {
  outline: 2px solid #e8dfd3;
  outline-offset: 9px;
}

.meme {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid rgb(225 183 134 / 26%);
  object-fit: contain;
  box-shadow: 0 0 54px rgb(151 53 32 / 14%), 0 0 180px rgb(117 32 18 / 9%);
  transform: rotate(-0.45deg);
  transition: filter 180ms ease, transform 180ms ease;
}

.meme-button:hover .meme {
  filter: brightness(1.07);
  transform: rotate(0deg) scale(1.015);
}

.meme-button:active .meme {
  transform: rotate(0deg) scale(0.99);
}

.click-cue {
  position: absolute;
  z-index: 1;
  top: -40%;
  left: -3%;
  width: 78%;
  height: auto;
  filter: invert(1) contrast(4);
  pointer-events: none;
}

@keyframes appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-height: 520px) {
  .meme-control {
    width: min(72vw, 54svh, 460px);
    transform: translateY(clamp(1.5rem, 8svh, 2.5rem));
  }
}
