/* ============================================================
   Tela pública do sorteio — /sorteio
   Visual impactante para TV, telão, computador ou celular.
   Identidade: fundo preto, branco, cinza escuro, detalhes dourados.
   ============================================================ */

:root {
  --bg: #060606;
  --surface: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.1);
  --gold: #fd8f05;
  --text: #ffffff;
  --text-muted: #a9a9a9;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(253, 143, 5, 0.16), transparent),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(253, 143, 5, 0.1), transparent),
    linear-gradient(160deg, #000 0%, #141414 55%, #000 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 32px 24px 48px;
}

/* Ranking: conteúdo mais afastado do topo, para não ficar "colado" em cima */
body.ranking-page {
  padding-top: clamp(70px, 13vh, 150px);
}
body.ranking-page .public-header { margin-bottom: 40px; }

.public-header { text-align: center; margin-bottom: 28px; }
.public-logo { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 10px; object-fit: cover; }
.public-header h1 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
}
.public-brinde {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
}
.public-brinde strong { color: var(--gold); font-weight: 600; }

.public-stage {
  flex: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 40vh;
}

[hidden] { display: none !important; }

/* --- Estado: aguardando --- */
.waiting-box { text-align: center; }
.waiting-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold);
  margin: 0 auto 18px;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.waiting-text { color: var(--text-muted); font-size: 1.2rem; }

/* --- Nome em destaque (girando ou revelado) --- */
.name-display {
  width: 100%;
  text-align: center;
  padding: 0 16px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A área do resultado ocupa a largura toda do palco.
   Sem isto ela encolhia junto com o texto: o nome diminuía, a caixa
   diminuía junto, e no ajuste seguinte o nome diminuía de novo. */
#estado-resultado {
  width: 100%;
}

/* As duas telas sem altura própria acompanham a altura da roleta, para o
   palco medir sempre o mesmo e nada mudar de lugar ao trocar de estado.
   A roleta fica de fora: ela já tem altura fixa e o cálculo da parada
   depende do conteúdo começar no topo da janela. */
#estado-aguardando,
#estado-resultado {
  min-height: var(--altura-palco);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Nome do ganhador: sempre em UMA linha. O JS diminui a letra quando o
   nome é longo — deixar quebrar jogava a última letra para a linha de baixo. */
