*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {

  background-color: hsl(240, 3%, 7%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  max-width: 100vw;
  margin: 0;
  padding: 0;

  font-size: clamp(.5rem, 2.5vmin, 1.5rem);

}

.circles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.circles li {
  position: absolute;
  display: block;
  list-style: none;
  color: white;
  place-items: center;
  place-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  animation: animate 25s linear infinite;
  bottom: -150px;

}

.circles li:nth-child(1) {
  left: 25%;
  width: 80px;
  height: 80px;
  animation-delay: 0s;
}


.circles li:nth-child(2) {
  left: 10%;
  width: 80px;
  height: 80px;
  animation-delay: 2s;
  animation-duration: 12s;
}

.circles li:nth-child(3) {
  left: 20%;
  width: 80px;
  height: 80px;
  animation-delay: 4s;
}

.circles li:nth-child(4) {
  left: 30%;
  width: 60px;
  height: 60px;
  animation-delay: 0s;
  animation-duration: 18s;
}

.circles li:nth-child(5) {
  left: 65%;
  width: 20px;
  height: 20px;
  animation-delay: 0s;
}

.circles li:nth-child(6) {
  left: 75%;
  width: 110px;
  height: 110px;
  animation-delay: 3s;
}

.circles li:nth-child(7) {
  left: 35%;
  width: 150px;
  height: 150px;
  animation-delay: 7s;
}

.circles li:nth-child(8) {
  left: 90%;
  width: 80px;
  height: 80px;
  animation-delay: 15s;
  animation-duration: 45s;
}

.circles li:nth-child(9) {
  left: 20%;
  width: 80px;
  height: 80px;
  animation-delay: 2s;
  animation-duration: 35s;
}

.circles li:nth-child(10) {
  left: 63%;
  width: 150px;
  height: 150px;
  animation-delay: 0s;
  animation-duration: 11s;
}

.circles li:nth-child(11) {
  left: 15%;
  width: 150px;
  height: 150px;
  animation-delay: 30s;
  animation-duration: 29s;
}

.circles li:nth-child(12) {
  left: 70%;
  width: 150px;
  height: 150px;
  animation-delay: 7s;
  animation-duration: 29s;
}



@keyframes animate {

  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
    border-radius: 0;
  }

  100% {
    transform: translateY(-1000px) rotate(720deg);
    opacity: 0;
    border-radius: 50%;
  }

}

.animated2 {

  text-align: center;
  font-size: 65px;
  font-weight: 900;
  text-decoration: none;
  background: linear-gradient(to right, #cdcdcd 50%, #970d36 50%, #ff7c50);
  background-size: 200%;
  background-clip: border-box;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: 0.5s ease-out;
  cursor: pointer;
  z-index: 1;
}

.animated2:hover {
  background-position: -100%;
}

.overlay {
  position: fixed;
  width: 100%;
  height: 100vh;
  top: 0;
  background-color: rgb(0 0 0 / 50%);
  backdrop-filter: blur(16px) saturate(180%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.125);
  display: none;
  z-index: 1;
  left: 0%;

  visibility: visible;
  -webkit-animation: fadeIn 250ms;
  animation: fadeIn 250ms;

}

.popup {
  display: block;
  margin: 0;
  padding: 30px;
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: hsl(240, 3%, 7%);
  border: 2px solid rgba(255, 255, 255, 0.125);
  border-radius: 30px;
  box-shadow: 2px 2px 2px rgba(204, 204, 204, 0.192);
  max-height: 1000px;
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.CloseIcon {
  position: absolute;
  right: 20px;
  top: 0px;
  font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
  cursor: pointer;
  font-weight: bolder;
  font-size: 30px;
  color: #ccc;

}

.CloseIcon:hover {


  color: #ff0000;
  border-radius: 10px;

}

.btn-pop {

  cursor: pointer;
  display: inline-block;

}

@media (max-width:900px) {
  .popup {
    width: 100%;
    max-height: 550px;
    overflow: auto;
  }
}

#menuToggle {
  display: block;
  position: relative;
  top: 40px;
  left: 15px;

  z-index: 1;

  -webkit-user-select: none;
  user-select: none;
}

#menuToggle a {
  text-decoration: none;
  color: #CCC;

  transition: color 0.3s ease;
}

#menuToggle a:hover {
  color: #ff7c50;
}


#menuToggle input {
  display: block;
  width: 40px;
  height: 32px;
  position: absolute;
  top: -7px;
  left: -5px;

  cursor: pointer;

  opacity: 0;
  z-index: 2;
  -webkit-touch-callout: none;
}

#menuToggle span {
  display: block;
  width: 33px;
  height: 4px;
  margin-bottom: 5px;
  position: relative;

  background: #cdcdcd;
  border-radius: 10px;

  z-index: 1;

  transform-origin: 4px 0px;

  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
    background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
    opacity 0.55s ease;
}

#menuToggle span:first-child {
  transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2) {
  transform-origin: 0% 100%;
}

/* 
 * Transform all the slices of hamburger
 * into a crossmark.
 */
#menuToggle input:checked~span {
  opacity: 1;
  transform: rotate(45deg) translate(-2px, -1px);
  background: #ff7c50;
}

/*
 * But let's hide the middle one.
 */
#menuToggle input:checked~span:nth-last-child(3) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}

#menuToggle input:checked~span:nth-last-child(2) {
  transform: rotate(-45deg) translate(0, -1px);
}


#menu {
  position: absolute;
  width: 350px;
  margin: -100px 0 0 -65px;
  padding: 73px;
  padding-top: 120px;
  background: transparent;
  list-style-type: none;
  -webkit-font-smoothing: antialiased;


  transform-origin: 0% 0%;
  transform: translate(-100%, 0);

  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
}

#menu li {
  padding: 10px 0;
  font-size: 27px;
}

#menuToggle input:checked~ul {
  transform: none;
}

nav {

  display: flex;
  width: 100%;
}

nav>.nav-section {

  padding: 0;
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: center;

}

#nav-text-section {

  color: #ccc;
  font-size: 30px;
  flex-basis: calc(100% / 1);
}

.keyboard {

  display: grid;
  grid-template-columns: repeat(20, minmax(auto, 1.25em));
  grid-auto-rows: 2.7em;
  gap: .25em;
  min-height: 90vh;
  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: 1em;
  cursor: pointer;
  user-select: none;
  z-index: 1;

}

.key.large {

  grid-column: span 3;
}

.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%;
}

.guess-grid {

  display: grid;
  justify-content: center;
  align-content: center;
  flex-grow: 1;
  grid-template-columns: repeat(5, 4em);
  grid-template-rows: repeat(6, 4em);
  gap: .25em;
  margin-bottom: 1em;

}

.tile {

  font-size: 2.5em;
  color: white;
  border: 0.04em 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%, 33%);
}

.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 200ms 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: 2;
  display: flex;
  flex-direction: column;
  align-items: center;

}

.alert {

  pointer-events: none;
  background-color: hsl(208, 11%, 77%);
  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;
}

@media screen and (max-width: 900px) {

  .animated2 {

    text-align: center;
    font-size: 35px;
    font-weight: 550;
  }

  nav {

    display: flex;
    max-width: auto;
    max-height: 30%;

  }

  body {

    overflow: hidden;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 1rem;

  }

  #menu {
    position: absolute;
    width: 350px;
    margin: -50px 0 0 -50px;
    padding: 50px;
    background: transparent;
    list-style-type: none;
    -webkit-font-smoothing: antialiased;


    transform-origin: 0% 0%;
    transform: translate(-100%, 0);

    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
  }

  #menuToggle {
    display: block;
    position: relative;
    bottom: 100%;
    left: 0%;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
  }

  #menu li {
    padding: 0.2rem;
    font-size: 20px;
  }

  .keyboard {

    display: grid;
    grid-template-columns: repeat(20, minmax(auto, 3em));
    grid-auto-rows: 4em;
    gap: .5em;
    min-height: auto;
    justify-content: center;
  }

  .key {

    font-size: inherit;
    grid-column: span 2.1;
    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: auto;
    cursor: pointer;
    user-select: none;
    z-index: 1;

  }

  .guess-grid {

    display: grid;
    justify-content: center;
    align-content: center;
    flex-grow: 1;
    grid-template-columns: repeat(5, 4em);
    grid-template-rows: repeat(6, 4em);
    gap: .35em;
    margin-bottom: .5em;

  }

  .tile {

    font-size: 2.5em;
    color: white;
    border: 0.1em 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;

  }

}