/* ============================================================
   styles.css — identidade do Convocados.
   Prancheta azul-marinho (o fundo, com a grade da lousa tática), a folha de
   convocação por cima (papel creme com pauta) e o selo vermelho de "convocado".
   Letras: Big Shoulders Display (placar de estádio), Barlow / Barlow Condensed
   e IBM Plex Mono para números. A barra do Zeb Studio fica acima de tudo.
   ============================================================ */
:root {
  --navy: #0f1f3d;
  --navy-2: #16294f;
  --navy-3: #22396b;
  --ink: #12203d;
  --ink-soft: #33415e;
  --muted: #6b778f;
  --chalk: #fbf8f1;
  --bg-card: #fffdf8;
  --bg-paper: #f3eee2;
  --rule: rgba(18, 32, 61, 0.07);
  --primary: #22396b;          /* seleção, ritmo, números em destaque */
  --primary-light: #3f63c7;
  --primary-dark: #102657;
  --stamp: #d7263d;            /* o selo: ação principal e alertas */
  --stamp-dark: #a8162a;
  --gold: #f0b429;
  --highlight: #ffd23f;
  --accent-2: #7c4dff;
  --win: #1f8a4c;
  --pitch: #2a8a4d;
  --pitch-light: #33a35b;
  --pitch-dark: #1b6237;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --f-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--f-body); font-size: 16px; line-height: 1.45; color: var(--chalk);
  background-color: var(--navy);
  /* a lousa tática: grade fina e uma linha de meio-campo bem apagada */
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(63, 99, 199, 0.35), transparent 60%);
  background-size: 32px 32px, 32px 32px, 100% 900px;
  background-repeat: repeat, repeat, no-repeat;
}
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- topo do jogo (abaixo da barra do estúdio) ---------- */
.cv-top { padding: 1.4rem 1rem 0; }
.cv-top-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.cv-brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; color: var(--chalk); }
.cv-brand-seal { width: 52px; height: 52px; flex: none; }
.cv-brand-name { font-family: var(--f-display); font-weight: 900; font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 0.9; letter-spacing: 0.01em; display: block; }
.cv-brand-sub { display: block; font-family: var(--f-label); font-weight: 600; font-size: 0.98rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(251, 248, 241, 0.7); margin-top: 0.25rem; }

.cv-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.cv-tab {
  font-family: var(--f-label); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(251, 248, 241, 0.75); text-decoration: none; padding: 0.55rem 0.95rem 0.65rem; border-radius: 8px 8px 0 0;
  border: 2px solid transparent; border-bottom: 0;
}
.cv-tab:hover { color: var(--chalk); background: rgba(255,255,255,0.06); }
.cv-tab[aria-current="page"] { color: var(--ink); background: var(--bg-paper); border-color: var(--bg-paper); }

/* ---------- a folha de convocação (onde o jogo acontece) ---------- */
.cv-paper {
  position: relative; max-width: 1200px; margin: 0 auto; min-height: 60vh;
  color: var(--ink); background-color: var(--bg-paper);
  background-image: repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px);
  border-radius: 0 14px 14px 14px; padding: 1.6rem 1.3rem 2.2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.2);
}
.cv-main { padding: 0 1rem 3rem; }
@media (max-width: 700px) {
  .cv-top { padding-top: 1rem; }
  .cv-brand-seal { width: 40px; height: 40px; }
  .cv-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cv-tabs::-webkit-scrollbar { display: none; }
  .cv-tab { flex: 1 0 auto; text-align: center; padding: 0.5rem 0.55rem 0.6rem; font-size: 0.92rem; white-space: nowrap; }
  .cv-paper { border-radius: 0 0 12px 12px; padding: 1.1rem 0.8rem 1.8rem; }
  .cv-main { padding: 0 0.5rem 2rem; }
}

.cv-page-h { font-family: var(--f-display); font-weight: 900; font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1; margin: 0 0 0.3rem; color: var(--ink); text-transform: uppercase; }
.cv-page-sub { margin: 0 0 1.3rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: var(--f-label); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.55rem 1.1rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--chalk); color: var(--ink);
  box-shadow: 0 3px 0 var(--ink); cursor: pointer; text-decoration: none; transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn-primary { background: var(--stamp); color: #fff; }
.btn-primary:hover { background: var(--stamp-dark); }
.btn-red { background: var(--bg-paper); }
.btn-sm { font-size: 0.9rem; padding: 0.35rem 0.7rem; }
.btn-light { border-color: var(--chalk); box-shadow: 0 3px 0 rgba(0,0,0,0.4); }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }

