/* StockFC — SPA do jogador. Dark, clima de app de trading. */

/* Fontes self-hosted (nunca <link> pro Google Fonts — quebraria o CSP
   default-src 'self' planejado em ARQUITETURA.md §6 e vaza IP de usuário).
   Hanken Grotesk = headlines, Inter = corpo/dados, JetBrains Mono = ticker/
   preços/símbolos — referência "Pitch Precision" (PLANO_DESIGN_V2.md). */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500.woff2') format('woff2');
}

:root {
  --bg: #0B0F14;
  --surface: #121821;
  --surface-alt: #182130;
  --border: #1E2833;
  --text: #E8EEF5;
  --text-2: #8A97A6;
  --accent: #A3E635;
  --accent-ink: #0B0F14;
  --up: #22C55E;
  --down: #EF4444;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 10px;
  --radius-lg: 12px;
  --font-display: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 64px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
}

.tabular { font-variant-numeric: tabular-nums; }

h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo span { color: var(--accent); }

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

.header-saldo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.header-saldo small {
  color: var(--text-2);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.header-saldo strong {
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 44px;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.98); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-accent:hover { filter: brightness(1.05); }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 10px; font-size: 0.82rem; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--down); border-color: var(--down); background: transparent; }

/* ---------- Nav (bottom mobile / topbar desktop) ---------- */

.mainnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.navitem {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 0.68rem;
  font-weight: 600;
  min-height: 44px;
  transition: color 150ms ease;
}
.navitem svg { transition: transform 150ms ease; }
.navitem.active { color: var(--accent); }
.navitem:active svg { transform: scale(0.92); }

@media (min-width: 768px) {
  .mainnav {
    position: sticky;
    top: var(--topbar-h);
    height: auto;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 16px;
    border-top: none;
    border-bottom: 1px solid var(--border);
  }
  .navitem {
    flex: none;
    flex-direction: row;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
  }
  .navitem.active { background: var(--surface-alt); }
  body { padding-bottom: 0; }
}

/* ---------- Layout de conteúdo ---------- */

.app-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card + .card { margin-top: 12px; }

.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin: 20px 2px 8px;
}
.section-title:first-child { margin-top: 4px; }

/* ---------- Busca ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.search svg { color: var(--text-2); flex-shrink: 0; }
.search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  min-height: 24px;
}
.search input::placeholder { color: var(--text-2); }

.mercado-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  isolation: isolate;
  /* min-height suficiente pra revelar a cena inteira (holofotes + torcida +
     grama com linhas) — antes o banner só tinha altura do conteúdo e a
     SVG (slice) cortava quase tudo, sobrando só uma tira de grama. */
  min-height: 200px;
  display: flex;
  align-items: flex-end;
}
.banner-estadio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.mercado-banner-conteudo {
  position: relative;
  padding: 18px 16px 16px;
  width: 100%;
}
.mercado-banner-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #F5F8FC;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  margin: 0 0 14px;
}
.live-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--up);
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
.mercado-banner .resumo-mercado { margin-bottom: 0; }
.mercado-banner .resumo-item {
  background: rgba(18, 24, 33, 0.6);
  backdrop-filter: blur(6px);
  border-color: rgba(255, 255, 255, 0.1);
}

.resumo-mercado {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.resumo-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
}
.resumo-item .resumo-valor { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; }
.resumo-item.up .resumo-valor { color: var(--up); }
.resumo-item.down .resumo-valor { color: var(--down); }
.resumo-item .resumo-label { color: var(--text-2); font-size: 0.68rem; }

.tabs-mercado {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.chip-filtro {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.chip-filtro.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------- Lista de ativos (mercado) ---------- */

.ativo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-align: left;
  color: var(--text);
  transition: border-color 150ms ease, transform 150ms ease;
}
.ativo-row:hover { border-color: var(--accent); }
.ativo-row:active { transform: scale(0.99); }

.ativo-nome { font-weight: 700; font-size: 0.98rem; }
.ativo-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
}

