/* Root and body */
*
{
  box-sizing: border-box;
}

html, body
{
  margin: 0;
  width: 100vw;
  height: 100vh;
  background-color: #111;
  color: #eee;
  font-size: 16px;
  font-family: Verdana, arial, sans-serif;
}

body
{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 100%;
}
body > div { /* Three-column body layout */
  display: flex;
  flex-direction: column;
}

/* Central gameplay main */
main
{
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  width: 45%;
  height: 60%;
}

/* Header with title */
header
{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  font-size: 1.4rem;
}

/* Displays the actual word on failure */
#real-word
{
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* Sidebar with stats */
aside
{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20%;
  height: 75%;
  margin: auto auto auto 0;
}
aside > div {
  margin: 1.5rem auto;
}

/* Difficulty setting */
.settings
{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings select
{
  padding: 0.5rem;
  font-size: 1rem;
  color: #ddd;
  border: none;
  background-color: #444;
  border-radius: 5px;
  box-shadow: -1px -1px 1px 2px #101010;
}

.note
{
  padding: 0.25rem;
  font-size: 0.75rem;
}

/* Popup for a message */
.popup-overlay
{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #00000030;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 1s ease;
}
#popup
{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 3rem 2rem;
  justify-content: center;
  align-content: center;
  text-align: center;
  transform: translateY(-20%);
  min-width: 6%;
  min-height: 4%;
  max-width: 20%;
  max-height: 30%;
  background-color: #333;
  font-size: 1rem;
  color: #eee;
  border-radius: 15px;
  box-shadow: -1px -1px 5px 1px #111;
  transition: opacity 1s ease;
}

#popup-buttons
{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  gap: 1rem;
  margin: 2rem auto 0 auto;
  width: 100%;
  height: 2rem;
}

.button {
  height: 2rem;
  width: auto;
  filter: contrast(0) brightness(2);
  transition: transform 0.3s ease-in-out;
}
.button:hover {
  opacity: 0.8;
  cursor: pointer;
  transform: scale(1.1);
}

/* Time left */
#timer {
  font-size: 1.25rem;
}

/* Score / points display */
.score
{
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.25rem;
}
.score > span {
  padding: 0.5rem;
  font-size: 2rem;
}
#highscore {
  font-size: 1.9rem;
}
#clear-highscore {
  width: 1rem !important;
  height: auto !important;
  margin: 0.25rem;
}
#clear-highscore:hover {
  animation: spin 1s ease-out 1;
}

/* Individual rows of guesses */
.guess-row
{
  margin: 0.75em auto;
  display: grid;
  grid-template-rows: 4em;
  grid-template-columns: repeat(5, 4em);
  grid-column-gap: 0.75em;
  width: 100%;
}

.guess-letter /* Each letter cell */
{
  display: flex;
  width: 100%;
  height: 100%;
  border: 2px solid #444;
  font-size: 2rem;
  font-weight: bold;
}
/* Individual cell colouring */
.guess-letter > * { margin: auto; }
.guess-letter.correct { color: #ddd; background-color: #3d8e3d; animation: bounce 0.5s 1; }
.guess-letter.possible { color: #ddd; background-color: #9e8c3f; animation: bounce 0.5s 1; }
.guess-letter.incorrect { color: #ddd; background-color: #333; animation: bounce 0.5s 1; }

/* Keyboard guess input */
#guess-input
{
  font-size: 2rem;
  margin: 1em;
}

/* Version # */
#version-number
{
  font-size: 1rem;
  position: absolute;
  right: 10px;
  bottom: 0;
}

/* Animations */
@keyframes bounce {
  from {
    scale: 1;
  }
  50% {
    scale: 1.1;
  }
  to {
    scale: 1;
  }
}

@keyframes normal-scale {
  0% {
  }
  100% {
    transform: scale(1);
  }
}

@keyframes scale-up {
  from {
    scale: 1;
  }
  to {
    scale: 1.1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


