@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
:root {
    --bgColor: #333;
    --textPrimary: #fff;
    --textSecondary: #666;
    --primaryColor: #fd4;
}

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

html {
    position: relative;
    height: 100vh;
}

main {
    width: 800px;
    margin: 100px auto;
    line-height: 2;
}

@media (max-width: 500px) {
    main {
        width: 400px;
        margin: 100px auto;
        line-height: 1.5;
    }
    #cursor {
        height: 1.2rem;
    }
}

body {
    font-family: 'Roboto', 'sans serif';
    background-color: var(--bgColor);
    color: var(--textPrimary);
}

h1 svg {
    width: 40px;
    color: var(--primaryColor);
    fill: var(--primaryColor);
}

#header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 20px 20px;
}

#buttons {
    text-align: right;
    ;
}

#info {
    color: var(--primaryColor);
}

button {
    background: rgba(255, 255, 255, .5);
    border: 0;
    padding: 5px 20px;
    border-radius: 5px;
    cursor: pointer;
}

div.word {
    display: inline-block;
    font-family: 'Roboto Mono', monospace;
    margin: 0 5px;
    ;
}

div#game {
    line-height: 35px;
    height: 105px;
    overflow: hidden;
    position: relative;
}

#words {
    filter: blur(5px);
    color: var(--textSecondary);
    font-size: 28px;
}

#game:focus #words {
    filter: blur(0);
}

#game:focus #focus-error {
    display: none;
}

div#game:focus {
    outline: 0
}

#focus-error {
    position: absolute;
    inset: 0;
    text-align: center;
    padding-top: 35px
}

.letter.correct {
    color: white;
}

.letter.incorrect {
    color: #f55;
}

#cursor {
    width: 2px;
    height: 1.8rem;
    background: var(--primaryColor);
    position: fixed;
    top: 0px;
    left: 0px;
    animation: blink 1s infinite;
    display: none;
}

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

#game.over #words {
    opacity: 0.3;
    filter: blur(0);
}

#game.over:focus #cursor {
    display: none;
}

#game.over #focus-error {
    display: none;
}

.overlay {
    display: none;
    background-color: rgba(0, 0, 0, .5);
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.box {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    width: 400px;
    height: 200px;
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    background-color: black;
}

.box button {
    width: 80%;
    align-self: center;
    outline: none;
    border: none;
    padding: 10px 40px;
    background-color: var(--primaryColor);
}

.result {
    font-size: 20px;
}

.result span {
    font-size: 24px;
    color: var(--primaryColor);
}

.average {
    color: var(--primaryColor)
}

.amazing {
    color: rgb(35, 172, 35)
}

.bad {
    color: rgb(189, 23, 23)
}