*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  color: white;
}

/*- Weights: 400, 600, 700 */

@font-face {
  font-family: "Sora";
  src: url("./typing-speed-test-main/Sora/Sora-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Sora";
  src: url("./typing-speed-test-main/Sora/Sora-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "Sora";
  src: url("./typing-speed-test-main/Sora/Sora-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 700;
  font-style: normal;
}

body {
  background: hsl(0, 0%, 7%);
  font-family: "Sora", sans-serif;
  display: flex;
  flex-direction: column;

  line-height: 1.5;
  min-height: 100vh;
}

nav {
  font-size: 1.2rem;
}

main {
  border-top: 1px solid gray;
  border-bottom: 1px solid gray;
  margin-block-start: 1em;
  padding-block: 1em;
}

.container {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 1em;
}

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

.score span:first-of-type {
  color: hsl(240, 3%, 46%);
  margin-inline: 0.5em;
}

.head {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-block-end: 2em;
}

.head button {
  background: none;
  cursor: pointer;
}

.logo-desktop {
  display: none;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-block-end: 1em;
  position: sticky;
  background: hsl(0, 0%, 7%);
  inset: 0;
  z-index: 100;
}

.wpm-wrapper,
.accuracy-wrapper,
.time-wrapper {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: 700;
}

.stats-container div span:first-child {
  color: hsl(240, 3%, 46%);
  font-weight: 400;
}

#accuracy {
  color: hsl(354, 63%, 57%);
}

.gap {
  height: auto;
  width: 1px;

  background-color: hsl(240, 3%, 46%);
}

.head span:first-child {
  color: hsl(0, 0%, 15%);
}

.option-container {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 1em;
}

.option-container-desktop {
  display: none;
}

.option-container-desktop button {
  background: none;
  border: 1px solid;
  padding: 0.1em;
  border-radius: 0.4em;
}

.difficulty-wrapper,
.mode-wrapper {
  display: flex;
  align-items: center;
}

.difficulty-wrapper div {
  display: flex;
}

.mode-wrapper div {
  display: flex;
}

select {
  background-color: hsl(0, 0%, 7%);
  appearance: none;
  text-align: center;
  cursor: pointer;

  width: 50%;
  padding-inline: 1em;
  padding-block: 0.4em;
  border-radius: 0.6em;
}

select,
::picker(select) {
  appearance: base-select;
}

::picker(select) {
  background-color: hsl(0, 0%, 15%);
  margin-block-start: 0.25em;
  border-radius: 5px;
  border: none;
}

select:open::picker-icon {
  rotate: 180deg;
  transition: rotate 0.2s linear;
}

select:focus {
  outline: none;
}

option {
  background: none;
  border-bottom: 1px solid white;
  padding-inline: 1em;
  padding-block: 0.2em;
  cursor: pointer;
}

option:last-of-type {
  border: none;
}

::checkmark {
  display: none;
}

option span {
  width: 17px;
  height: 17px;
  border: 1px solid;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

option span::before {
  content: "";
  position: absolute;
  width: 35%;
  height: 35%;
  background-color: black;
  border-radius: 50%;
  opacity: 0;
}

option:hover span {
  background: hsl(210, 100%, 65%);
}
option:checked span {
  background: hsl(210, 100%, 65%);
}

option:checked span::before {
  opacity: 1;
}
.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}

.overlay span {
  font-size: 1em;
  display: block;
  margin-block-start: 0.3em;
}

#start {
  background: hsl(214, 100%, 55%);
  border: none;
  text-transform: capitalize;
  cursor: pointer;
  font-size: 1.2rem;
  padding-inline: 0.5em;

  padding-block: 0.5em;
  border-radius: 10px;
}

#start:hover {
  background: hsl(210, 100%, 65%);
}

#time {
  color: hsl(49, 85%, 70%);
}
main {
  position: relative;
}

#text {
  display: flex;
  flex-wrap: wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

#text.not-started {
  filter: blur(10px);
}

#text span {
  font-size: 2rem;
  color: hsl(240, 3%, 46%);

  white-space: pre-wrap;
}

