* {
  box-sizing: border-box;
}

body {
  /* a nice font that uses a user's built in font */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;

  color: #333;
  margin: 0;
  padding: 0;
}

.navbar {
  border-bottom: 2px solid #333;
  padding: 15px;
  text-align: center;
  margin-bottom: 0;
}

.brand {
  font-size: 30px;
}

.scoreboard {
  max-width: 250px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  row-gap: 5px;
  column-gap: 0;
}

.scoreboard-letter {
  height: 2.5em;
  width: 2.5em;
  font-size: 1rem;
  text-transform: uppercase;
  border: 3px solid #ccc;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.correct {
  background-color: darkgreen;
  color: white;
}

.close {
  background-color: goldenrod;
  color: white;
}

.wrong {
  background-color: #888;
  color: white;
}

.invalid {
  animation: flash 1s;
}

/* flashes red border and then fades back to gray */
@keyframes flash {
  5% {
    border-color: crimson;
  }

  100% {
    border-color: #ccc;
  }
}

.spiral {
  font-size: 40px;
  animation: spin 1.5s linear infinite;
}

/* rotates clockwise indefinitely */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.info-bar {
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* visibility hidden means the item is still there and taking up space
   but just not shown. display: none doesn't take up space */
.show {
  visibility: visible;
}

/* winner animation */

@keyframes rainbow {
  100%,
  0% {
    color: rgb(255, 0, 0);
  }
  8% {
    color: rgb(255, 127, 0);
  }
  16% {
    color: rgb(255, 255, 0);
  }
  25% {
    color: rgb(127, 255, 0);
  }
  33% {
    color: rgb(0, 255, 0);
  }
  41% {
    color: rgb(0, 255, 127);
  }
  50% {
    color: rgb(0, 255, 255);
  }
  58% {
    color: rgb(0, 127, 255);
  }
  66% {
    color: rgb(0, 0, 255);
  }
  75% {
    color: rgb(127, 0, 255);
  }
  83% {
    color: rgb(255, 0, 255);
  }
  91% {
    color: rgb(255, 0, 127);
  }
}

.winner {
  animation: rainbow 4s infinite linear;
}

#keyboard-cont {
  max-width: 300px;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#keyboard-cont div {
  display: flex;
}

.second-row {
  margin: 0.5rem 0;
}

.keyboard-button {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25em;
  margin: 0 2px;
  cursor: pointer;
  text-transform: uppercase;
}

@media only screen and (min-width: 500px) {
  body {
    width: 100vw;
  }

  .scoreboard {
    max-width: 300px;
    margin: 10px auto;
    row-gap: 10px;
  }

  .scoreboard-letter {
    height: 45px;
    width: 45px;
    font-size: 30px;
  }

  .keyboard-button {
    font-size: 1rem;
    padding: 0.5em;
  }
}
