@charset "UTF-8";
html,
body {
  height: 100%;
}

body .app .grid .row .cell:before {
  content: "";
  padding-bottom: 100%;
}

body {
  margin: 0;
  background-color: #222;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body .app {
  max-width: 600px;
  margin: auto;
  height: 100%;
  position: relative;
  color: rgb(218, 249, 171);
  display: flex;
  flex-direction: column;
}
body .app .header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
body .app .header .button {
  padding: 5px;
  border: 1px grey solid;
  border-radius: 3px;
  background-color: #333333;
  cursor: pointer;
}
body .app .header h2 {
  margin-top: 0;
  text-align: center;
}
body .app .warning {
  color: orange;
  margin: 5px auto;
  text-align: center;
}
body .app .buffer {
  color: aquamarine;
  margin: 5px auto;
  width: fit-content;
}
body .app .grid {
  --border-color: grey;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: bolder;
  display: flex;
  flex-direction: column;
  border: 1px var(--border-color) solid;
  box-shadow: -1px 0 var(--border-color) inset, 1px 0 var(--border-color) inset, 0 -1px var(--border-color) inset, 0 1px var(--border-color) inset;
}
body .app .grid .row {
  display: flex;
  flex-direction: row;
}
body .app .grid .row .cell {
  flex: 1 1 0;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
body .app .grid .row .cell.recent {
  background-color: teal;
}
body .app .grid .row .cell.guide {
  background-color: #59c8bb;
}
body .app .grid .row .cell.start {
  background-color: #4bb0f8;
}
body .app .grid .row .cell.goal {
  background-color: #117e48;
}
body .app .grid .row .cell.goal::after {
  content: "🏁";
  position: absolute;
  font-size: 150%;
}
body .app .grid .row .cell.goal.hint, body .app .grid .row .cell.goal.letter {
  z-index: 0;
}
body .app .grid .row .cell.goal.hint::after, body .app .grid .row .cell.goal.letter::after {
  z-index: -1;
  filter: opacity(60%);
}
body .app .grid .row .cell.horizontal {
  border-right-color: transparent;
  border-left-color: transparent;
}
body .app .grid .row .cell.vertical {
  border-top-color: transparent;
  border-bottom-color: transparent;
}
body .app .grid .row .cell.first-horizontal {
  border-left-color: var(--border-color);
}
body .app .grid .row .cell.last-horizontal {
  border-right-color: var(--border-color);
}
body .app .grid .row .cell.first-vertical {
  border-top-color: var(--border-color);
}
body .app .grid .row .cell.last-vertical {
  border-bottom-color: var(--border-color);
}
body .app .grid .row .cell.cursor {
  border-color: #aa13c5;
}
body .app .grid .row .cell.error {
  color: tomato;
  font-size: 120%;
  -webkit-text-stroke: 1px;
}
body .app .grid .row .cell.wall {
  z-index: 0;
}
body .app .grid .row .cell.wall::after {
  content: "🧱";
  position: absolute;
  z-index: -1;
}
body .app .grid .row .cell.wall.error {
  background-color: rgba(255, 131, 109, 0.7);
  color: #222;
  -webkit-text-stroke: 1px #222;
}
body .app .grid .row .cell.wall.error::after {
  filter: opacity(35%);
}
body .app .keyboard {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  display: flex;
  flex-direction: column;
  gap: 3px;
  outline: none;
}
body .app .keyboard .row {
  display: flex;
  justify-content: center;
  gap: inherit;
}
body .app .keyboard .row .hollow, body .app .keyboard .row .button {
  flex: 1 1 0;
  display: flex;
  max-width: 55.3px;
  user-select: none;
  border: 1px solid var(--border-color, transparent);
}
body .app .keyboard .row .hollow:before, body .app .keyboard .row .button:before {
  content: "";
  padding-bottom: 120%;
}
body .app .keyboard .row .button {
  --border-color: grey;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  background-color: #333333;
  border-radius: 2px;
}
body .app .keyboard .row .button.selected {
  border-color: #aa13c5;
  font-weight: bold;
}
body .app .keyboard .row .button.disabled {
  background-color: #222;
  color: grey;
}
body .app .keyboard .row .button.action {
  max-width: initial;
  font-size: 110%;
}
body .app .keyboard .row .button.action:before {
  content: "";
  padding-bottom: initial;
}
body .app .footer {
  margin-block-start: auto;
  margin-block-end: 15px;
}
body .app .footer .words {
  margin: 5px;
  color: #59c8bb;
  display: flex;
  flex-direction: row;
  gap: 5px;
  justify-content: center;
}
body .app .footer .words .word {
  color: #222;
  display: inline-block;
  border: 1px rgb(218, 249, 171) solid;
  background-color: rgb(218, 249, 171);
  padding: 5px;
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
body .app .footer .words .word.placing {
  cursor: initial;
}
body .app .footer .words .word.selected {
  background-color: #aa13c5;
  color: rgb(218, 249, 171);
  cursor: initial;
}
body .app .footer .words .word.placed {
  color: rgb(218, 249, 171);
  text-decoration: line-through rgb(218, 249, 171) 2px;
  background-color: #117e48;
  cursor: initial;
}
body .overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  isolation: isolate;
  background-color: rgba(128, 128, 128, 0.3);
  z-index: 1;
}
body .overlay .confetti {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
body .overlay .confetti__piece {
  position: absolute;
  top: calc(-1 * var(--size));
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 1.7);
  border-radius: 1px;
  opacity: 0;
  background-color: var(--color);
  animation: confetti-fall var(--duration) cubic-bezier(0.18, 0.67, 0.42, 1) var(--delay) 1 both;
}
body .overlay .confetti__piece:nth-child(3n) {
  height: var(--size);
  border-radius: 50%;
}
body .overlay .confetti__piece:nth-child(4n) {
  width: calc(var(--size) * 1.6);
  height: calc(var(--size) * 0.65);
}
body .overlay .modal {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  z-index: 1;
  margin-top: 10vh;
  padding: 30px 20px;
  background-color: #333;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  min-height: 20vh;
  margin-left: 7px;
  margin-right: 7px;
}
body .overlay .modal input {
  border: 1px #222 solid;
  border-radius: 5px;
  background-color: #555;
  color: inherit;
  padding: 10px;
  cursor: pointer;
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -8vh, 0) rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 110vh, 0) rotate(var(--rotation));
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}
