:root {
  --main-bg-color: #998888;
  --main-light-color: #e6dbd0;
  --main-title-color: #754f5b;
  --main-text-color: #e6e6e9;
  --main-false-color: #b6244f;
  --main-element-color: #7d6167;
}

* {
  font-family: "Raleway", sans-serif;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--main-bg-color);
  padding: 0 10px;
}
.container {
  width: 850px;
  background: var(--main-light-color);
  display: flex;
  gap: 70px;
  align-items: flex-end;
  padding: 60px 40px;
  border-radius: 10px;
}
.hangman-box {
  max-width: 270px;
}
.hangman-box h1 {
  font-size: 1.45rem;
  margin-top: 20px;
  text-align: center;
  text-transform: uppercase;
  color: var(--main-title-color);
}
.word-display {
  display: flex;
  gap: 10px;
  list-style: none;
  align-items: center;
  justify-content: center;
}
.word-display .letter {
  width: 28px;
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 40px;
  border-bottom: 3px solid var(--main-element-color);
}
.word-display .letter.guessed {
  color: var(--main-element-color);
  border-color: transparent;
  margin: -40px 0px 35px;
}
.game-box h4 {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 15px;
}
.game-box h4 b {
  font-weight: 600;
}
.game-box .guesses-text b {
  color: var(--main-false-color);
}
.game-box .keyboard {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 40px;
}

:where(.game-modal, .keyboard) button {
  cursor: pointer;
  color: var(--main-text-color);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  border-radius: 4px;
  text-transform: uppercase;
  background-color: var(--main-element-color);
  border: none;
}
:where(.game-modal, .keyboard) button:hover {
  background-color: var(--main-light-color);
  color: var(--main-element-color);
  border: 2px solid var(--main-element-color);
  margin: -2px 0px;
}
.keyboard button {
  width: calc(100% / 9 - 5px);
  padding: 7px;
}
.keyboard button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.game-modal {
  opacity: 0;
  z-index: -5;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  transition: opacity 400ms ease;
}
.game-modal .content {
  display: block;
  margin: auto;
  width: 100%;
  max-width: 420px;
  text-align: center;
  border-radius: 10px;
  border: none;
  padding: 30px;
}
.game-modal img {
  width: 250px;
}
.game-modal h4 {
  font-size: 1.53rem;
}
.game-modal p {
  font-size: 1.15rem;
  margin: 15px 0 30px;
  font-weight: 500;
}
.game-modal p b {
  color: var(--main-element-color);
  font-weight: 600;
}
.game-modal button {
  padding: 12px 23px;
}
.game-modal.displayed {
  opacity: 1;
  z-index: 5;
  cursor: auto;
}

@media (max-width: 782px) {
  .container {
    flex-direction: column;
    padding: 30px 15px;
    align-items: center;
  }
  .hangman-box img {
    max-width: 200px;
  }
  .hangman-box h1 {
    display: none;
  }
}
