:root {
    /* Cores MB - Padrão Amarelo e Preto */
    --bg-color: #FFCF00;      /* Amarelo vibrante da MB */
    --text-main: #111111;
    --text-muted: #4b5563;
    
    --primary: #000000;       /* Preto profissional para alto contraste */
    --primary-hover: #222222;
    --primary-text: #FFCF00;  /* Amarelo para textos no fundo escuro */
    
    --card-bg: rgba(255, 255, 255, 0.98);
    
    --success: #22c55e;
    --success-light: #dcfce7;
    
    --error: #ef4444;
    --error-light: #fee2e2;
    
    /* Variáveis visuais */
    --radius: 16px;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 600px;
    min-height: 500px;
    padding: 24px;
    position: relative;
}

/* Telas e Transições */
.screen {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 100%;
}

.screen.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.hidden {
    display: none !important;
}

/* TELA 1: Abertura */
.ranking-float-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ranking-float-btn:hover {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.logo-container {
    margin-bottom: 24px;
}

.logo-placeholder {
    width: 70px;
    height: 70px;
    background: var(--primary);
    color: var(--primary-text);
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.main-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
}

/* Botões Gamificados */
.primary-btn {
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #333; /* Estilo gamificado 3D */
    text-transform: uppercase;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(2px);
    box-shadow: 0 2px 0 #333;
}

.primary-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.secondary-btn {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: #eff6ff;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 0 #333, 0 0 0 0 rgba(0, 0, 0, 0.4); }
    70% { box-shadow: 0 4px 0 #333, 0 0 0 15px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 4px 0 #333, 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* TELA 2: Quiz */
.quiz-header {
    margin-bottom: 24px;
}

.progress-container {
    width: 100%;
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 4px;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 24px;
    line-height: 1.4;
    color: var(--text-main);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.option-btn .badge {
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 800;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: #fff8d6;
}

/* Estilos de Acerto / Erro */
.option-btn.correct {
    background: var(--success-light);
    border-color: var(--success);
    color: #166534;
}

.option-btn.correct .badge {
    background: var(--success);
    color: white;
}

.option-btn.wrong {
    background: var(--error-light);
    border-color: var(--error);
    color: #991b1b;
}

.option-btn.wrong .badge {
    background: var(--error);
    color: white;
}

.option-btn:disabled {
    cursor: not-allowed;
}

/* Feedback Imediato */
.feedback-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    animation: slideUp 0.4s ease;
}

.feedback-box.correct-bg {
    background-color: var(--success-light);
    border: 1px solid var(--success);
}

.feedback-box.wrong-bg {
    background-color: var(--error-light);
    border: 1px solid var(--error);
}

.feedback-box h3 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-box.correct-bg h3 {
    color: #166534;
}

.feedback-box.wrong-bg h3 {
    color: #991b1b;
}

.feedback-box p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--text-main);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* TELA 3: Resultado */
.result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.score-display {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-main);
    margin: 16px 0;
}

.level-title {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 24px;
}

.level-highlight {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 18px;
}

.motivational-message {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

.ranking-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.ranking-container h3 {
    font-size: 18px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 8px;
}

.ranking-container ul {
    list-style: none;
}

.ranking-container li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    font-weight: 600;
}

.ranking-container li:last-child {
    border-bottom: none;
}

.ranking-container li .score-val {
    color: var(--primary);
    font-weight: 800;
}
