:root {
  --bg: #0b1020;
  --bg-2: #131a2e;
  --fg: #e6edf7;
  --muted: #8b95ad;
  --accent: #00d97e;
  --accent-2: #2bd2ff;
  --warn: #ffcc66;
  --danger: #ff5577;
  --border: #1f2a44;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(180deg, #0d1428 0%, #0b1020 100%);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 8px rgba(0, 217, 126, 0.4));
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sub {
  font-size: 13px;
  color: var(--muted);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 85, 119, 0.15);
  color: #ff7799;
  border: 1px solid rgba(255, 85, 119, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5577;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

main { padding: 24px 20px 60px; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.updated {
  font-size: 12px;
  color: var(--muted);
}

/* Apuração */
.apuracao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
}

.stat .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat .value.small {
  font-size: 14px;
  color: var(--fg);
  font-weight: 500;
}

.stat .meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.progress-wrap {
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
  border-radius: 4px;
}

.apuracao-mini {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.apuracao-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.apuracao-info b {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  margin-right: 4px;
}

.apuracao-info .meta {
  font-size: 11px;
}

/* Candidatos */
.candidato-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candidato {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.candidato:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--accent);
}

.candidato.eleito {
  border-color: var(--accent);
  background: rgba(0, 217, 126, 0.08);
}

.candidato .pos {
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.candidato.eleito .pos { color: var(--accent); }

.candidato .info { min-width: 0; }

.linha-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-2);
  flex-shrink: 0;
}

.info-text { min-width: 0; }

.tag-eleito {
  background: var(--accent);
  color: #0b1020;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.tag-2turno {
  background: var(--warn);
  color: #0b1020;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.falta {
  font-size: 11px;
  color: var(--warn);
  margin-top: 2px;
}

.falta b { color: var(--warn); font-weight: 700; }

.candidato .nome {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidato .partido {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.candidato .voto {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.candidato .pct {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-2);
}

.candidato .num {
  font-size: 12px;
  color: var(--muted);
}

.muted { color: var(--muted); font-style: italic; }

/* Notícias */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  transition: all 0.2s;
}

.news-item:hover {
  border-color: var(--accent-2);
  transform: translateX(4px);
}

.news-item a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  display: block;
}

.news-item a:hover { color: var(--accent-2); }

.news-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.fonte {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-2);
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 32px;
  padding: 20px;
}

.footer-note a { color: var(--accent-2); text-decoration: none; }
.footer-note code {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.info-banner {
  background: rgba(255, 204, 102, 0.08);
  border: 1px solid rgba(255, 204, 102, 0.3);
  color: #ffd999;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.info-banner strong { color: var(--warn); }

.badge {
  background: var(--accent);
  color: #0b1020;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.msg-rodape {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .brand h1 { font-size: 18px; }
  .brand-icon { font-size: 28px; }
  .stat .value { font-size: 22px; }
  .candidato { grid-template-columns: 28px 1fr auto; gap: 10px; padding: 12px; }
}