* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Heebo", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}

body {
  display: flex;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: rgb(255, 255, 255);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 55%,
    rgba(55, 180, 213, 1) 89%
  );
}

h1 {
  font-size: 50px;
  text-shadow: 2px 2px 5px white;
  color: black;
}

.container {
  display: flex;
  width: 850px;
  gap: 70px;
  padding: 60px 40px;
  background: rgb(5, 42, 247);
  background: linear-gradient(
    138deg,
    rgba(5, 42, 247, 1) 0%,
    rgba(28, 163, 139, 1) 50%
  );
  border-radius: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: solid 2px;
  box-shadow: 10px 10px 50px black;
}

.hangman-box img {
  user-select: none;
  max-width: 270px;
  /* background-color: rgb(200, 200, 200); */
  border: double 4px rgb(229, 255, 0);
  border-radius: 15px;
  padding: 5px;
}

.hangman-box h1 {
  font-size: 1.45rem;
  text-align: center;
  margin-top: 20px;
  text-transform: uppercase;
}

.game-box .word-display {
  gap: 10px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.word-display .letter {
  width: 28px;
  font-size: 2rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 40px;
  text-transform: uppercase;
  border-bottom: 3px solid #000;
}

.word-display .letter.guessed {
  margin: -40px 0 35px;
  border-color: transparent;
}

.hint-text {
  display: none;
}

.game-box h4 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 15px;
  margin-top: 15px;
}

#hint-btn {
  opacity: 1;
  padding: 5px 5px;
  display: flex;
  justify-content: center;
  width: 100%;
  color: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: capitalize;
  background: #202453;
}

#hint-btn:hover {
  background: #09e08e;
  color: #000;
  border: 2px solid #000;
}

.hint-text {
  font-weight: 900;
}

.game-box h4 b {
  font-weight: 600;
}
.game-box .guesses-text b {
  color: #c4ee0a;
  font-weight: 500;
}
.game-box .keyboard {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 35px;
  justify-content: center;
}
:where(.game-modal, .keyboard) button {
  color: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  background: #202453;
  animation: flip-horizontal-bottom 0.9s cubic-bezier(0.455, 0.03, 0.515, 0.955)
    both;
}

@keyframes flip-horizontal-bottom {
  0% {
    transform: rotateX(0);
  }
  50% {
    transform: rotateX(180deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}

.keyboard button {
  padding: 7px;
  width: calc(100% / 9 - 5px);
}
.keyboard button[disabled] {
  pointer-events: none;
  opacity: 0.6;
}
:where(.game-modal, .keyboard) button:hover {
  background: #8b8b90;
}

.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 0 10px;
  transition: opacity 0.4s ease;
}
.game-modal.show {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s 0.4s ease;
}
.game-modal .content {
  padding: 30px;
  max-width: 420px;
  width: 100%;
  border-radius: 10px;
  background: #fff;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.game-modal img {
  max-width: 300px;
  margin-bottom: 20px;
}
.game-modal img[src="images/win.gif"] {
  margin-left: -10px;
}
.game-modal h4 {
  font-size: 2.53rem;
}
.game-modal p {
  font-size: 1.75rem;
  margin: 15px 0 30px;
  font-weight: 500;
}
.game-modal p b {
  color: #5e63ba;
  font-weight: 600;
}
.game-modal button {
  padding: 12px 23px;
}

@media only screen and (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 30px 15px;
    align-items: center;
  }
  .hangman-box img {
    max-width: 200px;
  }
  .hangman-box h1 {
    display: none;
  }
  .game-box h4 {
    font-size: 1rem;
  }
  .game-box .keyboard {
    margin-bottom: 1rem;
  }
  .word-display .letter {
    margin-bottom: 35px;
    font-size: 1.7rem;
  }
  .word-display .letter.guessed {
    margin: -35px 0 25px;
  }
  .game-modal img {
    max-width: 120px;
  }
  .game-modal h4 {
    font-size: 1.45rem;
  }
  .game-modal p {
    font-size: 1.1rem;
  }
  .game-modal button {
    padding: 10px 18px;
  }
}

.animate__bounce:hover {
  --animate-duration: 2s;
}