.ativo-right {
  margin-left: auto;
  text-align: right;
}
.ativo-preco { font-weight: 700; font-size: 1rem; }

.variacao {
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}
.variacao.up { color: var(--up); background: rgba(34, 197, 94, 0.12); }
.variacao.down { color: var(--down); background: rgba(239, 68, 68, 0.12); }
.variacao.neutral { color: var(--text-2); background: rgba(138, 151, 166, 0.1); }

/* ---------- Estado vazio ---------- */

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-2);
}
.empty-state p { margin: 8px 0 20px; }

/* ---------- Página do ativo ---------- */

.ativo-header { margin-bottom: 12px; }
.ativo-header h1 { font-size: 1.3rem; margin: 0 0 4px; }
.ativo-header .preco-grande {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 8px 0 2px;
}
.ativo-header .variacao { font-size: 0.95rem; }

.chart-wrap { margin: 12px 0 4px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-eixo {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}
.chart-vazio {
  color: var(--text-2);
  text-align: center;
  padding: 30px 0;
  font-size: 0.88rem;
}
.evolucao-vazia { color: var(--text-2); text-align: center; padding: 22px 14px; font-size: 0.85rem; }
.evolucao-cabecalho {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.evolucao-cabecalho > span:first-child { font-size: 1.3rem; font-weight: 700; }

.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.toggle-btn {
  flex: 1;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  font-weight: 700;
  padding: 10px;
  min-height: 44px;
  transition: background 150ms ease, color 150ms ease;
}
.toggle-btn.active.compra { background: var(--up); color: #06210f; }
.toggle-btn.active.venda { background: var(--down); color: #2a0a0a; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.stepper button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}
.stepper input {
  flex: 1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  height: 44px;
  min-width: 0;
}
.qtd-rapida { display: flex; gap: 6px; margin-bottom: 14px; }
.qtd-rapida button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.82rem;
  min-height: 36px;
}
.qtd-rapida button:hover { border-color: var(--accent); color: var(--text); }

.preview-linha {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
}
.preview-linha span:first-child { color: var(--text-2); }
.preview-linha.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; font-weight: 700; }

.posicao-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.posicao-item small { display: block; color: var(--text-2); font-size: 0.72rem; margin-bottom: 2px; }
.posicao-item strong { font-size: 0.98rem; }

.trade-recente {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.trade-recente:last-child { border-bottom: none; }
.trade-tipo { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }
.trade-tipo.compra { color: var(--up); }
.trade-tipo.venda { color: var(--down); }
.trade-tipo.bonus { color: #F2C14E; }
.trade-recente .muted { color: var(--text-2); margin-left: auto; font-size: 0.78rem; }

/* ---------- Carteira ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.stat-card small { display: block; color: var(--text-2); font-size: 0.72rem; margin-bottom: 4px; }
.stat-card strong { font-size: 1.15rem; }
.stat-card.full { grid-column: 1 / -1; }

.pl.up { color: var(--up); }
.pl.down { color: var(--down); }
.pl.neutral { color: var(--text-2); }

.posicao-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-align: left;
  color: var(--text);
}
.posicao-row .info { flex: 1; min-width: 0; }
.posicao-row .nome { font-weight: 700; }
.posicao-row .sub { color: var(--text-2); font-size: 0.78rem; margin-top: 2px; }
.posicao-row .valores { text-align: right; }
.posicao-peso {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.posicao-peso-barra {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.posicao-peso-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.posicao-peso-pct {
  flex-shrink: 0;
  color: var(--text-2);
  font-size: 0.72rem;
}

/* ---------- Ranking ---------- */

.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.ranking-row:last-child { border-bottom: none; }
.ranking-row.destaque {
  background: rgba(163, 230, 53, 0.08);
  border-radius: var(--radius-sm);
  border-bottom-color: transparent;
}
.ranking-pos {
  width: 30px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-2);
}
.ranking-nome { flex: 1; font-weight: 600; }
.ranking-valor { font-weight: 700; }
.ranking-pct { width: 74px; flex-shrink: 0; text-align: right; font-size: 0.78rem; font-weight: 700; }
.ranking-pct.up { color: var(--up); }
.ranking-pct.down { color: var(--down); }
.ranking-pct.neutral { color: var(--text-2); }
.podio-valor + .ranking-pct { width: auto; text-align: center; }
.ranking-nota { color: var(--text-2); font-size: 0.78rem; text-align: center; margin-top: 14px; }

/* ---------- Entrar / Conta ---------- */

.auth-card { max-width: 420px; margin: 24px auto 0; }
.auth-card h1 { font-size: 1.25rem; margin: 0 0 6px; }
.auth-card p.lead { color: var(--text-2); font-size: 0.9rem; margin: 0 0 18px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 1rem;
  min-height: 44px;
  outline: none;
  transition: border-color 150ms ease;
}
.field input:focus { border-color: var(--accent); }

.field-erro { color: var(--down); font-size: 0.8rem; margin-top: 6px; }

.link-sutil {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 0.85rem;
  text-decoration: underline;
}
.link-sutil:hover { color: var(--accent); }

.conta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.conta-row:last-of-type { border-bottom: none; }
.conta-row small { color: var(--text-2); display: block; font-size: 0.72rem; }

/* Aviso "confira o spam" na tela de código */
.aviso-spam {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border-radius: var(--r-md, 12px);
  background: rgba(255,196,0,0.10);
  border: 1px solid rgba(255,196,0,0.30);
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.4;
}
.aviso-spam strong { color: var(--text-1); }

/* Selo Fundador */
.selo-fundador { font-size: 0.9em; }
.conta-fundador {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-md, 12px);
  background: linear-gradient(135deg, rgba(255,196,0,0.14), rgba(255,140,0,0.08));
  border: 1px solid rgba(255,196,0,0.35);
  color: var(--text-1);
  font-size: 0.92rem;
}
.conta-fundador strong { font-weight: 700; }

.ref-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.ref-code-box code { flex: 1; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  max-width: calc(100% - 32px);
  text-align: center;
  transition: opacity 150ms ease, transform 150ms ease;
}
.toast[hidden] { display: none; }

@media (min-width: 768px) {
  .toast { bottom: 24px; }
}

/* ---------- Ordens programadas ---------- */

.ordens-titulo {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin-bottom: 4px;
}
.ordens-sub { color: var(--text-2); font-size: 0.8rem; margin: 0 0 12px; }

.ordem-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ordem-form select,
.ordem-form input {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 10px;
  height: 44px;
  font-size: 0.9rem;
}
.ordem-form select { flex: 0 0 auto; }
.ordem-form #ordem-qtd { width: 76px; text-align: center; }
.ordem-form #ordem-gatilho { width: 100px; text-align: center; }
.ordem-quando { color: var(--text-2); font-size: 0.82rem; }
.ordem-form .btn { flex: 1 0 auto; min-width: 110px; }

.ordem-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.ordem-linha:last-child { border-bottom: none; }
.ordem-linha .ordem-desc { flex: 1; min-width: 0; }
.ordem-linha .ordem-desc a { text-decoration: underline; }
.ordem-linha.resolvida { opacity: 0.75; }
#lista-ordens-ativo .ordem-linha:first-child { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 12px; }

.ordens-historico-titulo {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin: 12px 0 4px;
}
.ordem-vazia { color: var(--text-2); font-size: 0.85rem; }

/* ---------- Regras ---------- */

.regras h1 { font-size: 1.35rem; margin: 4px 0 4px; }
.regras h2 {
  font-size: 0.95rem;
  color: var(--accent);
  margin: 22px 0 6px;
}
.regras p { color: var(--text); font-size: 0.92rem; line-height: 1.55; margin: 6px 0; }
.regras ul { margin: 6px 0; padding-left: 20px; }
.regras li { font-size: 0.92rem; line-height: 1.55; color: var(--text); margin: 4px 0; }
.regras em { color: var(--text-2); }

.rodape-links {
  text-align: center;
  margin: 18px 0 6px;
}
.rodape-links a {
  color: var(--text-2);
  font-size: 0.82rem;
  text-decoration: underline;
}
.rodape-links a:hover { color: var(--accent); }

/* ---------- Skeleton / loading ---------- */

.loading { color: var(--text-2); text-align: center; padding: 40px 0; font-size: 0.9rem; }

.share-btn { margin-top: 4px; }

/* ── Ticker (letreiro do mercado) ── */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  margin: 0 0 14px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.tk-track {
  display: inline-block;
  animation: tk-slide 30s linear infinite;
  will-change: transform;
}
.ticker:hover .tk-track { animation-play-state: paused; }
.tk {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.tk b {
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.tk em { font-style: normal; font-variant-numeric: tabular-nums; }
.tk em.up { color: var(--up); }
.tk em.down { color: var(--down); }
.tk-sep { color: var(--border); margin: 0 14px; }
@keyframes tk-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none; }
}

/* ── Pênalti do Dia ── */
.penalty-chamada {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--surface-alt), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.penalty-chamada:hover { border-color: var(--accent); }
.penalty-emoji { font-size: 22px; }
.penalty-texto { flex: 1; color: var(--text-2); font-size: 13px; }
.penalty-texto strong { display: block; color: var(--text); font-size: 14px; }
.penalty-cta { color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap; }

.penalty-card { max-width: 460px; margin: 0 auto; }
.penalty-topo h1 { margin: 0 0 6px; font-size: 22px; }
.penalty-cena {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 14px 0 10px;
}
.penalty-status {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  min-height: 18px;
}
.penalty-status #pen-ganho { color: var(--up); font-weight: 600; }
.penalty-botoes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.penalty-botoes .btn:disabled { opacity: 0.45; cursor: default; }
.penalty-fim { text-align: center; color: var(--text-2); }

/* ── Pênalti: cena v2 (estádio noturno) ── */
.penalty-palco {
  position: relative;
  margin: 14px 0 10px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.penalty-palco .penalty-cena { margin: 0; border-radius: 0; }

#pen-bola {
  transition: transform 0.42s cubic-bezier(.18,.75,.28,1);
  will-change: transform;
}
#pen-bola .pen-bola-rot { transform-box: fill-box; transform-origin: 50% 50%; }
#pen-bola.voando .pen-bola-rot { animation: pen-giro 0.45s linear infinite; }
@keyframes pen-giro { to { transform: rotate(360deg); } }
#pen-sombra { transition: opacity 0.3s; }

#pen-goleiro {
  transform-box: fill-box;
  transform-origin: 50% 68%;
  transition: transform 0.4s cubic-bezier(.3,1.35,.5,1);
  animation: pen-espera 2.4s ease-in-out infinite;
  will-change: transform;
}
#pen-goleiro.mergulho { animation: none; }
@keyframes pen-espera {
  0%, 100% { translate: -5px 0; }
  50% { translate: 5px 0; }
}

#pen-net.balanca {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: pen-rede-balanco 0.5s ease-out;
}
@keyframes pen-rede-balanco {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.02, 1.06); }
  60% { transform: scale(0.995, 0.98); }
  100% { transform: scale(1, 1); }
}

.pen-flicker { animation: pen-flicker 6s ease-in-out infinite; }
@keyframes pen-flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  94% { opacity: 0.75; }
  96% { opacity: 1; }
}

#pen-resultado-g { transition: opacity 0.22s; }

.penalty-palco.tremida { animation: pen-tremida 0.4s linear; }
@keyframes pen-tremida {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(2px, 1px); }
}

.penalty-confete {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.penalty-confete span {
  position: absolute;
  top: -10px;
  width: 7px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: pen-confete-cai 1.2s ease-in forwards;
}
@keyframes pen-confete-cai {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0.9; transform: translateY(260px) rotate(300deg); }
}

@media (prefers-reduced-motion: reduce) {
  #pen-goleiro { animation: none; }
  .pen-flicker { animation: none; }
  #pen-bola.voando .pen-bola-rot { animation: none; }
  .penalty-palco.tremida { animation: none; }
}

.consentimento {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}
.consentimento a { color: var(--accent); }

/* ── Pênalti: mira no gol + dica ── */
#pen-alvo-area { cursor: crosshair; touch-action: manipulation; }
#pen-mira { transition: opacity 0.15s; pointer-events: none; }
#pen-mira > circle:first-child { animation: pen-mira-gira 6s linear infinite; }
@keyframes pen-mira-gira { to { stroke-dashoffset: -28; } }
.penalty-dica {
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  margin: 2px 0 4px;
}

