:root {
    color-scheme: light dark;
    --black: #222222;
    --dark-gray: #555555;
    --gray: #999999;
    --green: #00b755;
    --yellow: #daaf38;
    --red: #ca4754;
}

body {
    background: var(--black);
    font-family: monospace;
    font-size: 24px;
    display: grid;
    padding: 0 2em;
    margin: 1em;
    justify-content: center;
}

section {
    padding: 1em;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

time {
    color: var(--yellow);
    margin: 0 2em;
}

input {
    pointer-events: none;
    opacity: 0;
}

p {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
}

word {
    border-bottom: 2px solid transparent;

    &.incomplete {
        border-bottom: 2px solid var(--red);
    }
}

char {
    color: var(--gray);
    position: relative;

    &.active::before {
        content: '|';
        color: var(--yellow);
        font-size: 20px;
        position: absolute;
        left: -55%;
        animation: blink 1s ease-in-out 0s infinite both;
    }

    &.active.is-last::before {
        left: 70%;
    }

    &.correct {
        color: var(--green);
    }

    &.incorrect {
        color: var(--red);
    }
}

@keyframes blink {

    0%,
    25% {
        opacity: 1;
    }

    75%,
    100% {
        opacity: 0;
    }
}


#game {
    display: flex;
}

#results {
    display: none;
}

h2 {
    color: var(--gray);
    font-weight: 400;
    margin: 0;
    font-size: 32px;
}

h3 {
    color: var(--yellow);
    font-weight: 400;
    margin: 0 0 0.5em 0;
    font-size: 48px;
}

button {
    background: transparent;
    border: 0;
    margin-top: 2em;
    padding: 2em;
    opacity: .4;
    display: inline-block;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    cursor: pointer;
    border-radius: 16px;

    &:hover {
        background-color: var(--dark-gray);
        opacity: 1;
        scale: 120%;
    }
}

#header {
    width: max-content;
    padding-bottom: 4em;
}