@charset "UTF-8";

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&display=swap');

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

:root {
    --fundo: #282a36;
    --texto: #f8f8f2;
    --destaque: #bd93f9;
    --superficies: #44475a;
    --correto: #50fa7b;
    --incorreto: #ff5555;
}

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', sans-serif;
    background-color: var(--fundo);
    color: var(--texto);
}

header {
    padding: 20px;
    text-align: center;
}

header a {
    color: var(--texto);
    margin: 0 15px;
    text-decoration: none;
}

main {
    /* faz o main ocupar todo o espaço que sobra na tela abaixo do header */
    flex: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 {
    margin-top: 0px;
    font-size: 40px;
    color: var(--texto);
    white-space: nowrap;
}

.infos {
    display: flex;
    gap: 20px;
    font-size: 18px;
    text-decoration: 2px underline;
    text-decoration-color: var(--destaque);
    margin-bottom: 10px;
}

nav a {
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease; 
}

nav a::after {
    content: ''; 
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--destaque);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 2px;
}
nav a:hover {
    color: var(--destaque);
    opacity: 0.8;
}

.campo-de-digitacao {
    height: 70%;
    width: 70%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    background-color: var(--superficies);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--destaque);
    text-align: center;
}

.texto {
    width: 80%;
    font-size: 15px;
}

.inp-texto {
    width: 80%;
    font-family: 'Fira Code', sans-serif;
    height: 40px;
    border-radius: 5px;
    outline: none;
    background-color: var(--fundo);
    color: var(--texto);
    padding: 10px;
}

.inp-texto:focus {
    transition: .5s;
    border: 2px solid var(--destaque);
}

.correto {
    color: var(--correto);
}

.incorreto {
    color: var(--incorreto);
    text-decoration: underline;
}

.escondido {
    display: none !important;
}

.reiniciar {
    display: block;
    width: 25px;
    padding: 20px;
    height: 25px;
    border-radius: 3px;
    background-color: var(--fundo);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.reiniciar:active span {
    transform: translate(-2px, -2px);
}


.botao-ativo::after {
    width: 100%; 
}

@media (max-width: 768px) {

    body {
        height: auto;
        min-height: 100vh;
        padding-bottom: 50px; /* Espaço extra no final para scroll */
    }

    .campo-de-digitacao {
        width: 90%; 
        height: auto;
        padding: 20px;
    }

    h1 {
        font-size: 32px;
        white-space: normal;
    }

    .texto {
        width: 100%;
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 20px;
        white-space: normal;
    }

    .infos {
        width: 100%;
        justify-content: space-around;
        margin-bottom: 15px;
    }

    .inp-texto {
        width: 100%;
        font-size: 14px; 
        padding: 15px;
    }


    header nav {
        display: flex;
        gap: 15px;
        justify-content: center;
    }
}