*, *::before, *::after { box-sizing: border-box }

body {
  height: 100dvh;
  display: grid;
  grid-template-rows: min-content auto;

  max-width: 60ch;
  margin: 0 auto;
  padding: 5px;
  padding-bottom: calc(5px + env(safe-area-inset-bottom));

  font-family: system-ui;
  font-size: clamp(1rem, 2vw, 1.5rem);
}

nav {
  background: #eee;
  padding-block: 2ch;
  display: flex;
  justify-content: space-around;
}

main {
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
}

/*a {
  display: block;
  padding: 1ch;
  text-align: center;
  background: green;
  color: white;
}*/
a:hover {
  opacity: 0.8;
}

input {
  font: inherit;
  font-family: monospace;
}

kbd, .letter {
  --fill: .9 0 0;

  display: flex;
  justify-content: center;
  align-items: center;

  font: inherit;
  background: oklch(var(--fill));
  color: black;
  border-radius: 10px;
  text-transform: uppercase;
  text-align: center;
  border: none;
  min-width: 2ch;

  &:not(.wide) { aspect-ratio: 1 }

  .keyboard &:hover {
    background: oklch(var(--fill) / .8);
    cursor: pointer;
  }

  transition: transform .05s;
  &:active {
    transform: translateY(5px);
  }
}

.right, .close, .wrong { color: white }
.right { --fill: 0.61 0.2058 142.5 }
.close { --fill: 0.68 0.1779 49.58 }
.wrong { --fill: 0.45 0 0 }

.board {
  max-width: 30ch;
  margin: auto;
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  align-items: center;
  gap: 10px;

  small {
    opacity: .5;
  }
}

.guesses {
  padding: 1ch;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  height: 100%;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 5px;
  overflow: hidden;

  .wide { grid-column: span 3 }
}

.keyboard button {
  display: block;
}

.winner {
  background: yellow;
}