@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

html, body {

  font-family: 'Orbitron', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom, #000000, #222222);
  color: #f49756;
  text-align: center;
  height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /*justify-content: space-between;*/
}

#gameTitle {
  display: block;
  align-items: center;
  white-space: nowrap;
  font-size: clamp(3vw, 4vw, 8vw);
  font-weight: 600;
  min-height: 150px;
  margin-top: 50px;
}

#overlays > div {
  display: none;
}

#overlays > div.active {
  display: block;
}

.keyboard {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 600px;
  margin-bottom: 20px;
  background: #111111;
  padding: 1px;
  border-radius: 10px;
  box-shadow: 0 0 10px #666666;
  position: fixed; /* Fixed position to keep it at the bottom */
  bottom: 0; /* Align to the bottom of the viewport */
  left: 50%; /* Center it horizontally */
  transform: translateX(-50%); /* Adjust for centering */
  /*z-index: 100; /* Ensure it stays above other content */
  margin-top: 0; /* Remove any margin that might cause a gap */
  padding-top: 1%; /* Remove any padding that might cause a gap */
}

.key-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
}

.key {
  background-color: #D47756;
  border: none;
  border-radius: 6px;
  font-size: 2.5rem;
  cursor: pointer;
  color: #FDFCFB;
  text-shadow: 0px 0px 3px #000000;
  padding: 8px;
  box-shadow: 0 0 5px #666666;
  background: linear-gradient(145deg, #D25646, #D47756);
  transform: scale(1);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  width: 10%;
  height: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#Dummy {
  background: transparent; /* or match the background color */
  border: 1px solid rgba(255, 255, 255, 0.05); /* Lighter and more transparent */
  font-size: 2.5rem;
  cursor:not-allowed;
  
}

.key:hover:not(.disabled) {
  background-color: #D47756;
  transform: scale(1.2);
  box-shadow: 0 0 10px #D47756;
}

.key.disabled {
  background-color: #1a1a1a;
  color: #666666;
  cursor: not-allowed;
  box-shadow: none;
}

#level {
  justify-content: center;
  font-weight: bold;
  margin: 30px 0;
  font-size: clamp(1vw, 3vw, 6vw);
}

#gameArea {
  display: block;
  align-items: center;
  justify-content: center; /* Center vertically */
  margin: 0;
  padding: 0;
}

.game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;

}

#attempts {
  font-size: clamp(1vw, 3vw, 6vw);
  margin-top: 0;
  margin-bottom: 5px;
}

#word {
  display: block;
  align-items: center;
  white-space: nowrap;
  font-size: clamp(2vw, 4vw, 8vw);
  font-weight: bold;
  text-shadow: 2px 2px 4px #522200;
  padding: 6px;
  border-radius: 10px;
  margin-bottom: 10px;
  max-width: 90%;
  margin: 0 auto;
}

#hint-container{
  margin-top: 10px;
  display: block;
  width: 100%;
  font-style: italic;
}

#hintSpan{
  font-size: clamp(1.8vw, 2.4vw, 3.8vw);
}

#hint {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  font-size: clamp(1vw, 3vw, 6vw);
  color: #f49756;
  border-radius: 6px;
}



.word-container {
  width: 100%;
  text-align: center;
  font-size: clamp(1vw, 3vw, 6vw);
}

#word .letter.letter-reveal {
  opacity: 1;
  animation: fadeIn 0.9s ease;
}

#gameOver, #gameWin, #howToPlay {
  background: linear-gradient(to bottom, #000000, #222222);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  color: #f49756;
  display: block;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 1000;
 padding-top: 10%;
  box-sizing: border-box;
  overflow: hidden;
}

#gameOver h2, #gameWin h2, #howToPlay h2 {
  font-size: clamp(1vw, 3vw, 6vw);
  margin: 10px 0;
  max-width: 80%;
  overflow: hidden;
  flex-wrap: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  display: inline-block;
}

