/* Identidade: fundo lilás-acinzentado claro, faixas da bandeira trans,
   fotos em formato orgânico e tipografia arredondada em azul e rosa. */
:root {
  /* bandeira */
  --azul: #45cdf7;
  --rosa: #f7a8bd;
  --branco: #ffffff;

  /* tipografia de destaque (títulos grandes) */
  --azul-titulo: #45c6f2;
  --rosa-titulo: #f59fd6;
  /* versões mais fortes para números e textos menores (contraste) */
  --azul-forte: #0a95cc;
  --rosa-forte: #d8549a;

  --fundo: #f4f2f6;
  --superficie: #ffffff;
  --texto: #2b2730;
  --texto-suave: #6a6470;
  --borda: #ebe6ee;
  --trilho: #efeaf2;
  --barra: linear-gradient(90deg, var(--azul), var(--rosa));
  --sombra: 0 1px 2px rgb(40 20 60 / 5%), 0 8px 24px rgb(40 20 60 / 6%);
  --sombra-foto: 0 10px 24px rgb(40 20 60 / 18%), inset 0 0 0 1px rgb(255 255 255 / 30%);
  --listras: linear-gradient(180deg,
    var(--azul) 0 20%, var(--rosa) 20% 40%, var(--branco) 40% 60%,
    var(--rosa) 60% 80%, var(--azul) 80% 100%);

  /* formas orgânicas */
  --blob-1: 58% 42% 46% 54% / 46% 40% 60% 54%;
  --blob-2: 46% 54% 40% 60% / 56% 44% 56% 44%;
  --blob-3: 62% 38% 54% 46% / 42% 56% 44% 58%;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --branco: #f1eef4;
    --azul-forte: #6fd6fa;
    --rosa-forte: #f7a8cf;
    --fundo: #17141c;
    --superficie: #221e28;
    --texto: #f3eff6;
    --texto-suave: #aaa2b3;
    --borda: #312c39;
    --trilho: #2d2834;
    --sombra: none;
    --sombra-foto: 0 10px 24px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --branco: #f1eef4;
  --azul-forte: #6fd6fa;
  --rosa-forte: #f7a8cf;
  --fundo: #17141c;
  --superficie: #221e28;
  --texto: #f3eff6;
  --texto-suave: #aaa2b3;
  --borda: #312c39;
  --trilho: #2d2834;
  --sombra: none;
  --sombra-foto: 0 10px 24px rgb(0 0 0 / 45%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 500 16px/1.45 "Quicksand", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------- topo ---------- */

.topo, .conteudo {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.topo {
  padding-top: 44px;
  padding-bottom: 8px;
  text-align: center;
}

.sobretitulo {
  margin: 0 0 6px;
  font-size: clamp(17px, 3.6vw, 22px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--texto-suave);
}
.sobretitulo::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--rosa-forte);
  vertical-align: 2px;
  animation: pulso 2s ease-in-out infinite;
}
@keyframes pulso { 50% { opacity: .3; } }

h1 {
  margin: 0;
  font-size: clamp(44px, 11vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
}
h1 .t1 { color: var(--azul-titulo); }
h1 .t2 { color: var(--rosa-titulo); }

/* ---------- pódio (faixas + fotos orgânicas) ---------- */

.podio {
  --foto-lider: 176px;
  --foto: 128px;
  position: relative;
  margin: 28px 0 8px;
  padding: 0 16px;
}

.podio-faixa {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--foto-lider) * .12);
  height: calc(var(--foto-lider) * .76);
  display: flex;
  flex-direction: column;
}
.podio-faixa span { flex: 1; }
.podio-faixa span:nth-child(1), .podio-faixa span:nth-child(5) { background: var(--azul); }
.podio-faixa span:nth-child(2), .podio-faixa span:nth-child(4) { background: var(--rosa); }
.podio-faixa span:nth-child(3) { background: var(--branco); }

.podio-lista {
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  align-items: start;
}
.podio-lista:empty { min-height: var(--foto-lider); }

.destaque {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
/* ordem visual 2º · 1º · 3º */
.destaque:nth-child(1) { order: 2; }
.destaque:nth-child(2) { order: 1; }
.destaque:nth-child(3) { order: 3; }

.destaque-foto {
  height: var(--foto-lider);
  display: grid;
  place-items: center;
}
.destaque .foto {
  display: block;
  width: var(--foto);
  height: var(--foto);
  object-fit: cover;
  background: var(--trilho);
  border-radius: var(--blob-2);
  box-shadow: var(--sombra-foto);
  transition: border-radius .6s ease;
}
.destaque:nth-child(1) .foto {
  width: var(--foto-lider);
  height: var(--foto-lider);
  border-radius: var(--blob-1);
}
.destaque:nth-child(3) .foto { border-radius: var(--blob-3); }
.destaque-foto:hover .foto { border-radius: var(--blob-1); }
.destaque:nth-child(1) .destaque-foto:hover .foto { border-radius: var(--blob-3); }

.destaque-posicao {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--texto-suave);
}
.destaque:nth-child(1) .destaque-posicao { color: var(--rosa-forte); }

.destaque-nome {
  max-width: 100%;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--azul-forte);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.destaque-nome:hover { text-decoration: underline; }
.destaque:nth-child(1) .destaque-nome { font-size: 23px; }

