@font-face {
  font-family: "Porky";
  src: url("/font/Porky/PORKYS_.woff2") format("woff2"),
    url("/font/Porky/PORKYS_.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: "Porky", "Comic Sans MS";
}

html,
body {
  background-color: rgb(189, 217, 252);
  transition: background-color 0.5s;
  height: 100%;
  margin: 0;
  min-height: 100vh;
  min-width: 275px;
}

.bg-image {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-height: 50vh;
  overflow: hidden;
}

.bg-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(214, 235, 255, 0.5);
  z-index: 1;
}

.bg-image img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 0;
}

.site-text {
  background-color: rgb(153, 197, 255);
  color: black;
  text-align: center;
  width: clamp(100px, 80%, 800px);
  margin: 20px auto;
  padding: 20px;
  font-family: porky;
  border-radius: 15px;
  letter-spacing: 1px;
  font-size: clamp(8px, 2vw, 16px);
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(104, 183, 236);
  font-size: 32;
  color: white;
  padding: 5px;
  font-family: "porky";
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(87, 169, 223);
  font-size: 32;
  color: white;
  padding: 5px;
  font-family: "porky";
  position: sticky;
  top: 0;
  z-index: 100;
}

.footer {
  display: flex;
  background-color: rgb(87, 169, 223);
  padding: 5px;
  color: white;
  font-family: "porky";
  justify-content: center;
  align-items: center;
  width: 100%;
  position: fixed;
  bottom: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 40px;
}

#wordSearchControls {
  padding-bottom: 50px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#puzzle-wordsearch {
  position: relative;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

#canvasSearch {
  background: white;
  position: absolute;
  z-index: 0;
  border: solid black 2px;
  height: 100%;
  aspect-ratio: 1;
  top: 11.25px;
}

#bankDiv {
  background-color: #99c5ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "porky";
  padding: 10px;
  border-radius: 10px;
  width: 80%;
  margin: 0 auto;
}

#bankGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  line-height: 0px;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

/* throbber */
#wordsearchThrobber {
  border: solid black 2px;
  min-width: 85%;
  height: 70vh;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lds-ripple,
.lds-ripple div {
  box-sizing: border-box;
}
.lds-ripple {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ripple div {
  position: absolute;
  border: 4px solid currentColor;
  opacity: 1;
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes lds-ripple {
  0% {
    top: 36px;
    left: 36px;
    width: 8px;
    height: 8px;
    opacity: 0;
  }
  4.9% {
    top: 36px;
    left: 36px;
    width: 8px;
    height: 8px;
    opacity: 0;
  }
  5% {
    top: 36px;
    left: 36px;
    width: 8px;
    height: 8px;
    opacity: 1;
  }
  100% {
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}

@keyframes mascot-jump {
  0% {
    top: 0;
  }

  50% {
    top: -25px;
  }

  100% {
    top: 0;
  }
}

#mascot {
  position: relative;
  width: 50%;
}

.--jump {
  animation: mascot-jump 0.5s ease-in-out;
}

#fgCanvas {
  position: absolute;
  z-index: 1;
  aspect-ratio: 1;
  top: 11.25px;
  height: 100%;
}

#lineCanvas {
  position: absolute;
  z-index: 1;
  aspect-ratio: 1;
  top: 11.25px;
  height: 100%;
}

.--hidden {
  display: none !important;
}

#canvi {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 70vh;
  aspect-ratio: 1;
  padding: 10px 0;
}

.wordBankItem {
  font-size: clamp(16px, 5vw, 32px);
}

.wordInput {
  width: 90%;
  border-radius: 5px;
}

#generateNew {
  position: absolute;
  top: 6.25px;
  z-index: -2;
  border: 10px solid;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 1s;
}

#generateNewButton {
  width: 30%;
  height: 10%;
  border-radius: 10px;
  border-width: 1px;
}

#generateNewButton:hover {
  color: red;
}

#mascotBox {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80%;
}

#speakingBox {
  opacity: 0;
  transition: opacity 0.5s;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  display: block;
  width: 300px;
  height: fit-content;
  background: white;
  border-radius: 25px;
  padding: 10px 25px;
  font-size: clamp(8px, 2vw, 16px);
}

#inputText {
  margin-top: -10px;
}

@media (min-width: 1280px) {
  #puzzle-wordsearch {
    flex-direction: row;
    align-items: flex-end;
    height: 70vh;
    gap: 25px;
  }
  #mascotBox {
    gap: 25px;
    flex-direction: column;
    width: fit-content;
  }
  #mascot {
    width: auto;
    height: 50%;
  }
  #bankDiv {
    margin-top: 25px;
  }
}

@media (max-width: 90vh) {
  #puzzle-wordsearch {
    gap: 50px;
    width: 75vw;
    align-items: center;
    justify-content: center;
  }
  #canvi {
    width: 75vw;
    height: 75vw;
  }
}

button {
  font-family: "Porky";
  letter-spacing: 0.1em;
  padding: 10px;
  background: rgb(127, 171, 246);
  border-radius: 20px;
  transition: transform 0.1s;
}
button:hover {
  transform: scale(1.01, 1.01);
}
