body,
html {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: white;
  background-color: black;
  height: 100%;
}

main {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

button {
  font-size: 1rem;
}

video {
  left: 0;
  top: 0;
  position: absolute;
  height: 100%;
  width: 100%;
}

.bottom {
  position: absolute;
  bottom: 1svh;
  margin-left: auto;
  margin-right: auto;
  transform: translate(-50%);
  -webkit-text-stroke: 3px black;
  paint-order: stroke fill;
  width: 100%;
}

.top {
  position: absolute;
  top: 1svh;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  z-index: 5;
  gap: 1rem;
  transform: translate(-50%);
}

button {
  color: white;
  background: black;
  border: solid 1px white;
  padding: 5px 20px;
  border-radius: 0.3rem;
  font-size: 1.5em;
}

#preview {
  display: flex;
  flex-direction: column;
}

.invisible {
  display: none !important;
}

.rainbow-button {
  animation: rainbow-bg 2.5s linear;
  animation-iteration-count: infinite;
}

.rainbow-button:hover {
  animation: rainbow 2.5s linear;
  animation-iteration-count: infinite;
}

.rainbow {
  animation: rainbow 2.5s linear;
  animation-iteration-count: infinite;
}

dialog {
  padding: 0;
  border: none;
  background: transparent;
  outline: 0;
  max-width: 50%;
  height: 100%;
}

dialog::backdrop {
  backdrop-filter: blur(5px);
}

#dialog-container {
  display: flow-root;
  padding: 10px;
  background-color: black;
  color: white;
  border: 1px solid white;
  border-radius: 1rem;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
}

p {
  font-size: 1.2rem;
  text-align: left;
}

@keyframes rainbow {
  100%,
  0% {
    color: rgb(255, 0, 0);
  }
  8% {
    color: rgb(255, 127, 0);
  }
  16% {
    color: rgb(255, 255, 0);
  }
  25% {
    color: rgb(127, 255, 0);
  }
  33% {
    color: rgb(0, 255, 0);
  }
  41% {
    color: rgb(0, 255, 127);
  }
  50% {
    color: rgb(0, 255, 255);
  }
  58% {
    color: rgb(0, 127, 255);
  }
  66% {
    color: rgb(0, 0, 255);
  }
  75% {
    color: rgb(127, 0, 255);
  }
  83% {
    color: rgb(255, 0, 255);
  }
  91% {
    color: rgb(255, 0, 127);
  }
}

.rainbow-bg {
  animation: rainbow-bg 2.5s linear;
  animation-iteration-count: infinite;
}

@keyframes rainbow-bg {
  100%,
  0% {
    background-color: rgb(255, 0, 0);
  }
  8% {
    background-color: rgb(255, 127, 0);
  }
  16% {
    background-color: rgb(255, 255, 0);
  }
  25% {
    background-color: rgb(127, 255, 0);
  }
  33% {
    background-color: rgb(0, 255, 0);
  }
  41% {
    background-color: rgb(0, 255, 127);
  }
  50% {
    background-color: rgb(0, 255, 255);
  }
  58% {
    background-color: rgb(0, 127, 255);
  }
  66% {
    background-color: rgb(0, 0, 255);
  }
  75% {
    background-color: rgb(127, 0, 255);
  }
  83% {
    background-color: rgb(255, 0, 255);
  }
  91% {
    background-color: rgb(255, 0, 127);
  }
}

@media only screen and (max-width: 600px) {
  dialog {
    max-width: 80%;
  }
}
