:root {
    /* Tema Padrão/Geral (Espacial) */
    --body-bg: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --container-bg: rgba(10, 25, 47, 0.85);
    --container-border: #7DF9FF;
    --text-color: #e0e0e0;
    --title-color: #FFA500;   /* NOVA COR: Laranja para títulos e perguntas */
   /*  --title-shadow: #FFA500;  NOVA COR: Sombra Laranja */
    --subtitle-color: #bdc1c6;
    --button-bg: linear-gradient(145deg, #007bff, #0056b3);
    --button-hover-bg: linear-gradient(145deg, #0056b3, #003d80);
    --button-shadow: rgba(0, 123, 255, 0.4);
    --answer-bg: linear-gradient(145deg, #3a506b, #2c3e50);
    --answer-hover-bg: linear-gradient(145deg, #4e6a85, #34495e);
    --answer-border: #5bc0de80;
    --correct-bg: linear-gradient(145deg, #28a745, #1e7e34);
    --correct-shadow: #28a745;
    --incorrect-bg: linear-gradient(145deg, #dc3545, #c82333);
    --incorrect-shadow: #dc3545;
    --hud-bg: rgba(0,0,0,0.3);
    --hud-text-color: #FFD700;
    --font-main: 'Poppins', sans-serif;
    --font-title: 'Poppins', sans-serif;
    --icon-header-color: var(--title-color);
}



body {
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: var(--body-bg);
    color: var(--text-color);
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

main {
    /* Mude para alinhamento vertical */
    flex-direction: column;
    /* Alinhe horizontalmente ao centro */
    align-items: center; 
    /* Remova a margem inferior para que a logo se aproxime do topo do container */
    padding-bottom: 0 !important;
}

.container {
    background-color: var(--container-bg);
    padding: 25px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    max-width: 800px;
    border: 2px solid var(--container-border);
    backdrop-filter: blur(5px);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.screen { display: none; }
.screen.active {
    display: block;
    animation: fadeInScreen 0.7s ease-in-out;
}
@keyframes fadeInScreen {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2 {
    font-family: var(--font-title);
    color: var(--title-color);
    text-shadow: 0 0 10px var(--title-shadow), 0 0 20px var(--title-shadow);
    margin-bottom: 10px;
    transition: color 0.5s ease, text-shadow 0.5s ease;
}
h1 { font-size: 2.8em; }
h2 { font-size: 1.8em; margin-bottom: 20px; }

.subtitle {
    font-size: 1.1em;
    color: var(--subtitle-color);
    margin-bottom: 30px;
    transition: color 0.5s ease;
}

.logo-image, .gameover-image {
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--title-shadow);
    transition: box-shadow 0.5s ease;
   
}

#theme-selection-container, .instructions-preview {
    margin-bottom: 30px;
}
#theme-selection-container h3, .instructions-preview h3 {
    font-family: var(--font-title);
    color: var(--subtitle-color);
    margin-bottom: 15px;
    font-size: 1.4em;
}
.icon-header {
    color: var(--icon-header-color);
    margin-right: 5px;
}

.theme-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.theme-button {
    font-family: var(--font-main);
    background: var(--answer-bg);
    color: var(--text-color);
    border: 1px solid var(--answer-border);
    padding: 10px 20px;
    margin: 5px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.theme-button:hover {
    background: var(--answer-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.theme-button.selected {
    background: var(--button-bg);
    color: white;
    box-shadow: 0 0 10px var(--button-shadow);
    transform: scale(1.05);
    border-color: transparent;
}

.mode-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.mode-preview {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--answer-border);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mode-preview:hover {
    background-color: var(--answer-hover-bg);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px var(--button-shadow);
    border-color: var(--title-color);
}
.mode-preview h4 {
    font-family: var(--font-title);
    color: var(--hud-text-color);
    margin-top: 0; margin-bottom: 8px;
    font-size: 1.1em;
}
.mode-preview p {
    font-size: 0.9em;
    color: var(--subtitle-color);
    line-height: 1.4;
}

#mode-selection-container { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;}
#select-theme-message {
    margin-top: 15px;
    color: var(--subtitle-color);
    font-style: italic;
}

.mode-button, button#next-question-button {
    font-family: var(--font-title);
    background: var(--button-bg);
    color: white;
    border: none;
    padding: 10px 25px;
    margin: 5px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--button-shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.mode-button:hover, button#next-question-button:hover {
    background: var(--button-hover-bg);
    transform: translateY(-3px) scale(1.05);
}
.mode-button:active, button#next-question-button:active {
    transform: translateY(-1px) scale(0.98);
}
.mode-button:disabled {
    background: grey;
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.hidden { display: none !important; }

#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: var(--hud-bg);
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--answer-border);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}
#hud div {
    color: var(--hud-text-color);
    display: flex;
    align-items: center;
    transition: color 0.5s ease;
}
.hud-icon {
    font-size: 1.5em;
    margin-right: 8px;
    line-height: 1;
}
#lives-display .life-icon {
    display: inline-block;
    margin: 0 2px;
    font-size: 1.3em;
    color: #ff4d4d;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.life-icon.gained { animation: lifeGainedAnimation 0.5s ease-out; }
.life-icon.lost { animation: lifeLostAnimation 0.5s ease-out forwards; }
@keyframes lifeGainedAnimation {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes lifeLostAnimation {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2) rotate(15deg); opacity: 0.8; }
    100% { transform: scale(0.5) rotate(-15deg); opacity: 0; }
}

#question-area {
    margin-bottom: 25px;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 15px;
    min-height: 100px;
    border: 1px solid var(--answer-border);
    transition: border-color 0.5s ease;
}
#question-image-container { margin-top: 20px; text-align: center; }
#question-image {
    max-width: 100%;
    max-height: 250px;
    border-radius: 10px;
    border: 2px solid var(--container-border);
    box-shadow: 0 0 10px var(--title-shadow);
    object-fit: contain;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
    background-color: rgba(255,255,255,0.05);
}

#answers-container {
    display: grid;
    /* Linha MODIFICADA: Em telas grandes, force 3 colunas iguais. */
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px;
    margin-top: 20px;
}
.answer-button {
    background: var(--answer-bg);
    color: var(--text-color);
    padding: 18px;
    border: 1px solid var(--answer-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-anime .answer-button {
    font-family: 'Montserrat', sans-serif;
}
.answer-button.true-false-btn {
    font-size: 1.2em;
    font-weight: bold;
}


.answer-button:hover {
    background: var(--answer-hover-bg);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--container-border);
}
.answer-button.selected { opacity: 0.8; }
.answer-button.correct {
    background: var(--correct-bg) !important;
    color: white !important;
    animation: correctAnswerAnimation 0.7s ease-out;
    box-shadow: 0 0 20px var(--correct-shadow) !important;
    border-color: var(--correct-shadow) !important;
}
.answer-button.incorrect {
    background: var(--incorrect-bg) !important;
    color: white !important;
    animation: incorrectAnswerAnimation 0.7s ease-in-out;
    box-shadow: 0 0 20px var(--incorrect-shadow) !important;
    border-color: var(--incorrect-shadow) !important;
}
.answer-button:disabled { cursor: not-allowed; }
.answer-button.correct::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: scale(0);
    animation: shineEffect 0.7s ease-out;
}
@keyframes shineEffect { to { transform: scale(2); opacity: 0; } }

