/* ============================================================
   Endrik Titular — estilo leve, claro, animado (vibe Google)
   ============================================================ */

:root {
  --green: #009c3b;       /* verde Brasil */
  --yellow: #ffdf00;      /* amarelo Brasil */
  --blue: #002776;        /* azul Brasil */
  --ink: #1f2430;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.14);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  /* fundo: grama de futebol fixa cobrindo a tela */
  background:
    linear-gradient(180deg, rgba(0, 60, 20, 0.18), rgba(0, 40, 12, 0.28)),
    url("assets/grass.jpg") center / cover no-repeat fixed;
  background-color: #2f7d3a; /* fallback enquanto a grama carrega */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

.stage {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* painel claro translúcido sobre a grama, p/ leitura */
.view {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 26px;
  padding: clamp(20px, 5vw, 34px) clamp(16px, 4vw, 28px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Views ---------- */
.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: viewIn 0.5s var(--ease) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Title ---------- */
.title {
  font-size: clamp(28px, 6.5vw, 44px);
  line-height: 1.08;
  font-weight: 800;
  text-align: center;
  margin: 14px 0 6px;
  letter-spacing: -0.5px;
}
.title__name { color: var(--green); }
.title__highlight {
  position: relative;
  white-space: nowrap;
}
.title__highlight::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 2px;
  height: 38%;
  background: var(--yellow);
  z-index: -1;
  border-radius: 4px;
  transform: skew(-1deg);
  opacity: 0.85;
}
.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 18px;
  text-align: center;
}

/* ---------- Hero / card com foto ---------- */
.hero {
  width: min(340px, 78vw);
  aspect-ratio: 3 / 4;
  margin: 6px 0 22px;
  display: grid;
  place-items: center;
}
.hero--result { width: min(300px, 70vw); margin: 4px 0 18px; }

.card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--bg-soft));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

/* pulso ao votar */
.card.is-pulse { animation: pulse 0.6s var(--ease); }
@keyframes pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); box-shadow: var(--shadow-lg); }
  100% { transform: scale(1); }
}

/* ---------- Botões ---------- */
.actions {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 460px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 22px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
  box-shadow: var(--shadow);
  flex: 1 1 auto;
  justify-content: center;
  min-width: 160px;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn__emoji { font-size: 18px; }

.btn--yes {
  background: linear-gradient(135deg, var(--green), #00b347);
  color: #fff;
}
.btn--yes:hover { filter: brightness(1.05); box-shadow: 0 14px 32px rgba(0, 156, 59, 0.32); }

.btn--no {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #e6e9ef;
}
.btn--no:hover { box-shadow: var(--shadow-lg); }

.btn--share {
  background: linear-gradient(135deg, var(--blue), #0040c1);
  color: #fff;
}
.btn--share:hover { filter: brightness(1.06); }
.btn--ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1.5px solid #e6e9ef;
  font-weight: 600;
  font-size: 15px;
}

.microcopy {
  color: var(--muted);
  font-size: 14px;
  margin-top: 18px;
  text-align: center;
  min-height: 20px;
}

/* ---------- Resultado ---------- */
.result__kicker {
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  margin: 8px 0 4px;
  text-align: center;
}
.counter {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}
.counter__label { color: var(--muted); font-size: 14px; }
.counter__number {
  font-size: clamp(40px, 11vw, 68px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.counter__goal { color: var(--muted); font-size: 15px; }
.counter__goal strong { color: var(--ink); }

/* ---------- Barra de progresso ---------- */
.progress { width: 100%; max-width: 460px; margin-bottom: 22px; }
.progress__track {
  width: 100%;
  height: 14px;
  background: #eef1f6;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(16, 24, 40, 0.08);
}
.progress__fill {
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--green));
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
  transition: width 1s var(--ease);
}
@keyframes shimmer {
  to { background-position: 200% 0; }
}
.progress__caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.progress__caption #progressPercent { font-weight: 700; color: var(--green); }

/* ---------- Tally Sim x Não ---------- */
.tally {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  margin-bottom: 22px;
}
.tally__item {
  flex: 1;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid #eef1f6;
}
.tally__num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tally__cap { font-size: 12.5px; color: var(--muted); }
.tally__item--yes .tally__num { color: var(--green); }
.tally__item--no .tally__num { color: var(--muted); }

/* ---------- Share ---------- */
.share {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Share sheet (menu de compartilhar) ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #e1e5ee;
  margin: 2px auto 12px;
}
.sheet__title { font-weight: 800; font-size: 18px; text-align: center; margin: 0 0 16px; }
.sheet__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
  margin-bottom: 14px;
}
@media (max-width: 360px) { .sheet__grid { grid-template-columns: repeat(3, 1fr); } }
.shareopt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  transition: transform 0.15s var(--ease);
}
.shareopt:active { transform: scale(0.95); }
.shareopt__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow);
}
.shareopt__icon--whats { background: #25d366; }
.shareopt__icon--telegram { background: #229ed9; }
.shareopt__icon--x { background: #000; }
.shareopt__icon--facebook { background: #1877f2; }
.shareopt__icon--instagram {
  background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
}
.shareopt__icon--copy { background: #6b7280; }
.sheet__cancel {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.sheet__cancel:active { transform: translateY(1px); }

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding-top: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* ---------- Confete ---------- */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: #1f2430;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 60;
  max-width: 90vw;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Loading state ---------- */
body.is-loading .actions { opacity: 0.5; pointer-events: none; }

/* ---------- Botão Contribuir (destaque dourado) ---------- */
.btn--contribuir {
  background: linear-gradient(135deg, #ffd000, #ff9d00);
  color: #4a2d00;
  text-decoration: none;
}
.btn--contribuir:hover { filter: brightness(1.05); box-shadow: 0 14px 32px rgba(255, 157, 0, 0.35); }

/* ---------- Página Contribuir ---------- */
.view--contribuir { text-align: center; }
.backlink {
  align-self: flex-start;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.backlink:hover { color: var(--ink); }
.title--sm { font-size: clamp(24px, 5.5vw, 34px); margin: 8px 0 10px; }
.lead {
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 460px;
  margin: 0 auto 18px;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  max-width: 460px;
  width: 100%;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid #eef1f6;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14.5px;
}
.steps li span {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.pixbox {
  background: var(--bg-soft);
  border: 1px solid #eef1f6;
  border-radius: 20px;
  padding: 22px 18px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pixbox__title { font-weight: 800; margin: 0; }
.pixbox__qr {
  width: 240px;
  height: 240px;
  max-width: 70vw;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.pixbox__copy { display: flex; gap: 8px; width: 100%; }
.pixbox__input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  padding: 11px 12px;
  border: 1.5px solid #e1e5ee;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}
.pixbox__notice {
  font-size: 12.5px;
  color: #b26a00;
  background: #fff6e0;
  border: 1px solid #ffe2a8;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0;
}
.pixbox__notice code { font-size: 12px; }
.finehint {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  max-width: 460px;
  margin: 6px auto 0;
  line-height: 1.5;
}
.view--contribuir .finehint { color: #9aa1ad; text-shadow: none; }

/* ---------- Mobile ---------- */
@media (max-width: 420px) {
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .hero { width: min(300px, 70vw); }
  .title { font-size: clamp(26px, 8vw, 36px); }
}

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
