/* Container Principal */
#quizzzz-app {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-family: inherit;
    color: #333;
    box-sizing: border-box;
}

/* Botão Pular */
.btn-skip { background: #6c757d; }
.btn-skip:hover { background: #5a6268; }

#quizzzz-app * {
    box-sizing: border-box;
}

/* Tela Inicial e Categorias */
.quizzzz-instructions {
    background: #f0f7fc;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 0 4px 4px 0;
    font-size: 15px;
    line-height: 1.6;
}

.quizzzz-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.quizzzz-cat-btn {
    padding: 12px 10px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.quizzzz-cat-btn:hover { 
    background: #135e96;
}

/* Estrutura da Pergunta */
.quizzzz-progress {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.quizzzz-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quizzzz-question-text {
    font-size: 16px;
    text-transform: uppercase;
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 25px;
    color: #222;
    font-weight: 700;
    clear: both;
}

/* Respostas */
.quizzzz-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.quizzzz-answer-btn {
    padding: 10px 16px;
    font-size: 14px;
    text-align: left;
    background: #fff;
    color: #333;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
    display: block;
    line-height: 1.4;
    margin: 0;
    
    /* CORREÇÃO DO VAZAMENTO DE TEXTO */
    white-space: normal;
    word-wrap: break-word;
    height: auto;
}

.quizzzz-answer-btn:hover:not(.disabled) {
    background: #f8f9fa;
    border-color: #cdd0d4;
    color: #333;
}

.quizzzz-answer-btn.disabled {
    cursor: default;
    opacity: 0.9;
}

/* Estilos de Validação (Certo/Errado) */
.quizzzz-answer-btn.correct-selected {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: bold;
}

.quizzzz-answer-btn.wrong-selected {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    font-weight: bold;
}

.quizzzz-answer-btn.correct-revealed {
    background: #e2f3e5;
    border-color: #28a745;
    border-style: dashed;
    color: #155724;
}

/* Estado temporário quando seleciona opção antes de avançar */
.quizzzz-answer-btn.state-selected {
    background: #e2f0fd;
    border-color: #2271b1;
    color: #135e96;
    font-weight: 600;
}

/* Navegação Inferior */
.quizzzz-navigation {
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha caso falte espaço no desktop */
    justify-content: space-between;
    align-items: center;
    gap: 15px; 
    border-top: 1px solid #e2e4e7;
    padding-top: 20px;
}

/* Garante que o agrupamento de Pular/Verificar responda ao wrap */
.quizzzz-navigation > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quizzzz-nav-btn {
    padding: 12px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
    text-align: center;
}
.quizzzz-nav-btn:hover { background: #000; }

.btn-finish { background: #28a745; }
.btn-finish:hover { background: #218838; }

/* Tela de Resultados */
.quizzzz-result-screen {
    text-align: center;
    padding: 20px 0;
}
.quizzzz-result-screen h2 {
    font-size: 28px;
    color: #222;
    margin-bottom: 15px;
}
.quizzzz-result-screen p {
    font-size: 18px;
    color: #555;
    margin-bottom: 25px;
}
.quizzzz-restart-btn {
    padding: 14px 30px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.quizzzz-restart-btn:hover { background: #135e96; }


/* --- RESPONSIVIDADE PARA MOBILE --- */
@media (max-width: 600px) {
    #quizzzz-app {
        padding: 20px 15px; /* Reduz padding lateral para ganhar mais tela */
    }
    
    /* Empilha os botões de controle na vertical */
    .quizzzz-navigation {
        flex-direction: column-reverse; 
        align-items: stretch;
        gap: 10px;
    }

    .quizzzz-navigation > div {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .quizzzz-nav-btn {
        width: 100%; /* Força botões a ocuparem 100% da tela */
        padding: 15px; /* Deixa o botão mais alto para toque do dedo */
        font-size: 14px;
    }

    /* Oculta divs vazias geradas pelo JS para não criar espaços em branco */
    .quizzzz-navigation > div:empty {
        display: none;
    }
}