#gameOver p, #gameWin p, #howToPlay p {
  white-space: normal;
  max-width: 80%;
  margin: 20px auto;
  font-size: clamp(1vw, 3vw, 6vw);
  text-align: center;
  word-wrap: break-word;
  word-break: break-word;
}

.game-button {
  font-family: 'Orbitron', sans-serif;
  background-color: #D47756;
  border: none;
  border-radius: 5px;
  font-size: clamp(1vw, 2vw, 4vw);
  cursor: pointer;
  color: #FDFCFB;
  text-shadow: 0px 0px 3px #000000;
  box-shadow: 0 0 5px #666666;
  background-color: #D25646;
  color: #FDFCFB;
  box-shadow: 0 0 10px #D47756;
  margin-bottom: 20px;
  position: fixed; /* Fixed position to keep it at the bottom */
  bottom: 0; /* Align to the bottom of the viewport */
  left: 50%; /* Center it horizontally */
  transform: translateX(-50%); /* Adjust for centering */
  /*z-index: 100; /* Ensure it stays above other content */
  margin-top: 0; /* Remove any margin that might cause a gap */
  padding: 5px;
}

.soundcontrols {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px; /* Adjust the gap as needed */
  margin-bottom: 0; /* Remove any margin that might cause a gap */
  padding-bottom: 0; /* Remove any padding that might cause a gap */
}

.soundcontrols .slider-container {
  display: flex;
  align-items: center;
  gap: 5px; /* Adjust the gap as needed */
}

.soundcontrols #muteButton {
  margin: 0; /* Adjust the margin as needed */
}

.slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* Adjust the gap as needed */
  margin-bottom: 10px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; /* Adjust the width as needed */
  max-width: 300px; /* Set a max-width if necessary */
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(145deg, #D25646, #D47756);
  outline: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f49756;
  cursor: pointer;
  box-shadow: 0 0 5px #666666;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f49756;
  cursor: pointer;
  box-shadow: 0 0 5px #666666;
}


@media (max-width: 768px) {

  #gameTitle{
min-height: max-content;
margin-bottom: 100px;

    font-size: clamp(5vw, 7vw, 9vw);
    text-wrap: nowrap;
  }

  #word{
    font-size: clamp(5vw, 6vw, 9vw);

  }

  #hintSpan{

    font-size: clamp(2vw, 4vw, 6vw);
  }

  #hint {
    font-size: clamp(2vw, 4vw, 6vw);

  }

  #level{
    margin-top: 50px;
    font-size: clamp(2vw, 4vw, 6vw);
  }
  .key {
    width: auto;
    flex: 1;
    font-size: 1.5rem;
    padding: 6px;
    width: 12%;
    height: 35px;
  }

  
  .keyboard {
    width: 96%;
    min-width: 315px;
  }
  #gameOver, #gameWin, #howToPlay {
    width: 90%;
    left: 5%;
    font-size: 5vw;
  }
  #gameOver p, #gameWin p, #howToPlay p {
    max-width: 90%;
    font-size: 3vw;
  }

  .soundcontrols{
    font-size: clamp(1vw, 3vw, 6vw);
    padding: 0 5px;
  }

  .slider-container {
    flex-direction: row; /* Ensure it stays in a row on smaller screens */
    gap: 5px; /* Adjust the gap for smaller screens */
  }

  .slider {
    max-width: 190px; /* Adjust the max-width for smaller screens */
  }
.game-button{
  font-size: clamp(3vw, 4vw, 5vw);
}

/* Additional animations */
@keyframes revealWord {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLevel {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.word-reveal-animation {
  animation: revealWord 1s ease-out forwards;
}

.level-reveal-animation {
  animation: fadeInLevel 1s ease-out forwards;
}

.word-fade-out {
  animation: fadeOut 1.5s forwards;
}

@keyframes levelIncrease {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-30px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 1; }
}

.level-up {
  animation: levelIncrease 1.5s ease-in-out forwards;
}