@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,400;0,700;1,500&family=Roboto+Slab:wght@300&family=Young+Serif&display=swap");
*,
*::after,
*::before {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Roboto Slab", serif;
}

:root,
[data-theme="dark"] {
  --text-clr: white;
  --bg-clr: hsl(240, 90%, 4%);
  --bg-btn-clr: rgba(255, 255, 255, 0.102);
  --bg-btn-hvr-clr: rgba(255, 255, 255, 0.007);
  --border-clr: hsl(0, 0%, 97%);
  --clr-theme-icon: white;
  --bg-how-to-play: rgb(37, 34, 34);
  --clr-fill-cut-icon: white;
}

:root,
[data-theme="light"] {
  --font-roboto-slab: "Roboto Slab", serif;
  --font-poppins: "Poppins", sans-serif;
  --text-clr: rgb(10, 10, 10);
  --bg-clr: hsl(240, 30%, 95%);
  --bg-btn-clr: rgb(236, 227, 227);
  --bg-btn-hvr-clr: rgb(224, 213, 213);
  --border-clr: hsl(0, 4%, 15%);
  --clr-theme-icon: black;
  --bg-how-to-play: rgb(208, 208, 208);
  --clr-fill-cut-icon: rgb(0, 0, 0);
}

body {
  background-color: var(--bg-clr);
  max-width: 1080px;
  height: 100vh;
  margin-inline: auto;
  padding: 0.4em;
  font-size: clamp(0.5rem, 2.5vmin, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-clr);
  position: relative;
}

ul,
li {
  margin: 0;
  padding: 0;
}

.theme {
  position: absolute;
  right: 2rem;
  top: 1.2rem;
  border: 1px solid rgb(168, 132, 13);
  border-radius: 50px;
  padding: 5px;
  display: flex;
  place-items: center;
}

.theme > [data-select-theme="dark"] {
  display: none;
}

.theme > .theme-icon {
  width: 30px;
}

.btn {
  font-family: var(--font-poppins);
  font-weight: 300;
  font-size: 1.5rem;
  outline: none;
  border: none;
  letter-spacing: 1px;
  padding: 8px 60px;
  color: var(--text-clr);
  border: 2px var(--border-clr) solid;
  background-color: var(--bg-btn-clr);
  border-radius: 30px;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--bg-btn-hvr-clr);
}

.header {
  max-width: 700px;
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.wordle-box {
  display: grid;
  justify-content: center;
  align-content: center;
  grid-template-columns: repeat(3, 1.4rem);
  grid-template-rows: repeat(3, 1.4rem);
  gap: 1px;
}

.tile {
  border-radius: 2px;
  border: 0.05em solid var(--border-clr);
}

.tile.dance-tiles {
  border: none;
  background-color: hsl(115, 29%, 43%);
  animation: dance 2s infinite linear;
}
@keyframes dance {
  20% {
    transform: translateY(-50%);
  }

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

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

  80% {
    transform: translateY(2.5%);
    background-color: hsl(49, 51%, 47%);
  }

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

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

.header-text {
  text-align: center;
}

.title {
  font-family: "Young Serif", sans-serif;
  font-size: 3.5rem;
  letter-spacing: 4px;
  margin-bottom: 1px;
  background: linear-gradient(45deg, #ff8a00, #e52e71);
  -webkit-background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

.description {
  font-weight: 400;
  font-size: 1.8rem;
}

.wordle-buttons {
  display: flex;
  gap: 30px;
}

footer {
  position: absolute;
  bottom: 20px;
}

.about {
  font-family: var(--font-poppins);
  font-size: 1.3rem;
}

.about > a {
  font-family: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  color: inherit;
  text-decoration-color: var(--text-clr);
}
.about > a:hover {
  background: linear-gradient(45deg, #ff8a00, #e52e71);
  -webkit-background-clip: text;
  color: transparent;
  text-decoration: none;
}

/* How to Play Banner */
.how-to-play-section {
  top: -200%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
  background-color: var(--bg-how-to-play);
  border-radius: 10px;
  padding-inline: 1.7rem;
  padding-block: 1.4rem;
  transition: top 0.5s ease;
  max-width: 620px;
  width: 100%;
}

.cut-button {
  position: absolute;
  right: 1.7rem;
  top: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
}
.cut-button > svg {
  font-size: 1.5rem;
  fill: var(--clr-fill-cut-icon);
}

.how-to-play-description {
  margin-top: 1rem;
}
.how-to-play-description > h2 {
  font-family: var(--font-poppins);
  font-size: 2rem;
}
.how-to-play-description > p {
  font-family: var(--font-poppins);
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.how-to-play-description > ul > li {
  font-weight: 300;
  font-family: var(--font-poppins);
  font-size: 1.1rem;
  margin-left: 15px;
  line-height: 1.3;
}
.how-to-play-description > ul {
  margin-bottom: 1rem;
}

.examples > h4 {
  font-family: var(--font-poppins);
  font-weight: 500;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.example:not(:nth-last-child(1)) {
  margin-bottom: 10px;
}

.example {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.example > p {
  font-family: var(--font-poppins);
  font-size: 1rem;
}
.example > p > strong {
  font-family: inherit;
  font-weight: 900;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(5, 3rem);
  grid-template-rows: repeat(1, 3rem);
  gap: 4px;
}

.tile {
  font-family: var(--font-poppins);
  font-size: 2rem;
  text-align: center;
  font-weight: 900;
  user-select: none;
}

.tiles > .correct {
  border: none;
  background-color: hsl(115, 29%, 43%);
  color: white;
}
.tiles > .tile.wrong-location {
  border: none;
  background-color: hsl(49, 51%, 47%);
  color: white;
}
.tiles > .wrong {
  border: none;
  background-color: hsl(240, 2%, 23%);
  color: white;
}

@keyframes flip {
  from {
    transform: rotateX(90deg);
  }
  to {
    transform: rotateX(0);
  }
}

/* Media Queries */

@media only screen and (max-width: 800px) {
  .title {
    font-size: 2.8rem;
  }
  .description {
    max-width: 440px;
    font-size: 1.3rem;
  }
  .btn {
    font-size: 1.2rem;
    padding: 10px 15px;
    border-radius: 30px;
  }
  .wordle-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .about {
    font-size: 1.2rem;
  }

  /*How to Play*/
  .how-to-play-description > h2 {
    font-size: 1.8rem;
  }

  .how-to-play-description > p {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .how-to-play-description > ul > li {
    font-size: 1rem;
    margin-left: 15px;
    line-height: 1.2;
  }
  .examples > h4 {
    font-size: 1.1rem;
  }

  .example > p {
    font-size: 0.9rem;
  }

  .tiles {
    display: grid;
    grid-template-columns: repeat(5, 2.8rem);
    grid-template-rows: repeat(1, 2.8rem);
    gap: 3px;
  }

  .tile {
    font-size: 1.8rem;
  }
}
@media only screen and (max-width: 600px) {
  .title {
    font-size: 2.2rem;
  }
  .description {
    max-width: 300px;
    font-size: 1.2rem;
  }
  .btn {
    font-size: 1rem;
    padding: 7px 12px;
    border-radius: 30px;
  }
  .wordle-buttons {
    gap: 15px;
  }

  .about {
    font-size: 1.1rem;
  }
  .wordle-box {
    grid-template-columns: repeat(3, 1rem);
    grid-template-rows: repeat(3, 1rem);
    gap: 1px;
  }
}
