/* App mobile-first */
.app-page {
    padding-bottom: calc(var(--nav-height) + 1rem);
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14, 17, 22, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}
.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
}
.app-brand { display: flex; align-items: center; gap: 0.5rem; }
.brand-icon { font-size: 1.25rem; }
.brand-name {
    font-family: var(--font-score);
    font-size: 1.25rem;
    letter-spacing: 1px;
    font-weight: 700;
}
.grupo-ativo-chip {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-header-admin {
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.25rem;
}
.btn-header-admin:hover { color: var(--accent); }

.app-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
    min-width: 64px;
}
.bottom-nav-item i { font-size: 1.35rem; }
.bottom-nav-item.active { color: var(--accent); }

/* Match cards */
.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}
.section-title:first-child { margin-top: 0; }

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.match-card:hover { border-color: var(--accent); }
.match-card.saved { border-color: rgba(22, 199, 132, 0.4); }
.match-card.closed { opacity: 0.75; }

.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.match-fase { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.match-countdown { font-size: 0.75rem; font-weight: 600; }
.match-countdown.open { color: var(--warning); }
.match-countdown.closed { color: var(--text-muted); }

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.match-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.match-team img { width: 36px; height: 24px; object-fit: cover; border-radius: 3px; }
.match-team .sigla {
    font-family: var(--font-score);
    font-size: 1rem;
    font-weight: 700;
}

.match-score-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.score-stepper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.score-stepper button {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 32px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.score-stepper button:active { background: var(--accent-glow); border-color: var(--accent); }
.score-value {
    font-family: var(--font-score);
    font-size: 1.75rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    line-height: 1;
}
.score-separator {
    font-family: var(--font-score);
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 700;
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.match-info { font-size: 0.7rem; color: var(--text-muted); }
.match-status-ok { color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.match-status-ok i { margin-right: 0.25rem; }

.btn-save-bet {
    background: var(--accent);
    color: #0E1116;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-save-bet:disabled { opacity: 0.4; cursor: not-allowed; }

/* Ranking */
.ranking-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0 0.5rem;
}
.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 110px;
}
.podium-item.first { order: 2; }
.podium-item.second { order: 1; }
.podium-item.third { order: 3; }
.podium-bar {
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-score);
    font-size: 1.5rem;
    font-weight: 700;
    color: #0E1116;
}
.podium-item.first .podium-bar { height: 80px; background: linear-gradient(180deg, #FFD700, #FFB300); }
.podium-item.second .podium-bar { height: 60px; background: linear-gradient(180deg, #C0C0C0, #A0A0A0); }
.podium-item.third .podium-bar { height: 45px; background: linear-gradient(180deg, #CD7F32, #A0522D); }
.podium-name { font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.podium-points { font-size: 0.7rem; color: var(--accent); font-weight: 600; }

.ranking-list { list-style: none; padding: 0; margin: 0; }
.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.ranking-item.me {
    border-color: var(--accent);
    background: rgba(22, 199, 132, 0.08);
}
.ranking-pos {
    font-family: var(--font-score);
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 28px;
    color: var(--text-muted);
}
.ranking-pos.top3 { color: var(--accent); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-points {
    font-family: var(--font-score);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}
.ranking-variacao { font-size: 0.7rem; }
.ranking-variacao.up { color: var(--accent); }
.ranking-variacao.down { color: var(--danger); }

/* Grupo card */
.grupo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.grupo-card:hover, .grupo-card.active { border-color: var(--accent); }
.grupo-card h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.grupo-card .premio { color: var(--warning); font-size: 0.85rem; margin-bottom: 0.5rem; }
.grupo-card .meta { font-size: 0.75rem; color: var(--text-muted); }

/* Convite */
.convite-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, #0E1116, #0a2e1f);
}
.convite-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}
.convite-escudo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
    border: 2px solid var(--accent);
}
.convite-premio {
    background: rgba(255, 179, 0, 0.1);
    border: 1px solid rgba(255, 179, 0, 0.3);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--warning);
    font-weight: 600;
    margin: 1rem 0;
}

/* Perfil */
.perfil-header {
    text-align: center;
    padding: 1.5rem 0;
}
.perfil-header .avatar-lg { margin-bottom: 0.75rem; border-color: var(--accent); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}
.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 0.5rem;
    text-align: center;
}
.stat-box .value {
    font-family: var(--font-score);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-box .label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }

@media (min-width: 768px) {
    .app-content { max-width: 720px; padding: 1.5rem; }
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