#feedback {
    margin-top: 25px;
    font-size: 1.3em;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    animation: feedbackPopIn 0.4s ease-out;
    color: var(--text-color);
}
#feedback.correct-feedback {
    background-color: rgba(var(--r-correct, 21), var(--g-correct, 87), var(--b-correct, 36), 0.8);
    border: 1px solid var(--correct-shadow);
    text-shadow: 0 0 5px var(--correct-shadow);
}
#feedback.incorrect-feedback {
    background-color: rgba(var(--r-incorrect, 114), var(--g-incorrect, 28), var(--b-incorrect, 36), 0.8);
    border: 1px solid var(--incorrect-shadow);
    text-shadow: 0 0 5px var(--incorrect-shadow);
}

/* Definindo componentes RGB para temas específicos se necessário */
.theme-matematica { --r-correct: 72; --g-correct: 201; --b-correct: 176; --r-incorrect: 236; --g-incorrect: 112; --b-incorrect: 99;}
.theme-anime { --r-correct: 129; --g-correct: 199; --b-correct: 132; --r-incorrect: 229; --g-incorrect: 115; --b-incorrect: 115;}

/* ------------------------------------------------------------------------- */
/* ESTILOS DO FOOTER (Rodapé Fixo e Alinhamento Lateral)                      */
/* ------------------------------------------------------------------------- */
#quiz-footer {
    width: 100%; /* Ocupa a largura total da tela */
   
    color: var(--subtitle-color);
    padding: 10px 20px;
    box-sizing: border-box;
    /* Adicione estas propriedades para garantir que ele fique no final do body */
    position: relative; /* ou absolute, dependendo do layout do body */
    bottom: 0;
    left: 0;
}

