/* Gamificação — cards coloridos estilo referência */

.niveis-container { padding: 8px 0; }
.nivel-section { margin-bottom: 28px; }

.nivel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--r);
}
.nivel-numero {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--lime);
    line-height: 1;
}
.nivel-info h3 { margin: 0; font-size: 1.05rem; }

/* Mission goal cards — colorful like Savings grid */
.missao-card {
    border-radius: var(--r);
    padding: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--t);
    border: none;
    position: relative;
    overflow: hidden;
    background: var(--surface);
}
.missao-card::before { display: none; }

.missao-card.disponivel { border: 1px solid rgba(198,255,0,.35); }
.missao-card.em-andamento { border: 1px solid rgba(255,140,66,.5); background: linear-gradient(145deg, #2a1a10, #1a1410); }
.missao-card.concluida { border: 1px solid rgba(155,123,255,.35); }
.missao-card.bloqueada { opacity: .45; cursor: not-allowed; }

.missao-card:hover:not(.bloqueada) { transform: translateY(-3px); }

.missao-header { display: flex; gap: 12px; margin-bottom: 12px; }
.missao-icone { font-size: 2.4rem; flex-shrink: 0; }
.missao-info { flex: 1; }
.missao-titulo { font-size: 1.05rem; font-weight: 800; margin: 0 0 4px; }
.missao-descricao { font-size: .82rem; color: var(--soft); margin: 0; opacity: .9; }

.missao-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.missao-pontos { font-weight: 800; color: var(--lime); font-size: .9rem; }

.missao-connector {
    width: 3px;
    height: 16px;
    background: var(--line);
    margin: 0 0 10px 28px;
}
.missao-connector.completo { background: var(--lime); }

/* Grid of mission tiles (savings-style) */
.missoes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.missao-tile {
    border-radius: var(--r);
    padding: 16px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--t);
}
.missao-tile:hover { transform: scale(1.02); }
.missao-tile .tile-icon { font-size: 1.8rem; }
.missao-tile .tile-title { font-weight: 800; font-size: .95rem; margin: 8px 0 4px; }
.missao-tile .tile-sub { font-size: .75rem; opacity: .85; font-weight: 700; }
.missao-tile .progress-bar-container { margin-top: 10px; height: 8px; }
.missao-tile.cor-orange { background: var(--orange); color: #fff; }
.missao-tile.cor-orange .progress-bar-container { background: rgba(0,0,0,.2); }
.missao-tile.cor-orange .progress-bar { background: #fff; }
.missao-tile.cor-purple { background: var(--purple); color: #fff; }
.missao-tile.cor-purple .progress-bar-container { background: rgba(0,0,0,.2); }
.missao-tile.cor-purple .progress-bar { background: #fff; }
.missao-tile.cor-lime { background: var(--lime); color: #0A0A0C; }
.missao-tile.cor-lime .progress-bar-container { background: rgba(0,0,0,.15); }
.missao-tile.cor-lime .progress-bar { background: #0A0A0C; }
.missao-tile.cor-dark {
    background: var(--surface);
    border: 2px dashed var(--line);
    color: var(--muted);
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Profile — like leaderboard screen top */
.perfil-hero {
    text-align: center;
    padding: 12px 0 20px;
}
.perfil-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 12px;
}
.perfil-avatar-wrap img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--lime);
    object-fit: cover;
    background: var(--surface-2);
}
.perfil-edit {
    position: absolute;
    right: 0; bottom: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--purple);
    border: 2px solid var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; cursor: pointer; color: #fff;
}
.perfil-nome { font-size: 1.5rem; font-weight: 800; margin: 0 0 6px; }
.perfil-exp-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: .85rem;
    font-weight: 800;
    color: var(--soft);
    margin-bottom: 8px;
}
.perfil-exp-bar {
    flex: 1;
    max-width: 140px;
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--pill);
    overflow: hidden;
}
.perfil-exp-bar > div {
    height: 100%;
    background: var(--purple);
    border-radius: var(--pill);
}
.perfil-badges-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
.perfil-badge-circle {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    position: relative;
}
.perfil-badge-circle .count {
    position: absolute;
    top: -4px; right: -4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--line);
    font-size: .65rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* Ranking list — highlight "eu" in purple */
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border-radius: var(--r-sm);
    margin-bottom: 6px;
}
.ranking-item.eu {
    background: rgba(155, 123, 255, .28);
}
.ranking-posicao {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--muted);
    min-width: 32px;
}
.ranking-item.top-1 .ranking-posicao { color: #FFD700; }
.ranking-item.top-2 .ranking-posicao { color: #C0C0C0; }
.ranking-item.top-3 .ranking-posicao { color: #CD7F32; }

.ranking-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--line);
}
.ranking-info { flex: 1; }
.ranking-nome { font-weight: 800; font-size: .95rem; }
.ranking-nivel { font-size: .78rem; color: var(--muted); font-weight: 700; }
.ranking-pontos { font-size: 1.05rem; font-weight: 800; color: var(--lime); }
.ranking-medal {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
}

/* Mission detail */
.missao-detalhe-header {
    background: var(--surface);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 16px;
}
.missao-detalhe-titulo { font-size: 1.4rem; margin: 0 0 8px; }
.missao-detalhe-pergunta {
    font-size: .95rem;
    font-style: italic;
    padding: 12px 14px;
    background: rgba(198,255,0,.1);
    border-radius: var(--r-sm);
    border-left: 3px solid var(--lime);
    margin: 12px 0;
}
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--r);
    overflow: hidden;
    background: #000;
    margin: 0;
}
.video-embed iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: 0;
}
.video-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(145deg, #1a2a10, #0A0A0C);
    cursor: pointer;
}
.video-placeholder:hover { background: linear-gradient(145deg, #243818, #121212); }
.video-placeholder .play-icon { font-size: 3rem; }
.video-placeholder p { color: var(--soft); font-weight: 700; margin: 0; font-size: .9rem; }

.missao-aula-info {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--surface-2);
    border-radius: var(--r-sm); margin-top: 10px;
}
.missao-aula-icone { font-size: 1.5rem; }

/* Desafios */
.desafio-card {
    background: var(--surface);
    border-radius: var(--r);
    padding: 18px;
    margin-bottom: 12px;
    border: 2px solid transparent;
}
.desafio-card.principal { border-color: var(--lime); }
.desafio-card.bonus { border-color: var(--orange); }
.desafio-card.participacao { border-color: var(--purple); }

.desafio-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 8px;
}
.desafio-tipo {
    padding: 4px 10px; border-radius: var(--pill);
    font-size: .68rem; font-weight: 800; text-transform: uppercase;
}
.desafio-tipo.principal { background: rgba(198,255,0,.15); color: var(--lime); }
.desafio-tipo.bonus { background: rgba(255,140,66,.2); color: var(--orange); }
.desafio-tipo.participacao { background: rgba(155,123,255,.2); color: var(--purple-soft); }

