:root {
  --rows: 13;
  --cols: 10;
  --size: 15px;
}

* {
  margin: 0;
  padding: 0;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto,
    Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell,
    Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji,
    Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif;
}
html {
  background-color: #000;
}

body {
  background-color: hsl(224, 44%, 95%);
  background: url("../images/background_p.png") no-repeat center center fixed;
  width: 100vw; /* Sets body width to fill the viewport */
  min-height: 100vh; /* Fallback */
  min-height: calc(
    100vh - env(safe-area-inset-bottom)
  ); /* Sets body height to fill the viewport */
  display: none;
}

#game {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow-y: auto;
  position: relative;
  padding-bottom: 50px;
  min-height: 100vh;
}

#current-turn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
}

#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(100% - 15px);
  max-width: 450px;
  max-height: 650px;
  height: 450px;
  margin-top: 100px;
}

.guess-box {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 0.2rem;
  margin: 0 0 0.2rem 0;
  width: 80%;
}

.current {
  filter: drop-shadow(3px 3px 10px rgb(202, 216, 228));
}
.selected {
  outline: 2px solid #f94646;
}

.bad-guess {
  animation: wiggle 0.5s;
}
.cell {
  aspect-ratio: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  text-transform: uppercase;
  border: none;
  font-size: 1.3rem;
  border-radius: 2px;
  background: #fff;
  margin: 0;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 600;
}

.cell.missing {
  background: #8693ab;
  color: white;
}

.cell.exact {
  background: #5ddd60;
  color: white;
  font-size: 1.1rem;
}

.cell.close {
  background: #ffba08;
  color: white;
  font-size: 1.1rem;
}

#timer {
  display: flex;
  width: 100%;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: #000;
  column-gap: 10px;
  margin-left: 20px;
  img {
    width: 30px;
    height: 30px;
  }
}

.user_wrapper {
  display: none;
  flex-direction: row;
  align-items: center;
  z-index: 10;
  height: 100px;
  width: 100%;
  justify-content: center;
}

.user_name {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  margin-right: 10px;
}

.user_image_wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  height: 56px;
  position: relative;
}

.user_circle {
  width: 54px;
  height: 54px;
  border-radius: 27px;
  border: 2px solid #9afaa3;
  overflow: hidden;
}

.user_image {
  width: 56px;
  height: auto;
  background-size: cover;
}

.level_wrapper {
  background-color: #9afaa3;
  position: absolute;
  bottom: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: 10px;
  padding: 0px 10px;
  left: 6px;
  width: 25px;
}

.level_icon,
.coin_icon {
  width: 12px;
  height: 12px;
}

.level {
  font-size: 12px;
  color: #082d2a;
  font-weight: 600;
  margin-left: 2px;
}

.player2 {
  margin-left: 10px;
  margin-right: 0;
}

.coin_wrapper {
  height: 30px;
  padding: 0px 15px;
  margin-left: -10px;
  margin-right: -10px;
  z-index: 10;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coins {
  font-size: 13px;
  color: #0fe880;
  font-weight: 600;
  margin-left: 3px;
  word-break: keep-all;
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 40px);
  max-width: 450px;
  padding: 0px 20px;
  flex-direction: row;
  margin: 10px 0px;
}

.progress-image {
  width: 25px;
  height: 25px;
  border: 2px solid #228b22;
}

.progress-name {
  font-size: 1.2rem;
  color: #000;
  font-weight: 400;
  text-transform: uppercase;
}

.progress-correct {
  font-size: 2rem;
  color: #000;
  font-weight: 400;
  text-transform: uppercase;
}

#modal {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
}

/* Modal Content/Box */
#modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 58%;
  box-sizing: border-box;
  border: 10px solid #13359e;
  border-radius: 30px;
}

/* The Close Button */
.close {
  color: #fff;
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  z-index: 10;
}
.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  border: 5px solid #fff;
  border-radius: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.modal-header,
.modal-header-2 {
  background-color: #69aec4;
  height: 150px;
  width: 100%;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-footer {
  background-color: #4497aa;
  flex: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  margin-top: -30px;
  justify-content: center;
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  width: 200%;
}
.modal-footer-wrapper {
  width: 50%;
  display: flex;
  flex-direction: column;
  row-gap: 80px;
  align-items: center;
  margin-top: -30px;
  padding: 0px 20px;
  box-sizing: border-box;
}
#modal-text {
  text-align: center;
  font-size: 2rem;
  color: #fff;
  width: 80%;
  margin-top: 30px;
  font-weight: bold;
}
.modal-text-footer {
  text-align: center;
  font-size: 1.5rem;
  color: #fff;
  width: 80%;
}