/* ---------- tabelas de ranking ---------- */
.ranking-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; font-size: 0.95rem; }
.ranking-table th { font-family: var(--f-label); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; color: var(--chalk); background: var(--ink); padding: 0.5rem 0.6rem; }
.ranking-table td { padding: 0.5rem 0.6rem; border-top: 1px solid rgba(18, 32, 61, 0.12); }
.ranking-table tr.cv-me td { background: #fff4c7; }
.ranking-table td.num, .ranking-table th.num { text-align: right; font-family: var(--f-mono); }

/* ---------- abertura (sem conta) ---------- */
.cv-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: center; }
.cv-hero h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 0.92; margin: 0 0 0.8rem; text-transform: uppercase; }
.cv-hero h1 em { font-style: normal; color: var(--stamp); }
.cv-hero p { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; }
.cv-hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.cv-hero-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; }
@media (max-width: 820px) { .cv-hero { grid-template-columns: 1fr; } }

/* a ficha de exemplo, com o carimbo */
.cv-ficha { position: relative; background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 6px 0 var(--ink); padding: 1rem 1.1rem 4.2rem; transform: rotate(-1.2deg); }
.cv-ficha-h { font-family: var(--f-label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; color: var(--muted); border-bottom: 2px solid var(--ink); padding-bottom: 0.45rem; margin-bottom: 0.4rem; display: flex; justify-content: space-between; }
.cv-ficha ol { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.cv-ficha li { counter-increment: n; display: flex; align-items: center; gap: 0.6rem; padding: 0.32rem 0; border-bottom: 1px dashed rgba(18, 32, 61, 0.18); font-weight: 600; }
.cv-ficha li::before { content: counter(n); font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); width: 1.4rem; text-align: right; }
.cv-ficha li small { margin-left: auto; font-family: var(--f-mono); font-weight: 500; color: var(--muted); }
.cv-ficha .cv-flag { width: 22px; height: 15px; }
.cv-carimbo {
  position: absolute; right: 1rem; bottom: 0.9rem; transform: rotate(-7deg);
  font-family: var(--f-display); font-weight: 900; font-size: 1.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--stamp); border: 4px solid var(--stamp); border-radius: 8px; padding: 0.1rem 0.6rem; opacity: 0.85;
  mix-blend-mode: multiply; pointer-events: none;
}

.cv-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2.2rem 0 0; padding: 0; list-style: none; counter-reset: s; }
.cv-steps li { counter-increment: s; background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; padding: 0.9rem; box-shadow: 0 4px 0 var(--ink); }
.cv-steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: var(--chalk); font-family: var(--f-display); font-weight: 900; margin-bottom: 0.4rem; }
.cv-steps b { display: block; font-family: var(--f-label); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 820px) { .cv-steps { grid-template-columns: 1fr 1fr; } }

