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

:root {
  --verde: #10b981;
  --verde-escuro: #059669;
  --roxo: #7c3aed;
  --bg: #0f172a;
  --bg-claro: #1e293b;
  --borda: #334155;
  --texto: #e2e8f0;
  --texto-claro: #94a3b8;
  --amarelo: #f59e0b;
}

body {
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--verde); text-decoration: none; }

header.site {
  background: var(--bg-claro);
  border-bottom: 1px solid var(--borda);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

header.site .container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

header.site .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--texto);
  display: flex;
  align-items: center;
  gap: 8px;
}

header.site .logo .icon { font-size: 24px; line-height: 1; }
header.site .logo .icon img {
  width: 28px; height: 28px; border-radius: 8px; object-fit: cover;
  display: block; box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
header.site nav a { margin-left: 16px; color: var(--texto-claro); padding: 6px 12px; border-radius: 8px; }
header.site nav a:hover { color: var(--texto); background: var(--borda); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; width: 100%; flex: 1; }

.card {
  background: var(--bg-claro);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 24px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }

h1.hero { font-size: 32px; line-height: 1.15; margin-bottom: 8px; }
h2 { font-size: 20px; margin-bottom: 12px; }
.sub { color: var(--texto-claro); margin-bottom: 16px; }

.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge-verde { background: #064e3b; color: #a7f3d0; }
.badge-amarelo { background: #78350f; color: #fde68a; }
.badge-roxo { background: #4c1d95; color: #ddd6fe; }
.badge-cinza { background: #334155; color: #cbd5e1; }

.btn {
  display: inline-block; background: var(--verde); color: #04231a;
  font-weight: 700; padding: 12px 24px; border: 0; border-radius: 10px;
  font-size: 16px; cursor: pointer;
}
.btn:hover { background: var(--verde-escuro); color: #fff; }
.btn-roxo { background: var(--roxo); color: #fff; }
.btn-roxo:hover { background: #6d28d9; }
.btn-perigo { background: #dc2626; color: #fff; }
.btn-perigo:hover { background: #b91c1c; }
.btn-menor { padding: 8px 14px; font-size: 14px; }
.btn-cinza { background: #475569; color: #fff; }
.btn-cinza:hover { background: #64748b; }
.btn:disabled { background: var(--borda); color: #64748b; cursor: not-allowed; }

.progresso { background: var(--borda); border-radius: 999px; height: 14px; overflow: hidden; }
.progresso > div { height: 100%; background: linear-gradient(90deg, var(--verde), var(--roxo)); border-radius: 999px; transition: width 0.4s; }

input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--borda);
  color: var(--texto); padding: 12px 14px; border-radius: 10px; font-size: 16px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde); border-color: transparent; }
label { display: block; margin-bottom: 6px; color: var(--texto-claro); font-size: 14px; }

.grade-numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.numero {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 700; cursor: pointer; border: 1px solid #cbd5e1;
  background: #ffffff; color: #0f172a; transition: 0.15s; user-select: none;
}
.numero:hover { border-color: var(--verde); }
.numero.selecionado { background: #fde047; border: 2px solid var(--verde); color: #422006; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35); }
.numero.reservado { background: #fbbf24; border-color: #d97706; color: #451a03; cursor: not-allowed; }
.numero.pago { background: var(--verde); border-color: var(--verde-escuro); color: #04231a; cursor: not-allowed; }

.legenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--texto-claro); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.bolinha { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid #cbd5e1; background: #ffffff; }
.bolinha.selecionada { background: #fde047; border: 2px solid var(--verde); }
.bolinha.reservada { background: #fbbf24; border-color: #d97706; }
.bolinha.paga { background: var(--verde); border-color: var(--verde-escuro); }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--borda); font-size: 14px; }
.tabela th { color: var(--texto-claro); font-size: 12px; text-transform: uppercase; }

.box-pix {
  background: #f8fafc; border: 2px dashed #94a3b8; border-radius: 12px; padding: 16px;
  color: #1e293b; font-family: monospace; font-size: 13px; word-break: break-all;
}

.aviso { background: #3b0764; border: 1px solid #6b21a8; color: #e9d5ff; padding: 14px 18px; border-radius: 12px; font-size: 14px; }
.erro { background: #7f1d1d; border: 1px solid #b91c1c; color: #fecaca; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.sucesso { background: #064e3b; border: 1px solid #059669; color: #a7f3d0; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

.tab { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab a { padding: 8px 16px; border-radius: 999px; background: var(--bg-claro); border: 1px solid var(--borda); color: var(--texto-claro); font-size: 14px; cursor: pointer; }
.tab a.ativo { background: var(--verde); color: #04231a; font-weight: 700; border-color: var(--verde); }

.centralizado { text-align: center; }
.icon-grande { font-size: 56px; }

.premio { background: linear-gradient(135deg, var(--roxo), #4338ca); border-radius: 20px; padding: 36px; margin-bottom: 20px; }
.premio h1 { font-size: 38px; margin-bottom: 6px; }
.premio .sub { color: #c4b5fd; }

.rifa-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.rifa-card { background: var(--bg-claro); border: 1px solid var(--borda); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: 0.15s; }
.rifa-card:hover { border-color: var(--verde); transform: translateY(-2px); }
.rifa-card .corpo { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.rifa-imagem { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--borda); }

.rifa-foto-box { clear: both; margin-bottom: 20px; border: 1px solid var(--borda); border-radius: 20px; overflow: hidden; }
.rifa-foto { display: block; width: 100%; height: clamp(180px, 30vw, 380px); object-fit: cover; object-position: center; }

.voltar { display: inline-block; margin-bottom: 14px; color: var(--texto-claro); font-size: 14px; }

.rodape { text-align: center; color: var(--texto-claro); font-size: 13px; padding: 20px; border-top: 1px solid var(--borda); }
.rodape-logo { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.rodape-logo img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; border: 1px solid var(--borda); z-index: 50;
  display: none; max-width: 90vw;
}
#toast.erro { border-color: #b91c1c; }

.spinner { width: 40px; height: 40px; border: 4px solid var(--borda); border-top-color: var(--verde); border-radius: 50%; margin: 40px auto; animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Modal do sorteio */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 25, 0.85);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 999;
  padding: 16px;
}
.modal {
  background: var(--bg-claro);
  border: 1px solid var(--roxo);
  border-radius: 18px;
  max-width: 460px;
  width: 100%;
  padding: 34px 26px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: subir 0.25s ease;
  margin: auto 0;
}
@media (max-height: 640px) {
  .modal { margin: 8px auto; }
}
@keyframes subir {
  from { transform: translateY(14px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes girarDado {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.vencedor-num {
  font-size: 110px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 10px;
  background: linear-gradient(135deg, #34d399, #a78bfa, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  header.site nav a { margin-left: 8px; padding: 4px 8px; font-size: 14px; }
  .premio h1 { font-size: 28px; }
  .tabela { display: block; overflow-x: auto; }
  /* Header no celular: nunca estoura a tela — o logo encolhe e os botões
     quebram para a linha de baixo (antes ficavam 550px numa tela de 375px). */
  header.site { padding: 10px 12px; }
  header.site .container { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
  header.site .container > div { flex-wrap: wrap; justify-content: center; }
  header.site .logo { font-size: 16px; }
  header.site .logo .icon img { width: 24px; height: 24px; }
  header.site .btn.btn-menor { font-size: 13px; padding: 6px 10px; margin: 0; }
  /* Card roxo da rifa: menos padding e título menor — em 375px o título
     de 28px com padding 36px quebrava em 8 linhas e "fugia" do card. */
  .premio { padding: 18px; }
  .premio h1 { font-size: 22px; }
  h1.hero { font-size: 26px; }
}

/* ---------- Entrar com Google ---------- */
.btn-google {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-google:hover { background: #f3f4f6; color: #1f2937; }
.divisor-ou {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--texto-claro);
  font-size: 13px;
}
.divisor-ou::before,
.divisor-ou::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.14); }

/* ===== Painéis (dono e organizador): topo, stats e ações dos cards ===== */
.painel-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.painel-topo h2 { font-size: 1.1rem; line-height: 1.3; }
.painel-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.painel-stats span { display: block; font-size: 11px; letter-spacing: 0.05em; color: var(--texto-claro); }
.painel-stats strong { font-size: 19px; }
.painel-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }

/* ===== Gráfico de barras do painel de períodos (7/15/30 dias e por mês) ===== */
.grafico { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding-top: 8px; }
.gcol { flex: 1 0 22px; min-width: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gbarras { display: flex; gap: 2px; align-items: flex-end; height: 120px; width: 100%; justify-content: center; }
.gfat, .gvis { width: 100%; max-width: 26px; border-radius: 3px 3px 0 0; min-height: 2px; }
.gfat { background: var(--verde); }
.gvis { background: #2f6bff; }
.gcol span { font-size: 10px; color: var(--texto-claro); white-space: nowrap; }

/* ============================================================
   SORTEADOR — cena animada (APENAS VISUAL, adição pura)
   Não altera nenhuma regra existente: .modal, .modal-overlay,
   .vencedor-num e @keyframes girarDado continuam intactos.
   ============================================================ */
.sorteio-fundo { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sorteio-fundo::before,
.sorteio-fundo::after {
  content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  filter: blur(64px); opacity: 0.55; animation: sorteioOrbe 6s ease-in-out infinite alternate;
}
.sorteio-fundo::before { background: #7c3aed; top: -90px; left: -80px; }
.sorteio-fundo::after { background: #34d399; bottom: -100px; right: -80px; animation-delay: -3s; }
@keyframes sorteioOrbe {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(26px, 20px) scale(1.18); }
}

.sorteio-conteudo { position: relative; z-index: 1; }
.sorteio-icone { filter: drop-shadow(0 0 14px rgba(167, 139, 250, 0.5)); }
@keyframes sorteioVenceu {
  0% { transform: scale(0.4) rotate(-25deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.sorteio-titulo { letter-spacing: 1px; font-weight: 700; }
.sorteio-titulo .ponto { display: inline-block; animation: sorteioPisca 1.1s infinite; opacity: 0.3; }
.sorteio-titulo .p1 { animation-delay: 0s; }
.sorteio-titulo .p2 { animation-delay: 0.2s; }
.sorteio-titulo .p3 { animation-delay: 0.4s; }
@keyframes sorteioPisca {
  0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}

.slot {
  position: relative; z-index: 1; overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 16px; padding: 20px 14px; margin: 10px 0 14px;
  box-shadow: inset 0 0 34px rgba(124, 58, 237, 0.22);
}
.slot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.14) 50%, transparent 68%);
  transform: translateX(-130%);
  animation: sorteioBrilho 1.7s linear infinite;
}
@keyframes sorteioBrilho { to { transform: translateX(130%); } }
.slot.venceu::after { animation: none; opacity: 0; }
.slot.venceu { animation: sorteioSlotVenceu 0.75s ease both; }
@keyframes sorteioSlotVenceu {
  0% { box-shadow: inset 0 0 34px rgba(124, 58, 237, 0.22), 0 0 0 rgba(52, 211, 153, 0); }
  40% { box-shadow: inset 0 0 44px rgba(167, 139, 250, 0.5), 0 0 46px rgba(52, 211, 153, 0.75); }
  100% { box-shadow: inset 0 0 34px rgba(124, 58, 237, 0.22), 0 0 18px rgba(52, 211, 153, 0.35); }
}

.slot-numero {
  font-size: 104px; font-weight: 800; line-height: 1.1; min-height: 1.1em;
  background: linear-gradient(135deg, #34d399, #a78bfa, #fbbf24);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 20px rgba(52, 211, 153, 0.35));
  word-break: break-word;
}
.slot-numero.multiplo {
  font-size: clamp(26px, 7vw, 44px);
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
}
.slot-numero.venceu { animation: sorteioEstouro 0.55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes sorteioEstouro {
  0% { transform: scale(0.35); opacity: 0; filter: blur(8px); }
  100% {
    transform: scale(1); opacity: 1;
    filter: blur(0) drop-shadow(0 6px 20px rgba(52, 211, 153, 0.35));
  }
}

.ganhador-chip {
  display: inline-block; padding: 8px 22px; border-radius: 999px;
  font-size: 46px; font-weight: 800; line-height: 1.2; color: #fff;
  background: linear-gradient(135deg, #34d399, #7c3aed);
  box-shadow: 0 10px 26px rgba(52, 211, 153, 0.4);
}
.ganhador-chip.chip-entra { animation: sorteioEstouro 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
.slot-numero.multiplo .ganhador-chip { font-size: clamp(20px, 4.6vw, 30px); padding: 7px 15px; }

.sorteio-progresso {
  position: relative; z-index: 1; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden;
}
.sorteio-progresso-barra {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #a78bfa, #fbbf24);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.85);
  transition: width 0.12s linear;
}

.sorteio-dica {
  position: relative; z-index: 1; margin: 12px 0 0; font-size: 13px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--texto-claro); opacity: 0.75;
}

.sorteio-confete { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.confete {
  position: absolute; top: -18px; width: 9px; height: 15px; border-radius: 2px;
  pointer-events: none; animation-name: sorteioCai; animation-timing-function: linear; animation-fill-mode: both;
}
@keyframes sorteioCai {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(620px) rotate(var(--giro, 540deg)); opacity: 0.9; }
}