/* =========================================================
   Dia dos Pais — desafios + raspadinha
   Mobile-first. Sem webfonts (font stack nativa) para FCP.
   ========================================================= */

:root {
  --bg:        #14100d;
  --bg-soft:   #1e1813;
  --bg-lift:   #251d17;
  --line:      #322820;
  --ink:       #faf6f0;
  --ink-muted: #b0a496;
  --gold:      #e8b04b;
  --gold-deep: #c4821f;
  --green:     #6fcf8b;
  --radius:    16px;
  --shell:     32rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* trava a rolagem enquanto tem camada por cima */
body.is-locked { overflow: hidden; height: 100%; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

[hidden] { display: none !important; }

/* ---------------------------------------------------------
   Botão base
   --------------------------------------------------------- */

.btn {
  font: inherit;
  font-weight: 700;
  color: #241a0c;
  background: linear-gradient(160deg, #f2c268, var(--gold-deep));
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.5rem;
  min-height: 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); filter: brightness(1.08); }
.btn--lg { width: 100%; max-width: 20rem; font-size: 1.05rem; min-height: 54px; }

/* ---------------------------------------------------------
   Camada 1 — portal de desafios
   --------------------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: radial-gradient(120% 80% at 80% 0%, #35271a 0%, var(--bg) 62%);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .5s ease;
}

.gate.is-gone { opacity: 0; pointer-events: none; }

.stage {
  display: none;
  min-height: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 2rem 1.35rem calc(2rem + env(safe-area-inset-bottom));
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
}

.stage.is-active { display: flex; animation: stage-in .38s ease both; }

@keyframes stage-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
}

.stage__title {
  font-size: clamp(2.1rem, 10vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
}

.stage__lead {
  color: var(--ink-muted);
  font-size: 1.02rem;
}

.stage__foot {
  font-size: .82rem;
  color: #7d7266;
}

/* --- pontinhos de progresso --- */

.dots {
  display: flex;
  gap: .4rem;
  margin-bottom: .35rem;
}

.dots span {
  width: 26px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  transition: background .3s ease;
}
.dots span.is-done { background: var(--gold); }
.dots span.is-now  { background: var(--ink-muted); }

/* --- bloco do desafio --- */

.quiz { width: 100%; }

.quiz__step {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.quiz__q {
  font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  line-height: 1.22;
  letter-spacing: -.015em;
  font-weight: 800;
  margin: .5rem 0 1.35rem;
}

.opts { display: grid; gap: .6rem; }

.opt {
  font: inherit;
  text-align: left;
  width: 100%;
  min-height: 56px;
  padding: .85rem 1rem;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.opt:active { transform: scale(.985); }
.opt.is-right {
  border-color: var(--green);
  background: rgba(111, 207, 139, .14);
}
.opt.is-wrong {
  border-color: #a8564a;
  background: rgba(168, 86, 74, .14);
  animation: shake .38s ease;
}
.opt[disabled] { cursor: default; opacity: .55; }
.opt.is-right[disabled], .opt.is-wrong[disabled] { opacity: 1; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.quiz__say {
  min-height: 3rem;
  margin-top: 1rem;
  font-size: .95rem;
  color: var(--ink-muted);
}
.quiz__say.is-good { color: var(--green); font-weight: 600; }

/* --- navegação entre desafios --- */

.navrow {
  display: flex;
  gap: .6rem;
  margin-top: .5rem;
}

.navrow .btn {
  flex: 1;
  padding-inline: 1rem;
}

.btn--ghost {
  flex: 0 0 auto !important;
  min-width: 6.5rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: .38;
  cursor: default;
  filter: none;
}
.btn:disabled:active { transform: none; }

/* --- frases entre o quiz e a raspadinha --- */

.stage--msg {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.75rem;
}

.phrase {
  font-size: clamp(1.5rem, 7.5vw, 2.15rem);
  line-height: 1.28;
  letter-spacing: -.02em;
  font-weight: 800;
  max-width: 18ch;
  min-height: 4.2em;              /* trava a altura: as frases não pulam */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .3, 1);
}

.phrase.is-in { opacity: 1; transform: none; }

.phrase.is-final { color: var(--gold); }

#msgHint {
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .55;
  transition: opacity .3s ease;
}

/* --- desafio de segurar o botão --- */

.hold {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: .5rem auto 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    conic-gradient(var(--gold) calc(var(--p, 0) * 1%), var(--line) 0);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hold::after {
  content: attr(data-label);
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--bg-lift);
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  line-height: 1.25;
  padding: 0 1rem;
}

.hold.is-holding { transform: scale(1.03); }
.hold { transition: transform .18s ease; }

/* ---------------------------------------------------------
   Camada 2 — raspadinha
   --------------------------------------------------------- */

.scratch {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;

  /* mata scroll, pull-to-refresh, seleção e o menu de "salvar imagem" */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;

  transition: opacity .6s ease;
}

.scratch__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* dica central: por cima da tinta, mas transparente ao toque
   (pointer-events:none deixa o dedo chegar no canvas) */
.scratch__hint {
  position: relative;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  padding: 0 1.5rem;
  color: #2a1d0c;
  animation: breathe 2.6s ease-in-out infinite;
  transition: opacity .4s ease;
}

.scratch__hint.is-hidden { opacity: 0; }

.scratch__finger { font-size: 2.5rem; display: block; }

.scratch__label {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: .4rem;
}

.scratch__sub {
  font-size: .92rem;
  opacity: .72;
  margin-top: .15rem;
}

.scratch__skip {
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  font: inherit;
  font-size: .85rem;
  color: #2a1d0c;
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(42, 29, 12, .25);
  border-radius: 999px;
  padding: .7rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.scratch.is-gone { opacity: 0; pointer-events: none; }

@keyframes breathe {
  0%, 100% { transform: translateY(0);    opacity: 1;   }
  50%      { transform: translateY(-6px); opacity: .82; }
}

/* ---------------------------------------------------------
   Camada 3 — o presente
   --------------------------------------------------------- */

.reveal {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 2.5rem 1.25rem calc(3rem + env(safe-area-inset-bottom));
}

.reveal > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1);
}
body.is-revealed .reveal > * { opacity: 1; transform: none; }
body.is-revealed .reveal > :nth-child(2) { transition-delay: .10s; }
body.is-revealed .reveal > :nth-child(3) { transition-delay: .20s; }
body.is-revealed .reveal > :nth-child(4) { transition-delay: .30s; }

.hero { margin-bottom: 2.25rem; }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 1rem;
}

.hero__title {
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
}

.hero__lead {
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 1.02rem;
}

.box__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card--wide { grid-column: 1 / -1; }

.card__media { background: #f1f1f1; }

.card__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.card__media--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}

.card__body { padding: .8rem .85rem 1rem; }

.card__tag {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .3rem;
}

.card__name { font-size: 1rem; font-weight: 700; line-height: 1.25; }

.card__meta { font-size: .85rem; color: var(--ink-muted); margin-top: .15rem; }

/* --- a foto --- */

.photo {
  margin: 2.25rem 0 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.photo img { width: 100%; display: block; }

.photo__cap {
  padding: .85rem .95rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--gold);
}

/* --- a carta --- */

.letter {
  margin-top: 2.25rem;
  padding: 1.6rem 1.35rem 1.5rem;
  background: linear-gradient(160deg, rgba(232, 176, 75, .10), rgba(232, 176, 75, .02));
  border: 1px solid rgba(232, 176, 75, .26);
  border-radius: var(--radius);
  font-size: 1.02rem;
  line-height: 1.7;
}

.letter p + p { margin-top: .9rem; }

.letter__open {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
}

.letter__punch {
  margin-top: 1.3rem !important;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(232, 176, 75, .22);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.45;
}

.letter__sign {
  margin-top: 1.3rem !important;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.4;
}
.letter__sign span {
  display: inline-block;
  margin-top: .35rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.foot { margin-top: 2rem; text-align: center; }

/* ---------------------------------------------------------
   Acessibilidade
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal > * { opacity: 1; transform: none; }
}

@media (min-width: 34rem) {
  .reveal { padding-top: 3.5rem; }
  .grid { gap: 1rem; }
}
