*, *::after, *::before {
  box-sizing: border-box;
  font-family: "Objektiv Mk1", Arial;
}

body {
  touch-action: pan-y;
  background-color: #000000;
  font-size: clamp(0.5rem, 4vmin, 2rem);
}

.wrapper, html, body {
    height: 100%;
    margin: 0;
}
.wrapper {
    max-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    justify-content: space-between;
}

.icons {
    display: flex;
    align-items: center;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(20, minmax(4%, 2em));
  grid-auto-rows: 3em;
  gap: .25em;
  justify-content: center;
}

.key {
  font-size: inherit;
  grid-column: span 2;
  border: none;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: hsl(
    var(--hue, 200),
    var(--saturation, 1%),
    calc(var(--lightness-offset, 0%) + var(--lightness, 51%))
  );
  color: white;
  fill: white;
  text-transform: uppercase;
  border-radius: .25em;
  cursor: pointer;
  user-select: none;
}

.key.large {
  grid-column: span 3;
}

.key > svg {
  width: 1.75em;
  height: 1.75em;
}

.key:hover, .key:focus {
  --lightness-offset: 10%;
}

.key.wrong {
  --lightness: 23%;
}

.key.wrong-location {
  --hue: 49;
  --saturation: 51%;
  --lightness: 47%;
}

.key.correct {
  --hue: 115;
  --saturation: 29%;
  --lightness: 43%;
}

.grid {
    display: flex;
    justify-content: center;
    align-content: center;
}

.guess-grid {
  display: grid;
  justify-content: center;
  align-content: center;
  flex-grow: 1;
  grid-template-columns: repeat(5, 18%);
  grid-template-rows: repeat(6, auto);
  gap: .25em;
  margin-bottom: 20px;
  max-width: 45vh;
}

.tile {
    aspect-ratio: 1 / 1;
  font-size: 1.9em;
  color: white;
  border: .05em solid hsl(240, 2%, 23%);
  text-transform: uppercase;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  transition: transform 250ms linear;
}

.tile[data-state="active"] {
  border-color: hsl(200, 1%, 34%);
}

.tile[data-state="wrong"] {
  border: none;
  background-color: hsl(240, 2%, 23%);
}

.tile[data-state="wrong-location"] {
  border: none;
  background-color: hsl(49, 51%, 47%);
}

.tile[data-state="correct"] {
  border: none;
  background-color: hsl(115, 29%, 43%);
}

.tile.shake {
  animation: shake 250ms ease-in-out;
}

.tile.dance {
  animation: dance 500ms ease-in-out;
}

.tile.flip {
  transform: rotateX(90deg);
}

@keyframes shake {
  10% {
    transform: translateX(-5%);
  }

  30% {
    transform: translateX(5%);
  }

  50% {
    transform: translateX(-7.5%);
  }

  70% {
    transform: translateX(7.5%);
  }

  90% {
    transform: translateX(-5%);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes dance {
  20% {
    transform: translateY(-50%);
  }  

  40% {
    transform: translateY(5%);
  }  

  60% {
    transform: translateY(-25%);
  }  

  80% {
    transform: translateY(2.5%);
  }  

  90% {
    transform: translateY(-5%);
  }  

  100% {
    transform: translateY(0);
  }
}

.alert-container {
  position: fixed;
  top: 10vh;
  left: 50vw;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.alert {
  pointer-events: none;
  background-color: hsl(204, 7%, 85%);
  padding: .75em;
  border-radius: .25em;
  opacity: 1;
  transition: opacity 500ms ease-in-out;
  margin-bottom: .5em;
}

.alert:last-child {
  margin-bottom: 0;
}

.alert.hide {
  opacity: 0;
}

/* Menu */

:root{
    --white: #f9f9f9;
    --black: #36383F;
    --grey: #85888C;
}

a{
    text-decoration: none;
}

ul{
    list-style: none;
}

.dtd-banner, .dtd-banner img {
    max-width: 100%;
    margin-top: 50px;
}

.dtd-banner {
    padding: 0 20px;
}

/* Header */
.header{
    background-color: var(--black);
    margin-bottom: 20px;
    padding: 0 10px 0 20px;
    min-height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo{
    display: inline-block;
    color: var(--white);
    font-size: 30px;

}

/* Nav menu */
.nav{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    bottom: 100%;
    overflow: hidden;
    background-color: var(--black);
    color: var(--white);
}

.menu {
    padding: 0;
}

.menu a {
    display: block;
    font-size: 20px;
    padding: 20px;
    color: var(--white);
}

.menu a:hover{
    background-color: var(--grey);
}

.nav{
    max-height: 0;
    text-align: center;
    transition: max-height .5s ease-out;
}

/* Menu Icon */

.hamb, .help, .help-close {
    cursor: pointer;
    padding: 10px;
}

.help {
    color: var(--white);
    border: solid 2px var(--white);
    border-radius: 50%;
    padding: 9px 14px;
    font-size: 22px;
    margin-right: 20px;
    line-height: 1;
    display: inline-block;
}

.hamb-line {
    background: var(--white);
    display: block;
    height: 2px;
    position: relative;
    width: 30px;
}


.hamb-line::before,
.hamb-line::after{
    background: var(--white);
    content: '';
    display: block;
    height: 100%;
    position: absolute;
    transition: all .2s ease-out;
    width: 100%;
}

.hamb-line::before{
    top: 10px;
}

.hamb-line::after{
    top: -10px;
}


.side-menu {
    display: none;
}

/* Toggle menu icon */

.side-menu:checked ~ nav{
    max-height: 100%;
}

.side-menu:checked ~ .hamb .hamb-line {
    background: transparent;
}

.side-menu:checked ~ .hamb .hamb-line::before {
    transform: rotate(-45deg);
    top:0;

}

.side-menu:checked ~ .hamb .hamb-line::after {
    transform: rotate(45deg);
    top:0;
}

.help-container, .result-container {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 80px;
    z-index: 5;
    background: #ffffff;
    font-size: 16px;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.help-container .help-close {
    float: right;
    margin-top: -10px;
    margin-right: -10px;
    font-size: 22px;
}

.help-container img {
    max-width: 100%;
}

.result-container {
    font-size: 18px;
    text-align: center;
}

#resultlink {
    display: inline-block;
    background: var(--grey);
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--white);
}

.help-container.show, .result-container.show {
    display: block;
}

