/* =========================================================
   RankingPreProva · tema "sala de estudos"
   ========================================================= */
:root {
    --rpp-primaria: #1f5f6b;
    --rpp-primaria-escura: #164650;
    --rpp-primaria-clara: #e3eff1;
    --rpp-papel: #f7f5f0;
    --rpp-superficie: #ffffff;
    --rpp-borda: #e2ded5;
    --rpp-texto: #1f2a30;
    --rpp-texto-suave: #5d6b72;
    --rpp-ouro: #d9a425;
    --rpp-prata: #9aa6ad;
    --rpp-bronze: #b8743a;
    --rpp-sucesso: #2f7d4a;
    --rpp-sucesso-fundo: #e5f3e9;
    --rpp-erro: #b23b3b;
    --rpp-erro-fundo: #fbe8e8;
    --rpp-alerta: #d98b1c;
    --rpp-raio: 10px;
    --rpp-sombra: 0 1px 2px rgba(31, 42, 48, .06), 0 4px 14px rgba(31, 42, 48, .06);
    --rpp-fonte: "Inter", "Segoe UI", system-ui, sans-serif;
    --rpp-fonte-titulo: "Merriweather", Georgia, serif;
    --header-altura: 64px;
}

html, body {
    margin: 0;
    font-family: var(--rpp-fonte);
    color: var(--rpp-texto);
    background: var(--rpp-papel);
    font-size: 15px;
}

body {
    background-image: radial-gradient(rgba(31, 95, 107, .05) 1px, transparent 1px);
    background-size: 22px 22px;
}

h1, h2, h3 {
    font-family: var(--rpp-fonte-titulo);
    color: var(--rpp-texto);
    line-height: 1.25;
}

h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

a { color: var(--rpp-primaria); }

h1:focus { outline: none; }

/* ---------- Splash ---------- */
#app-splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: var(--rpp-papel);
    transition: opacity .35s ease;
}
#app-splash.saindo { opacity: 0; pointer-events: none; }
.splash-logo { font-size: 64px; line-height: 1; height: 1.15em; margin-bottom: 0px; animation: flutuar 1.6s ease-in-out infinite; }
.splash-nome { position: relative; z-index: 1; font-family: var(--rpp-fonte-titulo); font-size: 28px; font-weight: 900; line-height: 1.2; color: var(--rpp-primaria); }
.splash-nome span, .logo-texto span { color: var(--rpp-ouro); }
.splash-barra { width: 220px; height: 6px; border-radius: 6px; background: var(--rpp-borda); overflow: hidden; }
.splash-barra span { display: block; width: 40%; height: 100%; background: var(--rpp-primaria); border-radius: 6px; animation: barra 1.1s ease-in-out infinite; }
.splash-dica { color: var(--rpp-texto-suave); font-size: 14px; }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-altura);
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px;
    background: var(--rpp-superficie);
    border-bottom: 1px solid var(--rpp-borda);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 206px; }
.logo-icone { font-size: 28px; transition: transform .3s; }
.logo:hover .logo-icone { transform: rotate(-12deg) scale(1.1); }
.logo-texto { font-family: var(--rpp-fonte-titulo); font-weight: 900; font-size: 20px; color: var(--rpp-primaria); }

.busca-global { flex: 1; max-width: 560px; }

