:root {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  --header-height: 50px;
  --keyboard-height: 200px;
  --input-height: 203px;
  --max-width: 500px;
  --animation-duration-winner: 0.7s;
  --animation-duration-reveal: 0.6s;
  --animation-duration-invalid: 0.4s;
  --animation-duration-endscreen: 0.2s;
  --animation-duration-duplicate: 0.6s;
  --color-background: #19221b;
  --color-exact: #43933c;
  --color-any: #ceb132;
  --color-not: #bd4242;
  --color-warn: #f5793a;
  --color-tint-1: #e0e3e6;
  --color-tint-2: #8e9192;
  --color-tint-3: #4c4c4e;
  --color-tint-4: #313131;
}

* {
  box-sizing: border-box;
  animation-fill-mode: forwards;
  animation-timing-function: linear;
}

body {
  background-color: var(--color-background);
  margin: 0;
  padding: 0;
  height: 100%;
  user-select: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}

#nav_left, #nav_right {
  padding: 0 15px;
  cursor: pointer;
}
#nav_right {
  opacity: 0;
}

#game {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
}

.container {
  display: flex;
  justify-content: center;
  flex-grow: 1;
  overflow: hidden; /* Needed to prevent words growing. */
}

.board_container {
  display: flex;
  height: 100%;
  width: 95%;
}
.board_container.hidden {
  display: none;
}

.board {
  padding: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.guess {
  width: 100%;
  height: 40px;
  min-height: 40px;
  line-height: 36px;
  border: 2px solid  var(--color-tint-3);
  background-color: transparent;
  color: var(--color-tint-1);
  font-size: 1.4em;
  padding: 0 10px;
  margin-bottom: 7px;
  overflow: auto;
}
.guess.hidden {
  display: none;
}
.guess.invalid {
  border-color: var(--color-not);
  animation-duration: var(--animation-duration-invalid);
  animation-name: shake;
}

.about {
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
  color: var(--color-tint-1);
}
.about.hidden {
  display: none;
}

.about > div {
  display: flex;
  flex-direction: column;
  width: 90%;
}

.about > div > div {
  display: flex;
  flex-direction: row;
  margin: 7px;
}


.about > div > div > span:nth-child(1) {
  flex-grow: 1;
}

.about > div > div > span:nth-child(2) {
  text-align: right;
  flex-shrink: 1;
  font-weight: 600;
}

.instructions {
  color: var(--color-tint-1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: 10px;
}
.instructions > p:nth-child(1), .instructions > p:nth-child(2) {
  text-align: center;
}
.instructions.hidden {
  display: none;
}
.instructions p {
  padding: 5px 0;
  margin: 0;
}
.instructions ul {
  padding: 0 15px;
  margin: 0;
  list-style-type: square;
}
.instructions li {
  padding: 3px 0;
}

.words {
  display: flex;
  overflow-y: auto;
}

.words table,
.word_last {
  border-collapse: collapse;
  border: 2px solid  var(--color-tint-3);
  margin: 0;
  padding: 5px 2px;
  color: var(--color-tint-1);
  width: 100%;
}
.word_last {
  margin-bottom: 7px;
  cursor: pointer;
}
.word_last tbody tr {
  border: 2px solid  var(--color-tint-1);
  background-color: var(--color-tint-4);
}
.word_last tbody tr.winner  {
  border: 2px solid  var(--color-exact);
  background-color: var(--color-tint-4);
}
.words tr.duplicate td {
  animation-duration: var(--animation-duration-duplicate);
  animation-name: flash;
}
.words td,
.word_last td {
  padding: 5px 8px;
}
.words td:nth-child(1),
.word_last td:nth-child(1) {
  width: 5%;
}
.words td:nth-child(2),
.word_last td:nth-child(2) {
  width: 35%;
}
.words td:nth-child(3),
.word_last td:nth-child(3) {
  width: 20%;
}
.spoiler_free .words td:nth-child(2),
.spoiler_free .word_last td:nth-child(2) {
  color: transparent;
  position: relative;
}
.spoiler_free .words td:nth-child(2):after,
.spoiler_free .word_last td:nth-child(2):after {
  display: block;
  color: var(--color-tint-1);
  visibility: visible;
  position: absolute;
  top: 0.5em;
  left: 0.5em;
  content: "**********";
}
.words td:nth-child(4),
.word_last td:nth-child(4) {
  text-align: center;
  width: 40%;
  position: relative;
}
.words td:nth-child(4) > span:nth-child(1),
.word_last td:nth-child(4) > span:nth-child(1) {
  position: absolute;
  top: 5px;
  left: 0;
  width: 100%;
  height: calc(1em + 2px);
  z-index: 1;
}
.words td:nth-child(4) span:nth-child(2),
.word_last td:nth-child(4) span:nth-child(2) {
  display: block;
  height: calc(1em + 2px);
  background-color: var(--color-tint-2);
  border: 1px solid var(--color-tint-4);
}
.words td:nth-child(4) span:nth-child(2) span,
.word_last td:nth-child(4) span:nth-child(2) span {
  display: block;
  height: 1em;
  background-color: var(--color-exact);
}
.words tr td:nth-child(1),
.word_last tr td:nth-child(1) {
  text-align: right;
}
.words tr td:nth-child(3),
.word_last tr td:nth-child(3) {
  text-align: right;
}
.words tr:nth-child(2n),
.word_last tr:nth-child(2n) {
  border: 2px solid  var(--color-tint-3);
  background-color: var(--color-tint-4);
}

#heading {
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 600;
  padding-top: 10px;
  height: 40px;
  min-height: 40px;
}

#heading_title {
  width: 100%;
  cursor: pointer;
}

