/* Fontes hospedadas aqui mesmo (sem Google Fonts: o Google não fica sabendo quem abriu o site).
   Só o conjunto "latin" (cobre o português). Licença SIL Open Font License. Fredoka e Nunito são variáveis (um arquivo, vários pesos). */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 700; font-display: swap; src: url(fontes/fraunces-700.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 500; font-display: swap; src: url(fontes/fraunces-italico-500.woff2) format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fontes/fredoka.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(fontes/nunito.woff2) format("woff2"); }

/* Convite: cor de chiclete, tinta ameixa, botões gordinhos. Uma coluna centralizada que cabe no celular. */
:root {
  --fundo: #ffe3ee;
  --fundo-2: #ffd0e2;
  --tinta: #3b1235;
  --tinta-suave: #7a4a72;
  --sim: #ff3d6e;
  --sim-escuro: #d61f50;
  --nao: #ffffff;
  --cartao: #fff7fa;
  --borda: #f4a6c0;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --texto: "Nunito", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --fundo: #2a0f27; --fundo-2: #3a1535; --tinta: #ffe3ee; --tinta-suave: #e3a9c8;
  --sim: #ff5a85; --sim-escuro: #ff3d6e; --nao: #4a1d44; --cartao: #3a1535; --borda: #7a3a6e; color-scheme: dark } }
:root[data-theme="dark"] {
  --fundo: #2a0f27; --fundo-2: #3a1535; --tinta: #ffe3ee; --tinta-suave: #e3a9c8;
  --sim: #ff5a85; --sim-escuro: #ff3d6e; --nao: #4a1d44; --cartao: #3a1535; --borda: #7a3a6e; color-scheme: dark }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 50% 0%, var(--fundo-2), var(--fundo) 60%);
  color: var(--tinta); font: 500 17px/1.5 var(--texto);
  overflow-x: hidden;
}
.ceu { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ceu span { position: absolute; bottom: -40px; font-size: 22px; opacity: .55; animation: sobe linear infinite; }
@keyframes sobe { to { transform: translateY(-115vh) rotate(25deg); } }
/* Coração raro: grande, dourado e brilhando; sobe mais devagar */
.ceu .raro { font-size: 46px; bottom: -70px; opacity: 1; animation: sobe 13s linear forwards, brilho-raro 1.1s ease-in-out infinite alternate; }
@keyframes brilho-raro { from { filter: drop-shadow(0 0 4px #ffd166); } to { filter: drop-shadow(0 0 16px #ffb703) drop-shadow(0 0 6px #fff3b0); } }

/* Corações no topo: avançam a cada tela */
.progresso {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 16px;
}
.passo { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .35; transition: filter .4s ease, opacity .4s ease, transform .4s ease; }
.passo.feito { filter: none; opacity: 1; }
.passo.atual { filter: none; opacity: 1; transform: scale(1.25); animation: bate 1.1s ease-in-out infinite; }
@keyframes bate { 0%, 100% { transform: scale(1.15); } 15% { transform: scale(1.4); } 30% { transform: scale(1.15); } 45% { transform: scale(1.3); } }
.trilho { width: clamp(28px, 8vw, 54px); height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--tinta) 15%, transparent); position: relative; overflow: hidden; }
.trilho::after { content: ""; position: absolute; inset: 0; background: var(--sim); transform: scaleX(0); transform-origin: left; transition: transform .5s ease; }
.trilho.feito::after { transform: scaleX(1); }
/* Botão de som (canto de cima, à direita, na altura dos corações: embaixo ficava por cima dos botões) */
.som {
  position: fixed; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 11px); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--borda);
  background: var(--cartao); font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tinta) 15%, transparent);
}
.som:focus-visible { outline: 3px solid var(--sim); outline-offset: 2px; }
.som[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.palco { min-height: 100%; display: grid; place-items: center;
  padding-block: 76px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.tela { width: min(100%, 460px); display: grid; justify-items: center; gap: 18px; text-align: center; position: relative; z-index: 1; }
.tela:not(.ativa) { display: none; }

h1, h2 { font-family: var(--display); margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(30px, 8vw, 44px); font-weight: 700; }
h2 { font-size: clamp(26px, 7vw, 36px); font-weight: 600; }

.figurinha { font-size: 96px; line-height: 1; min-height: 110px; display: grid; place-items: center; position: relative; }
.figurinha img { max-width: 170px; max-height: 170px; border-radius: 18px; }
.balanca { animation: balanca 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes balanca { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.pula { animation: pula .9s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pula { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.botoes { display: flex; justify-content: center; align-items: center; min-height: 90px; flex-wrap: wrap;
  /* o Sim cresce com scale (que não ocupa espaço): o espaço em volta cresce junto para ele não cobrir o título, a dica e o Não */
  --extra: calc(var(--escala, 1) - 1);
  padding-block: calc(var(--extra) * 32px); column-gap: calc(18px + var(--extra) * 58px); row-gap: calc(18px + var(--extra) * 32px);
  transition: padding .25s ease, gap .25s ease; }
.btn {
  font: 700 19px var(--display); border: 0; border-radius: 999px; padding: 14px 30px; cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease; text-decoration: none; display: inline-block;
}
.btn:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; }
.sim { background: var(--sim); color: #fff; box-shadow: 0 6px 0 var(--sim-escuro); transform: scale(var(--escala, 1)); }
.sim:hover { background: var(--sim-escuro); }
.sim:active { transform: scale(var(--escala, 1)) translateY(4px); box-shadow: 0 2px 0 var(--sim-escuro); }
.nao { background: var(--nao); color: var(--tinta); border: 2px solid var(--borda); transform: scale(var(--escala-nao, 1));
  transition: left .28s cubic-bezier(.3,1.4,.5,1), top .28s cubic-bezier(.3,1.4,.5,1), transform .2s ease; white-space: nowrap; z-index: 5; }
.nao.solto { position: fixed; }
.dica { margin: 0; min-height: 1.5em; color: var(--tinta-suave); font-weight: 700; }

.lugares { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; width: 100%; }
.lugar {
  background: var(--cartao); border: 2px solid var(--borda); border-radius: 18px; padding: 14px 10px; cursor: pointer;
  font: inherit; color: var(--tinta); display: grid; gap: 2px; justify-items: center; transition: transform .15s ease, border-color .15s ease;
}
.lugar:hover { transform: translateY(-3px); }
.lugar[aria-pressed="true"] { border-color: var(--sim); background: color-mix(in srgb, var(--sim) 12%, var(--cartao)); transform: translateY(-3px); }
.lugar .emo { font-size: 38px; line-height: 1.1; }
.lugar .emo img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.lugar b { font-family: var(--display); font-size: 17px; }
.lugar small { color: var(--tinta-suave); font-size: 13px; }

.outro, .campo { display: grid; gap: 6px; width: 100%; text-align: left; font-weight: 700; }
input[type="text"], input[type="date"], input[type="time"] {
  font: 600 17px var(--texto); padding: 12px 14px; border-radius: 14px; border: 2px solid var(--borda);
  background: var(--cartao); color: var(--tinta); width: 100%;
}
input:focus-visible { outline: 3px solid var(--sim); outline-offset: 1px; }
.horarios { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { font: 700 16px var(--display); padding: 8px 16px; border-radius: 999px; border: 2px solid var(--borda); background: var(--cartao); color: var(--tinta); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--sim); border-color: var(--sim); color: #fff; }
.seguir { background: var(--sim); color: #fff; box-shadow: 0 5px 0 var(--sim-escuro); }
.seguir:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.voltar { background: transparent; color: var(--tinta); border: 2px solid var(--borda); }
.linha { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.ingresso {
  width: 100%; background: var(--cartao); border: 2px dashed var(--sim); border-radius: 20px; padding: 18px 20px;
  display: grid; gap: 6px; text-align: left; position: relative;
}
.ingresso .rotulo { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-suave); font-weight: 800; }
.ingresso .valor { font-family: var(--display); font-size: 22px; font-weight: 600; }
.zap { background: #25d366; color: #0b3d1e; box-shadow: 0 5px 0 #1a9e4b; }

/* Tela final: cartão de papel pontilhado, título serifado, polaroid inclinada */
.tela-fim { width: min(100%, 520px); margin-top: 60px; }   /* o gato do canto não sobe por cima dos corações do topo */
.papel {
  --pontos: color-mix(in srgb, var(--tinta) 14%, transparent);
  position: relative; width: 100%; display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 44px 22px 26px; border-radius: 22px; border: 1px solid var(--borda);
  background-color: var(--cartao);
  background-image: radial-gradient(var(--pontos) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--tinta) 45%, transparent);
}
.titulo-fim { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: clamp(34px, 9vw, 48px); color: var(--sim-escuro); letter-spacing: -.01em; }
.envelope { font-size: .8em; }
.recado { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 19px; line-height: 1.45; max-width: 34ch; }
.ps { margin: 0; font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 15px; color: var(--tinta-suave); max-width: 40ch; text-wrap: balance; }
.detalhes { width: 100%; display: grid; gap: 16px; text-align: left; padding: 18px; margin-top: 4px;
  background: color-mix(in srgb, var(--fundo) 55%, var(--cartao)); border-radius: 16px; }
.linha-det { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.linha-det .rotulo { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-suave); font-weight: 800; }
.linha-det .valor { display: block; font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 700; color: var(--sim-escuro); }
.linha-det .sub { display: block; font-size: 15px; font-weight: 700; }
.cal { width: 42px; border-radius: 7px; overflow: hidden; border: 1.5px solid var(--borda); background: var(--cartao); text-align: center; line-height: 1.1; }
.cal-mes { display: block; background: var(--sim); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 0; }
.cal-dia { display: block; font-family: "Fraunces", Georgia, serif; font-size: 18px; font-weight: 700; padding: 3px 0 4px; }
.ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 28px; }
.ico img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.mandar { background: linear-gradient(180deg, #ff5c8a, var(--sim-escuro)); color: #fff; font-family: "Fraunces", Georgia, serif; font-weight: 700;
  padding: 15px 30px; box-shadow: 0 6px 0 color-mix(in srgb, var(--sim-escuro) 70%, #000), 0 12px 24px -10px var(--sim); margin-top: 6px; }
.mandar:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--sim-escuro) 70%, #000); }
/* Figurinha do fim: sem moldura, grande, inclinada no canto do cartão (o título desce para não ficar embaixo dela) */
.tela-fim .papel { padding-top: 112px; }
.polaroid {
  position: absolute; top: -72px; right: -18px; width: 176px; z-index: 2;
  transform: rotate(8deg); animation: pula .9s cubic-bezier(.3,1.6,.5,1) both;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28));
}
/* Porquinho: no fim do cartão, centralizado embaixo do botão e da mensagem de copiar (order: vai para o fim da grade) */
.polaroid.esquerda { position: relative; top: auto; right: auto; order: 99; width: 130px; margin-top: -4px; transform: rotate(-4deg); animation-delay: .15s; }
.polaroid > div:empty { display: none; }
.polaroid img { display: block; width: 100%; height: auto; border-radius: 22px; }
.polaroid > div { font-size: 96px; line-height: 1; text-align: center; }
@media (max-width: 420px) {
  .polaroid { width: 132px; top: -56px; right: -6px; }
  .polaroid.esquerda { width: 108px; }
  .tela-fim .papel { padding-top: 88px; }
  .tela-fim { margin-top: 44px; }   /* o gato não sobe por cima dos corações do topo */
  .mandar { font-size: 15px; padding: 14px 18px; }
}

.confete { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* ---------- Efeitos ---------- */
/* Gato nervoso (o "Não" em perigo) e feliz (mouse no "Sim") */
.figurinha.nervoso { animation: treme .18s linear infinite; }
@keyframes treme { 0%, 100% { transform: translateX(-1.5px) rotate(-1.5deg); } 50% { transform: translateX(1.5px) rotate(1.5deg); } }
.figurinha.feliz { animation: feliz .6s ease; }
@keyframes feliz { 0%, 100% { transform: none; } 40% { transform: translateY(-18px) scale(1.06); } }
.gota { position: absolute; top: 6px; right: -10px; font-size: 30px; pointer-events: none; animation: gota 1s ease-in forwards; }
@keyframes gota { 0% { opacity: 0; transform: translateY(-6px) scale(.5); } 25% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(28px); } }

/* Fumacinha onde o "Não" estava e partículas dos estouros (posição em --x/--y, voo em --dx/--dy) */
.fumaca, .particula { position: fixed; left: 0; top: 0; translate: var(--x) var(--y); pointer-events: none; z-index: 9; line-height: 1; }
.fumaca { font-size: 34px; animation: puf .7s ease-out forwards; }
@keyframes puf { from { transform: translate(-50%, -50%) scale(.4); opacity: .9; } to { transform: translate(-80%, -70%) scale(1.6); opacity: 0; } }
.particula { font-size: 16px; animation: voa .8s ease-out forwards; }
@keyframes voa { from { transform: translate(-50%, -50%) scale(.5); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; } }

/* Segredo: 5 cliques numa figurinha (ela gira e fala) */
.segredo img, .segredo:not(:has(img)) { animation: giro 1s cubic-bezier(.3,1.3,.5,1); }
@keyframes giro { 0% { transform: none; } 50% { transform: translateY(-20px) rotate(360deg) scale(1.15); } 100% { transform: rotate(720deg); } }
.balao { position: absolute; top: -18px; left: 50%; translate: -50% 0; z-index: 3; white-space: nowrap; pointer-events: none;
  background: var(--cartao); color: var(--tinta); border: 2px solid var(--borda); border-radius: 999px; padding: 4px 12px;
  font: 700 16px var(--display); animation: balao 1.7s ease forwards; }
@keyframes balao { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* Envelope antes do cartão final: espera fechado (pulsando) até a pessoa tocar; aí abre */
.envelope-abre { position: fixed; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 22px; }
.env-botao { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; border-radius: 12px; }
.env-botao:focus-visible { outline: 3px solid var(--sim); outline-offset: 8px; }
.env { position: relative; display: block; width: min(260px, 70vw); aspect-ratio: 3 / 2; perspective: 900px;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.25)); animation: env-entra .55s cubic-bezier(.3,1.5,.5,1) both, env-espera 1.6s ease-in-out .6s infinite; }
.env > span { position: absolute; display: block; }
.env-fundo, .env-bolso { inset: 0; border-radius: 12px; }
.env-fundo { background: var(--sim-escuro); }
.env-carta { left: 7%; right: 7%; top: 8%; height: 80%; border-radius: 8px;
  background-color: var(--cartao); background-image: radial-gradient(color-mix(in srgb, var(--tinta) 14%, transparent) 1.2px, transparent 1.3px);
  background-size: 12px 12px; }
.env-bolso { background: var(--sim); clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); }
.env-aba { left: 0; right: 0; top: 0; height: 56%; z-index: 2; transform-origin: top;
  background: color-mix(in srgb, var(--sim) 78%, #fff); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-selo { left: 50%; top: 56%; translate: -50% -50%; z-index: 3; font-size: 30px; animation: bate 1.1s ease-in-out infinite; }
.env-dica { font: 700 18px var(--display); color: var(--tinta-suave); animation: pula .5s ease .7s both; }
/* depois do toque */
.envelope-abre.aberto .env-botao { cursor: default; }
.envelope-abre.aberto { animation: env-sai .6s ease-in 1.15s forwards; }
.envelope-abre.aberto .env { animation: none; }
.envelope-abre.aberto .env-selo { animation: selo .25s ease forwards; }
.envelope-abre.aberto .env-aba { animation: aba-abre .5s ease-in-out .05s both; }
.envelope-abre.aberto .env-carta { animation: carta-sobe .6s cubic-bezier(.3,1.3,.5,1) .5s both; }
.envelope-abre.aberto .env-dica { animation: selo .25s ease forwards; }
@keyframes env-entra { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes env-espera { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-4deg); } 20% { transform: rotate(4deg); } 30% { transform: rotate(0); } }
@keyframes aba-abre { 0% { transform: rotateX(0); z-index: 2; } 50% { z-index: 2; } 51% { z-index: -1; } 100% { transform: rotateX(180deg); z-index: -1; } }
@keyframes selo { to { transform: scale(.3); opacity: 0; } }
@keyframes carta-sobe { to { transform: translateY(-58%); } }
@keyframes env-sai { to { opacity: 0; transform: translateY(30px) scale(.95); } }
/* enquanto o envelope abre, o cartão espera escondido; depois sobe (e as figurinhas pulam só nessa hora) */
.tela-fim .papel { transition: opacity .5s ease, transform .6s cubic-bezier(.3,1.3,.5,1); }
.tela-fim.chegando .papel { opacity: 0; transform: translateY(50px) scale(.9); }
.tela-fim.chegando .polaroid { animation: none; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .balanca, .pula, .ceu span, .passo.atual, .figurinha.nervoso, .segredo img, .segredo:not(:has(img)) { animation: none; }
  .nao { transition: none; }
}