#text span.correct {
  color: hsl(140, 63%, 57%);
}
#text span.incorrect {
  color: hsl(354, 63%, 57%);
  text-decoration: underline;
}

.current {
  border-radius: 0.3rem;
  animation: smooth-blink 2s infinite;
}

@keyframes smooth-blink {
  0%,
  100% {
    background: hsl(240, 1%, 59%);
  }
  50% {
    background: hsla(240, 1%, 59%, 0.295);
  }
}

button {
  font: inherit;
  border: none;

  cursor: pointer;
}

.hidden {
  display: none;
}

footer {
  margin-block-start: 1em;
  position: relative;
}

#restart.hidden {
  display: none;
}

#restart {
  border-radius: 0.4em;
  padding-inline: 1em;
  padding-block: 0.8em;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  gap: 0.7em;
  align-items: center;
  background: hsl(0, 0%, 15%);
}

.result {
  text-align: center;
  width: 100%;
  max-width: 600px;
}

.result .wrapper {
  display: flex;
  flex-direction: column;
  margin-block-end: 2em;
  border-radius: 0.3em;
  padding-inline-start: 1em;
  padding-block: 0.4em;
  font-size: 1.3rem;
  border: 1px solid hsl(240, 3%, 46%);
}

.result .wrapper span:first-of-type {
  margin-block-end: 0.4em;
  color: hsl(240, 1%, 59%);
}

.base-img {
  border: none;
  max-width: 3rem;
  margin-block: 2em;
  animation: shadow-expand 2s;
  border-radius: 50%;
  animation: circle-appear 2s ease forwards;
}

@keyframes circle-appear {
  from {
    box-shadow: none;
  }
  to {
    box-shadow:
      0 0 0 7px hsla(140, 63%, 57%, 0.212),
      0 0 0 14px hsla(140, 63%, 57%, 0.13);
  }
}

h3 {
  margin-block-end: 0.5em;
}

.stat-result {
  text-align: left;
  margin-block-start: 1em;
}

#wpm-result {
  font-weight: 700;
}

#correct {
  color: hsl(140, 63%, 57%);
  font-weight: 700;
}
#incorrect,
#accuracy-result {
  color: hsl(354, 63%, 57%);
  font-weight: 700;
}

.highscore {
  max-width: 3.5rem;
  height: auto;
}

.confetti-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: auto;
}

.confetti-wrapper img {
  width: 100%;
  min-width: 600px;
  height: auto;
}

@media screen and (min-width: 900px) {
  .option-container {
    display: none;
  }

  nav {
    display: flex;
    align-items: center;
    font-size: clamp(0.65rem, 0.067rem + 1.037vw, 1rem);
    max-width: 100%;
    justify-content: space-between;
  }

  .wpm-wrapper,
  .accuracy-wrapper,
  .time-wrapper {
    flex-direction: row;
    gap: 0.4em;
    margin: 0;
  }

  .stats-container {
    justify-content: start;
    position: static;
    background: none;
    margin-block-end: 0em;
    gap: 1em;
  }

  .difficulty-wrapper,
  .mode-wrapper {
    display: flex;
    gap: 0.5em;
  }

  .difficulty-wrapper div,
  .mode-wrapper div {
    display: flex;
    gap: 0.4em;
  }

  .difficulty-wrapper span,
  .mode-wrapper span {
    color: hsl(240, 3%, 46%);
  }

  .option-container-desktop {
    display: flex;
    gap: 1em;
  }

  button.active {
    border-color: hsl(210, 100%, 65%);
    color: hsl(210, 100%, 65%);
  }

  .test {
    width: 70%;
  }

  .logo-desktop {
    display: block;
  }

  .logo {
    display: none;
  }

  .stat-result {
    display: flex;
    gap: 10px;
  }

  .stat-result .wrapper {
    flex: 1;
  }

  @keyframes circle-appear {
    from {
      box-shadow: none;
    }
    to {
      box-shadow:
        0 0 0 14px hsla(140, 63%, 57%, 0.212),
        0 0 0 28px hsla(140, 63%, 57%, 0.13);
    }
  }
}