/* ── Mercado: sparkline + flash de preço ── */
.ativo-row > div:first-child { flex: 1; min-width: 0; }
.spark {
  width: 60px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0 4px;
}
@media (max-width: 380px) { .spark { display: none; } }
.ativo-row.flash-up { animation: flash-up 1.1s ease-out; }
.ativo-row.flash-down { animation: flash-down 1.1s ease-out; }
@keyframes flash-up {
  0% { background: rgba(34, 197, 94, 0.16); }
  100% { background: transparent; }
}
@keyframes flash-down {
  0% { background: rgba(239, 68, 68, 0.16); }
  100% { background: transparent; }
}

.penalty-topo { position: relative; }
.penalty-som {
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1;
}

/* ── Ranking: pódio top-3 ── */

.podio {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 16px;
}
.podio-item {
  flex: 1;
  max-width: 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  text-align: center;
}
.podio-medalha { font-size: 1.3rem; line-height: 1; }
.podio-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  margin: 2px 0;
}
.podio-nome {
  font-weight: 600;
  font-size: 0.82rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podio-valor { font-size: 0.78rem; font-weight: 700; color: var(--text-2); }

/* 1º lugar: maior, elevado e com glow accent */
.podio-item.lugar-1 {
  padding: 20px 10px 16px;
  margin-bottom: 14px;
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(163, 230, 53, 0.18);
}
.podio-item.lugar-1 .podio-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  border-color: var(--accent);
}
.podio-item.lugar-1 .podio-medalha { font-size: 1.6rem; }
.podio-item.lugar-1 .podio-valor { color: var(--accent); }
.podio-item.destaque .podio-nome { color: var(--accent); }