.destaque-curtidas {
  margin-top: 2px;
  font-size: 14px;
  color: var(--texto-suave);
}
.destaque-curtidas strong {
  display: block;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--rosa-forte);
}
.destaque:nth-child(1) .destaque-curtidas strong { font-size: 40px; }

.destaque-perfil {
  margin-top: 4px;
  max-width: 100%;
  font-size: 13px;
  color: var(--texto-suave);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.destaque-perfil:hover { text-decoration: underline; }

/* link para a página do candidato (pódio e lista) */
.ver-sobre {
  font-weight: 700;
  color: var(--azul-forte);
  text-decoration: none;
  white-space: nowrap;
}
.ver-sobre:hover { text-decoration: underline; }
.ver-sobre[hidden] { display: none; }
.destaque .ver-sobre { margin-top: 6px; font-size: 13px; }
.detalhe .ver-sobre { margin-left: auto; }

/* ---------- chamada + resumo ---------- */

.conteudo { text-align: center; }
.conteudo > main, .conteudo > .rodape, .conteudo > .resumo { text-align: left; }

.perfil-oficial {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--superficie);
  box-shadow: var(--sombra);
  font-size: 15px;
  text-align: left;
  text-decoration: none;
}
.perfil-oficial svg { flex: none; color: var(--rosa-forte); }
.perfil-oficial strong { color: var(--azul-forte); font-weight: 700; }
.perfil-oficial:hover { box-shadow: var(--sombra), 0 0 0 2px var(--rosa); }

.resumo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.resumo div {
  padding: 14px 16px;
  background: var(--superficie);
  border-radius: 22px;
  box-shadow: var(--sombra);
  text-align: center;
  min-width: 0;
}
.resumo dt { font-size: 13px; color: var(--texto-suave); }
.resumo dd {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resumo div:nth-child(1) dd { color: var(--azul-forte); }
.resumo div:nth-child(2) dd { color: var(--rosa-forte); }

/* ---------- lista ---------- */

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.candidato {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 18px 14px 14px;
  background: var(--superficie);
  border-radius: 24px;
  box-shadow: var(--sombra);
}

/* foto orgânica sobre as listras da bandeira */
.avatar {
  position: relative;
  flex: none;
  width: 64px; height: 64px;
  display: grid;
  place-items: center;
}
.avatar::before {
  content: "";
  position: absolute;
  left: -4px; right: -4px;
  top: 12px; bottom: 12px;
  border-radius: 6px;
  background: var(--listras);
}
.avatar .foto {
  position: relative;
  display: block;
  width: 56px; height: 56px;
  object-fit: cover;
  background: var(--trilho);
  border-radius: var(--blob-1);
  box-shadow: 0 4px 10px rgb(40 20 60 / 18%);
}
.candidato:nth-child(3n+2) .avatar .foto { border-radius: var(--blob-2); }
.candidato:nth-child(3n) .avatar .foto { border-radius: var(--blob-3); }

.info { flex: 1; min-width: 0; }

.linha {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.posicao {
  flex: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--rosa-forte);
}

.nome {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nome:hover { text-decoration: underline; }

.curtidas { flex: none; color: var(--texto-suave); font-size: 14px; }
.curtidas strong { color: var(--rosa-forte); font-size: 22px; font-weight: 700; }

.barra {
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--trilho);
  overflow: hidden;
}
.barra span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--barra);
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}

.detalhe {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--texto-suave);
}
a.perfil { text-decoration: none; }
a.perfil:hover { text-decoration: underline; }

.erro {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--trilho);
  color: var(--texto-suave);
}

.ver-todos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--barra);
  color: #2b2730;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sombra);
  transition: transform .2s;
}
.ver-todos:hover { transform: translateY(-2px); }
.ver-todos:focus-visible { outline: 3px solid var(--azul-forte); outline-offset: 3px; }

.rodape {
  margin-top: 36px;
  padding-top: 20px;
  padding-bottom: 44px;
  border-top: 1px solid var(--borda);
  font-size: 13px;
  color: var(--texto-suave);
}
.rodape p { margin: 0 0 8px; }
.rodape strong { color: var(--texto); }

@media (max-width: 560px) {
  .topo { padding-top: 32px; }
  .podio { --foto-lider: 120px; --foto: 88px; padding: 0 10px; }
  .podio-lista { gap: 6px; }
  .destaque-nome { font-size: 15px; }
  .destaque:nth-child(1) .destaque-nome { font-size: 17px; }
  .destaque-curtidas { font-size: 12px; }
  .destaque-curtidas strong { font-size: 24px; }
  .destaque:nth-child(1) .destaque-curtidas strong { font-size: 30px; }
  .destaque-perfil { font-size: 12px; }
  .perfil-oficial { font-size: 14px; padding: 10px 16px; }
  .resumo { grid-template-columns: 1fr 1fr; gap: 10px; }
  .resumo div:last-child { grid-column: 1 / -1; }
  .candidato { gap: 12px; padding: 12px 14px 12px 12px; border-radius: 20px; }
  .avatar { width: 56px; height: 56px; }
  .avatar .foto { width: 50px; height: 50px; }
  .nome { font-size: 16px; }
  .curtidas strong { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .barra span, .destaque .foto { transition: none; }
  .sobretitulo::before { animation: none; }
}
