:root {
    --bg-obsidian: #0B0F19;
    --bg-card: #141B2D;
    --bg-card-hover: #1E293B;
    --neon-purple: #8B5CF6;
    --neon-cyan: #06B6D4;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(139, 92, 246, 0.2);
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Fundo Espacial com Estrelas em CSS */
.space-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1b243f 0%, #0B0F19 100%);
}
.stars, .twinkling {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    display: block;
}
.stars {
    background: #000 url('https://images.unsplash.com/photo-1534447677768-be436bb09401?q=80&w=1000') repeat top center;
    opacity: 0.25;
}

/* App Container (Max-width otimizado para mobile) */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

@media(min-width: 500px) {
    .app-container {
        min-height: 85vh;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        box-shadow: 0 20px 40px rgba(0,0,0,0.6);
        background: rgba(20, 27, 45, 0.7);
        backdrop-filter: blur(12px);
    }
}

.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Tela 1: Home */
.hero-content {
    text-align: center;
    margin-bottom: 24px;
}
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--neon-purple);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 0%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.hero-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.4;
}

.record-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    text-align: left;
}
.record-card i {
    font-size: 24px;
    color: #F59E0B;
}
.record-card span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.record-card h3 {
    font-size: 18px;
    color: #FFF;
    font-family: 'Outfit', sans-serif;
}

.config-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}
.config-label {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
}
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.cat-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 12px 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-btn i {
    font-size: 18px;
}
.cat-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--neon-purple);
    color: #FFF;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.cta-button {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-cyan) 100%);
    color: #FFF;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: transform 0.1s, opacity 0.2s;
}
.cta-button:active {
    transform: scale(0.98);
}

/* Tela 2: Quiz */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
#current-score-label {
    font-size: 15px;
    color: var(--text-muted);
}
#current-score-label strong {
    color: var(--neon-cyan);
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
}
.lives-container {
    display: flex;
    gap: 6px;
    color: var(--accent-red);
    font-size: 18px;
}
.lives-container i {
    opacity: 0.3;
    transition: opacity 0.3s;
}
.lives-container i.active {
    opacity: 1;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.question-card-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.tag-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--neon-cyan);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}
.diff-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}
#question-text {
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #FFF;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.option-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--neon-purple);
}
.option-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--accent-green) !important;
    color: #34D399;
}
.option-btn.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--accent-red) !important;
    color: #F87171;
}

.explanation-box {
    margin-top: 20px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    animation: fadeIn 0.3s ease;
}
.explanation-box.hidden {
    display: none;
}
.expl-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-purple);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.explanation-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
}
.next-button {
    width: 100%;
    background: var(--text-main);
    color: var(--bg-obsidian);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Tela 3: Results */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
}
.result-icon-wrapper {
    width: 60px; height: 60px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--neon-purple);
    font-size: 24px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.new-record-tag {
    display: inline-block;
    background: #F59E0B;
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.new-record-tag.hidden { display: none; }
.result-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    margin-bottom: 14px;
}
.final-score-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 14px;
}
#final-score-val {
    font-size: 32px;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    color: var(--neon-cyan);
}
.final-score-box p {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.rank-badge-box {
    margin-bottom: 20px;
}
.rank-label {
    font-size: 12px;
    color: var(--text-muted);
}
#rank-title {
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    color: #F59E0B;
    margin-top: 2px;
}
.action-buttons {
    margin-bottom: 20px;
}

/* Social Share & Canal CTA */
.social-share-section {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
    margin-bottom: 20px;
    text-align: left;
}
.share-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}
.share-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.share-btn {
    padding: 10px 6px;
    border-radius: 8px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #FFF;
}
.share-btn.native { background: #475569; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.copy { background: #334155; }
.share-btn i { font-size: 14px; }

.canal-cta-banner {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}
.canal-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.canal-info i {
    font-size: 28px;
    color: #FF0000;
}
.canal-info h4 {
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
}
.canal-info p {
    font-size: 11px;
    color: var(--text-muted);
}
.social-links-row {
    display: flex;
    gap: 8px;
}
.s-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    text-decoration: none;
    font-size: 14px;
    background: rgba(255,255,255,0.05);
}
.s-icon.yt:hover { background: #FF0000; }
.s-icon.tk:hover { background: #000000; }
.s-icon.ig:hover { background: #E1306C; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}