@font-face {
  font-family: "NYT Franklin 300";
  src: url('../fonts/nyt-franklin-300.ttf') format('truetype');
}

@font-face {
  font-family: "NYT Franklin 500";
  src: url('../fonts/nyt-franklin-500.ttf') format('truetype');
}

@font-face {
  font-family: "NYT Franklin 600";
  src: url('../fonts/nyt-franklin-600.ttf') format('truetype');
}

@font-face {
  font-family: "NYT Franklin 700";
  src: url('../fonts/nyt-franklin-700.ttf') format('truetype');
}

@font-face {
  font-family: "NYT Karnak 400";
  src: url('../fonts/nyt-karnak-400.ttf') format('truetype');
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  background: #121213;
  color: #d7dadc;
  overflow: hidden;

  display: -webkit-flex;
  -webkit-flex-direction: column;
  -webkit-align-items: center;
}

.header {
  padding: 14px 0;
  flex-direction: column;
  border-bottom: 1px #3a3a3c solid;
  width: -webkit-fill-available;

  display: flex;
  align-items: center;

  display: -webkit-flex;
  -webkit-align-items: center;
}

#title {
    font-family: "NYT Karnak 400";
    font-size: 36px;
}

#subtitle {
    font-family: "NYT Franklin 300";
    font-size: 18px;
    font-weight: lighter;
}

.game-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;

  display: -webkit-flex;
  -webkit-flex-direction: column;
  -webkit-flex-grow: 1;
  width: 100%;
  width: -webkit-fill-available;
  margin: 0 auto;
  height: calc(100% - 126px);
}

.words {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;

  display: -webkit-flex;
  -webkit-flex-direction: column;
  -webkit-align-items: center;
  -webkit-flex-grow: 1;
}
.words > .word:first-child {
  margin-top: 5px;
}

.word {
  display: flex;
  margin-bottom: 5px;
}

.letter {
  display: flex;
  justify-content: center;
  align-items: center;
  border: solid 2px #3a3a3c;
  width: 78px;
  height: 78px;
  font-family: "NYT Franklin 700";
  font-size: 2rem;
  font-weight: bold;
  transform-origin: center;
  user-select: none;

  display: -webkit-flex;
  -webkit-align-items: center;
}
@media screen and (max-width: 699px) {
  .letter {
    width: 54px;
    height: 54px;
  }
}
.letter:not(:last-child) {
  margin-right: 5px;
}
.letter.correct {
  background: #538d4e;
  border-color: #538d4e;
}
.letter.semi {
  background: #b59f3b;
  border-color: #b59f3b;
}
.letter.incorrect {
  background: #3a3a3c;
  border-color: #3a3a3c;
}
.word:not(.attempted) .letter:not(:empty) {
  border-color: #565758;
}

button {
  cursor: pointer;
  outline: none;
  border: unset;
}

.game-over .keyboard {
  opacity: 0;
  height: 0;
  pointer-events: none;
}

.keyboard {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s ease-in-out;
  user-select: none;
  margin: 0 8px;
  padding-bottom: 2px;
  vertical-align: baseline;

  display: -webkit-flex;
  -webkit-flex-direction: column;
  -webkit-align-items: center;
  -webkit-user-select: none;
}
.keyboard-row {
  display: flex;
  display: -webkit-flex;
  margin: 0 auto 6px;
  width: 100%;
  width: -webkit-fill-available;
  touch-action: manipulation;
}
.keyboard-button {
  flex: 1;
  -webkit-flex: 1;
  font-family: "NYT Franklin 700";
  font-size: 20px;
  text-transform: uppercase;
  font-weight: bold;
  height: 50px;
  margin: 0 3px 0;
  padding: 0;
  color: rgb(248, 248, 248);
  background: rgb(129, 131, 132);
  border-radius: 4px;
  transition: background 0.1s ease-in;
  user-select: none;
}
.keyboard-button.correct {
  background: #538d4e !important;
}
.keyboard-button.semi {
  background: #b59f3b;
}
.keyboard-button.incorrect {
  background: #3a3a3c;
}
.keyboard-button.larger {
  flex: 1.5;
  -webkit-flex: 1.5;
  padding: 0 6px;
  font-size: 12px;
}
.keyboard-button.spacer {
  flex: 0.5;
  -webkit-flex: 0.5;
  opacity: 0;
  padding: 0;
  margin: 0 1px;
}

.end-actions {
  display: flex;
  align-items: center;
  display: -webkit-flex;
  -webkit-align-items: center;
  justify-content: center;
  grid-column-gap: 32px;
  grid-row-gap: 2px;
  height: 0;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-family: "NYT Franklin 600";
}
.game-over .end-actions {
  height: 120px;
  opacity: 1;
  padding: 24px 58px;
  pointer-events: unset;
  transition: opacity 0.2s ease-in;
}

.answer-container {
  display: flex;
  flex-direction: column;
  display: -webkit-flex;
  -webkit-flex-direction: column;
}
.answer-container > span:first-of-type {
  font-size: 28px;
  font-weight: bold;
}
.answer-container > span:last-of-type {
  font-size: 12px;
}

.toast {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #d7dadc;
  color: black;
  padding: 16px;
  font-family: "NYT Franklin 700";
  font-weight: bolder;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  position: fixed;
  top: 15vh;
  left: 50vw;
  animation: toast-birth 0.2s forwards;
  transform-origin: center;
  width: auto;
}
@keyframes toast-birth {
  0% { transform: translateX(-50%); }
  80% { transform: translateX(-50%) scale(1.1); }
  100% { transform: translateX(-50%) scale(1); }
}

.share-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #3f7ad2;
  padding: 12px 24px 14px;
  white-space: pre;
  text-transform: uppercase;
  font-family: "NYT Franklin 700";
  font-weight: bold;
  color: white;
  font-size: 20px;
  font-family: inherit;
  border-radius: 4px;
  grid-row: span 2;
}
