:root {
  --yellow: #ffe14d;
  --pink: #ff3d7f;
  --cyan: #00c2ff;
  --green: #3ddc84;
  --red: #ff4b3e;
  --purple: #9b5cff;
  --ink: #111;
  --paper: #fff;
  --radius: 18px;
  --shadow: 6px 6px 0 var(--ink);
  --font-display: 'Bangers', 'Impact', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--yellow);
  background-image: radial-gradient(rgba(0, 0, 0, 0.12) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- faixa de avisos ---------- */
.ticker {
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  position: relative;
  z-index: 3;
}
.ticker__track {
  display: inline-block;
  padding: 8px 0;
  animation: ticker 40s linear infinite;
}
.ticker__track span { margin: 0 28px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- figurinhas flutuantes ---------- */
.sticker-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.float-sticker {
  position: absolute;
  width: clamp(70px, 9vw, 130px);
  opacity: 0.95;
  animation: bob 6s ease-in-out infinite;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.35));
}
.float-sticker img { width: 100%; height: auto; display: block; }
.float-sticker.emoji { font-size: clamp(42px, 6vw, 80px); width: auto; line-height: 1; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -8deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--rot, -8deg) * -1)); }
}

/* ---------- layout ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.hero {
  text-align: center;
  padding: 26px 0 10px;
  position: relative;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  line-height: 0.9;
  margin: 0;
  color: var(--pink);
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 6px 6px 0 var(--ink);
  letter-spacing: 2px;
  transform: rotate(-2deg);
}
.hero__title .alt { color: var(--cyan); display: inline-block; transform: rotate(3deg); }
.hero__group {
  display: inline-block;
  margin-top: 18px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 6px 20px;
  font-weight: 900;
  font-size: 1.15rem;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(1deg);
}
.hero__tagline {
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 560px;
  margin: 16px auto 0;
}
.hero__stickers {
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.hero__sticker {
  width: clamp(90px, 15vw, 180px);
  align-self: center;
  animation: wiggle 2.8s ease-in-out infinite;
  filter: drop-shadow(5px 5px 0 var(--ink));
}
.hero__sticker:last-child { animation-delay: -1.4s; }
.hero__sticker img { width: 100%; display: block; }
.hero__sticker.emoji { font-size: clamp(60px, 10vw, 120px); line-height: 1; width: auto; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.06); }
}

/* ---------- contagem regressiva ---------- */
.countdown {
  margin: 30px auto 8px;
  text-align: center;
}
.countdown__label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
}
.countdown__boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.countdown__box {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 88px;
  padding: 8px 10px 6px;
}
.countdown__box:nth-child(1) { background: var(--cyan); transform: rotate(-3deg); }
.countdown__box:nth-child(2) { background: var(--green); transform: rotate(2deg); }
.countdown__box:nth-child(3) { background: var(--pink); color: var(--paper); transform: rotate(-1deg); }
.countdown__box:nth-child(4) { background: var(--paper); transform: rotate(3deg); }
.countdown__num {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown__unit { font-weight: 900; font-size: 0.8rem; letter-spacing: 1px; }
.countdown__when { margin-top: 14px; font-weight: 800; }

/* ---------- cartões ---------- */
.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  margin-top: 34px;
}
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
  position: relative;
}
.card--tilt-l { transform: rotate(-0.8deg); }
.card--tilt-r { transform: rotate(0.8deg); }
.card__title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 1px;
  margin: 0 0 4px;
  line-height: 1;
}
.card__sub { margin: 0 0 16px; font-weight: 700; color: #444; }
.card__tape {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 120px;
  height: 30px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(255, 255, 255, 0.75);
  border: 2px dashed rgba(0, 0, 0, 0.35);
}

.badge {
  display: inline-block;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-display);
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 1rem;
  transform: rotate(-3deg);
}

