:root {
  --tile-size: 48px;
}

* {
  font-family: Milonga;
  /* box-sizing: border-box; */
  image-rendering: pixelated;
}

#garden {
  position: absolute;
  top: 0;
  left: 0;
}

.plant {
  height: 48px;
  width: 48px;
  position: absolute;
  /* background-position-x: -96px; */
  background-position-y: -32px;
  background-size: 500%;
  background-repeat: no-repeat;
}

.plant::before {
  content: "";
  background-image: url("/typist/static/plants/base.png");
  background-size: 48px 48px;
  z-index: -100;
  width: 100%;
  height: 100%;
  position: absolute;
  bottom: -16px;
}

.plant.p1 {
  background-position-x: 48px;
}

.plant.p2 {
  background-position-x: -96px;
}

.plant.p3 {
  background-position-x: -144px;
}

.plant.p4 {
  background-position-x: -192px;
}

.falling {
  animation: animate 4s linear forwards;
  background-position-x: -48px;
  background-position-y: -48px;
  z-index: 100;
}

.falling::before {
  background-image: none;
}

@keyframes animate {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/************************************************/
/* Color Pallet */
/* Base Colors */
/* Main Primary color */
/* Word Colors */
/************************************************/

.blurred {
  filter: blur(10px);
  opacity: 0.7;
  pointer-events: none;
}

body {
  outline: 0;
  overflow: hidden;
  color: #e0e6c0;
  background-color: #cca47e;
  font-family: sans-serif;
}

header {
  padding: 1em;
  text-align: center;
}

header h3 {
  font-weight: normal;
}

section {
  padding: 0.5em;
}

#typing-main {
  margin: auto;
  border: var(--tile-size) #cca47e solid;
  border-image-source: url('/typist/static/tile-grass-light.png');
  border-image-slice: calc(100%/3) fill;
  border-image-repeat: repeat;

  height: 200px;
  width: 50%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

#word-section {
  color: #393939;
  font-size: 1.5em;
  height: 4em;
  line-height: 2em;
  /* hide 3rd line of text */
  position: relative;
  overflow: hidden;
}

#word-section>span {
  display: inline-block;
  padding: 0 0.2rem;
  /* emulate spaces between words */
}

#type-section {
  display: flex;
  text-align: center;
  justify-content: center;
  height: 81px;
  gap: 10px;
}

#type-section>* {
  font-size: 1.5em;
  display: inline-block;
  border: none;
  vertical-align: middle;
}

#typebox {
  /* flex-grow: 1; */
  border: 27px #cca47e solid;
  border-image-source: url("/typist/static/ui-white-long.png");
  border-image-slice: calc(100%/3) calc(100%/3/5) fill;
  border-image-repeat: repeat;
  height: auto;
  width: 100%;
  background: none;
  outline: none;
  padding: 0;
  /* background-color: #e5e5e5;
  border: solid 3px #cbcccb;
  border-radius: 2px;
  outline: 3px solid #e7e7e7;
  box-shadow: 0 4px 0px 2px #c1c1c1;
  height: auto;
  padding: 0.5em; */
}

/* #typebox:focus {
  outline: none;
} */

#timer {
  border: 27px #cca47e solid;
  border-image-source: url("/typist/static/ui-dark-flat.png");
  border-image-slice: calc(100%/3) fill;
  border-image-repeat: repeat;
  width: 80px;
  height: auto;
  /* width: 4em;
  background-color: #97714a;
  border: solid 3px #b8926b;
  border-radius: 2px;
  outline: 3px solid #8e6b48;
  margin-right: 0; */
}

#restart {
  /* background: none;
  border-radius: 0px;
  border: 27px #cca47e solid;
  border-image-source: url("/typist/static/ui-light-button.png");
  border-image-slice: calc(100%/3) fill;
  border-image-repeat: repeat;
  padding: 0;
  width: 120px;
  height: auto; */

  background: url("/typist/static/ui-light-button.png");
  padding: 26px;
  padding-top: 23px;
  background-size: auto 81px;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  height: auto;

  /* background-color: #d3bf8f;
  border: solid 3px #af9e75;
  border-radius: 2px;
  outline: 3px solid #d3c7a8;
  box-shadow: 0 4px 0px 2px #a2987e; */
}

#restart>svg {
  transition: transform .4s ease-in-out;
  width: 30px;
  height: 30px;
}

#restart:hover>svg {
  transform: rotate(360deg);
}

#results {
  text-align: center;
  margin: 0 1%;
  display: block;
}

#results li {
  list-style: none;
}

#results li:first-child {
  font-size: 1.5em;
}

#results li:nth-child(2) {
  font-size: 0.8em;
  line-height: 1em;
}

#results #results-stats {
  font-size: 0.6em;
}

footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 10px;
  font-size: 0.8em;
}

/************************************************/
/* hides small bit of residule text after scrolling */
.magic-box {
  position: fixed;
  width: inherit;
  height: 0.5em;
  top: 54px;
}

.waiting {
  text-align: center;
  line-height: 1.5em;
  font-size: 3em;
}

.current-word {
  background-color: #dddddd;
}

.correct-word-c {
  color: #426e70;
}

.incorrect-word-c {
  color: #e50000;
}

.incorrect-word-bg {
  background-color: #e50000;
}

/* ------------------------------------------------------- */

#login-prompt {
  border-radius: 10px;
  padding: 20px;
  background-color: #222;
  text-align: center;
  z-index: 10000;
  box-shadow: 0px 0px 10px #222;
}

.login-input {
  padding: 15px;
  width: 100px;
  border: none;
  color: #ddd;
  background-color: #1a1a1a;
  border-radius: 5px;
}

.centered {
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
}

.centered>* {
  margin: auto;
}

#enter-button {
  transition: all 200ms;
  margin: 10px 0 0 0;
  color: #ddd;
  padding: 10px 115px 10px 115px;
  border-radius: 5px;
  border: 0;
  background-color: #222;
}

#enter-button:hover {
  background-color: #333;
  color: white;
  box-shadow: 0px 2px 5px #1e1e1e;
}