:root {
  --fundo: #FFFBF3;
  --tinta: #8a847e;      /* cinza no lugar do preto */
  --suave: #a8a29b;
  --linha: rgba(27, 26, 25, .14);
  --papel: #fffefc;
  --rosa: #F48591;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--fundo);
}

body {
  font-family: 'Londrina Solid', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tinta);
  font-weight: 400;
}

#palco {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  display: block;
  touch-action: none;
  cursor: grab;
}
#palco.pegando { cursor: grabbing; }

/* ---------- a carta: grande, no meio da tela, formato de carta ---------- */
.carta {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 660px, 60dvh);
  aspect-ratio: 17 / 24;
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 34px;
  padding: clamp(24px, 4.5vw, 46px);
  box-shadow: 0 34px 80px -22px rgba(27, 26, 25, .34), 0 3px 10px rgba(27, 26, 25, .07);
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: entra .48s cubic-bezier(.2, .9, .2, 1) both;
}
@keyframes entra {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.9) rotate(-1.5deg); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

.ico {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  /* a Londrina não tem o × — esse botãozinho usa a fonte do sistema */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--suave);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background .2s ease, color .2s ease, transform .25s ease;
}
.ico:hover { background: rgba(27, 26, 25, .06); color: var(--tinta); transform: rotate(90deg); }

#form {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.6vh, 22px);
}

/* uma linha só */
#campo {
  width: 100%;
  border: 2px solid var(--linha);
  border-radius: 999px;
  background: #fff;
  padding: clamp(16px, 3.2vh, 26px) 26px;
  font-family: inherit;
  font-size: clamp(22px, 6.4vw, 34px);
  letter-spacing: .09em;
  text-align: center;
  color: var(--tinta);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#campo::placeholder { color: #c9c2ba; letter-spacing: .09em; }
#campo:focus { border-color: var(--rosa); box-shadow: 0 0 0 6px rgba(244, 133, 145, .18); }

.linha {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.96); }

.primario {
  background: var(--rosa);
  color: #fff;
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 400;
  letter-spacing: .16em;
  padding: clamp(14px, 3vh, 24px) 26px;
  width: 100%;
}
.primario:hover { background: #ef7181; }

.fantasma {
  background: transparent;
  color: var(--suave);
  border-color: var(--linha);
  font-size: clamp(17px, 4.4vw, 21px);
  letter-spacing: .12em;
  padding: 10px 20px;
}
.fantasma:hover { color: var(--tinta); border-color: rgba(27, 26, 25, .34); }

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