.name-text {
  display: block;
  max-width: 100%;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Roleta: coluna de nomes passando até parar no vencedor --- */
/* ------------------------------------------------------------------
   Altura fixa da área do palco.

   As três telas (aguardando / roleta / resultado) ocupam a MESMA altura.
   Sem isso, o palco — que é um flex column centralizado — encolhia ao
   trocar de estado, e a logo do patrocinador (primeiro item da coluna)
   mudava de lugar: com o histórico cheio ela ficava numa altura, e depois
   de resetar (todos os sorteios voltam para "aguardando") subia ~245px.
   ------------------------------------------------------------------ */
:root { --altura-palco: 258px; }

.reel-viewport {
  position: relative;
  width: 100%;
  height: var(--altura-palco);   /* 3 linhas de 86px (item da roleta) */
  overflow: hidden;
  /* Nomes vão sumindo nas bordas, para o foco ficar no centro */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
}

.reel {
  will-change: transform;
}

.reel-item {
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 16px;
  overflow: hidden;
}

/* Nome escolhido pela pessoa: é o que fica em destaque */
.reel-nome {
  max-width: 100%;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: clamp(1.35rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* @ do Instagram: logo abaixo do nome, menor */
.reel-usuario {
  max-width: 100%;
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(253, 143, 5, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Faixa que marca o centro, onde o nome sorteado vai parar */
.reel-marker {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 86px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(253, 143, 5, 0.35);
  border-bottom: 1px solid rgba(253, 143, 5, 0.35);
  background: rgba(253, 143, 5, 0.07);
  pointer-events: none;
}

/* Vencedor: nome grande em cima, @ do Instagram embaixo */
.winner-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.winner-usuario {
  display: block;
  max-width: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(0.95rem, 2.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: winnerPop 0.6s cubic-bezier(0.22, 1.4, 0.36, 1) 0.1s backwards;
}

.name-text.winner {
  background: linear-gradient(90deg, var(--gold), #ffe1ab, #fff, #ffe1ab, var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 2.6s linear infinite, winnerPop 0.6s cubic-bezier(0.22, 1.4, 0.36, 1);
  filter: drop-shadow(0 0 26px rgba(253, 143, 5, 0.45));
}

@keyframes shine { to { background-position: 200% center; } }
@keyframes winnerPop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.stage-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Lista de ganhadores (quando > 1) --- */
.winners-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.winner-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 20px;
  animation: winnerPop 0.5s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.winner-row .place {
  font-weight: 800;
  color: var(--gold);
  min-width: 36px;
}
.winner-row-texto {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}
.winner-row .name {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.winner-row-usuario {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gold);
  opacity: 0.8;
}

/* --- Logo do patrocinador: fica ACIMA do nome, indicando qual é o sorteio.
       Gira em flip (rotação no eixo Y) de tempos em tempos. --- */
/* Sem patrocinador: some da vista mas continua ocupando o espaço, para o
   resto do palco não subir. (display:none / atributo hidden fariam o
   layout inteiro se deslocar.) */
.sponsor-logo-big.sem-logo {
  visibility: hidden;
  animation: none;
}

.sponsor-logo-big {
  width: 100%;
  max-width: 260px;
  height: 110px;
  border-radius: 20px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 24px;
  animation: sponsor-flip 7s ease-in-out infinite;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

@keyframes sponsor-flip {
  /* Gira uma volta completa e depois fica parado, para dar tempo de ler */
  0%   { transform: perspective(700px) rotateY(0deg); }
  30%  { transform: perspective(700px) rotateY(360deg); }
  100% { transform: perspective(700px) rotateY(360deg); }
}
.sponsor-line { font-size: 1.05rem; color: var(--text-muted); text-align: center; }
.sponsor-line strong { color: var(--gold); font-weight: 700; }

/* --- Barra fixa inferior com a logo do patrocinador (sempre visível) --- */
/* --- Controles do apresentador (botões na própria tela do sorteio) --- */
/* Altura estável para a faixa de botões.

   Durante o giro TODOS os botões ficam escondidos. Sem uma altura mínima, a
   faixa encolhia para zero, o palco (que ocupa o espaço restante) crescia e
   o conteúdo centralizado — logo do patrocinador inclusive — descia alguns
   pixels no meio da animação. */
.host-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  min-height: var(--altura-controles);
}

:root { --altura-controles: 104px; }

@media (max-width: 640px) {
  :root { --altura-controles: 92px; }
}

.btn-sortear,
.btn-resortear,
.btn-proximo {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Botão principal da live: é o que o apresentador procura na tela,
   então é grande e fica "respirando" para chamar atenção. */
.btn-sortear {
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 22px 80px;
  color: #101010;
  background: linear-gradient(180deg, #ffc76b, var(--gold));
  border: none;
  box-shadow: 0 14px 44px -10px rgba(253, 143, 5, 0.75);
  animation: respirarSortear 2.6s ease-in-out infinite;
}

@keyframes respirarSortear {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 14px 44px -10px rgba(253, 143, 5, 0.75), 0 0 0 0 rgba(253, 143, 5, 0.45);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 18px 54px -10px rgba(253, 143, 5, 0.9), 0 0 0 18px rgba(253, 143, 5, 0);
  }
}

.btn-sortear:hover:not(:disabled) {
  animation: none;                       /* para de pulsar quando está na mira */
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 20px 56px -10px rgba(253, 143, 5, 0.95);
}

/* Respeita quem pediu menos animação no sistema */
@media (prefers-reduced-motion: reduce) {
  .btn-sortear { animation: none; }
}

.btn-proximo {
  font-size: 0.95rem;
  padding: 11px 26px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-proximo:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-sortear:disabled,
.btn-proximo:disabled { opacity: 0.4; cursor: default; }

.host-aviso {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Atalho do administrador para voltar à tela do sorteio --- */
.voltar-sorteio {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.9);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.voltar-sorteio:hover {
  color: var(--gold);
  border-color: var(--gold);
}

@media (max-width: 900px) {
  .voltar-sorteio {
    position: static;
    margin: 0 auto 20px;
  }
  body.ranking-page { padding-top: 28px; }
}

/* --- Painel lateral: ranking sendo montado durante a live --- */
.ranking-live {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 50;
  width: 235px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.ranking-live-conteudo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.2s ease;
}

/* Recolhido: o painel sai pela esquerda e só o botão continua na tela */
.ranking-live.recolhido {
  transform: translateX(-100%);
}

.ranking-live.recolhido .ranking-live-conteudo {
  opacity: 0;
  pointer-events: none;
}

.ranking-live-toggle {
  position: absolute;
  top: 14px;
  right: -15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #1c1c1c;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ranking-live-toggle:hover {
  background: rgba(253, 143, 5, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

.ranking-live-titulo {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.ranking-live-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-live-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-live-item img {
  width: 46px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 7px;
  background: #161616;
  border: 1px solid var(--border);
  padding: 4px;
}

.ranking-live-destaque {
  width: 46px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border-radius: 7px;
  border: 1px solid rgba(253, 143, 5, 0.45);
}

.ranking-live-item > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ranking-live-sorteio {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ranking-live-nome {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-live-usuario {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-live-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  padding: 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ranking-live-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* Em telas estreitas o painel fica no fluxo, acima do conteúdo.
   Aqui recolher apenas oculta o conteúdo, sem empurrar para fora da tela. */
@media (max-width: 900px) {
  .ranking-live {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 22px;
  }

  .ranking-live.recolhido {
    transform: none;
    padding-bottom: 10px;
  }

  .ranking-live.recolhido .ranking-live-conteudo {
    display: none;
  }

  .ranking-live-toggle {
    right: 12px;
  }
}

/* --- Confete brilhante (CSS puro) --- */
.confetti-piece {
  position: fixed;
  top: -24px;
  left: var(--x);
  width: var(--w);
  height: var(--h);
  background: linear-gradient(135deg, #fff 0%, var(--c) 35%, var(--c) 65%, #fff 100%);
  background-size: 220% 220%;
  border-radius: 2px;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.55), 0 0 12px rgba(253, 143, 5, 0.35);
  animation: confettiFall var(--t) cubic-bezier(0.25, 0.4, 0.45, 1) var(--delay) forwards,
             confettiShine 0.9s ease-in-out infinite;
}

@keyframes confettiShine {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 100%; }
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translate3d(0, 0, 0) rotateZ(0deg); }
  50%  { transform: translate3d(calc(var(--drift) * 0.7), 50vh, 0) rotateZ(calc(var(--spin) * 0.5)); }
  100% { opacity: 0.85; transform: translate3d(var(--drift), 108vh, 0) rotateZ(var(--spin)); }
}

@media (max-width: 640px) {
  .sponsor-logo-big { max-width: 200px; height: 84px; padding: 12px 18px; }
  :root { --altura-palco: 210px; }
  .reel-item, .reel-marker { height: 70px; }
  .reel-nome { font-size: clamp(1.15rem, 5.4vw, 1.6rem); }
  .reel-usuario { font-size: 0.72rem; }
  .btn-sortear { padding: 18px 54px; letter-spacing: 0.03em; }
}

/* ============================================================
   Ranking dos ganhadores, por mês (/sorteio/ranking.php)
   ============================================================ */

.ranking-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* --- Navegação entre os meses (um mês por vez) --- */
.ranking-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.ranking-nav-titulo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 190px;
}

.ranking-nav-titulo h3 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.ranking-nav-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.ranking-nav-btn:hover:not(:disabled) {
  background: rgba(253, 143, 5, 0.14);
  border-color: var(--gold);
  color: var(--gold);
}

.ranking-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.ranking-mes-atual {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 2px 9px;
}

.ranking-grid {
  /* Flex (em vez de grade fixa) para os cards ficarem sempre centralizados,
     mesmo quando o mês tem menos de 4 sorteios realizados. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  width: 100%;
}

.ranking-card {
  position: relative;
  /* Cresce até 230px e encolhe até 150px: 4 cabem numa linha no desktop
     e 2 por linha no celular — sempre centralizados. */
  flex: 1 1 150px;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px 14px;
  animation: winnerPop 0.5s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.ranking-card.pending { opacity: 0.55; }

/* Fundo escuro e formato largo: as logos dos patrocinadores são brancas,
   com fundo transparente, e a maioria tem formato horizontal. */
.ranking-card .ranking-sponsor-logo {
  width: 100%;
  height: 70px;
  border-radius: 12px;
  object-fit: contain;
  background: #161616;
  border: 1px solid var(--border);
  padding: 10px 14px;
  margin-bottom: 2px;
}

.ranking-card .ranking-sponsor-logo-placeholder {
  width: 100%;
  height: 70px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 2px;
}

/* Destaque em texto (ex.: "100k") no lugar do logo — mesmo dourado com
   brilho do nome do ganhador na roleta (.name-text.winner). */
.ranking-card .ranking-destaque {
  width: 100%;
  height: 70px;
  border-radius: 12px;
  background: #161616;
  border: 1px solid rgba(253, 143, 5, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  overflow: hidden;
}

.ranking-destaque span,
.ranking-live-destaque {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--gold), #ffe1ab, #fff, #ffe1ab, var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 2.6s linear infinite;
  filter: drop-shadow(0 0 14px rgba(253, 143, 5, 0.45));
}

.ranking-destaque span { font-size: 2.2rem; letter-spacing: 0.02em; }

.ranking-card .ranking-sorteio-nome {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Nome e @ do ganhador também em uma linha só (o JS reduz a letra
   quando o @ é comprido, em vez de quebrar a palavra no meio). */
.ranking-card .ranking-winner-name {
  max-width: 100%;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-card .ranking-winner-user {
  max-width: 100%;
  font-size: clamp(0.68rem, 1.1vw, 0.8rem);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-card .ranking-brinde {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.ranking-card .ranking-status-pill {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

/* Celular: cards um pouco menores (o flex já quebra em 2 por linha) */
@media (max-width: 560px) {
  .ranking-grid { gap: 10px; }
  .ranking-card .ranking-sponsor-logo,
  .ranking-card .ranking-sponsor-logo-placeholder,
  .ranking-card .ranking-destaque { height: 58px; }
  .ranking-destaque span { font-size: 1.8rem; }
  .ranking-nav { gap: 10px; }
  .ranking-nav-titulo { min-width: 150px; }
  .ranking-nav-titulo h3 { font-size: 1rem; }
  .ranking-nav-btn { width: 36px; height: 36px; font-size: 1.3rem; }
}

/* --- Atalhos do administrador embaixo do ranking (invisíveis para o público) --- */
.ranking-admin-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
}

.ranking-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #ffb648, var(--gold));
  color: #101010;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ranking-admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(253, 143, 5, 0.32);
}

.ranking-admin-btn.secundario {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.ranking-admin-btn.secundario:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .ranking-admin-acoes { margin-top: 26px; }
  .ranking-admin-btn { padding: 12px 20px; font-size: 0.88rem; }
}

/* --- Refazer o sorteio (ganhador não participou) --- */
.btn-resortear {
  font-size: 0.95rem;
  padding: 11px 26px;
  color: #fdba74;
  background: rgba(253, 143, 5, 0.1);
  border: 1px solid rgba(253, 143, 5, 0.4);
}

.btn-resortear:hover:not(:disabled) {
  transform: translateY(-2px);
  color: #101010;
  background: linear-gradient(180deg, #ffb648, var(--gold));
  border-color: transparent;
}

.btn-resortear:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Atalho do administrador para o painel, no canto da tela do sorteio --- */
.ir-para-painel {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Discreto durante a live; fica nítido ao passar o mouse */
.ir-para-painel:hover {
  opacity: 1;
  color: var(--gold);
  border-color: var(--gold);
}

@media (max-width: 640px) {
  .ir-para-painel { top: 12px; right: 12px; padding: 8px 14px; font-size: 0.75rem; }
}

/* Botão em destaque quando o apresentador chega pelo histórico
   clicando em "Sortear de novo" — pisca até ser usado. */
.btn-resortear.destaque {
  color: #101010;
  background: linear-gradient(180deg, #ffb648, var(--gold));
  border-color: transparent;
  animation: pulsarResortear 1.6s ease-in-out infinite;
}

@keyframes pulsarResortear {
  0%, 100% { box-shadow: 0 0 0 0 rgba(253, 143, 5, 0.55); }
  50%      { box-shadow: 0 0 0 12px rgba(253, 143, 5, 0); }
}