.exit-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  align-self: flex-end;
  margin-top: 0px;
  width: 100%;
}
.button-wrapper {
  display: flex;
  justify-content: flex-end;
  column-gap: 15px;
  padding: 0px 20px;
  width: 100%;
}

.exit-wrapper img {
  width: 35px;
  height: 35px;
  cursor: pointer;
}

.action-buttons {
  display: none;
  justify-content: center;
  width: 100%;
  max-width: 450px;
  padding: 0px 20px;
  margin-top: 20px;
  column-gap: 30px;
}

.action-button {
  cursor: pointer;
}

.action-button img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

#exit-game {
  border-radius: 5px;
}

#continue {
  border-radius: 5px;
}

#modal-2,
#modal-3,
#modal-4 {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
}

/* Modal Content/Box */
#modal-content-2,
#modal-content-3,
#modal-content-4 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 30%;
  box-sizing: border-box;
  border: 10px solid #13359e;
  border-radius: 30px;
}

#modal-body-2,
#modal-body-3,
#modal-body-4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  border: 5px solid #fff;
  border-radius: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
#modal-text-2,
#modal-text-3,
#modal-text-4 {
  text-align: center;
  font-size: 2rem;
  color: #fff;
  width: 80%;
  margin-top: 30px;
  font-weight: bold;
}
#correct_word {
  margin-top: 20px;
  text-align: center;
  font-size: 1.2rem;
  color: #fff;
  width: 80%;
}

#modal-text-3 {
  font-weight: bold;
}

#modal-timer {
  margin-top: 20px;
  text-align: center;
  font-size: 1.5rem;
  color: #000;
  width: 80%;
}

#modal-body-3 {
  justify-content: start;
  row-gap: 30px;
}

.modal-span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8em;
  width: 2.4em;
  height: 2.4em;
  background-color: white;
  box-sizing: border-box;
  border-radius: 2px;
  border-width: 2px;
  color: rgba(0, 0, 0, 0.7);
}

.example-missing {
  background: #8693ab;
  color: white;
}

.example-close {
  background: #ffba08;
  color: white;
}

.example-exact {
  background: #5ddd60;
  color: white;
}

.example {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0;
  gap: 0.2rem;
}

.example span {
  font-size: 1.4rem;
}

.example-p {
  line-height: 30px;
}

.example-p span {
  position: relative;
  border-width: 1px;
  border-radius: 1px;
  font-size: 0.4em;
  transform: scale(2) translate(0, -10%);
  margin: 0 1em;
}

.keyboard {
  --gap: 0.2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 180px;
}

.keyboard .row {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  flex: 1;
}

.keyboard button,
.keyboard button:disabled {
  --size: min(8vw, 4vh, 40px);
  background-color: white;
  color: black;
  width: var(--size);
  border: none;
  border-radius: 2px;
  font-size: calc(var(--size) * 0.5);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
}

.keyboard button.exact {
  background: #5ddd60;
  color: white;
}

.keyboard button.missing {
  opacity: 0.5;
}

.keyboard button.close {
  background: #ffba08;
  color: white;
}

.keyboard button:focus {
  background: #f94646;
  color: white;
  outline: none;
}

.keyboard button[data-key="enter"],
.keyboard button[data-key="backspace"] {
  position: absolute;
  bottom: 0;
  width: calc(1.5 * var(--size));
  height: calc(1 / 3 * (100% - 2 * var(--gap)));
  text-transform: uppercase;
  font-size: calc(0.3 * var(--size));
  padding-top: calc(0.15 * var(--size));
}

.keyboard button[data-key="enter"] {
  right: calc(50% + 3.5 * var(--size) + 0.8rem);
}

.keyboard button[data-key="backspace"] {
  left: calc(50% + 3.5 * var(--size) + 0.8rem);
}

.keyboard button[data-key="enter"]:disabled {
  opacity: 0.5;
}

@keyframes wiggle {
  0% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(-2px);
  }
  30% {
    transform: translateX(4px);
  }
  50% {
    transform: translateX(-6px);
  }
  70% {
    transform: translateX(+4px);
  }
  90% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}
