@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css");

*, *::after, *::before {
    box-sizing: border-box;
    font-family: Arial;
    touch-action: manipulation;
    user-select: none;
    flex-wrap: wrap ;
  }

html {
    height:100%;
}

body {
  /* background-color: hsl(240, 3%, 7%); */
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding-bottom: 1em;
  align-content: center;
}

#top-bar {
  margin-top: 10em;
  /* width: 100%; */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;  

}

#title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1em;
}


@keyframes wave {

  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.2em);
  }
  
}

#main-title {
  font-size: 2em;
  font-weight: 600;
}

#main-title span {
  /* position: relative; */
  display: inline-block;
  animation: wave 0.3s ease-in-out;

}


.rainbow {
  font-weight: 600;
  background: linear-gradient(to right, #de3030,  #e07a34,  #e2c337,  #9dbd3d,  #40d6cf,  #3d9dbd,  #ab567e, #db2b7d, #de3030);
  /* background: linear-gradient(to right, #ff595e, #ffca3a, #8ac926, #1982c4, #6a4c93, #ff595e); */
  background-clip: text;
  color: transparent !important;
  animation: rainbow 2s infinite linear;
  background-size: 200% 100%;
}

@keyframes rainbow {
  
  0% {
    background-position: 0 0;
  }

100% {
    background-position: 200% 0;
}

}

#current-letter {
  font-size: 1.3em;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  font-size: 2em;
  color: black;
}


#game {
  display: flex;
  flex-direction: column;
  /* gap: 1em; */
  align-items: center;
  justify-content: center;

}

#not-keyboard {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
  align-items: center;
  justify-content: center;
}

#submitted {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.submitted-word {
  display: flex;
  flex-direction: row;
  font-size: 2em;
  gap: 1em;
  background-color: rgba(0, 0, 0, 0.13);
  width: 100%;
  align-items: center;
  justify-content:space-between;
  padding-left: 0.1em;
  padding-right: 0.1em;
}

.appear-bounce {
  animation: appear 250ms ease;
}

@keyframes appear {

  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }



}

.word-score {
  font-size: 0.8em;
  color: rgba(0, 0, 0, 0.733);
  font-weight: 600;
  display: flex;
  flex-direction: row;
  gap: 0.2em;

}

.penalty {
  /* font-size: 0.8em; */
  color: rgba(207, 47, 47, 0.733);
  font-weight: 600;
}

#penalty-alert {
  display: none;
  font-weight: 600;
}

#penalty-alert.show {
  color: rgba(235, 36, 36, 0.733);;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: show-penalty 200ms ease-out;
  margin-top: 1em;
}

@keyframes show-penalty {

  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }

}

#end-highscore {
  display: flex;
  justify-content: center;
  font-size: 1.2em;
  font-weight: 600;
  color: rgb(54, 54, 54);
  margin-bottom: 0.4em;
}

#score {
  display: flex;
  justify-content: center;
  font-size: 2em;
  font-weight: 600;
  gap: 0.1em;
  margin-bottom: 0.1em;
}

#current-score {
    display: flex;
    justify-content: center;
    /* font-size: 2em;
    font-weight: 600;
    gap: 0.1em; */
}

#current-score.add {
  animation: add 200ms ease-out;
}

@keyframes add {

  0% {
    color: black;
    transform: scale(1);
  }

  25% {
    color: greenyellow;
    transform: scale(1.5);
  }

  100% {
    color: black;
    transform: scale(1);
  }

}

#score-add {
  display: flex;
  color: gray;
  font-size: 0.8em;
}

#bottom-bar {
  display: flex;
  flex-direction: row;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  font-size: 1.5em;

}

#info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: baseline;
}

#attempts {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: end;
  /* padding-right: 0.5em; */
}

#spacer {
  display: flex;
  width: 20ch;
  font-size: 3em;
}

#textbox {

  display: flex;
  width: 100%;
  /* width: 5em; */
  /* height: 3em; */
  padding-left: 0.1em;
  padding-right: 0.1em;

  font-size: 3em;

  border-bottom: 0.2em rgb(77, 77, 77) solid;
  background-color: rgba(0, 0, 0, 0.13);

  margin-top: 0.4em;
  margin-bottom: 0.2em;

}