/* ── Carteira: donut de alocação ── */

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.donut {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  margin: 0 auto;
}
.donut-label {
  font-size: 9px;
  fill: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.donut-valor { font-size: 13px; font-weight: 700; fill: var(--text); }
.donut-legenda {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.donut-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.donut-leg-nome {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.donut-leg-pct { color: var(--text-2); font-weight: 600; }

/* ── Página do ativo: selo de dividendo ── */

.selo-dividendo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--text-2);
}
.selo-dividendo strong { color: var(--text); font-weight: 700; }

/* ── Hero (visitante deslogado) ── */
.hero {
  position: relative;
  overflow: hidden;
  margin: 4px 0 16px;
  padding: 30px 22px 26px;
  background: linear-gradient(160deg, var(--surface-alt), var(--surface) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.hero-glow {
  position: absolute;
  inset: -60% 20% 55% -20%;
  background: radial-gradient(ellipse at center, rgba(163, 230, 53, 0.14), transparent 65%);
  pointer-events: none;
}
.hero h1 {
  position: relative;
  margin: 0 0 10px;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  position: relative;
  margin: 0 auto 18px;
  max-width: 420px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.5;
}
.hero-cta {
  position: relative;
  display: inline-block;
  padding: 13px 26px;
  font-size: 15px;
  box-shadow: 0 0 24px rgba(163, 230, 53, 0.28);
}
.hero-cta:hover { box-shadow: 0 0 32px rgba(163, 230, 53, 0.4); }
.hero-pontos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}
.hero-pontos div {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.35;
}
.hero-pontos strong {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  margin-bottom: 3px;
  white-space: nowrap;
}
@media (max-width: 380px) { .hero-pontos { grid-template-columns: 1fr; gap: 8px; } }

/* ── Cores do clube ── */
.chip-cores {
  display: inline-block;
  width: 14px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex: 0 0 auto;
}
.ativo-row .chip-cores { margin-right: 2px; }
.ativo-header { border-radius: var(--radius-lg); padding: 14px 16px 12px; }
.ativo-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ativo-header .chip-cores { width: 16px; height: 26px; }

/* ── Ligas de amigos ── */
.tabs-ranking {
  display: flex;
  gap: 8px;
  margin: 2px 0 14px;
}
.tabs-ranking .btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.liga-form { display: flex; gap: 10px; }
.liga-form input {
  flex: 1;
  min-width: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
}
.liga-form input:focus { outline: none; border-color: var(--accent); }
.liga-row .liga-seta { color: var(--text-2); font-size: 18px; }
.liga-topo h1 { margin: 8px 0 8px; font-size: 24px; }
.liga-convite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-2);
}
.liga-convite code {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.liga-acoes { margin-top: 18px; }
.ranking-row .liga-remover { margin-left: 8px; padding: 4px 9px; }

/* ── Sobe ou desce? + streak ── */
.sd-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-titulo { font-size: 13px; font-weight: 700; }
.sd-clube {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
}
.sd-clube a { color: var(--text); font-weight: 600; }
.sd-clube .chip-cores { width: 11px; height: 17px; }
.sd-premio { font-size: 11.5px; color: var(--text-2); }
.sd-botoes { display: flex; flex-direction: column; gap: 8px; }
.sd-botoes .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.sd-feito { font-size: 12.5px; color: var(--text-2); max-width: 150px; text-align: right; }
.sd-resolvido {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
}
.sd-resolvido.up { border-color: rgba(34, 197, 94, 0.4); color: var(--up); }
.sd-resolvido.down { color: var(--text-2); }
.penalty-streak {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
  margin: -4px 0 10px;
}
.penalty-streak strong { color: #F2C14E; }

/* ---------- Notícias ---------- */

.muted { color: var(--text-2); }

.noticias-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.noticia-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 150ms ease;
}
.noticia-card:hover { border-color: var(--accent); }
.noticia-thumb {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-alt);
}
.noticia-texto { min-width: 0; flex: 1; }
.noticia-titulo {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 6px;
}
.noticia-resumo {
  color: var(--text-2);
  font-size: 0.84rem;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.noticia-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
}
.noticias-credito {
  text-align: center;
  font-size: 0.74rem;
  margin-top: 14px;
}