.board .row, .archive .row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 5px;
}
.board.shareable {
  cursor: pointer;
}

#keyboard {
  margin: 0 8px;
  height: var(--keyboard-height);
  min-height: var(--keyboard-height);
}
#keyboard.hidden {
  display: none;
}

#keyboard .row {
  display: flex;
  width: 100%;
  margin: 0 auto 8px;
  touch-action: manipulation;
}

#keyboard button {
  font-family: inherit;
  font-weight: bold;
  border: 0;
  padding: 0;
  margin: 0 6px 0 0;
  height: 58px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  background-color: var(--color-tint-2);
  color: var(--color-tint-1);
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-tap-highlight-color: rgba(0,0,0,0.3);
}
#keyboard button[data-key='enter'] {
  text-transform: uppercase;
}
#keyboard button:last-of-type {
  margin: 0;
}
@media (hover: hover) {
  #keyboard button:hover {
    background-color: var(--color-tint-3);
  }
  #keyboard button:active {
    background-color: var(--color-tint-4);
  }
}
#keyboard .spacer_small {
  flex: 0.5;
}
#keyboard .key_big {
  flex: 1.5;
  font-size: 12px;
}
#keyboard button.pressed {
  background-color: var(--color-tint-4);
}

@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--opacity-target);
  }
}

@keyframes flash {
  from {
    background-color: var(--color-tint-1);
  }
  20% {
    background-color: var(--color-tint-4);
  }
  40% {
    background-color: var(--color-tint-1);
  }
  60% {
    background-color: var(--color-tint-4);
  }
  80% {
    background-color: var(--color-tint-1);
  }
  100% {
    background-color: var(--color-tint-4);
  }
}

@keyframes shake {
  from {
    transform: translate(-5px);
  }
  20% {
    transform: translate(5px);
  }
  40% {
    transform: translate(-5px);
  }
  60% {
    transform: translate(5px);
  }
  80% {
    transform: translate(-5px);
  }
  100% {
    transform: translate(0);
  }
}

#modal {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#modal.visible {
  display: block;
}
#endscreen {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#endscreen.visible {
  display: flex;
}
#endscreen #overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: var(--overlay-background);
  --opacity-target: 0.4;
  animation-name: fadein;
  animation-duration: var(--animation-duration-endscreen);
  z-index: 1000;
}
#endscreen.loser #overlay {
  --overlay-background: var(--color-not);
}
#endscreen.winner #overlay {
  --overlay-background: var(--color-exact);
}
#results {
  display: block;
  position: relative;
  width: 80%;
  max-height: 80%;
  background-color: var(--color-tint-3);
  border: 2px solid;
  border-radius: 10px;
  padding: 20px 0;
  color: #fff;
  max-width: var(--max-width);
  text-align: center;
  --opacity-target: 1;
  animation-name: fadein;
  animation-duration: var(--animation-duration-endscreen);
  z-index: 1000;
}
#failure {
  display: none;
}
#endscreen.winner #results {
  display: block;
  border-color: var(--color-exact);
}
#endscreen.winner #results:before {
  content: "You Got It!";
  font-weight: 600;
  font-size: 1.5em;
  padding-bottom: 10px;
  line-height: 1em;
  display: block;
}
#endscreen.loser #results {
  display: block;
  border-color: var(--color-not);
}
#endscreen.loser #results:before {
  content: "You Were So Close!";
  font-weight: 600;
  font-size: 1.5em;
  line-height: 1em;
  padding-bottom: 10px;
  display: block;
}
#failure.visible {
  font-size: 1em;
  line-height: 1.5em;
  padding-bottom: 10px;
  display: block;
}
#failure.visible #answer {
  font-weight: 600;
  text-transform: uppercase;
}

#statistics {
  display: flex;
  justify-content: center;
}

.statistics {
  width: 275px;
  padding-bottom: 10px;
}

.statistics a {
  color: var(--color-tint-1);
}

.statistics > div {
  padding: 2px 0;
  text-align: left;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}

.statistics > div > span {
  padding: 0 8px;
  display: flex;
  flex-direction: row;
}

.statistics > div > span > span {
  flex-grow: 1;
  text-align: right;
  padding: 0 3px;
  width: 100%;
}

.statistics > div.new, .statistics > div.new a{
  color: var(--color-exact);
  font-weight: 600;
}
.statistics > div.sad, .statistics > div.sad a{
  color: var(--color-any);
  font-weight: 600;
}

.statistics div.turns10 {
  padding-bottom: 8px;
}
.statistics div.speedster {
  padding-top: 8px;
  border-top: 1px solid var(--color-tint-1);
}

#share {
  color: #fff;
  text-transform: uppercase;
  width: 175px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: var(--color-exact);
  padding: 8px 30px;
  font-weight: 600;
  margin: 0 auto;
}
#share svg {
  padding-left: 4px;
}
@media (hover: hover) {
  .statistics > div a:hover {
    color: var(--color-tint-4);
    font-weight: 600;
  }
  #share:hover {
    background-color: var(--color-any);
  }
  #share:active {
    background-color: var(--color-tint-2);
  }
}

.install_btn {
  display: block;
  color: var(--color-tint-1);
  background-color: var(--color-exact);
  width: 100px;
  text-align: center;
  margin: 0 auto;
  text-transform: uppercase;
  width: 175px;
  padding: 8px 30px;
  font-weight: 600;
  border-radius: 5px;
  margin-top: 10px;
}

@media all and (display-mode: standalone) {
  .install_btn {
    display: none;
  }
}