body {
  margin: 0;
  font-family: var(--font);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  touch-action: manipulation;
  background: var(--wallpaper) no-repeat center center fixed;
  background-size: cover;
}

@font-face {
  font-family: "Poppins";
  src: url(assets/poppins-regular.woff2);
}

@font-face {
  font-family: "Comic Sans MS";
  src: url(assets/comic-sans-ms.woff2);
}

#word-input {
  font-family: var(--font);
  margin: 20px 20px 0 20px;
  width: 90%;
  font-size: 200%;
  text-transform: uppercase;
  border: 2px solid var(--primary-color);
  border-bottom-width: 1px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  text-align: center;
}

#word-input:focus {
  outline: none;
}

#word-buttons-wrapper {
  margin: 0 20px 20px 20px;
  display: flex;
  width: calc(90% + 8px);
}

#word-submit,
#word-backspace {
  font-size: 200%;
  font-weight: bold;
  width: 100%;
  border-top-width: 1px;
}

#word-backspace {
  border-right: none;
  border-bottom-left-radius: 5px;
}

#word-submit {
  border-bottom-right-radius: 5px;
}

#word-input.error,
#word-input.error + #word-buttons-wrapper {
  animation: horizontal-shaking 0.5s ease-in-out;
  background-color: red;
  color: white;
}

@keyframes horizontal-shaking {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(1%);
  }
  50% {
    transform: translateX(-1%);
  }
  75% {
    transform: translateX(1%);
  }
  100% {
    transform: translateX(0);
  }
}

#word-input.warning,
#word-input.warning + #word-buttons-wrapper {
  animation: vertical-shaking 0.5s ease-in-out;
  background-color: skyblue;
  color: white;
}

@keyframes vertical-shaking {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(10%);
  }
  50% {
    transform: translateY(-10%);
  }
  75% {
    transform: translateY(10%);
  }
  100% {
    transform: translateY(0);
  }
}

#score {
  font-size: 200%;
  font-weight: bold;
  text-align: center;
}

.score-shake {
  animation: score-shake 0.5s ease-in-out;
}

@keyframes score-shake {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8%);
  }
  100% {
    transform: translateY(0);
  }
}

#letters-wrapper {
  margin: 10%;
}

#letters {
  font-size: 300%;
  display: flex;
  justify-content: space-between;
  user-select: none;
}

#letter-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.letter {
  background: var(--primary-color);
  color: var(--secondary-color);

  -webkit-mask-image: var(--letter-shape);
  mask-image: var(--letter-shape);
  cursor: pointer;
  padding: 15px;
  border-radius: 5px;
  width: 50px;
  height: 50px;
  text-align: center;
  font-weight: bold;
}

.letter-0 {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.text-outline {
  text-shadow: -1px -1px 0 var(--secondary-color),
    1px -1px 0 var(--secondary-color), -1px 1px 0 var(--secondary-color),
    1px 1px 0 var(--secondary-color);
  color: var(--primary-color);
}

#solutions {
  width: 90%;
  font-size: 175%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 70px;
}

@media (min-width: 800px) {
  #solutions {
    grid-template-columns: repeat(3, 1fr);
  }
}

#solutions > * {
  max-width: 100%;
  text-align: center;
  color: inherit;
  text-decoration: none;
  font-weight: bold;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cheated {
  color: var(--cheated-color) !important
}

.pop-word {
  animation: pop-word 3s ease-in-out;
  display: flex !important;
  position: fixed;
  z-index: 100;
  font-size: 300%;
  text-align: center;
  font-weight: bold;
  aspect-ratio: 1;
  min-width: 128px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.pop-word::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url(assets/shine.png) no-repeat center center;
  background-size: 100% auto;
  animation: spin 3s ease-in-out;
  z-index: -1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pop-word {
  0% {
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
  }
  25% {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  50% {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  100% {
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
  }
}

.confirm {
  display: flex;
  justify-content: flex-end;
}

.confirm > div {
  display: none;
}

.confirm.show > div {
  display: block;
}

.confirm.show > button {
  display: none;
}

#bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: calc(100% - 20px);
  max-height: fit-content;
  padding: 10px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.bottom-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.bottom-group:first-child {
  align-items: flex-start;
}

#settings-overlay-wrapper {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: 100;
}

#settings-overlay-wrapper.show {
  display: block;
}

#settings-overlay {
  position: absolute;
  bottom: 12%;
  left: 5%;
  width: 85%;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

#settings-overlay > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#settings-letters {
  font-family: monospace;
  width: 7ch;
}

button {
  font-family: var(--font);
  font-size: 100%;
  border: 2px solid var(--primary-color);
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.icon-button {
  font-size: 150%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}