/* ---------- formulários ---------- */
label { display: block; font-weight: 900; margin: 12px 0 6px; }
label small { font-weight: 700; color: #666; }
input, textarea {
  width: 100%;
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fffdf2;
  outline: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
textarea { resize: vertical; min-height: 74px; }
input:focus, textarea:focus { box-shadow: 4px 4px 0 var(--cyan); transform: translate(-2px, -2px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
  padding: 10px 24px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--pink);
  color: var(--paper);
  text-shadow: 2px 2px 0 var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  margin-top: 18px;
}
.btn:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--cyan { background: var(--cyan); }
.btn--green { background: var(--green); }
.btn--small { font-size: 1.1rem; padding: 6px 14px; margin-top: 0; box-shadow: 3px 3px 0 var(--ink); }
.btn--block { width: 100%; }

.msg {
  margin-top: 14px;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  display: none;
}
.msg.show { display: block; animation: pop 0.25s ease-out; }
.msg--err { background: #ffd2cf; }
.msg--ok { background: #cff8df; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.closed {
  text-align: center;
  padding: 22px 10px;
  font-weight: 800;
}
.closed .big { font-size: 3.4rem; display: block; }

/* ---------- lista da galera ---------- */
.people {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.people li {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
  animation: pop 0.3s ease-out both;
}
.people__count {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
}
.empty { font-weight: 700; color: #555; }

/* ---------- informações ---------- */
.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.info__item {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
}
.info__item b { display: block; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 1px; font-weight: 400; }

/* ---------- revelação ---------- */
.reveal { margin-top: 34px; }
.reveal__form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.reveal__form label { margin-top: 0; }
.reveal__form .btn { margin-top: 0; }
@media (max-width: 700px) { .reveal__form { grid-template-columns: 1fr; } }

.scratch {
  margin: 20px auto 0;
  max-width: 460px;
  position: relative;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--yellow);
  user-select: none;
}
.scratch__content { padding: 26px 20px; text-align: center; }
.scratch__label { font-weight: 900; letter-spacing: 1px; }
.scratch__name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1;
  margin: 8px 0;
  color: var(--pink);
  -webkit-text-stroke: 2px var(--ink);
  word-break: break-word;
}
.scratch__wish { font-weight: 700; font-style: italic; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.scratch__hint { text-align: center; font-weight: 800; margin-top: 10px; }

/* ---------- regras ---------- */
.rules { margin-top: 34px; }
.rules ol { margin: 0; padding-left: 0; list-style: none; counter-reset: r; display: grid; gap: 10px; }
.rules li {
  counter-increment: r;
  font-weight: 700;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.rules li::before {
  content: counter(r);
  font-family: var(--font-display);
  font-size: 1.3rem;
  background: var(--cyan);
  border: 3px solid var(--ink);
  border-radius: 10px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rules li:nth-child(2n)::before { background: var(--green); }
.rules li:nth-child(3n)::before { background: var(--pink); color: #fff; }

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-weight: 800;
  padding: 24px 16px 40px;
}
footer a { color: inherit; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 16px;
}
.modal.show { display: grid; }
.modal__box {
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 10px 10px 0 var(--ink);
  max-width: 460px;
  width: 100%;
  padding: 24px;
  text-align: center;
  animation: boing 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
  max-height: 92vh;
  overflow: auto;
}
@keyframes boing { from { transform: scale(0.4) rotate(-12deg); } to { transform: scale(1) rotate(0); } }
.modal__sticker { width: 150px; margin: 0 auto 6px; }
.modal__sticker img { width: 100%; display: block; }
.modal__sticker.emoji { font-size: 90px; width: auto; line-height: 1; }
.code {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: var(--green);
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 8px 16px;
  display: inline-block;
  margin: 10px 0;
}

/* ---------- confete ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-weight: 700; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 2px dashed #bbb; vertical-align: middle; }
.admin-table th { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; letter-spacing: 1px; }
.pill { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.85rem; }
.pill--sent { background: var(--green); }
.pill--failed { background: var(--red); color: #fff; }
.pill--pending { background: #eee; }
.pill--notified { background: var(--cyan); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.stack > * + * { margin-top: 26px; }
.warn { background: #fff3b0; border: 3px solid var(--ink); border-radius: 12px; padding: 10px 12px; font-weight: 800; margin-top: 12px; }

/* ---------- mural da vergonha ---------- */
.mural { margin-top: 44px; text-align: center; }
.mural__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin: 0;
  color: var(--cyan);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.mural__sub { font-weight: 800; margin: 8px 0 22px; }
.mural__wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px 26px;
  align-items: start;
  padding: 6px;
}
.polaroid {
  margin: 0;
  background: #fff;
  padding: 10px 10px 0;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s;
  cursor: zoom-in;
  position: relative;
}
.polaroid::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 70px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 225, 77, 0.85);
  border: 2px dashed rgba(0, 0, 0, 0.3);
}
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0deg) scale(1.06); z-index: 2; outline: none; }
.polaroid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #ddd; }
.mural__wall .polaroid img { aspect-ratio: auto; } /* fotos da turma inteiras, sem corte */
.polaroid figcaption {
  font-family: var(--font-display);
  letter-spacing: 1px;
  font-size: 1.15rem;
  padding: 8px 2px 10px;
  line-height: 1.1;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  place-items: center;
  z-index: 55;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox.show { display: grid; }
.polaroid--big { max-width: min(480px, 92vw); cursor: zoom-out; transform: rotate(-2deg); animation: boing 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
.polaroid--big img { aspect-ratio: auto; max-height: 72vh; object-fit: contain; }
.polaroid--big figcaption { font-size: 1.6rem; text-align: center; }

/* ---------- ajustes: texto sempre por cima das figurinhas ---------- */
.hero > *:not(.hero__stickers) { position: relative; z-index: 1; }
@media (max-width: 700px) {
  .hero__stickers { align-items: flex-start; top: -8px; bottom: auto; }
  .hero__sticker { width: 74px; align-self: flex-start; }
  .hero__sticker.emoji { font-size: 54px; }
  .float-sticker { width: 56px; }
  .float-sticker.emoji { font-size: 40px; }
  .hero__tagline, .countdown__label, .countdown__when {
    background: rgba(255, 225, 77, 0.94);
    border-radius: 10px;
    padding: 4px 10px;
    display: inline-block;
  }
}
