:root {
  --preto: #0a0a0a;
  --preto-2: #141414;
  --preto-3: #1e1e1e;
  --amarelo: #FFD60A;
  --amarelo-2: #FFC300;
  --amarelo-escuro: #B38F00;
  --texto: #F5F1E1;
  --texto-2: #B9B39C;
  --raio: 18px;
  --fonte-titulo: 'Creepster', 'Impact', cursive;
  --fonte: 'Outfit', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, #1d1a0b 0%, var(--preto) 55%) fixed, var(--preto);
  color: var(--texto);
  font-family: var(--fonte);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ================= Cenário ================= */
.cena { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.estrelas {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 8%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 30%, #ffe 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 40%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 62%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 75%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 90%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 85%, #fff7 50%, transparent 51%);
  animation: piscar 4s ease-in-out infinite alternate;
}
@keyframes piscar { from { opacity: .4; } to { opacity: 1; } }

.lua {
  position: absolute; top: 40px; right: -40px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #FFF6B8 0%, var(--amarelo) 45%, #E0A800 100%);
  box-shadow: 0 0 60px 10px #ffd60a55, 0 0 160px 40px #ffd60a22;
  animation: lua 8s ease-in-out infinite alternate;
}
.lua::before, .lua::after {
  content: ''; position: absolute; border-radius: 50%; background: #d9a80033;
}
.lua::before { width: 34px; height: 34px; top: 40px; left: 50px; }
.lua::after { width: 22px; height: 22px; top: 110px; left: 100px; }
@keyframes lua { to { transform: translateY(12px); box-shadow: 0 0 80px 18px #ffd60a66, 0 0 200px 60px #ffd60a2a; } }

.relampago { position: absolute; inset: 0; background: #fff7d0; opacity: 0; animation: relampago 11s infinite; mix-blend-mode: overlay; }
@keyframes relampago {
  0%, 92%, 100% { opacity: 0; }
  93% { opacity: .55; } 94% { opacity: .05; } 95% { opacity: .4; } 97% { opacity: 0; }
}

.nevoa {
  position: absolute; left: -50%; width: 200%; height: 220px; bottom: -40px;
  background:
    radial-gradient(40% 60% at 20% 60%, #ffffff14, transparent 70%),
    radial-gradient(35% 50% at 55% 50%, #ffffff10, transparent 70%),
    radial-gradient(40% 60% at 85% 65%, #ffffff12, transparent 70%);
  filter: blur(8px);
  animation: nevoa 26s linear infinite;
}
.nevoa-2 { bottom: 30%; opacity: .5; animation-duration: 40s; animation-direction: reverse; }
@keyframes nevoa { from { transform: translateX(0); } to { transform: translateX(25%); } }

.morcego { position: absolute; width: 54px; filter: drop-shadow(0 0 6px #ffd60a66); }
.morcego .asa, .morcego use { transform-origin: 50% 40%; animation: bater .25s ease-in-out infinite alternate; }
@keyframes bater { to { transform: scaleY(.45); } }
.m1 { top: 12%; animation: voo1 14s linear infinite; }
.m2 { top: 26%; width: 36px; animation: voo2 18s linear infinite 3s; }
.m3 { top: 6%; width: 28px; animation: voo1 22s linear infinite 7s; }
.m4 { top: 48%; width: 42px; animation: voo2 16s linear infinite 10s; }
@keyframes voo1 {
  0% { transform: translate(-80px, 0) rotate(-6deg); }
  25% { transform: translate(25vw, 40px) rotate(4deg); }
  50% { transform: translate(55vw, -10px) rotate(-4deg); }
  75% { transform: translate(80vw, 30px) rotate(6deg); }
  100% { transform: translate(calc(100vw + 80px), -20px) rotate(0); }
}
@keyframes voo2 {
  0% { transform: translate(calc(100vw + 80px), 0) scaleX(-1); }
  30% { transform: translate(65vw, -40px) scaleX(-1); }
  60% { transform: translate(35vw, 20px) scaleX(-1); }
  100% { transform: translate(-100px, -30px) scaleX(-1); }
}

.fantasma { position: absolute; width: 70px; opacity: .0; filter: drop-shadow(0 0 18px #ffffff66); }
.f1 { left: 6%; top: 55%; animation: fantasma 12s ease-in-out infinite; }
.f2 { right: 8%; top: 30%; width: 50px; animation: fantasma 15s ease-in-out infinite 6s; }
@keyframes fantasma {
  0%, 100% { opacity: 0; transform: translate(0, 20px) scale(.9); }
  15% { opacity: .55; }
  50% { opacity: .75; transform: translate(30px, -40px) scale(1) rotate(-6deg); }
  85% { opacity: .4; }
}

.aranha { position: absolute; top: 0; left: 14%; display: flex; flex-direction: column; align-items: center; animation: aranha 9s ease-in-out infinite; transform-origin: top center; }
.aranha .fio { width: 1px; height: 120px; background: linear-gradient(#ffffff00, #ffffffaa); }
.aranha svg { width: 38px; margin-top: -6px; filter: drop-shadow(0 0 6px #ffd60a99); }
@keyframes aranha {
  0%, 100% { transform: translateY(-110px); }
  40% { transform: translateY(0) rotate(4deg); }
  55% { transform: translateY(-20px) rotate(-4deg); }
  70% { transform: translateY(10px) rotate(2deg); }
}

.olhos { position: absolute; display: flex; gap: 10px; }
.olhos i { width: 10px; height: 6px; border-radius: 50% 50% 40% 40%; background: var(--amarelo); box-shadow: 0 0 10px var(--amarelo); animation: piscada 5s infinite; }
.o1 { bottom: 14%; left: 8%; }
.o2 { bottom: 38%; right: 6%; animation: some 9s infinite 2s; }
.o2 i { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; animation-delay: 1.3s; }
.o3 { top: 70%; left: 46%; gap: 6px; animation: some 13s infinite 5s; }
.o3 i { width: 7px; height: 4px; animation-delay: 2.6s; }
@keyframes piscada { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.05); } }
@keyframes some { 0%, 100% { opacity: 0; } 20%, 70% { opacity: 1; } }

/* ================= Layout ================= */
.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 16px calc(120px + env(safe-area-inset-bottom)); }

.topo { text-align: center; padding: 48px 0 12px; position: relative; }
.selo {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--preto); background: var(--amarelo); padding: 6px 12px; border-radius: 999px;
  animation: entrar .8s cubic-bezier(.2,.9,.3,1.4) both;
}
.titulo {
  font-family: var(--fonte-titulo); font-weight: 400;
  font-size: clamp(56px, 17vw, 92px); line-height: .95; margin: 18px 0 10px;
  color: var(--amarelo);
  text-shadow: 0 0 18px #ffd60a88, 0 4px 0 #6b5200, 0 10px 30px #000;
  position: relative;
  animation: entrar 1s .15s cubic-bezier(.2,.9,.3,1.3) both, tremer 6s 1.5s infinite;
}
.titulo::after { /* gotas escorrendo */
  content: ''; position: absolute; left: 22%; bottom: -14px; width: 6px; height: 0; border-radius: 0 0 6px 6px;
  background: var(--amarelo); box-shadow: 120px 0 0 var(--amarelo), 210px 0 0 var(--amarelo);
  animation: escorrer 4s 1.2s ease-in infinite;
}
@keyframes escorrer { 0% { height: 0; opacity: 1; } 70% { height: 22px; opacity: 1; } 100% { height: 30px; opacity: 0; } }
@keyframes tremer {
  0%, 90%, 100% { transform: none; opacity: 1; }
  91% { transform: translate(-2px, 1px) skewX(-4deg); opacity: .6; }
  92% { transform: translate(2px, -1px); opacity: 1; }
  93% { opacity: .4; } 94% { opacity: 1; }
}
@keyframes entrar { from { opacity: 0; transform: translateY(24px) scale(.9); } }

.sub { color: var(--texto-2); font-size: 16px; line-height: 1.5; max-width: 420px; margin: 18px auto 0; animation: entrar 1s .3s both; }
.sub strong { color: var(--texto); }

.abobora-hero { width: 96px; margin: 22px auto 6px; animation: entrar 1s .45s both; }
.abobora-hero svg { width: 100%; animation: balancar 3s ease-in-out infinite; filter: drop-shadow(0 0 24px #ffc40088); }
@keyframes balancar { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-8px); } }
.rosto { animation: vela 1.8s infinite; }
@keyframes vela { 0%, 100% { fill: #120a00; } 30% { fill: #3d2500; } 55% { fill: #1c1000; } 70% { fill: #4a2d00; } }

/* ================= Painéis ================= */
.painel {
  background: linear-gradient(180deg, #1a1810ee, #111111ee);
  border: 1px solid #ffd60a33; border-radius: var(--raio);
  padding: 20px; margin: 22px 0;
  box-shadow: 0 20px 40px #0008, inset 0 1px 0 #ffffff0d;
  backdrop-filter: blur(6px);
}
/* Login com ClickUp */
.login { text-align: center; }
.login h2 { font-family: var(--fonte-titulo); font-weight: 400; font-size: 34px; color: var(--amarelo); margin: 0 0 8px; letter-spacing: .02em; }
.login p { color: var(--texto-2); line-height: 1.5; margin: 0 0 18px; }
.login p strong { color: var(--texto); }
.login small { display: block; color: var(--texto-2); font-size: 13px; margin-top: 14px; }
.erro-login { background: #2a0d0d; border: 1px solid #ff5c5c88; color: #ffd9d9 !important; border-radius: 12px; padding: 12px 14px; font-size: 14px; text-align: left; animation: chacoalhar .4s; }
@keyframes chacoalhar { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.botao-clickup { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; text-decoration: none; animation: chamar 2s infinite; }
.botao-clickup svg { width: 24px; height: 24px; fill: currentColor; }

.previa h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-2); text-align: center; }
.previa-capas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.previa-capas img { width: 100%; aspect-ratio: 2/3; object-fit: cover; object-position: top; border-radius: 8px; box-shadow: 0 6px 14px #000a; filter: saturate(.8); }
.previa-capas img:nth-child(odd) { transform: rotate(-3deg); }
.previa-capas img:nth-child(even) { transform: rotate(3deg) translateY(6px); }

/* Usuário logado */
.usuario { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 12px; border-radius: 14px; background: #141414cc; border: 1px solid #ffd60a33; }
.usuario img, .usuario .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--amarelo); flex: none; }
.usuario .avatar { display: grid; place-items: center; background: var(--amarelo); color: var(--preto); font-weight: 800; }
.usuario-nome { flex: 1; min-width: 0; font-size: 15px; }
.usuario-nome small { display: block; color: var(--texto-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sair { color: var(--amarelo); font-size: 13px; font-weight: 600; text-decoration: none; padding: 8px; }

/* Abas de plataforma */
.abas {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; padding: 10px 16px; margin: 0 -16px;
  background: #0a0a0acc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.aba {
  flex: 1; text-align: center; text-decoration: none; font-weight: 800; font-size: 14px;
  color: var(--amarelo); border: 1.5px solid #ffd60a55; border-radius: 999px; padding: 10px 6px;
  transition: background .2s, color .2s, transform .15s;
}
.aba:active { transform: scale(.96); }
.aba.ativa { background: var(--amarelo); color: var(--preto); box-shadow: 0 0 18px #ffd60a55; }

.plataforma { margin-top: 18px; }
.plat-titulo { display: flex; align-items: center; gap: 12px; font-family: var(--fonte-titulo); font-weight: 400; font-size: 34px; color: var(--amarelo); margin: 14px 0; }
.plat-titulo::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, #ffd60a88, transparent); }

/* Cards de filme */
.filmes { display: grid; gap: 14px; }
.filme {
  position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start;
  padding: 12px; border-radius: var(--raio); cursor: pointer;
  background: var(--preto-2); border: 2px solid #26231a;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.3), border-color .25s, box-shadow .25s, background .25s;
  -webkit-tap-highlight-color: transparent;
}
.filme:active { transform: scale(.98); }
.filme input { position: absolute; opacity: 0; pointer-events: none; }
.filme:has(input:focus-visible) { outline: 3px solid var(--amarelo); outline-offset: 3px; }
.capa { display: block; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--preto-3); box-shadow: 0 8px 20px #000a; }
.capa img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .5s, filter .5s; filter: saturate(.85); }
.info { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 26px; }
.nome-filme { font-size: 17px; font-weight: 800; line-height: 1.2; }
.meta { font-size: 12.5px; color: var(--amarelo); opacity: .85; font-weight: 600; }
.sinopse { font-size: 14px; line-height: 1.45; color: var(--texto-2); margin-top: 2px; }

.marca { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #4a4433; display: grid; place-items: center; transition: .3s; }
.marca svg { width: 22px; opacity: 0; transform: scale(0) rotate(-90deg); transition: .4s cubic-bezier(.2,.9,.3,1.6); }

.filme:has(input:checked) {
  border-color: var(--amarelo); background: linear-gradient(160deg, #2a2408, #141414 60%);
  box-shadow: 0 0 0 1px var(--amarelo), 0 0 30px #ffd60a44, 0 14px 30px #000a;
  transform: translateY(-2px);
}
.filme:has(input:checked) .capa img { transform: scale(1.06); filter: saturate(1.1); }
.filme:has(input:checked) .marca { border-color: transparent; }
.filme:has(input:checked) .marca svg { opacity: 1; transform: scale(1.35) rotate(0); }
.filme.pulso { animation: pulso .5s; }
@keyframes pulso { 40% { transform: scale(1.03); } }

/* Revelar ao rolar */
.revelar { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.9,.3,1.2); }
.revelar.visivel { opacity: 1; transform: none; }

/* Barra de voto fixa */
.rodape-voto {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  max-width: 560px; margin: 0 auto; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(#0a0a0a00, #0a0a0af2 30%);
}
.escolha { flex: 1; min-width: 0; font-size: 13px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.escolha strong { color: var(--amarelo); display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.botao {
  font: 800 17px var(--fonte); color: var(--preto); background: var(--amarelo);
  border: 0; border-radius: 14px; padding: 16px 26px; cursor: pointer;
  box-shadow: 0 6px 0 var(--amarelo-escuro), 0 0 30px #ffd60a55;
  transition: transform .1s, box-shadow .1s, opacity .2s, filter .2s;
}
.botao:not(:disabled) { animation: chamar 2s infinite; }
.botao:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--amarelo-escuro); }
.botao:disabled { opacity: .35; filter: grayscale(1); cursor: not-allowed; box-shadow: 0 6px 0 #444; }
.botao.carregando { pointer-events: none; opacity: .8; }
@keyframes chamar { 0%, 100% { box-shadow: 0 6px 0 var(--amarelo-escuro), 0 0 20px #ffd60a44; } 50% { box-shadow: 0 6px 0 var(--amarelo-escuro), 0 0 40px #ffd60aaa; } }

/* Sucesso / já votou */
.feito { text-align: center; }
.feito h2 { font-family: var(--fonte-titulo); font-weight: 400; font-size: 38px; color: var(--amarelo); margin: 6px 0; }
.feito p { color: var(--texto-2); line-height: 1.5; }
.feito p strong { color: var(--texto); }
.feito-icone { width: 80px; margin: 0 auto; animation: flutuar 3s ease-in-out infinite; filter: drop-shadow(0 0 20px #fff6); }
@keyframes flutuar { 50% { transform: translateY(-12px) rotate(4deg); } }
.oculto { display: none; }

.ranking { text-align: left; margin-top: 18px; display: grid; gap: 10px; }
.ranking h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-2); margin: 6px 0 2px; display: flex; justify-content: space-between; }
.linha { display: grid; gap: 6px; }
.linha-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.linha-topo span:first-child { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-topo small { color: var(--texto-2); font-weight: 400; }
.barra { height: 10px; border-radius: 99px; background: #26231a; overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--amarelo-2), var(--amarelo)); box-shadow: 0 0 12px #ffd60a88; transition: width 1.2s cubic-bezier(.2,.9,.3,1); }
.linha.lider .linha-topo span:first-child::before { content: '🎃 '; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 18px; z-index: 50; transform: translate(-50%, -150%);
  max-width: calc(100% - 32px); width: max-content;
  background: #2a0d0d; color: #ffd9d9; border: 1px solid #ff5c5c; border-radius: 12px;
  padding: 12px 16px; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px #000c;
  transition: transform .4s cubic-bezier(.2,.9,.3,1.3);
}
.toast.mostrar { transform: translate(-50%, 0); }

/* Explosão de abóboras/morcegos no voto */
.explosao { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.particula { position: absolute; left: 50%; top: 60%; font-size: 28px; animation: voar 1.6s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes voar {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.2) rotate(var(--r)); opacity: 0; }
}

.rodape { text-align: center; margin-top: 40px; color: #6f6a58; font-size: 13px; }
.aboboras { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.aboboras svg { width: 54px; filter: drop-shadow(0 0 16px #ffc40066); animation: balancar 3.4s ease-in-out infinite; }
.aboboras svg:nth-child(2) { width: 74px; animation-delay: -1.2s; }
.aboboras svg:nth-child(3) { width: 46px; animation-delay: -2.1s; }

@media (min-width: 700px) {
  .lua { right: 8%; width: 220px; height: 220px; }
  .filme { grid-template-columns: 120px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { opacity: 1; transform: none; }
  .fantasma, .relampago { display: none; }
}
