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

  :root {
    --navy:       #0B1F45;
    --navy-mid:   #142d5e;
    --navy-light: #1e3f7a;
    --gold:       #F0A500;
    --gold-light: #ffd166;
    --green:      #14A85A;
    --green-dark: #0d7a41;
    --red:        #D93B3B;
    --white:      #FFFFFF;
    --off:        #F4F6FA;
    --border:     rgba(255,255,255,0.10);
    --text-dim:   rgba(255,255,255,0.55);
    --text-mid:   rgba(255,255,255,0.80);
    --radius:     14px;
    --radius-sm:  8px;
  }

  html, body {
    min-height: 100%;
    background: var(--navy);
    font-family: 'Inter', sans-serif;
    color: var(--white);
    -webkit-font-smoothing: antialiased;
  }

  .hidden { display: none !important; }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0 0 40px;
  }

  /* ── HEADER ── */
  .top-bar {
    width: 100%;
    background: linear-gradient(180deg, #060f22 0%, var(--navy) 100%);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px 16px;
    text-align: center;
    position: relative;
  }
  .top-bar::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    margin: 10px auto 0;
  }
  .top-logo {
    width: 58px;
    height: 58px;
    display: block;
    object-fit: contain;
    margin: 0 auto 10px;
    border-radius: 14px;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.28));
  }
  .top-eyebrow {
    font-size: 10px;
    letter-spacing: 2.5px;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 5px;
  }
  .top-title {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
  }
  .top-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
  }

  /* ── CONTAINER ── */
  .container {
    width: 100%;
    max-width: 480px;
    padding: 20px 16px;
  }

  /* ── TELA: MODO ── */
  .modo-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
  }
  .modo-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .modo-btn.ativo {
    background: var(--navy-light);
    color: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  }

  /* ── TELA DISPLAY (número) ── */
  .display-screen {
    background: #060f22;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
  }
  .display-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .display-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 44px;
    font-weight: 700;
    color: #4db8ff;
    letter-spacing: 10px;
    line-height: 1;
    min-height: 54px;
  }
  .display-candidate-name {
    font-size: 14px;
    color: var(--text-mid);
    margin-top: 6px;
    min-height: 20px;
    font-weight: 500;
  }

  /* ── INSTRUÇÃO ── */
  .instrucao {
    background: rgba(240,165,0,0.08);
    border: 1px solid rgba(240,165,0,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--gold-light);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .instrucao svg { flex-shrink: 0; }

  /* ── CANDIDATOS ── */
  .candidatos-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .candidato-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.18s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .candidato-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
  .candidato-card.selecionado {
    background: rgba(20,168,90,0.12);
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
  }
  .cand-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    border: 2px solid transparent;
  }
  .cand-avatar-ana { background: rgba(59,130,246,0.15); }
  .cand-avatar-carlos { background: rgba(240,165,0,0.12); }
  .cand-avatar-larissa { background: rgba(20,168,90,0.12); }
  .candidato-card.selecionado .cand-avatar { border-color: var(--green); }
  .cand-body { flex: 1; }
  .cand-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px; font-weight: 700;
    color: var(--gold);
    line-height: 1;
  }
  .cand-nome { font-size: 14px; font-weight: 600; color: var(--white); margin-top: 1px; }
  .cand-partido { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
  .cand-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--green);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
    flex-shrink: 0;
  }
  .candidato-card.selecionado .cand-check { opacity: 1; }

  /* ── VOTO BRANCO ── */
  .branco-card {
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: var(--radius);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.18s;
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 16px;
    -webkit-tap-highlight-color: transparent;
  }
  .branco-card:hover { background: rgba(255,255,255,0.07); color: var(--white); }
  .branco-card.selecionado {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.5);
    color: var(--white);
  }

  /* ── TECLADO ── */
  .teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .tec {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 16px 8px;
    cursor: pointer;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0;
  }
  .tec:hover { background: rgba(255,255,255,0.12); }
  .tec:active { transform: scale(0.95); }
  .tec-branco { font-size: 11px; letter-spacing: 1px; color: var(--text-dim); }
  .tec-laranja { background: rgba(240,165,0,0.15); border-color: rgba(240,165,0,0.3); color: var(--gold); font-size: 11px; letter-spacing: 0.5px; }
  .tec-verde { background: rgba(20,168,90,0.18); border-color: rgba(20,168,90,0.4); color: #2ecc82; font-size: 13px; letter-spacing: 1px; grid-column: 1 / -1; padding: 14px; }
  .tec-vermelho { background: rgba(217,59,59,0.15); border-color: rgba(217,59,59,0.3); color: #ff7b7b; font-size: 11px; letter-spacing: 0.5px; }

  /* ── BOTÃO CONFIRMAR ── */
  .btn-confirmar {
    width: 100%;
    background: var(--green);
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-confirmar:disabled {
    background: rgba(255,255,255,0.10);
    color: var(--text-dim);
    cursor: default;
  }
  .btn-confirmar:not(:disabled):hover { background: var(--green-dark); }
  .btn-confirmar:not(:disabled):active { transform: scale(0.98); }

  /* ── TELA CONFIRMADO ── */
  .tela-confirmado { display: none; }
  .confirmado-header {
    background: rgba(20,168,90,0.12);
    border: 1px solid rgba(20,168,90,0.3);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
  }
  .confirmado-icon {
    width: 60px; height: 60px;
    background: var(--green);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
  }
  .confirmado-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
  }
  .confirmado-sub {
    font-size: 13px;
    color: var(--text-dim);
  }

  /* ── STATS ── */
  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
  }
  .stat-label { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
  .stat-value { font-size: 26px; font-weight: 700; color: var(--white); font-family: 'JetBrains Mono', monospace; }
  .stat-value.lider { font-size: 16px; color: var(--gold); }

  /* ── RESULTADOS ── */
  .resultados-titulo {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 14px;
  }
  .res-item { margin-bottom: 14px; }
  .res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }
  .res-nome {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .res-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
  .res-pct {
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
  }
  .barra-bg {
    height: 7px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
  }
  .barra {
    height: 7px;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  }
  .lider-tag {
    background: rgba(240,165,0,0.18);
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(240,165,0,0.3);
    margin-left: 4px;
  }
  .divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
  }

  /* ── BOTÃO NOVO VOTO ── */
  .btn-novo {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-mid);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 14px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
  }
  .btn-novo:hover { background: rgba(255,255,255,0.06); color: var(--white); border-color: rgba(255,255,255,0.25); }

  /* ── FOOTER ── */
  .rodape {
    margin-top: 28px;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.5px;
  }

  /* ── ANIMAÇÃO ── */
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .fade-in { animation: fadeIn 0.3s ease forwards; }

  @media (min-width: 480px) {
    .container { padding: 24px 20px; }
    .top-title { font-size: 24px; }
  }
  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }

button.candidato-card, button.branco-card { width: 100%; color: inherit; font-family: inherit; text-align: left; }
.cand-body { display: flex; flex-direction: column; }
.cand-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cand-check { color: #fff; }
.alerta { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.alerta-error { background: rgba(217,59,59,.16); border: 1px solid rgba(217,59,59,.4); color: #ffb4b4; }
.alerta-warning { background: rgba(240,165,0,.12); border: 1px solid rgba(240,165,0,.35); color: var(--gold-light); }
.matematica { margin-top: 20px; padding: 12px; border-radius: var(--radius-sm); background: rgba(77,184,255,.08); color: #9bd7ff; font-size: 12px; text-align: center; }
