html {
  box-sizing: border-box;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  font-family: "Lato", sans-serif;
  background-color: #242f49;
  color: #ffa586;
}

.container {
  text-align: center;
  position: relative;
}

h1,
h3 {
  font-family: "Poetsen One", sans-serif;
  color: #b51a2b;
  font-weight: bold;
}

.screen {
  display: none;
}

#welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#welcome-screen ol {
  text-align: left;
}

ol li {
  padding-bottom: 5px;
}

#welcome-screen h3,
#welcome-screen label {
  margin-bottom: 25px;
}

input[type="radio"] {
  accent-color: #186049;
}

#game-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  display: none;
  position: relative;
}

#start-button {
  width: 150px;
  height: 35px;
  color: #ffa586;
  background-color: #186049;
  border: 1px solid #186049;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: rgba(0, 0, 0, 0.1) 0 2px 2px, rgba(0, 0, 0, 0.1) 0 4px 4px,
    rgba(0, 0, 0, 0.1) 0 8px 8px, rgba(0, 0, 0, 0.1) 0 16px 16px,
    rgba(0, 0, 0, 0.1) 0 32px 32px, rgba(0, 0, 0, 0.1) 0 64px 64px;
}

#start-button:hover {
  background-color: #1a7a5a;
}

#word-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  display: none;
}

#word-input-container label,
#word-input-container input,
#word-input-container button {
  display: block;
  margin: 15px 0;
  width: 100%;
  text-align: center;
}

#word-input-container button {
  height: 35px;
  color: #ffa586;
  background-color: #186049;
  border: 1px solid #186049;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: rgba(0, 0, 0, 0.1) 0 2px 2px, rgba(0, 0, 0, 0.1) 0 4px 4px,
    rgba(0, 0, 0, 0.1) 0 8px 8px, rgba(0, 0, 0, 0.1) 0 16px 16px,
    rgba(0, 0, 0, 0.1) 0 32px 32px, rgba(0, 0, 0, 0.1) 0 64px 64px;
}

#word-input-container button:hover {
  background-color: #1a7a5a;
}

.word-input {
  background-color: #86a8cf;
}

.figure {
  fill: none;
  stroke: #ffa586;
  stroke-width: 4px;
}

.figure-part {
  display: none;
}

#word {
  margin-top: 20px;
  font-size: 30px;
  letter-spacing: 10px;
}

.letter {
  display: inline-block;
  border-bottom: 3px solid #ffa586;
  width: 20px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  margin: 0 5px;
  font-weight: bold;
}

#wrong-letters-container {
  margin-top: 20px;
}

#wrong-letters {
  color: #b51a2b;
  letter-spacing: 20px;
  font-size: 1.5em;
}

.notification-container {
  display: none;
  background-color: #ffa586;
  color: #242f49;
  padding: 10px;
  border-radius: 5px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  transition: opacity 0.3s ease, bottom 0.3s ease;
  opacity: 0;
}

.notification-container.show {
  display: block;
  opacity: 1;
  bottom: 40px;
}

.popup-container {
  display: none;
  background-color: rgba(0, 0, 0, 0.7);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.popup {
  background-color: #384358;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
}

#play-button {
  background-color: #186049;
  color: #ffa586;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 10px;
}

#play-button:hover {
  background-color: #1a7a5a;
}

.home-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #186049;
  color: #ffa586;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  display: none;
  z-index: 50;
}

.home-button:hover {
  background-color: #1a7a5a;
}

#timer,
#points {
  margin-top: 10px;
  font-size: 20px;
  font-weight: bold;
}

#final-message {
  font-size: 24px;
  font-weight: bold;
  color: #ffa586;
  margin-bottom: 20px;
}

/* On-screen keyboard styles */
.keyboard-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 450px;
  margin: 20px auto;
  padding: 10px;
}

.key {
  width: 38px;
  height: 38px;
  background-color: #186049;
  color: #ffa586;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  text-transform: uppercase;
  transition: background-color 0.2s, transform 0.1s;
}

.key:hover:not(:disabled) {
  background-color: #1a7a5a;
  transform: scale(1.05);
}

.key:disabled {
  background-color: #555;
  cursor: not-allowed;
  opacity: 0.6;
}

.key.correct {
  background-color: #2e7d32;
}

.key.wrong {
  background-color: #b51a2b;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .container {
    width: 100%;
  }

  .figure {
    width: 100%;
  }

  #word {
    font-size: 20px;
  }

  .letter {
    width: 15px;
    height: 30px;
    line-height: 30px;
  }

  #wrong-letters {
    font-size: 1em;
    letter-spacing: 10px;
  }

  .home-button {
    padding: 5px 10px;
  }

  #play-button {
    padding: 5px 10px;
  }

  .keyboard-container {
    max-width: 100%;
    gap: 3px;
  }

  .key {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

