/* ==========================================================================
   FALCTEC - CONTRASTE (WCAG AA: 4.5:1 texto normal, 3:1 texto grande)
   Carregado por último. Corrige herança de cor e acentos nos dois temas.
   ========================================================================== */

/* A cor de texto precisa ser resolvida no body (onde o tema é aplicado), e não no html */
body { color: var(--text-main); }

/* Texto discreto mais legível no tema escuro */
:root { --text-dim: #8190a8; }

/* Acentos mais escuros no tema claro para atingir contraste sobre fundos claros */
body.light-theme {
  --accent-green: #047857;
  --accent-cyan: #0e7490;
  --accent-amber: #b45309;
  --accent-red: #be123c;
  --accent-blue: #0369a1;
  --text-muted: #475569;
  --text-dim: #5b6b82;
}

/* Botões e selos com preenchimento sólido: texto sempre escuro ou sempre claro, conforme o fundo */
.contatos-cta { color: #04210f; }
.rank-pos-badge.rank-pos-bronze { color: #1a0f00; }
.roster-tier.tier-s { color: #ff8da1; }
.roster-tier.tier-b { color: #6fb7ff; }
.contato-rotulo { color: color-mix(in srgb, var(--cor-contato) 55%, #ffffff); }
body.light-theme .contato-rotulo { color: color-mix(in srgb, var(--cor-contato) 60%, #000000); }
body.light-theme .contatos-cta { color: #04210f; }
body.light-theme .btn-contact { color: #fff; background: #047857; }
body.light-theme .gloss-filter-btn.active { color: #fff; background: #0369a1; }
body.light-theme .rank-pos-badge.rank-pos-bronze { color: #fff; background: #92400e; }

/* Tiers no tema claro */
body.light-theme .roster-tier.tier-s { color: #9f1239; }
body.light-theme .roster-tier.tier-a { color: #047857; }
body.light-theme .roster-tier.tier-b { color: #075985; }
body.light-theme .roster-tier.tier-c { color: #92400e; }
body.light-theme .logo-badge { color: #fff; }

/* ---------------------------------------------------------------------
   TEMA CLARO: superfícies e textos que estavam presos às cores do tema escuro
   --------------------------------------------------------------------- */
body.light-theme .control-bar-wrapper { background: rgba(255, 255, 255, .94); box-shadow: 0 4px 16px rgba(15, 23, 42, .08); }
body.light-theme .mode-btn { color: var(--text-muted); }
body.light-theme .mode-btn:hover { color: var(--text-main); background: rgba(15, 23, 42, .06); }
body.light-theme .mode-btn.active { color: var(--text-main); background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); }
@media (max-width: 700px) {
  body.light-theme .mode-btn.active[data-mode="executive"] {
    background: rgba(4, 120, 87, 0.12);
    border-color: rgba(4, 120, 87, 0.45);
    color: var(--accent-green);
  }
  body.light-theme .mode-btn.active[data-mode="battle"] {
    background: rgba(180, 83, 9, 0.14);
    border-color: rgba(180, 83, 9, 0.5);
    color: var(--accent-amber);
  }
  body.light-theme .mode-btn.active[data-mode="technical"] {
    background: rgba(14, 116, 144, 0.12);
    border-color: rgba(14, 116, 144, 0.45);
    color: var(--accent-cyan);
  }
}
body.light-theme .search-icon { color: var(--text-muted); }

/* Dossiê */
body.light-theme .cv-section-title,
body.light-theme .timeline-role,
body.light-theme .cv-hl-label,
body.light-theme .cv-hl-val { color: var(--text-main); }
body.light-theme .cv-summary-text,
body.light-theme .cv-finops-desc,
body.light-theme .timeline-desc,
body.light-theme .cv-modal-body p { color: var(--text-muted); }
body.light-theme .cv-tab-btn { color: var(--text-muted); }
body.light-theme .cv-tab-btn.active { color: var(--accent-green); }
body.light-theme .cv-header-title { color: var(--accent-green); }
body.light-theme .cv-modal-body { color: var(--text-main); }

/* Selos com preenchimento sólido: texto branco sobre acento escuro */
body.light-theme .timeline-atual,
body.light-theme .tech-reco-num,
body.light-theme .exec-cta a,
body.light-theme .exec-passo::before,
body.light-theme .arena-title-badge,
body.light-theme .battle-round-badge,
body.light-theme .titan-relato,
body.light-theme .btn-contact { color: #fff; }
body.light-theme .exec-cta a { background: var(--accent-green); }
body.light-theme .exec-cta a[href="#contatos"] { background: none; color: var(--accent-cyan); }

/* Textos com cor fixa */
body.light-theme .exec-highlight-box { color: var(--text-main); }
body.light-theme .hero-profile-badge { color: #0c4a6e; }
body.light-theme .tech-table th { color: var(--accent-cyan); }
body.light-theme .ranking-champion-badge { color: var(--accent-green); }
body.light-theme .i-tag { color: var(--accent-blue); }
body.light-theme .rank-delta-pill { color: #92400e; }
body.light-theme .twist-tag { color: #be123c; }
body.light-theme .exec-card-desc,
body.light-theme .exec-bloco-intro { color: var(--text-muted); }

/* Arena no tema claro: caixas escuras viram claras */
body.light-theme .battle-card::after { background: #fff; }
body.light-theme .fighter-detail-box { background: #fff; border-color: var(--border-steel); }
body.light-theme .fighter-detail-box h4 { color: var(--text-main); }
body.light-theme .fighter-detail-box div,
body.light-theme .btn-close-detail { color: var(--text-muted); }
body.light-theme .pro-box { background: #ecfdf5; color: #064e3b; }
body.light-theme .con-box { background: #fff1f2; color: #881337; }
body.light-theme .pro-box span, body.light-theme .con-box span { color: inherit !important; }
body.light-theme .battle-narrative { background: #f8fafc; color: var(--text-muted); }
body.light-theme .battle-narrative strong { color: #92400e !important; }
body.light-theme .battle-impact { background: #ecfdf5; color: #065f46; }
body.light-theme .vs-badge { background: #fff; }
body.light-theme .vs-badge div { color: var(--text-muted) !important; }
body.light-theme .ko-stamp { background: rgba(255, 255, 255, .95); color: #047857; border-color: #047857; }
body.light-theme .battle-art-tag { color: #6ee7b7; }
body.light-theme .f-metric-card { color: var(--text-main); }
body.light-theme .zoom-img-btn,
body.light-theme .infographic-caption { background: #fff; color: var(--accent-cyan); }

/* Arena sobre imagem escura: texto sempre claro */
.arena-hero-heading { color: #fff; }
.arena-hero-sub { color: #e2e8f0; }
body.light-theme .ranking-img-frame { background: #fff; border-color: var(--border-steel); }
body.light-theme .battle-card { background: #fff; }
body.light-theme .battle-round-title,
body.light-theme .battle-card h4 { color: var(--text-main); }
body.light-theme .duelo-vs { background: #fff; }
body.light-theme .duelista .ko-stamp { background: rgba(255, 255, 255, .95); color: #047857; border-color: #047857; }

/* ---------------------------------------------------------------------
   BARRAS DE ROLAGEM NA COR DO TEMA (vertical e horizontal, inclusive tabelas e dossiê)
   As variáveis ficam no <html>, que é de onde o navegador lê a barra da página.
   --------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  --scroll-track: #0b0f16;
  --scroll-thumb: #2c3a52;
  --scroll-thumb-hover: #00c46a;
}
html.light-theme {
  color-scheme: light;
  --scroll-track: #e8edf4;
  --scroll-thumb: #9fb0c8;
  --scroll-thumb-hover: #047857;
}
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
html { scrollbar-width: auto; }

/* Chrome/Safari antigos (sem suporte a scrollbar-color) */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--scroll-track); }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 3px solid var(--scroll-track); }
  ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-corner { background: var(--scroll-track); }
}
body.light-theme .lutador-dialogo { background: #fff; }
body.light-theme .lutador-arte-col .roster-tier { background: rgba(255, 255, 255, .92); }