.footer-content {
    display: flex;
    /* Alinha as logos no centro */
    justify-content: center; 
    align-items: center;
    gap: 30px; /* Aumenta o espaço entre as logos para ficarem mais visíveis */
    margin: 0 auto; /* Centraliza o bloco de logos */
    padding: 0 10px; /* Padding interno */
}

.footer-logo {
    height: auto; /* Permite que a altura se ajuste proporcionalmente */
    opacity: 0.8; 
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Tamanhos específicos para cada logo */
.footer-logo-link img[alt="Logo Koletividade"] {
    max-width: 90px; /* Koletividade menor */
}

.footer-logo-link img[alt="Logo Prysma Solutions"] {
    max-width: 130px; /* Prysma maior */
}


.footer-logo-link:hover .footer-logo {
    opacity: 1;
    transform: scale(1.05);
}

.footer-text {
    font-size: 0.75em;
    color: var(--subtitle-color);
    margin-top: 5px;
    text-align: center; /* Garante que o texto fique sempre centralizado */
}

/* Adicione estas regras ao seu style.css */

#logo-above-container {
    /* Centraliza a div na horizontal */
    width: 100%;
    text-align: center;
    /* Adiciona uma margem inferior para separar do container */
    margin-bottom: -1px; /* Puxe a logo para cima se o container a estiver empurrando muito para baixo */
    z-index: 10; /* Garante que fique sobre o container, se necessário */
}

#logo-above-container img {
    /* Centraliza a imagem dentro da div (embora o text-align já resolva) */
    display: inline-block; 
    /* Remove qualquer margem que possa estar interferindo */
    margin: 0; 
    
    /* Estilo da sua logo-image deve ser definido na classe .logo-image */
}

/* Tela Final */
#end-screen h1 {
    color: var(--hud-text-color);
    font-size: 2.2em;
    text-transform: uppercase; 
   
    font-family: Poppins;
}
#end-screen p { font-size: 1.5em; margin: 12px 0; color: var(--subtitle-color); }
#end-screen strong { color: var(--title-color); font-family: var(--font-title); }

/* Animações Botões Resposta */
@keyframes correctAnswerAnimation {
    0% { transform: scale(1); }
    30% { transform: scale(1.1) rotate(2deg); }
    60% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1); }
}
@keyframes incorrectAnswerAnimation {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px) rotate(-3deg); }
    40% { transform: translateX(10px) rotate(3deg); }
    60% { transform: translateX(-10px) rotate(-3deg); }
    80% { transform: translateX(10px) rotate(3deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .container { padding: 20px; }
    h1 { font-size: 1.5em; } .theme-anime h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    .subtitle { font-size: 1em; }
    #answers-container { grid-template-columns: 1fr; }
    #answers-container.true-false-layout {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .mode-button, button#next-question-button, .answer-button, .theme-button {
        font-size: 1em; padding: 12px 20px;
    }
    #hud { font-size: 1em; flex-direction: column; align-items: stretch; gap: 10px; }
    #hud > div { justify-content: center; }
    
    .footer-logo {
        height: 35px; /* Aumenta o tamanho da logo no desktop */
        max-width: 150px;
    }
}
@media (max-width: 480px) {
    .container { padding: 15px; }
    h1 { font-size: 1.8em; } .theme-anime h1 { font-size: 1.5em; }
    .subtitle { font-size: 0.9em; }
    .mode-button, button#next-question-button, .answer-button, .theme-button {
        font-size: 0.9em; padding: 10px 15px;
    }
    .mode-preview-grid { grid-template-columns: 1fr; }
    .theme-buttons { flex-direction: column; }
    .hud-icon { font-size: 1.3em; }
    #lives-display .life-icon { font-size: 1.1em; }
    #answers-container.true-false-layout {
        grid-template-columns: 1fr;
    }
}

.low-time { animation: pulseLowTime 1s infinite; }
@keyframes pulseLowTime {
    0%, 100% { transform: scale(1); color: var(--hud-text-color); }
    50% { transform: scale(1.1); color: #FF0000; }
}

#score-container.score-increased #score {
    animation: scoreBump 0.5s ease-out;
    display: inline-block;
}
@keyframes scoreBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: #00FF00; }
    100% { transform: scale(1); }
}
@keyframes feedbackPopIn {
    0% { transform: scale(0.8); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}