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

body {
    background: var(--black);
    font-family: Menlo, monospace;
    display: grid;
    padding: 32px;
    justify-content: center;
    margin-top: 32px;
    padding: 16px;
}

section {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 500px;
}

time {
    color: var(--yellow);
}

input {
    z-index: -999;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
}

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

j-letter {
    color: var(--gray);
    position: relative;

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

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

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

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

j-word {
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.3s ease-in-out;

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

@keyframes blink {
    0%, 25% {
        opacity: 1;
    }
    75% {
        opacity: 0;
    }    
}

#game {
    display: flex;
}

#results { 
    display: none;
}

h2 {
    font-weight: 400;
    opacity: 4;
    margin: 0;
    font-size: 16px;
}

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

button {
    padding: 8px 16px;
    background: var(--yellow);
    color: var(--black);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease-in-out;

    &:hover {
        background: var(--gray);
    }
}