/* ---------- ranking ---------- */
.cv-seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; box-shadow: 0 3px 0 var(--ink); }
.cv-seg button { border: 0; background: var(--bg-card); color: var(--ink); padding: 0.45rem 1rem; font-family: var(--f-label); font-weight: 700; font-size: 1rem; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; }
.cv-seg button + button { border-left: 2px solid var(--ink); }
.cv-seg button[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.cv-rank-who { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.cv-rank-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem; object-fit: cover; border: 2px solid var(--ink); }
.cv-reach-lbl { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem; color: var(--ink-soft); }
.cv-reach-lbl.champ { color: var(--stamp); }
.cv-mypos { margin-top: 0.8rem; background: #fff4c7; border: 2px solid var(--ink); border-radius: 8px; padding: 0.6rem 0.8rem; }
.cv-empty { background: var(--bg-card); border: 2px dashed var(--ink-soft); border-radius: 10px; padding: 1.4rem; text-align: center; color: var(--ink-soft); }
@media (max-width: 600px) { .ranking-table .hide-sm { display: none; } }

/* ---------- minhas campanhas ---------- */
.cv-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1.2rem; }
.cv-sum-box { background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; padding: 0.7rem 0.9rem; box-shadow: 0 4px 0 var(--ink); }
.cv-sum-box span { display: block; font-family: var(--f-label); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cv-sum-box b { font-family: var(--f-display); font-weight: 900; font-size: 2.1rem; line-height: 1.1; }
.cv-hist { display: grid; gap: 0.55rem; }
.cv-hist-row { display: grid; grid-template-columns: 4.2rem 1fr auto; gap: 0.8rem; align-items: center; background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; padding: 0.55rem 0.8rem; color: var(--ink); text-align: left; cursor: pointer; width: 100%; }
.cv-hist-row:hover { background: #fff; box-shadow: 0 3px 0 var(--ink); }
.cv-hist-row:disabled { cursor: default; box-shadow: none; }
.cv-hist-pts { font-family: var(--f-display); font-weight: 900; font-size: 1.8rem; line-height: 1; text-align: center; }
.cv-hist-pts small { display: block; font-family: var(--f-label); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--muted); }
.cv-hist-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; font-size: 0.9rem; color: var(--ink-soft); align-items: center; }
.cv-hist-date { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }
.cv-flag { width: 20px; height: 14px; object-fit: cover; border: 1px solid rgba(0,0,0,0.25); vertical-align: -2px; }

/* ---------- como jogar ---------- */
.cv-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cv-rules section { background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; padding: 1rem 1.1rem; box-shadow: 0 4px 0 var(--ink); }
.cv-rules h3 { font-family: var(--f-label); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 0.5rem; }
.cv-rules ul { margin: 0; padding-left: 1.1rem; }
.cv-rules li { margin: 0.25rem 0; }
.cv-pts { width: 100%; border-collapse: collapse; }
.cv-pts td { padding: 0.3rem 0; border-bottom: 1px dashed rgba(18,32,61,0.2); }
.cv-pts td:last-child { text-align: right; font-family: var(--f-mono); font-weight: 600; }
@media (max-width: 760px) { .cv-rules { grid-template-columns: 1fr; } }

/* ---------- complementos da campanha (o resto está em campaign.css) ---------- */
.cv-intro { position: relative; overflow: hidden; }
.cv-intro h3 { font-family: var(--f-display); font-weight: 900; font-size: 2.1rem; line-height: 1; text-transform: uppercase; margin: 0 0 0.6rem; }
.cv-intro-stamp { position: absolute; top: 0.9rem; right: -0.4rem; transform: rotate(8deg); font-family: var(--f-display); font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--stamp); border: 3px solid var(--stamp); border-radius: 6px; padding: 0 0.5rem; opacity: 0.7; }
.cv-bullets li { padding-left: 1.4rem; position: relative; }
.cv-bullets li::before { content: '✓'; position: absolute; left: 0; color: var(--stamp); font-weight: 900; }
.cv-record { background: var(--bg-card); border: 2px solid var(--ink); border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0 0 1rem; font-weight: 600; }
.cv-record.new { background: #fff4c7; }
.cv-lb-alone { background: var(--bg-card); border: 2px dashed var(--ink-soft); border-radius: 8px; padding: 0.8rem 1rem; }
.cv-lb-more { text-align: right; margin: 0.5rem 0 0; }
.cv-lb-more a { font-weight: 700; color: var(--primary); }
.user-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; }

/* ---------- avisos (toast) ---------- */
.cv-toast { visibility: hidden; position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 140%); z-index: 60; max-width: min(92vw, 520px); background: var(--ink); color: var(--chalk); border: 2px solid var(--chalk); border-radius: 8px; padding: 0.7rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.35); transition: transform 0.25s ease; font-weight: 600; }
.cv-toast.show { visibility: visible; transform: translate(-50%, 0); }
.cv-toast.error { background: var(--stamp-dark); }
.cv-toast.success { background: var(--win); }

/* ---------- janela (compartilhar) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: rgba(8, 15, 30, 0.7); padding: 1rem; }
.modal-backdrop.active { display: flex; }
.modal { width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--bg-paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 8px 0 var(--ink); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1rem; border-bottom: 2px solid var(--ink); }
.modal-header h3 { margin: 0; font-family: var(--f-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.modal-close { border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.modal-body { padding: 1rem; overflow: auto; text-align: center; }
.modal-footer { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; padding: 0.7rem 1rem; border-top: 2px solid var(--ink); }
.share-preview-img { max-height: 62vh; border: 2px solid var(--ink); border-radius: 8px; }
.share-loading { padding: 2rem; font-weight: 600; }

/* ---------- confete do título ---------- */
.cv-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.cv-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: cvFall linear forwards; }
@keyframes cvFall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- rodapé ---------- */
.site-foot { color: rgba(251, 248, 241, 0.8); padding: 0 1rem 1.5rem; --zs-rodape-cor: rgba(251, 248, 241, 0.8); --zs-rodape-destaque: var(--chalk); }
.foot-inner { max-width: 1200px; margin: 0 auto; }
.foot-jogo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--f-label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.foot-jogo img { height: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 700px) { .cv-hide-sm { display: none; } }