.desafio-pontos-badge {
    background: var(--lime); color: #0A0A0C;
    padding: 4px 10px; border-radius: var(--pill);
    font-weight: 800; font-size: .8rem;
}
.desafio-titulo { font-size: 1rem; font-weight: 800; margin: 6px 0; }
.desafio-descricao { color: var(--soft); font-size: .88rem; margin-bottom: 12px; }
.desafio-status {
    display: flex; gap: 8px; align-items: center;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.desafio-status.concluido { color: var(--lime); font-weight: 800; }

/* Upload */
.upload-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.upload-tab {
    flex: 1; min-width: 0; padding: 9px 2px;
    border-radius: var(--r-sm); border: 2px solid var(--line);
    background: var(--surface-2); color: var(--muted);
    font-weight: 800; font-size: .68rem; cursor: pointer;
    font-family: inherit; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.upload-tab svg { width: 18px; height: 18px; }
.upload-tab.ativo {
    border-color: var(--lime); color: var(--lime);
    background: rgba(198,255,0,.1);
}

.upload-opcoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.upload-opcoes.unica { grid-template-columns: 1fr; }
.upload-opcao {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 112px; padding: 16px 10px;
    border: 2px dashed var(--line); border-radius: var(--r);
    background: var(--surface-2); color: var(--white);
    font-family: inherit; cursor: pointer; transition: var(--t);
}
.upload-opcao svg { width: 28px; height: 28px; color: var(--lime); }
.upload-opcao:hover { border-color: var(--lime); background: rgba(198,255,0,.06); }
.upload-opcao-titulo { font-weight: 800; font-size: .88rem; }
.upload-opcao-sub { font-size: .72rem; color: var(--muted); }

.gravador-audio {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; margin-bottom: 12px;
    border-radius: var(--r-sm); background: rgba(255,107,157,.12);
    border: 1px solid rgba(255,107,157,.35);
}
.gravador-audio .btn svg { width: 14px; height: 14px; }
.gravador-ponto {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--pink); animation: pulsar 1s ease-in-out infinite;
}
.gravador-tempo { font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes pulsar { 50% { opacity: .3; } }

.preview-midia {
    margin: 12px 0; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2);
}
.preview-midia img, .preview-midia video {
    width: 100%; max-height: 200px; object-fit: cover; display: block;
}
.preview-midia audio { width: calc(100% - 24px); margin: 12px 12px 0; }
.preview-legenda { font-size: .78rem; color: var(--muted); padding: 8px 12px; margin: 0; }

.conclusao-missao {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px 18px;
    margin-bottom: 18px;
    display: flex; flex-direction: column; gap: 8px;
}
.conclusao-missao ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.conclusao-missao li { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--soft); }
.conclusao-missao li.feito { color: var(--lime); }
.conclusao-check {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 800;
}
.conclusao-missao li.feito .conclusao-check { background: var(--lime); border-color: var(--lime); color: #0A0A0C; }
.conclusao-missao.concluida { background: rgba(198,255,0,.12); border-color: rgba(198,255,0,.4); color: var(--lime); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    display: none !important;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    padding: 14px;
}
@media (min-width: 600px) { .modal-overlay { align-items: center; } }
.modal-overlay.aberto { display: flex !important; }
.modal {
    background: var(--surface);
    border-radius: var(--r) var(--r) 0 0;
    padding: 22px;
    max-width: 440px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow);
}
@media (min-width: 600px) { .modal { border-radius: var(--r); } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.modal-titulo { font-size: 1.2rem; font-weight: 800; margin: 0; }
.modal-fechar {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: var(--surface-2); color: var(--soft);
    font-size: 1.1rem; cursor: pointer;
}

.toast {
    position: fixed; top: 64px; left: 16px; right: 16px;
    max-width: 380px; margin: 0 auto;
    background: var(--surface-2); border: 1px solid var(--lime);
    padding: 14px; border-radius: var(--r-sm);
    display: flex; gap: 12px; align-items: center;
    z-index: 3000; box-shadow: var(--shadow);
}
.toast-icone { font-size: 1.4rem; }
.toast-titulo { font-weight: 800; }
.toast-mensagem { font-size: .85rem; color: var(--muted); }

.confete-container { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confete {
    position: absolute; width: 10px; height: 10px; background: var(--lime);
    animation: confeteFall 3s ease-out forwards;
}
@keyframes confeteFall {
    0% { transform: translateY(-20px) rotate(0); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.entrega-conteudo {
    margin: 12px 0; padding: 14px;
    background: var(--surface-2); border-radius: var(--r-sm);
}
.entrega-conteudo img {
    width: 100%; border-radius: var(--r-sm); max-height: 220px; object-fit: cover;
}
.entrega-texto { color: var(--soft); font-size: .9rem; margin: 0; white-space: pre-wrap; }
.entrega-meta { font-size: .75rem; color: var(--muted); margin-top: 8px; }

.metricas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.metrica-card {
    background: var(--surface);
    border-radius: var(--r);
    padding: 16px;
    text-align: center;
}
.metrica-numero {
    font-size: 1.8rem; font-weight: 800; color: var(--lime); display: block;
}
.metrica-label {
    font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: 4px;
}
.barra-chart {
    display: flex; align-items: flex-end; gap: 12px;
    height: 130px; padding-top: 20px;
}
.barra {
    flex: 1;
    background: linear-gradient(180deg, var(--lime), var(--lime-dim));
    border-radius: 10px 10px 0 0;
    min-height: 8px; position: relative;
}
.barra span {
    position: absolute; top: -20px; left: 0; right: 0;
    text-align: center; font-size: .75rem; font-weight: 800;
}

.conquistas-recentes {
    background: var(--surface);
    border-radius: var(--r);
    padding: 18px;
    margin-bottom: 16px;
}
.conquistas-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.conquistas-lista { display: flex; gap: 12px; overflow-x: auto; }
.conquista-mini { flex-shrink: 0; text-align: center; min-width: 68px; }
.conquista-mini-icone {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 6px;
    background: var(--surface-2);
}
.conquista-mini-nome { font-size: .68rem; font-weight: 700; color: var(--soft); }

.progresso-geral {
    display: block;
    background: linear-gradient(145deg, #1a2a0a 0%, #162010 40%, #1a1430 100%);
    border: 1px solid rgba(198,255,0,.25);
    color: var(--white);
    border-radius: var(--r);
    padding: 28px 20px;
    margin-bottom: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.progresso-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid var(--lime);
    margin: 0 auto 12px;
    object-fit: cover;
    background: var(--surface-2);
    display: block;
}
.progresso-nome { font-size: 1.4rem; font-weight: 800; margin: 0 0 4px; color: var(--white); }
.progresso-nivel { font-size: .95rem; color: var(--soft); margin-bottom: 8px; }
.pontos-destaque {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--white);
    margin: 8px 0;
}
.pontos-destaque span { font-size: 1rem; color: var(--lime); font-weight: 800; }
.progresso-geral .progress-bar-container { background: rgba(255,255,255,.15); }
.progresso-geral .progress-bar { background: var(--lime); }
.progresso-geral .progress-label { color: var(--soft); }

.progresso-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.progresso-geral .progresso-stats { grid-template-columns: repeat(3,1fr); }
.card .progresso-stats { grid-template-columns: repeat(2,1fr); }
@media (min-width: 400px) { .card .progresso-stats { grid-template-columns: repeat(4,1fr); } }
.progresso-stat {
    text-align: center; background: rgba(255,255,255,.06);
    border-radius: var(--r-sm); padding: 12px 6px;
}
.card .progresso-stat { background: var(--surface-2); }
.progresso-stat-numero { font-size: 1.5rem; font-weight: 800; color: var(--lime); display: block; }
.progresso-stat-label { font-size: .65rem; color: var(--soft); font-weight: 800; text-transform: uppercase; }
