* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
}

html,
body {
  color: white;
  background: #121213;
  text-align: center;
}

h1 {
  font-family: "Roboto Slab", serif;
}

header {
  position: fixed;
  width: 100%;
  text-align: center;
}

#settings {
  cursor: pointer;
  position: fixed;
  top: 5px;
  right: 20px;
  font-size: 2rem;
}

.wordLengthContainer {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.settingButton {
  z-index: 2;
  border-radius: 5px;
  cursor: pointer;
  background: #818384;
  min-width: 3rem;
  min-height: 3rem;
  margin: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settingButton.active {
  background: #538d4e;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

#message {
  z-index: 2;
  display: none;
  font-weight: 900;
  color: black;
  background: gainsboro;
  margin: 0 auto;
  border-radius: 5px;
  padding: 1rem;
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -80%);
  animation: fadeIn 1.5s forwards;
}

#message.show {
  display: block;
}

#grid {
  display: grid;
}

.square {
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: calc(4vmin + 0.5rem);
  margin: 0.2rem;
  max-width: 4rem;
  max-height: 4rem;
  border: 2px solid #3a3a3c;
}

.square.shake {
  animation: shake 0.4s forwards;
}

.square.semi-correct {
  animation: flipSemiCorrect 0.5s forwards;
}

.square.wrong {
  animation: flipWrong 0.5s forwards;
}

.square.correct {
  animation: flipCorrect 0.5s forwards;
}
.square.jump {
  animation: jump 0.4s forwards;
  background: #538d4e;
}

.square.bump {
  animation-name: bump;
  animation-duration: 0.2s;
}

.square.entered {
  border-color: #565758;
}

#keyboard {
  position: fixed;
  bottom: 0;
  width: 96%;
  max-width: 600px;
}

.keyboard-row {
  margin: 0.5rem 0;
  display: flex;
  width: 100%;
  justify-content: center;
}

button {
  max-width: 2rem;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: bold;
  margin: 3px;
  height: 3rem;
  border-radius: 0.2rem;
  border: none;
  background-color: #818384;
  color: white;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

button.wrong {
  background: #3a3a3c;
}

button.semi-correct {
  background: #b59f3b;
}
button.correct {
  background: #538d4e;
}

.enter,
.delete {
  max-width: 5rem;
  padding: 0.4rem;
}

#statsContainer,
#settingsContainer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: gainsboro;
  color: #121213;
  padding: 1rem;
  border-radius: 1rem;
  display: none;
}

#statsContainer.show,
#settingsContainer.show {
  display: block;
}

.statsContainer-inner {
  position: relative;
}

#closeButton {
  position: absolute;
  top: 0;
  right: 0;
  cursor: pointer;
}

.stats {
  display: flex;
  flex-direction: row;
}

.stats div {
  flex-direction: column;
  padding: 1rem;
  justify-content: center;
  display: flex;
  flex: 1 1 0;
}

.stats > div > .stat {
  font-size: 1.2rem;
  font-weight: 700;
}

.answer {
  font-weight: bold;
  font-size: 1.1rem;
}

#answer {
  font-size: 1.25rem;
  text-transform: uppercase;
  text-decoration: underline;
}

#again {
  cursor: pointer;
  background: #538d4e;
  padding: 1rem;
  border-radius: 5px;
  font-weight: 700;
  color: white;
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flipSemiCorrect {
  0% {
    transform: rotateX(0deg);
  }
  49% {
    background: none;
    border: 2px solid #3a3a3c;
  }
  50% {
    transform: rotateX(90deg);
    border: none;
    background: #b59f3b;
  }
  100% {
    transform: rotateX(0deg);
    border: none;
    background: #b59f3b;
  }
}
@keyframes flipWrong {
  0% {
    transform: rotateX(0deg);
  }
  49% {
    background: none;
    border: 2px solid #3a3a3c;
  }
  50% {
    transform: rotateX(90deg);
    border: none;
    background: #3a3a3c;
  }
  100% {
    transform: rotateX(0deg);
    border: none;
    background: #3a3a3c;
  }
}
@keyframes flipCorrect {
  0% {
    transform: rotateX(0deg);
  }
  49% {
    background: none;
    border: 2px solid #3a3a3c;
  }
  50% {
    transform: rotateX(90deg);
    border: none;
    background: #538d4e;
  }
  100% {
    transform: rotateX(0deg);
    border: none;
    background: #538d4e;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes shake {
  0% {
    transform: translateX(-5px);
  }
  20% {
    transform: translateX(5px);
  }
  40% {
    transform: translateX(-5px);
  }
  60% {
    transform: translateX(5px);
  }
  80% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes jump {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  80% {
    transform: translateY(10px);
  }
  95% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}
