/* ---------- Tokens ---------- */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --live: #ef4444;
  --true: #16a34a;
  --false: #dc2626;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #161a23;
  --surface-2: #1d2230;
  --border: #262c3b;
  --text: #eef0f5;
  --muted: #9aa3b5;
  --accent: #7c9cff;
  --accent-ink: #0b0d12;
  --accent-soft: rgba(124, 156, 255, .14);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
  --true-soft: rgba(22, 163, 74, .16);
  --true-ink: #4ade80;
  --false-ink: #f87171;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --border: #e3e4e8;
  --text: #12141a;
  --muted: #5d6475;
  --accent: #3355e0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(51, 85, 224, .1);
  --shadow: 0 20px 50px -24px rgba(20, 24, 40, .25);
  --true-soft: rgba(22, 163, 74, .1);
  --true-ink: #15803d;
  --false-ink: #b91c1c;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(700px 420px at 50% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 300px at 100% 100%, rgba(239, 68, 68, .07), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
[data-theme="dark"] .icon--moon,
[data-theme="light"] .icon--sun { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: min(1120px, 100% - 40px); margin-inline: auto;
  height: 72px; flex: none;
}
.topbar__actions { display: flex; gap: 10px; align-items: center; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; letter-spacing: -.03em; text-decoration: none;
}
.logo__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(239, 68, 68, .2); }

/* ---------- Hero (tela única) ---------- */
.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(16px, 3.2vh, 28px);
  width: min(680px, 100% - 40px); margin-inline: auto;
  padding: 8px 0 clamp(8px, 3vh, 40px);
  text-align: center;
}
.hero h1 { font-size: clamp(36px, min(7vw, 8.5vh), 68px); font-weight: 800; letter-spacing: -.035em; }
.lead { font-size: clamp(15px, 2.2vh, 18px); color: var(--muted); max-width: 34em; }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600;
}
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.pill.is-live { border-color: rgba(239, 68, 68, .45); color: var(--live); }
.pill.is-live .pill__dot { animation: pulse 1.4s infinite; }

/* Placar: candidatos nas pontas, contagem no meio */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px;
  width: min(520px, 100%);
}
.candidate { display: grid; justify-items: center; gap: 2px; }
.candidate strong { font-size: 16px; line-height: 1.2; margin-top: 8px; }
.candidate small { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.avatar {
  width: clamp(60px, 10vh, 80px); height: clamp(60px, 10vh, 80px);
  border-radius: 50%; object-fit: cover;
  background: var(--surface-2);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}
.scoreboard__mid { align-self: center; display: grid; justify-items: center; gap: 4px; }
.scoreboard__vs { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.scoreboard__clock { font: 700 clamp(24px, 4vh, 32px)/1 var(--mono); font-variant-numeric: tabular-nums; }
.scoreboard__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.scoreboard.is-live .scoreboard__clock,
.scoreboard.is-over .scoreboard__clock { font-family: var(--font); font-size: clamp(20px, 3.4vh, 26px); font-weight: 800; letter-spacing: .02em; }
.scoreboard.is-live .scoreboard__clock { color: var(--live); }

.footer {
  flex: none;
  width: min(720px, 100% - 40px); margin: 0 auto;
  padding: 0 0 14px;
  display: grid; gap: 4px;
  font-size: 11px; line-height: 1.5; text-align: center; color: var(--muted);
}

.footer__link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px;
}
.footer__link:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal {
  width: min(460px, calc(100% - 32px));
  padding: 0; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(5, 7, 12, .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal__head h2 { font-size: 22px; }
.modal__body { display: grid; gap: 16px; padding: 14px 20px 22px; }
.modal__success { justify-items: center; text-align: center; padding-top: 24px; }
.success-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--true-soft); color: var(--true-ink); }
.success-icon .icon { width: 28px; height: 28px; }

.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field abbr { text-decoration: none; color: var(--false-ink); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  font-weight: 400; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--false); }
.turnstile { min-height: 65px; }
.form-msg { font-size: 14px; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--false-ink); }

/* ---------- Banner de cookies (Silktide) ---------- */
#stcm-wrapper {
  --fontFamily: var(--font);
  --primaryColor: var(--accent);
  --backgroundColor: var(--surface);
  --textColor: var(--text);
  --boxShadow: var(--shadow);
  --backdropBackgroundColor: rgba(5, 7, 12, .6);
  --backdropBackgroundBlur: 3px;
  --iconColor: var(--muted);
  --iconBackgroundColor: var(--surface);
}
/* Sem ícone flutuante: as preferências abrem pelo link do rodapé. */
#stcm-icon { display: none !important; }

/* ---------- Animations ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .topbar { height: 60px; }
  .pill { font-size: 12px; padding: 5px 12px; }
  .scoreboard { gap: 8px; }
  .candidate strong { font-size: 14px; }
}
@media (max-height: 680px) {
  .hero { gap: 14px; }
  .footer { gap: 2px; padding-bottom: 10px; }
}