.header-status { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.sequencia {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    background: #f1efe9; color: var(--rpp-texto-suave); font-size: 14px;
    filter: grayscale(1);
}
.sequencia.ativa { background: #fff1dc; color: #9a5a00; filter: none; }
.sequencia.ativa:hover { animation: chama .6s ease-in-out; }

.xp-medidor { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--rpp-texto); font-size: 13px; }
.xp-nivel { background: var(--rpp-primaria); color: #fff; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.xp-barra { width: 120px; height: 8px; border-radius: 8px; background: var(--rpp-borda); overflow: hidden; }
.xp-preenchido { display: block; height: 100%; background: linear-gradient(90deg, var(--rpp-primaria), #3fa3a8); border-radius: 8px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.xp-valor { color: var(--rpp-texto-suave); font-variant-numeric: tabular-nums; }

.google-g { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 700; margin-right: 6px; }

.menu-usuario { position: relative; z-index: 1001; }
.menu-usuario-fundo { position: fixed; inset: 0; z-index: 1000; background: transparent; }
.menu-usuario summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu-usuario summary::-webkit-details-marker { display: none; }
.menu-usuario-painel {
    position: absolute; right: 0; top: 46px; width: 240px;
    background: var(--rpp-superficie); border: 1px solid var(--rpp-borda); border-radius: var(--rpp-raio);
    box-shadow: var(--rpp-sombra); padding: 8px; display: flex; flex-direction: column;
    animation: surgir .15s ease-out;
}
.menu-usuario-painel a { padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--rpp-texto); }
.menu-usuario-painel a:hover { background: var(--rpp-primaria-clara); }
.menu-usuario-painel hr { border: 0; border-top: 1px solid var(--rpp-borda); margin: 6px 0; width: 100%; }
.menu-usuario-topo { display: flex; flex-direction: column; padding: 6px 10px 10px; border-bottom: 1px solid var(--rpp-borda); margin-bottom: 6px; }
.menu-usuario-topo small { color: var(--rpp-texto-suave); }
.titulo-nivel { color: var(--rpp-primaria) !important; font-weight: 600; margin-top: 2px; }

.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }

.app-body {
    flex: 1;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 320px;
    gap: 24px;
    max-width: 1560px; width: 100%;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

.app-nav { position: sticky; top: calc(var(--header-altura) + 24px); align-self: start; }
.app-nav fluent-nav-menu, .app-nav .fluent-nav-menu { background: transparent; }

.app-main { min-width: 0; }

.app-ads { align-self: start; position: sticky; top: calc(var(--header-altura) + 24px); }
.ads-fixo { display: flex; flex-direction: column; gap: 16px; }

.app-footer { border-top: 1px solid var(--rpp-borda); background: var(--rpp-superficie); padding: 16px 24px; }
.rodape-links { display: flex; gap: 20px; justify-content: center; font-size: 13px; color: var(--rpp-texto-suave); margin-top: 8px; }
.rodape-links a { color: var(--rpp-texto-suave); }

/* ---------- Anúncios ---------- */
.ad-slot { width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-placeholder {
    width: 100%; height: 100%;
    border: 1px dashed #c9c4b8; border-radius: var(--rpp-raio);
    background: repeating-linear-gradient(45deg, #f2f0ea, #f2f0ea 10px, #eeebe3 10px, #eeebe3 20px);
    color: #9b968a; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center;
}
.ad-rotulo { font-size: 10px; color: #aaa39a; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; text-align: center; }

.dica-estudo { background: #fffbea; border: 1px solid #f0e2b0; border-radius: var(--rpp-raio); padding: 14px 16px; font-size: 14px; }
.dica-titulo { font-weight: 700; margin-bottom: 6px; }
.dica-estudo p { margin: 0; color: #5c5130; }

/* ---------- Componentes base ---------- */
.cartao {
    background: var(--rpp-superficie);
    border: 1px solid var(--rpp-borda);
    border-radius: var(--rpp-raio);
    box-shadow: var(--rpp-sombra);
    padding: 20px;
}
.cartao + .cartao { margin-top: 16px; }

.cartao-clicavel { transition: transform .15s ease, box-shadow .15s ease, border-color .15s; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.cartao-clicavel:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,42,48,.1); border-color: #c8d9dc; }

.cabecalho-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.cabecalho-pagina p { margin: 4px 0 0; color: var(--rpp-texto-suave); }

.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grade-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
:is(.grade-2, .grade-3, .grade-4) > .cartao { margin-top: 0; }

.linha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.linha-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coluna { display: flex; flex-direction: column; gap: 12px; }
.suave { color: var(--rpp-texto-suave); }
.pequeno { font-size: 13px; }
.negrito { font-weight: 600; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

.etiqueta {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
    background: #f0eee8; color: var(--rpp-texto-suave);
    white-space: nowrap;
}
.etiqueta-primaria { background: var(--rpp-primaria-clara); color: var(--rpp-primaria-escura); }
.etiqueta-assunto { background: #eef1fb; color: #3d4f8a; text-decoration: none; }
.etiqueta-assunto:hover { background: #dfe5f8; }
.etiqueta-ia { background: #f3e9fb; color: #6a3d8a; }
.etiqueta-alerta { background: #fff1dc; color: #9a5a00; }
.etiqueta-erro { background: var(--rpp-erro-fundo); color: var(--rpp-erro); }
.etiqueta-sucesso { background: var(--rpp-sucesso-fundo); color: var(--rpp-sucesso); }

.campo { display: flex; flex-direction: column; gap: 4px; }
.campo label, .rotulo { font-size: 13px; font-weight: 600; color: var(--rpp-texto-suave); }
.select-nativo {
    height: 32px; padding: 0 8px;
    border: 1px solid #c8c6c0; border-radius: 4px; background: #fff;
    font-family: inherit; font-size: 14px; color: var(--rpp-texto);
}
.select-nativo:focus { outline: 2px solid var(--rpp-primaria); outline-offset: -1px; }
.erro-validacao, .validation-message { color: var(--rpp-erro); font-size: 13px; }
.validation-errors { color: var(--rpp-erro); background: var(--rpp-erro-fundo); border-radius: 8px; padding: 10px 10px 10px 28px; margin: 0 0 12px; }

.estado-vazio { text-align: center; padding: 48px 24px; color: var(--rpp-texto-suave); }
.estado-vazio h1, .estado-vazio h2 { color: var(--rpp-texto); }
.estado-icone { font-size: 56px; margin-bottom: 8px; }

.carregando { display: flex; flex-direction: column; align-items: center; padding: 48px; color: var(--rpp-texto-suave); }
.carregando-livros span { display: inline-block; font-size: 32px; animation: pular 1s ease-in-out infinite; }
.carregando-livros span:nth-child(2) { animation-delay: .15s; }
.carregando-livros span:nth-child(3) { animation-delay: .3s; }

.paginacao { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }

/* ---------- Votos: saldo negativo ---------- */
.item-negativo {
    opacity: .55;
    border-left: 4px solid var(--rpp-alerta) !important;
    background: #fdfaf3 !important;
    transition: opacity .2s;
}
.item-negativo:hover { opacity: .9; }

.item-revisao { border-left: 4px solid var(--rpp-erro) !important; }

.votos { display: inline-flex; align-items: center; gap: 2px; background: #f4f2ec; border-radius: 20px; padding: 2px; }
.voto-botao {
    border: 0; background: transparent; cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.voto-botao:hover:not(:disabled) { background: #e7e3d9; transform: scale(1.12); }
.voto-botao:disabled { cursor: not-allowed; opacity: .45; }
.voto-botao.ativo-cima { background: var(--rpp-sucesso-fundo); }
.voto-botao.ativo-baixo { background: var(--rpp-erro-fundo); }
.voto-saldo { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.voto-saldo.negativo { color: var(--rpp-erro); }
.voto-saldo.positivo { color: var(--rpp-sucesso); }
.voto-saldo.mudou { animation: pop .35s ease; }

.botao-icone { border: 0; background: transparent; cursor: pointer; font-size: 18px; padding: 4px 6px; border-radius: 6px; transition: transform .15s, background .15s; }
.botao-icone:hover { background: #f0eee8; transform: scale(1.1); }
.favorito-ativo { animation: pop .35s ease; }

/* ---------- Questões ---------- */
.questao-item { display: flex; gap: 16px; }
.questao-item + .questao-item { margin-top: 12px; }
.questao-item .questao-corpo { flex: 1; min-width: 0; }
.questao-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.questao-enunciado { white-space: pre-wrap; line-height: 1.6; margin: 0 0 12px; font-size: 15.5px; }
.questao-resumo { margin: 0 0 8px; line-height: 1.55; color: var(--rpp-texto); }
.questao-resumo.md { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.questao-rodape { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--rpp-texto-suave); font-size: 13px; }

.alternativas { display: flex; flex-direction: column; gap: 8px; }
.alternativa {
    display: flex; align-items: flex-start; gap: 12px;
    width: 100%; text-align: left;
    padding: 12px 14px;
    border: 1.5px solid var(--rpp-borda); border-radius: var(--rpp-raio);
    background: var(--rpp-superficie);
    font-family: inherit; font-size: 15px; color: var(--rpp-texto);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}
.alternativa:hover:not(:disabled) { border-color: var(--rpp-primaria); background: #f6fafa; }
.alternativa:active:not(:disabled) { transform: scale(.995); }
.alternativa:disabled { cursor: default; }
.alternativa .letra {
    flex-shrink: 0;
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid #c9c4b8; font-weight: 700; font-size: 14px;
    transition: all .15s;
}
.alternativa .texto { padding-top: 4px; white-space: pre-wrap; line-height: 1.5; }
.alternativa.selecionada { border-color: var(--rpp-primaria); background: var(--rpp-primaria-clara); }
.alternativa.selecionada .letra { background: var(--rpp-primaria); border-color: var(--rpp-primaria); color: #fff; }
.alternativa.riscada .texto { text-decoration: line-through; color: #a8a39a; }
.alternativa.correta { border-color: var(--rpp-sucesso); background: var(--rpp-sucesso-fundo); }
.alternativa.correta .letra { background: var(--rpp-sucesso); border-color: var(--rpp-sucesso); color: #fff; }
.alternativa.errada { border-color: var(--rpp-erro); background: var(--rpp-erro-fundo); }
.alternativa.errada .letra { background: var(--rpp-erro); border-color: var(--rpp-erro); color: #fff; }

.alternativas-ce { flex-direction: row; }
.alternativas-ce .alternativa { justify-content: center; font-weight: 600; }

.feedback { margin-top: 16px; padding: 16px; border-radius: var(--rpp-raio); }
.feedback-acerto { background: var(--rpp-sucesso-fundo); border: 1px solid #b9dcc4; animation: pulso .6s ease; }
.feedback-erro { background: var(--rpp-erro-fundo); border: 1px solid #efc3c3; animation: tremer .45s ease; }
.feedback-titulo { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.explicacao { white-space: pre-wrap; line-height: 1.6; margin: 8px 0 0; }

.estatistica-barra { height: 6px; width: 120px; background: var(--rpp-erro-fundo); border-radius: 6px; overflow: hidden; display: inline-block; vertical-align: middle; }
.estatistica-barra span { display: block; height: 100%; background: var(--rpp-sucesso); }

.filtros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }

.assuntos-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid #c8c6c0; border-radius: 4px; background: #fff; min-height: 32px; }
.assuntos-editor input { border: 0; outline: 0; flex: 1; min-width: 160px; font-family: inherit; font-size: 14px; padding: 4px; }
.assunto-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef1fb; color: #3d4f8a; border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; }
.assunto-chip button { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 14px; }
.sugestoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sugestoes button { border: 1px dashed #b7c0e0; background: #f8f9fe; color: #3d4f8a; border-radius: 14px; padding: 2px 10px; font-size: 12px; cursor: pointer; }

.alternativa-editor { display: flex; gap: 10px; align-items: flex-start; }
.alternativa-editor .letra-radio {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid #c9c4b8; background: #fff; font-weight: 700; cursor: pointer;
    transition: all .15s; margin-top: 2px;
}
.alternativa-editor .letra-radio.gabarito { background: var(--rpp-sucesso); border-color: var(--rpp-sucesso); color: #fff; transform: scale(1.08); }
.alternativa-editor fluent-text-area { flex: 1; }
.alternativa-editor .md-editor { flex: 1; }

/* Markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .6em; }
.md ul, .md ol { margin: 0 0 .6em; padding-left: 1.4em; }
.md blockquote { margin: 0 0 .6em; padding: 4px 12px; border-left: 3px solid var(--rpp-borda); color: var(--rpp-texto-suave); }
.md code { background: var(--rpp-primaria-clara); padding: 1px 4px; border-radius: 4px; font-size: .92em; }
.md table { border-collapse: collapse; margin: 0 0 .6em; }
.md th, .md td { border: 1px solid var(--rpp-borda); padding: 4px 8px; }
.questao-enunciado.md, .alternativa .texto .md { white-space: normal; }
.md-editor { width: 100%; border: 1px solid var(--rpp-borda); border-radius: var(--rpp-raio); background: var(--rpp-superficie); overflow: hidden; }
.md-editor:focus-within { border-color: var(--rpp-primaria); }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px 6px; border-bottom: 1px solid var(--rpp-borda); background: var(--rpp-papel); }
.md-toolbar button { border: 0; background: transparent; color: var(--rpp-texto); padding: 4px 8px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.md-toolbar button:hover:not(:disabled), .md-toolbar button.ativo { background: var(--rpp-primaria-clara); }
.md-toolbar button:disabled { opacity: .4; cursor: default; }
.md-sep { width: 1px; height: 18px; background: var(--rpp-borda); margin: 0 4px; }
.md-textarea { display: block; width: 100%; box-sizing: border-box; border: 0; outline: 0; resize: vertical; padding: 10px 12px; font: inherit; font-size: 14.5px; line-height: 1.5; background: transparent; color: var(--rpp-texto); }
.md-previa { padding: 10px 12px; line-height: 1.6; }
.md-rodape { display: flex; justify-content: space-between; padding: 2px 10px 4px; border-top: 1px solid var(--rpp-borda); }

/* ---------- Provas ---------- */
.prova-cartao { display: flex; flex-direction: column; gap: 10px; height: 100%; box-sizing: border-box; }
.prova-cartao h3 { margin: 0; }
.prova-cartao .prova-rodape { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--rpp-texto-suave); font-size: 13px; }
.prova-capa {
    height: 6px; border-radius: 6px;
    background: linear-gradient(90deg, var(--rpp-primaria), #3fa3a8, var(--rpp-ouro));
}

.execucao { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
.execucao-topo {
    position: sticky; top: var(--header-altura); z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--rpp-papel); padding: 12px 0; margin-bottom: 12px;
}
.cronometro { font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 700; padding: 6px 14px; border-radius: 8px; background: var(--rpp-superficie); border: 1px solid var(--rpp-borda); }
.cronometro.alerta { color: var(--rpp-erro); border-color: var(--rpp-erro); animation: pulso 1s ease infinite; }
.folha-respostas { position: sticky; top: calc(var(--header-altura) + 80px); align-self: start; }
.folha-grade { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.folha-item {
    border: 1px solid var(--rpp-borda); background: #fff; border-radius: 6px;
    height: 38px; cursor: pointer; font-size: 12px; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.folha-item strong { font-size: 13px; }
.folha-item.respondida { background: var(--rpp-primaria-clara); border-color: var(--rpp-primaria); }
.folha-item.atual { outline: 2px solid var(--rpp-ouro); }
.folha-item.marcada::after { content: "🚩"; font-size: 9px; }
.barra-progresso { height: 8px; background: var(--rpp-borda); border-radius: 8px; overflow: hidden; }
.barra-progresso span { display: block; height: 100%; background: var(--rpp-primaria); transition: width .3s ease; }

/* ---------- Ranking ---------- */
.podio { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 12px; margin: 8px 0 20px; }
.podio-lugar { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podio-bloco { width: 100%; border-radius: 10px 10px 0 0; color: #fff; font-family: var(--rpp-fonte-titulo); font-weight: 900; font-size: 28px; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; animation: subir .7s cubic-bezier(.2,.8,.2,1) both; }
.podio-1 .podio-bloco { height: 120px; background: linear-gradient(180deg, #f0c24b, var(--rpp-ouro)); animation-delay: .3s; }
.podio-2 .podio-bloco { height: 90px; background: linear-gradient(180deg, #c3ccd1, var(--rpp-prata)); animation-delay: .15s; }
.podio-3 .podio-bloco { height: 70px; background: linear-gradient(180deg, #d99a63, var(--rpp-bronze)); }
.podio-1 { order: 2; } .podio-2 { order: 1; } .podio-3 { order: 3; }
.podio-coroa { font-size: 26px; animation: flutuar 2s ease-in-out infinite; }

.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--rpp-texto-suave); padding: 8px 10px; border-bottom: 2px solid var(--rpp-borda); }
.tabela td { padding: 10px; border-bottom: 1px solid var(--rpp-borda); vertical-align: middle; }
.tabela tr.voce td { background: #fff8e5; font-weight: 600; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.medalha { font-size: 18px; }

/* ---------- Dashboard ---------- */
.boas-vindas {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 24px; border-radius: var(--rpp-raio);
    background: linear-gradient(120deg, var(--rpp-primaria) 0%, #2b7a86 60%, #3c8e8f 100%);
    color: #fff; margin-bottom: 20px; position: relative; overflow: hidden;
}
.boas-vindas h1 { color: #fff; }
.boas-vindas p { margin: 4px 0 0; opacity: .9; }
.boas-vindas::after { content: "✏️"; position: absolute; right: 180px; top: -10px; font-size: 90px; opacity: .08; transform: rotate(20deg); }
.meta-anel { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--rpp-ouro) calc(var(--p) * 1%), rgba(255,255,255,.2) 0); flex-shrink: 0; }
.meta-anel > div { width: 76px; height: 76px; border-radius: 50%; background: var(--rpp-primaria); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; }
.meta-anel strong { font-size: 20px; }

.atalho { display: flex; flex-direction: column; gap: 6px; }
.atalho-icone { font-size: 30px; line-height: 1.2; transition: transform .25s; display: inline-block; align-self: flex-start; transform-origin: center; }
.cartao-clicavel:hover .atalho-icone { transform: scale(1.15) rotate(-6deg); }
.atalho h3 { margin: 0; }
.atalho p { margin: 0; color: var(--rpp-texto-suave); font-size: 13.5px; }

.desafio {
    display: flex; align-items: center; gap: 16px;
    background: #fff8e5; border: 1px solid #f0dca0; border-radius: var(--rpp-raio); padding: 16px 20px;
}
.desafio .desafio-icone { font-size: 36px; animation: balancar 2.5s ease-in-out infinite; }

.grafico-barras { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.grafico-barras .barra { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--rpp-texto-suave); }
.grafico-barras .barra-total { width: 100%; background: #dfe9eb; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; transition: height .6s ease; }
.grafico-barras .barra-acertos { position: absolute; bottom: 0; left: 0; right: 0; background: var(--rpp-primaria); border-radius: 4px 4px 0 0; }

.desempenho-linha { display: grid; grid-template-columns: 200px 1fr 90px; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.desempenho-barra { height: 10px; border-radius: 10px; background: var(--rpp-erro-fundo); overflow: hidden; }
.desempenho-barra span { display: block; height: 100%; background: linear-gradient(90deg, #3fa3a8, var(--rpp-sucesso)); }

/* ---------- Badges ---------- */
.badge-cartao { text-align: center; padding: 20px 14px; position: relative; }
.badge-icone { font-size: 44px; display: inline-block; margin-bottom: 6px; }
.badge-cartao.conquistada .badge-icone { animation: flutuar 3s ease-in-out infinite; }
.badge-cartao.conquistada { border-color: #ecd48f; background: linear-gradient(180deg, #fffcf2, #fff); }
.badge-cartao.bloqueada .badge-icone { filter: grayscale(1); opacity: .35; }
.badge-cartao h3 { margin: 4px 0; font-size: 15px; }
.badge-cartao p { margin: 0 0 10px; font-size: 13px; color: var(--rpp-texto-suave); }
.badge-mini { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; text-align: center; font-size: 12px; }
.badge-mini span:first-child { font-size: 30px; }

/* ---------- Perfil ---------- */
.perfil-topo { display: flex; align-items: center; gap: 20px; }
.estatistica { text-align: center; padding: 14px; }
.estatistica strong { display: block; font-size: 24px; font-family: var(--rpp-fonte-titulo); color: var(--rpp-primaria); }
.estatistica span { font-size: 12px; color: var(--rpp-texto-suave); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Landing ---------- */
.landing-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 24px 0 32px; }
.landing-hero h1 { font-size: 2.4rem; }
.landing-hero h1 span { color: var(--rpp-primaria); }
.landing-hero p { font-size: 17px; color: var(--rpp-texto-suave); line-height: 1.6; }
.landing-ilustracao { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: clamp(8px, 2vw, 24px); font-size: clamp(56px, 8vw, 120px); line-height: 1; min-width: 0; }
.landing-ilustracao span { display: inline-block; flex: 0 0 auto; animation: flutuar 3s ease-in-out infinite; }
.landing-ilustracao span:nth-child(2) { animation-delay: .6s; font-size: .67em; }
.landing-ilustracao span:nth-child(3) { animation-delay: 1.2s; font-size: .58em; }

/* ---------- Conteúdo institucional ---------- */
.texto-longo { line-height: 1.7; max-width: 820px; }
.texto-longo h2 { margin-top: 24px; }

.erro-pagina { max-width: 640px; margin: 80px auto; padding: 24px; }

/* ---------- Celebrações ---------- */
.xp-bolha {
    position: fixed; top: 70px; right: 220px; z-index: 200;
    background: var(--rpp-ouro); color: #3b2a00; font-weight: 800;
    padding: 6px 14px; border-radius: 20px; box-shadow: 0 6px 18px rgba(217,164,37,.4);
    animation: xp-pop 1.8s ease forwards; pointer-events: none;
}
.nivel-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(20, 35, 40, .55); display: grid; place-items: center; animation: surgir .2s ease; }
.nivel-cartao {
    background: #fff; border: 1px solid var(--rpp-borda); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 35, 40, .35); padding: 32px 40px;
    text-align: center; max-width: 92vw; animation: zoom .3s ease; cursor: default;
}
.nivel-emoji
.nivel-numero { font-family: var(--rpp-fonte-titulo); font-size: 64px; font-weight: 900; color: var(--rpp-primaria); line-height: 1; margin: 8px 0; }

.confete {
    position: fixed; top: -12px; width: 10px; height: 14px; z-index: 400;
    pointer-events: none; animation-name: cair; animation-timing-function: ease-in; animation-fill-mode: forwards;
}

.animar-flutuar { animation: flutuar 3s ease-in-out infinite; display: inline-block; }
.modal-cartao { width: 560px; max-width: 92vw; max-height: 86vh; overflow: auto; animation: zoom .25s ease; cursor: default; }
.animar-entrada { animation: entrar .35s ease both; }

/* ---------- Keyframes ---------- */
@keyframes flutuar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pular { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }
@keyframes barra { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes surgir { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(47,125,74,.35); } 100% { box-shadow: 0 0 0 14px rgba(47,125,74,0); } }
@keyframes tremer { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes xp-pop { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
@keyframes zoom { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes foguete { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes cair { to { transform: translateY(105vh) rotate(720deg); } }
@keyframes subir { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
@keyframes chama { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12) rotate(-4deg); } }
@keyframes balancar { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Desktop first: em telas menores a coluna de anúncios é ocultada. */
@media (max-width: 1280px) {
    .app-body { grid-template-columns: 280px minmax(0, 1fr); }
    .app-ads { display: none; }
}