/* ---------- Desktop largo (telas ≥1080px) ---------- */
/* .app-content ficava travado em 680px em qualquer tela — em monitor grande
   sobrava metade da largura em preto dos dois lados. Alarga o conteúdo e,
   no mercado especificamente, transforma a lista de clubes num grid de
   2 colunas em vez de uma coluna só de barras esticadas. */
@media (min-width: 1080px) {
  .app-content {
    max-width: 1080px;
    padding: 24px 20px 40px;
  }
  #lista-ativos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: start;
  }
  #lista-ativos .ativo-row { margin-bottom: 0; }
  #lista-ativos .empty-state { grid-column: 1 / -1; }
}
@media (min-width: 1440px) {
  .app-content { max-width: 1280px; }
}

/* ---------- Sala do clube (comentários) ---------- */

.form-comentario {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.form-comentario textarea {
  flex: 1;
  resize: vertical;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.form-comentario textarea::placeholder { color: var(--text-2); }

.comentarios-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comentario {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.comentario-cabeca {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.comentario-texto {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.comentario-denunciar {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 0.72rem;
  padding: 0;
  cursor: pointer;
}
.comentario-denunciar:hover { color: var(--down); }
.comentario-denunciar:disabled { cursor: default; color: var(--text-2); opacity: 0.6; }
