:root {
  --yellow: #dbd600;
  --green: #32b195;
  --blue: #0058a8;
  --red: #d58282;
}

body {
  background-color: #333333;
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  /* height: 100vh; */
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#container {
  position: relative;
  display: grid;
  gap: 1.5rem;
  /* grid-template-columns: minmax(6rem, 1fr) minmax(10rem, 1fr) 3fr minmax(
      5rem 1fr
    ); */
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "title title"
    "board board"
    "img alph";
  width: 90vw;
  max-width: 700px;
  height: 70vh;
  margin: auto;
  /* padding: 10px 0; */
}

#title {
  grid-area: title;
  color: #ffffff;
  font-size: 4rem;
  text-align: center;
  letter-spacing: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
}

#board {
  font-size: 2rem;
  color: #222222;
  grid-area: board;
  letter-spacing: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* border: 5px solid #ffffff; */
  background-color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  padding: 2rem;
  border-radius: 5rem;
}

#board.won {
  background-color: var(--green);
  color: #ffffff;
}

#board.lost {
  background-color: var(--red);
  color: #ffffff;
}

#hangin-dude {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-area: img;
  background-color: var(--yellow);
  padding: 1rem;
  border-radius: 3rem;
  /* min-height: 350px; */
}

#hangin-dude img {
  width: 90%;
  height: auto;
}

#alphabet {
  grid-area: alph;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  background-color: none;
  padding: 0;
  text-transform: uppercase;
  text-align: center;
  border-radius: 1rem;
  color: #ffffff;
}

h1 {
  width: 100%;
  padding: 0.8rem 0;
  font-size: 2rem;
  margin: 3px 0;
}

#timer {
  /* grid-area: bot; */
  position: absolute;
  top: 0;
  right: 0;
  font-size: 1.5rem;
  background-color: var(--yellow);
  text-align: center;
  /* display: flex;
  align-items: center;
  justify-content: center; */
  padding: 10px 20px;
  border-radius: 5rem;
}

#timer.timeout {
  background-color: var(--red);
}

#timer::before {
  display: inline-block;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;

  font: var(--fa-font-regular);
  content: "\f254";
  margin-right: 8px;
}

.letter {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 0.8rem;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0.3rem;
  cursor: pointer;
  font-size: 2rem;
}

.letter:not(.hit):not(.not-hit):hover {
  border: 2px solid var(--green);
  color: var(--green);
  box-shadow: 0px 0px 12px 0px #999999;
}

.hit {
  border: 1px solid var(--green);
  background-color: var(--green);
  cursor: default;
}

.not-hit {
  background-color: var(--red);
  border: 1px solid var(--red);
  cursor: default;
}

h1.won {
  color: var(--green);
}

h1.lost {
  color: var(--red);
}

.answer {
  width: 100%;
}

.answer .password {
  color: rgb(50, 177, 149);
  font-weight: 600;
}

.btn {
  margin-top: 2rem;
  color: #333333;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 10rem;
  padding: 1rem 2rem;
  cursor: pointer;
}

.btn:hover {
  box-shadow: 0px 0px 12px 0px #999999;
  border: 2px solid #ffffff;
  background-color: #eeeeee;
}

/* .play {
  color: #008800;
}

.play:hover {
  cursor: pointer;
  font-size: 40px;
  transition: all 0.2s ease-in-out;
} */

/* Shaking Animation */

.shake {
  /* Start the shake animation and make the animation last for 0.5 seconds */
  animation: shake 0.5s;

  /* When the animation is finished, start again */
  animation-iteration-count: infinite;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

/* Responsive */

@media screen and (max-width: 940px) and (min-width: 521px) {
  body {
    font-size: 1.4rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  #title {
    font-size: 2.5rem;
    letter-spacing: 0.5rem;
  }

  .letter {
    font-size: 1.8rem;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.3rem;
  }
}

@media screen and (max-width: 520px) {
  body {
    font-size: 1.2rem;
  }

  #timer {
    position: relative;
    grid-area: timer;
  }

  h1 {
    font-size: 1.4rem;
  }
  #title {
    font-size: 1.8rem;
    letter-spacing: 0.5rem;
  }

  #container {
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title title"
      "timer timer"
      "board board"
      "img img"
      "alph alph";
  }

  #board {
    font-size: 1.5rem;
    padding: 1rem;
  }

  #hangin-dude img {
    max-width: 60%;
  }

  .letter {
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
    margin: 0.3rem;
  }
}
