/**
 * AR Blog - Plataforma de Alfabetização Dinâmica
 * Estilos Globais, Acessibilidade, Animações e Karaokê
 */

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body.dark-mode {
    --bg-page: #0b1120;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --primary-light: #1e3a8a;
    --success-light: #14532d;
    --warning-light: #78350f;
    --danger-light: #7f1d1d;
    --shadow-md: 0 4px 14px rgba(0,0,0,0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================================
   BARRA SUPERIOR GLOBAL (HEADER)
   ======================================================== */
.navbar-alfabetiza {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.brand-alfabetiza {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo-ico {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.brand-text-col {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-nav-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav-action:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.badge-estrelas-total {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ========================================================
   CONTAINER PRINCIPAL
   ======================================================== */
.main-wrapper {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    flex: 1;
}

/* ========================================================
   HERO / CABEÇALHO DO CATÁLOGO (INDEX)
   ======================================================== */
.hero-hub {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.hero-hub::after {
    content: 'ABC';
    position: absolute;
    right: 20px;
    bottom: -20px;
    font-size: 140px;
    font-weight: 900;
    opacity: 0.08;
    pointer-events: none;
    letter-spacing: -5px;
}

.hero-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-texto h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero-texto p {
    font-size: 1.1rem;
    color: #e0f2fe;
    max-width: 680px;
}

.hero-botoes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-hero-primary {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-hero-primary:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* BARRA DE PROGRESSO GLOBAL NO HERO */
.progresso-geral-box {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progresso-geral-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
}

.barra-trilho {
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    height: 14px;
    overflow: hidden;
    position: relative;
}

.barra-preenchimento {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    height: 100%;
    width: 0%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   FILTROS, BUSCA E ABAS DE MÓDULOS
   ======================================================== */
.filtros-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.busca-linha {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.input-busca-wrap {
    flex: 1;
    position: relative;
    min-width: 260px;
}

.input-busca-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-busca {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

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

/* MÓDULOS CAROUSEL / ABAS */
.modulos-scroll-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.modulos-scroll-bar::-webkit-scrollbar {
    height: 6px;
}

.modulos-scroll-bar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chip-modulo {
    white-space: nowrap;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.chip-modulo:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip-modulo.ativo {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* ========================================================
   GRID DE 90 CARDS DE JOGOS
   ======================================================== */
.grid-jogos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card-jogo {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-jogo:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card-jogo-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-modulo-pill {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-estrelas {
    display: inline-flex;
    gap: 3px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.card-estrelas .estrela-ativa {
    color: #f59e0b;
}

.card-jogo-corpo {
    margin-bottom: 18px;
}

.card-jogo-num {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-jogo-titulo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0 8px 0;
    line-height: 1.3;
}

.card-jogo-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.card-jogo-rodape {
    display: flex;
    gap: 10px;
}

.btn-jogar-card {
    flex: 1;
    padding: 10px 16px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-jogar-card:hover {
    background: var(--primary-hover);
}

.btn-ouvir-resumo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ouvir-resumo:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================================
   TELA DE JOGO (JOGAR.PHP) & ARENA
   ======================================================== */
.jogo-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jogo-header-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.jogo-header-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.btn-voltar:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.jogo-header-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-controle-top {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-controle-top:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.jogo-info-bloco h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.jogo-info-bloco p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* FASES STEPPER */
.indicador-fases {
    display: flex;
    gap: 8px;
}

.step-pill {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-page);
    border: 2px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.step-pill.ativa {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.step-pill.concluida {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}

/* BOTÃO DE INSTRUÇÃO SONORA GRANDE */
.instrucao-audio-bar {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.instrucao-audio-texto {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-ouvir-instrucao-grande {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.btn-ouvir-instrucao-grande:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.pulse-audio {
    animation: audioPulse 1s infinite alternate;
}

@keyframes audioPulse {
    from { transform: scale(1); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35); }
    to { transform: scale(1.08); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6); }
}

/* ARENA DE EXECUÇÃO DOS JOGOS */
.arena-jogo {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: border-color 0.3s ease;
}

.arena-jogo.fase-acerto {
    border-color: var(--success);
    animation: acertoGlow 1.2s ease;
}

@keyframes acertoGlow {
    0% { box-shadow: 0 0 0 rgba(22, 163, 74, 0); }
    50% { box-shadow: 0 0 35px rgba(22, 163, 74, 0.4); }
    100% { box-shadow: 0 0 0 rgba(22, 163, 74, 0); }
}

/* WRAPPERS DE MOTORES */
.engine-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* 1. OUVIR E ESCOLHER */
.fase-prompt {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-primary);
}

.prompt-destaque {
    background: var(--warning-light);
    color: #92400e;
    padding: 6px 18px;
    border-radius: var(--radius-md);
    border: 2px dashed #f59e0b;
}

.opcoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 760px;
}

.card-opcao {
    background: var(--bg-page);
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-opcao:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.opcao-icone {
    font-size: 3.5rem;
    line-height: 1;
}

.opcao-texto {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.opcao-som-mini {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.opcao-som-mini:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.card-opcao.opcao-correta {
    border-color: var(--success);
    background: var(--success-light);
    transform: scale(1.05);
}

.opcao-errada-shake {
    animation: shakeErr 0.6s ease;
    border-color: var(--danger) !important;
}

@keyframes shakeErr {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* 3. PALMAS E SÍLABAS */
.palavra-destaque-palmas {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--primary);
    text-transform: uppercase;
}

.btn-bater-palmas-acao {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    background: var(--warning-light);
    color: #b45309;
    border: 2px solid #f59e0b;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.botoes-numeros-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-numero-silaba {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-lg);
    border: 3px solid var(--border-color);
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-numero-silaba:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.numero-valor {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.numero-palmas {
    font-size: 0.9rem;
}

/* 4. MEMÓRIA */
.memoria-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 520px;
    width: 100%;
}

.carta-memoria {
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    cursor: pointer;
}

.carta-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.carta-memoria.virada .carta-inner,
.carta-memoria.par-encontrado .carta-inner {
    transform: rotateY(180deg);
}

.carta-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
}

.carta-face.frente {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: 3px solid #60a5fa;
}

.carta-face.verso {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 3px solid var(--primary);
    transform: rotateY(180deg);
}

.carta-memoria.par-encontrado .carta-face.verso {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
}

/* 5. LETRAS MÓVEIS */
.slots-palavra {
    display: flex;
    gap: 12px;
    min-height: 80px;
    padding: 12px 24px;
    background: var(--bg-page);
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 600px;
}

.slot-letra {
    min-width: 54px;
    height: 60px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.slot-letra:hover {
    transform: scale(1.1);
    background: var(--danger);
}

.pool-letras {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
}

.btn-tile-letra {
    min-width: 58px;
    height: 64px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.btn-tile-letra:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.btn-tile-letra.usada {
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0.9);
}

.btn-limpar-palavra,
.btn-limpar-frase {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-limpar-palavra:hover,
.btn-limpar-frase:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* 6. CAÇA-LETRAS */
.grid-caca-letras {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.caca-row {
    display: flex;
    gap: 12px;
}

.caca-celula {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-md);
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.caca-celula:hover {
    border-color: var(--primary);
    transform: scale(1.06);
}

.caca-celula.marcada.correta {
    background: var(--success);
    color: #ffffff;
    border-color: #15803d;
}

/* 8. FRASE EMBARALHADA */
.linha-frase-montada {
    min-height: 80px;
    padding: 16px 20px;
    background: var(--bg-page);
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 720px;
}

.badge-palavra-slot {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.badge-palavra-slot:hover {
    transform: scale(1.08);
    background: var(--danger);
}

.pool-palavras-frase {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 720px;
}

.btn-bloco-palavra {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bloco-palavra:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.btn-bloco-palavra.usada {
    opacity: 0.3;
    pointer-events: none;
}

/* ========================================================
   9. MOTOR LEITURA DINÂMICA / KARAOKÊ (DESTACAMENTO REAL-TIME)
   ======================================================== */
.painel-karaoke-texto {
    background: var(--bg-page);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    font-size: 1.55rem;
    line-height: 2.2;
    color: var(--text-primary);
    max-width: 760px;
    width: 100%;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.04);
}

.karaoke-word {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background-color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.karaoke-word:hover {
    background-color: var(--primary-light);
}

/* DESTAQUE DO KARAOKÊ EM TEMPO REAL */
.karaoke-word.active {
    background-color: #fde047 !important;
    color: #713f12 !important;
    font-weight: 900;
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.45);
    border-radius: 6px;
}

body.dark-mode .karaoke-word.active {
    background-color: #eab308 !important;
    color: #422006 !important;
}

.btn-ouvir-karaoke-acao {
    padding: 12px 26px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.btn-ouvir-karaoke-acao:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.btn-ouvir-karaoke-acao.lendo {
    background: #059669;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
    animation: pulse 1.6s infinite ease-in-out;
}

/* BLOCO DE COMPREENSÃO */
.bloco-pergunta-compreensao {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.pergunta-texto {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.opcoes-compreensao-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-opcao-compreensao {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.btn-opcao-compreensao:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* 10. FÁBRICA DE HISTÓRIAS */
.secao-fabrica {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.secao-titulo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.seletor-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.card-elemento-historia {
    background: var(--bg-page);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-elemento-historia:hover {
    border-color: var(--primary);
}

.card-elemento-historia.selecionado {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.04);
}

.card-ico {
    font-size: 2.2rem;
}

.card-nome {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.livro-historia-pronta {
    width: 100%;
    max-width: 760px;
    background: #fffbeb;
    border: 3px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

body.dark-mode .livro-historia-pronta {
    background: #1e293b;
    border-color: #f59e0b;
}

.capa-emojis {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
}

.capa-titulo {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    color: #b45309;
    margin-bottom: 16px;
}

.capa-conto {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: justify;
}

.capa-botoes {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-ouvir-conto {
    padding: 12px 22px;
    border-radius: var(--radius-full);
    background: #f59e0b;
    color: #ffffff;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

.btn-concluir-conto {
    padding: 12px 22px;
    border-radius: var(--radius-full);
    background: var(--success);
    color: #ffffff;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

/* ========================================================
   MODAIS (VITÓRIA, DICA, CERTIFICADO)
   ======================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.active .modal-card {
    transform: scale(1);
}

.vitoria-icone-topo {
    font-size: 4rem;
    color: var(--warning);
    animation: bounceIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.vitoria-estrelas {
    display: flex;
    gap: 10px;
    font-size: 2.8rem;
    color: #cbd5e1;
}

.star-brilho {
    color: #f59e0b;
    animation: starPop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.star-1 { animation-delay: 0.2s; }
.star-2 { animation-delay: 0.4s; }
.star-3 { animation-delay: 0.6s; }

@keyframes starPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-titulo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
}

.modal-texto {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.modal-acoes-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.btn-modal-primary {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-modal-secondary {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

/* ========================================================
   CERTIFICADO OFICIAL IMPRESSÃO
   ======================================================== */
.certificado-card {
    max-width: 800px;
    border: 8px double #b45309;
    background: #fffdf5;
    padding: 40px;
    color: #1e293b;
}

.cert-moldura {
    border: 2px solid #d97706;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cert-logo {
    font-size: 3rem;
    color: #b45309;
}

.cert-titulo {
    font-size: 2.2rem;
    font-weight: 900;
    color: #92400e;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cert-texto {
    font-size: 1.25rem;
    line-height: 1.8;
    text-align: center;
}

.cert-aluno {
    font-size: 2rem;
    font-weight: 900;
    color: #1e3a8a;
    border-bottom: 2px solid #1e3a8a;
    padding: 4px 30px;
}

.cert-rodape {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 24px;
    font-size: 0.9rem;
    color: #64748b;
}

@media print {
    body * {
        visibility: hidden;
    }
    #modal-certificado-backdrop,
    #modal-certificado-backdrop * {
        visibility: visible;
    }
    #modal-certificado-backdrop {
        position: absolute;
        inset: 0;
        background: transparent;
        padding: 0;
    }
    .modal-acoes-row {
        display: none !important;
    }
}

/* ========================================================
   RESPONSIVIDADE (MOBILE FIRST & DESKTOP)
   ======================================================== */
@media (max-width: 768px) {
    .navbar-alfabetiza {
        padding: 10px 16px;
    }
    .hero-hub {
        padding: 24px 18px;
    }
    .hero-texto h1 {
        font-size: 1.7rem;
    }
    .grid-jogos {
        grid-template-columns: 1fr;
    }
    .seletor-cards-row {
        grid-template-columns: 1fr;
    }
    .memoria-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .painel-karaoke-texto {
        font-size: 1.25rem;
        padding: 18px;
        line-height: 1.9;
    }
}


/* ========================================================
   ESTILOS PARA 50 DESAFIOS POR JOGO
   ======================================================== */
.indicador-50-desafios {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
}

.barra-info-desafio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-desafio-contagem {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stats-rapidos-desafio {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-stat-streak,
.badge-stat-pontos {
    font-size: 0.9rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.btn-pausar-jogo {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-pausar-jogo:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.trilho-50-progresso {
    width: 100%;
    height: 14px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.preenchimento-50-progresso {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* BANNER DE CHECKPOINT */
.toast-checkpoint {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-checkpoint.ativo {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
