/* Reset básico e configurações do corpo da página */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #333;
    color: #f4f4f4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Container principal */
.container {
    background-color: #444;
    border-radius: 10px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
}

h1 { margin-bottom: 20px; color: #00bcd4; }
h2 { color: #ccc; margin-top: 30px; margin-bottom: 15px; border-bottom: 1px solid #666; padding-bottom: 10px; text-align: left; }

/* Informações do usuário logado */
.user-info { position: absolute; top: 15px; right: 20px; font-size: 0.9rem; display: flex; align-items: center; gap: 15px; }
.botao-logout { background-color: #666; color: white; padding: 5px 10px; border-radius: 5px; text-decoration: none; font-size: 0.8rem; transition: background-color 0.3s; margin-left: 5px; }
.botao-logout:hover { background-color: #777; }
.user-info a.botao-logout:first-child { background-color: #00bcd4; color: #333; }
.user-info a.botao-logout:first-child:hover { background-color: #0097a7; }

/* Estilo da área de estatísticas */
.stats { display: flex; justify-content: space-between; margin-bottom: 30px; gap: 10px; }
.stat-box { background-color: #555; padding: 10px; border-radius: 8px; width: 100%; flex: 1; }
.stat-box h2 { font-size: 1.1rem; color: #ccc; margin-top: 0; border-bottom: none; text-align: center; }
.stat-box p { font-size: 1.8rem; font-weight: bold; color: #fff; }

/* Caixa com o texto a ser digitado */
.texto { 
    background-color: #2c2c2c; 
    border: 2px solid #666; 
    border-radius: 5px; 
    padding: 20px; 
    font-size: 1.5rem; 
    letter-spacing: 1px; 
    line-height: 1.6; 
    margin-bottom: 20px; 
    text-align: left; 
    font-family: 'Courier New', Courier, monospace;
    /* MUDANÇA 1: Impede a seleção do texto com o mouse */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}
.texto span.correto { color: #4caf50; }
.texto span.incorreto { color: #f44336; text-decoration: underline; background-color: rgba(244, 67, 54, 0.2); }
/* NOVO: Classe para o cursor de digitação */
.texto span.cursor {
    background-color: #00bcd4;
    color: #333;
    border-radius: 2px;
}
/* NOVO: Animação de erro */
.texto.erro-flash {
    animation: tremor 0.3s;
}
@keyframes tremor {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Área de digitação do usuário */
.campo-digitacao { width: 100%; height: 100px; padding: 10px; font-size: 1.5rem; border-radius: 5px; border: 2px solid #666; background-color: #555; color: #f4f4f4; font-family: 'Courier New', Courier, monospace; resize: none; }
.campo-digitacao:focus { outline: none; border-color: #00bcd4; }

/* Botão Genérico */
.botao { display: inline-block; padding: 10px 20px; font-size: 0.9rem; font-weight: bold; border: none; border-radius: 5px; background-color: #00bcd4; color: #333; cursor: pointer; text-decoration: none; transition: background-color 0.3s, transform 0.2s; margin: 0; }
.botao:hover { background-color: #0097a7; transform: translateY(-2px); }

/* Seção para visitantes (deslogado) */
.guest-view p { font-size: 1.2rem; margin-bottom: 20px; }
.guest-actions .botao { margin: 20px 10px 0; }

/* Formulários de Autenticação */
.auth-form { max-width: 400px; margin: 0 auto; text-align: left; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #ccc; }
.form-group input { width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #666; background-color: #555; color: #f4f4f4; font-size: 1rem; }
.auth-link { margin-top: 20px; }
.auth-link a { color: #00bcd4; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* Mensagens do Servidor */
.mensagem { margin-top: 20px; padding: 10px; border-radius: 5px; font-weight: bold; min-height: 45px; }
.mensagem.success { background-color: #4caf50; color: white; }
.mensagem.error { background-color: #f44336; color: white; }
.mensagem.info { background-color: #2196F3; color: white; }

/* Página de Perfil */
.perfil-container { max-width: 900px; }
.recordes-wrapper { justify-content: center; gap: 30px; }
.historico-wrapper { width: 100%; max-height: 400px; overflow-y: auto; background-color: #3a3a3a; border-radius: 5px; }
.tabela-historico { width: 100%; border-collapse: collapse; text-align: center; }
.tabela-historico thead { background-color: #2c2c2c; position: sticky; top: 0; }
.tabela-historico th, .tabela-historico td { padding: 12px 15px; }
.tabela-historico tbody tr { border-bottom: 1px solid #555; }
.tabela-historico tbody tr:last-child { border-bottom: none; }
.tabela-historico tbody tr:nth-child(even) { background-color: #444; }
#sem-historico a { color: #00bcd4; }

/* GRUPO DE BOTÕES DE AÇÃO */
.botoes-grupo { margin-top: 20px; border-top: 1px solid #666; padding-top: 20px; }
.botoes-grupo:first-of-type { margin-top: 30px; border-top: none; padding-top: 0; }
.botoes-grupo p { margin-bottom: 15px; color: #ccc; font-size: 0.9rem; }
.botoes-acao { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.botao-foco { background-color: #ff9800; color: white; }
.botao-foco:hover { background-color: #f57c00; }
.botao-gemini { background: linear-gradient(45deg, #4285F4, #9b72cb); color: white; border: none; }
.botao-gemini:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }