* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-family: "Courier Prime", monospace;
  line-height: 1;
  font-weight: 400;
  color: var(--sub-color);
  background-color: var(--bg-color);
  position: relative;
}

:root {
  --bg-color: #dad3c1;
  --main-color: #1d1b17;
  --caret-color: #1d1b17;
  --sub-color: #918b7d;
  --sub-alt-color: #c8c3b3;
  --text-color: #1d1b17;
  --error-color: #bf616a;
  --error-extra-color: #793e44;
}

.dark-mode {
  --bg-color: #282828;
  --main-color: #d79921;
  --caret-color: #fabd2f;
  --sub-color: #665c54;
  --sub-alt-color: #212121;
  --text-color: #ebdbb2;
  --error-color: #fb4934;
  --error-extra-color: #cc241d;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  padding: 2rem 4rem;
}

.logo {
  height: 3.6rem;
}

.logo--text {
  font-size: 2.8rem;
  position: flex;
  margin-right: auto;
  color: var(--sub-alt-color-color);
}

.mode {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moon-icon {
  width: 2.8em;
  height: 2.8rem;
  color: var(--sub-color);
  position: absolute;
  margin-bottom: 2rem;
  margin-right: 5rem;
  /* display: none; */
}

.sun-icon {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--main-color);
  position: absolute;
  margin-bottom: 2rem;
  margin-right: 5.2rem;
  /* display: none; */
}

.moon-icon:hover,
.sun-icon:hover {
  color: var(--main-color);
  cursor: pointer;
}

.hide {
  display: none;
}

.configbox {
  margin: 5.2rem;
}

.configbox::after {
  content: "";
  width: 90%;
  position: absolute;
  top: 250px;
  border: 1.5px solid var(--sub-alt-color);
}

.config {
  display: flex;
  gap: 3.6rem;
  justify-content: center;
  align-items: center;
  background-color: var(--sub-alt-color);
  padding: 1.5rem;
  border-radius: 10px;
  width: max-content;
}

.config p {
  cursor: none;
}

.config-text {
  display: flex;
  gap: 2rem;
}

.config-time {
  display: flex;
  gap: 2rem;
}

.config-btn:hover {
  color: var(--text-color);
  cursor: pointer;
}

.active {
  color: var(--main-color);
}

.config-btn {
  display: inline-block;
  font-size: 1.6rem;
}

.config-btn:active {
  color: var(--main-color);
}

.wordsbox {
  padding: 5rem 15rem 8rem 15rem;
  line-height: 1.6;
  position: relative;
}

#timer {
  font-size: 3rem;
  font-weight: 600;
  color: var(--main-color);
}

.words {
  font-size: 100rem;
  align-content: flex-start;
  display: flex;
  flex-wrap: wrap;
  height: 16rem;
  overflow: hidden;
  width: 100%;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@keyframes fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

#cursor {
  /* display: none; */
  width: 2px;
  height: 2.6rem;
  background-color: var(--caret-color);
  position: relative;
  top: 2.8rem;
  left: 3px;
  animation: blink 0.6s infinite;
}

.word {
  display: inline-block;
  margin: 0 5px;
  font-size: 2.6rem;
}

.correct {
  color: var(--text-color);
}

.incorrect {
  color: var(--error-color);
}

.extra {
  color: var(--error-extra-color);
}

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

.blur {
  animation: fade 3s;
}

.btn {
  height: 2.4rem;
  width: 2.4rem;
  margin: 0 5.4rem;
  padding: 1rem;
  border-radius: 1rem;
}

.btn:hover {
  cursor: pointer;
  color: var(--main-color);
}

.btn:active {
  background-color: #555;
}

.touchtype-link {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 9rem;
}

.link {
  font-weight: 500;
  font-size: 1.6rem;
}

a:link,
a:active,
a:visited {
  text-decoration: none;
  color: #444;
}

a:hover {
  color: var(--sub-color);
  text-decoration: underline;
}

.hidden {
  display: none;
}

.hide-opacity {
  opacity: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 18rem;
  row-gap: 10rem;
}

.result-tab {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--caret-color);
}

.result-flex {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  align-items: center;
  justify-content: center;
}
.result-tab p {
  font-size: 3rem;
}

.result-tab h2 {
  font-size: 10rem;
}

.result-correct {
  grid-row: 2;
  grid-column: 1/3;
}

.result-wrong {
  grid-row: 2;
  grid-column: 2/4;
}

p {
  cursor: default;
}