.fake-textbox {

  display: flex;
  width: 100%;
  /* width: 5em; */
  /* height: 3em; */
  padding-left: 0.1em;
  padding-right: 0.1em;

  font-size: 3em;

  border-bottom: 0.2em rgb(77, 77, 77) solid;
  background-color: rgba(0, 0, 0, 0.13);

  margin-top: 0.4em;
  margin-bottom: 0.2em;

}

.shake {
  color: rgb(255, 61, 27);
  animation: shake 250ms ease-in-out;
}
  

@keyframes shake {
  10% {
    transform: translateX(-5%);
  }

  30% {
    transform: translateX(5%);
  }

  50% {
    transform: translateX(-7.5%);
  }

  70% {
    transform: translateX(7.5%);
  }

  90% {
    transform: translateX(-5%);
  }

  100% {
    transform: translateX(0);
  }
}



#game-over {
  display: none;
}

#game-over.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin-top: 2em;
}

#practice-button {

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 2em;
  border: 3px solid black;
  border-radius: 5px;
  padding: 0.3em;

}

.panel {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.459);
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateZ(1em);
  /* display: none; */
  /* pointer-events: visiblePainted; */
}

.panel.show {
  display: flex;
  animation: show-panel 100ms ease-out;

}


@keyframes show-panel {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 100;
  }
}

.popup {
  display: none;
  width: 50%;
  height: 70%;
  background-color: white;
  border: 5px solid grey;
  flex-direction: column;
  align-items: center;
  position: relative;
  /* justify-content: center; */
}
.popup.show {
  display: flex;
  animation: show-popup 200ms ease-out;
}


@keyframes show-popup {

  25% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
  
}

.exit {
  color: black;
  /* width: 2em;
  height: 2em; */
  font-size: 4em;
  display: flex;
  justify-self: flex-end;
  align-self: flex-end;
  position: absolute;
}

#explanation {
  display: flex;
  flex-direction: column;
  padding: 0.5em;
  gap: 1em;
  justify-content: center;
  /* align-items: center; */
  font-size: 1.2em;
  height: auto;
  flex-wrap: wrap;
  text-align: center;
  /* text-align: center; */
  margin-top: 0.5em;
}

#examples {
  font-size: 0.8em;
}

#stats-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:flex-start;
  gap: 0.5em;
  font-size: 1.2em;
}

#letter-scores {

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgb(233, 233, 233);
  padding: 1em;
  width: 60%;
  gap: 0.1em;

}

#letter {
  font-size: 1.4em;
  margin-bottom: 0.4em;
}

#general-scores {

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgb(233, 233, 233);
  padding: 1em;
  width: 60%;
  gap: 0.1em;

}

#general {
  font-size: 1.4em;
  margin-bottom: 0.4em;
}



@media only screen and (max-height: 800px) {
  
  #top-bar {
    margin-top: 0.5em;
  }

  #stats-container {
    font-size: 1em;
    /* justify-content: center;
    align-items: center; */
  }

  .stat-box {
    width: 30% !important;
  }

  #explanation {
    display: flex;
    /* flex-direction: row; */
    font-size: 1em;
    gap: 0.5em;
  }

  #examples {
    font-size: 0.7em;
  }

  .popup {
    width: 90%;
    height: 90%;
  }


  /* #explanation {
    font-size: 1em;
  } */

}

@media only screen and (max-width: 500px) {
  #explanation {
    font-size: 1.5em;
  }

  #stats-container {
    font-size: 1.4em;
  }
}

@media only screen and (max-width: 800px) {


  #examples {
    font-size: 0.5em;
  }

  #spacer {
    width: 0ch;
  }


  body {
    font-size: clamp(.5rem, 2.5vmin, 1rem);
  }

  .submitted-word {
    font-size: 2.5em;
  }

  #top-bar {
    margin-top: 10em;
  }

  .button {
    font-size: 3em;
  }

  #title {
    font-size: 1.2em;
  }

  #game {
    /* height: 99%; */
    justify-content: space-between;
    width: 98%;
  }

  #not-keyboard {
  padding: 0.5em;
  }

  #game-over {
    font-size: 1.5em;
  }

  .popup {
    width: 80%;
    height: 70%;
  }

  .stat-box {
    width: 60% !important;
  }

}


