:root {
  color: #57364b;
  background: #fffaf2;
  font-family: Quicksand, sans-serif;
  font-weight: 600;
  --pink: #b52d69;
  --yellow: #fff3bd;
}
* { box-sizing: border-box; }
body { margin: 0; background: repeating-linear-gradient(90deg, transparent 0 46px, #c6dcef80 46px 49px); }
[hidden] { display: none !important; }
main { max-width: 1050px; margin: auto; text-align: center; }
.cover {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 14px;
  padding: clamp(32px, 6vw, 68px) clamp(22px, 5vw, 70px) 28px;
  background: #f9dce9;
}
.cover-copy { z-index: 1; }
.intro { margin: 0 0 16px; font-weight: 700; }
h1, h2, .signoff strong { font-family: 'Young Serif', Georgia, serif; font-weight: 400; }
h1 { margin: 0; color: var(--pink); font-size: clamp(57px, 11vw, 112px); line-height: .94; letter-spacing: -.055em; }
h1 span { font-size: .53em; letter-spacing: -.035em; color: #733f65; }
h1 strong { font-weight: inherit; color: #a45724; }
.cover-copy > p:not(.intro) { font-size: clamp(17px, 2.5vw, 22px); max-width: 24ch; margin: 18px auto; }
.jump, .music, .cake-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px solid currentColor;
  border-radius: 100px;
  background: #fffaf2;
  color: var(--pink);
  font: inherit;
  font-weight: 700;
}
.jump { text-decoration: none; }
.portrait {
  position: relative;
  isolation: isolate;
  width: min(100%, 430px);
  margin-top: 12px;
  background: #fff3bd;
  border: 4px solid #fffaf2;
  border-radius: 48% 48% 19% 19% / 36% 36% 14% 14%;
}
.portrait img { display: block; width: 100%; height: clamp(270px, 55vw, 480px); object-fit: contain; }
.spark { position: absolute; z-index: -1; font-size: clamp(25px, 5vw, 48px); }
.spark-left { top: 16%; left: 11%; color: #b52d69; }
.spark-right { right: 12%; top: 55%; color: #9766b3; }
.balloon { position: absolute; z-index: -1; width: 15%; aspect-ratio: .81; border-radius: 50%; background: var(--color); }
.balloon::after { content: ''; position: absolute; top: 98%; left: 50%; height: 34px; border-left: 1px solid #77566b; }
.balloon-left { --color: #a9dce8; top: 40%; left: 8%; transform: rotate(-16deg); }
.balloon-right { --color: #ceb8f0; top: 23%; right: 10%; transform: rotate(13deg); }
.details { padding: 34px 20px 44px; background: var(--yellow); border-top: 7px solid #fffaf2; }
.bunting { display: flex; justify-content: center; gap: 4px; width: fit-content; margin: 0 auto 22px; border-top: 2px solid #a87688; }
.bunting i { width: clamp(20px, 6vw, 42px); height: 24px; clip-path: polygon(0 0,100% 0,50% 100%); background: #f0a9ca; }
.bunting i:nth-child(3n + 2) { background: #a9dce8; }
.bunting i:nth-child(3n) { background: #ceb8f0; }
h2 { margin: 0 0 18px; color: var(--pink); font-size: clamp(27px, 6vw, 43px); }
.ticket { max-width: 420px; margin: auto; padding: 20px 12px; background: #fffaf2; border: 2px dashed #c8819c; border-radius: 24px; }
.ticket strong { font-size: clamp(19px, 4vw, 26px); }
.ticket p { margin: 10px 0 0; }
.lunch { line-height: 1.65; margin: 20px auto; }
.music, .cake-button { cursor: pointer; }
.cake-section { position: relative; overflow: hidden; padding: 38px 20px 28px; background: #f5e8fa; border-top: 7px solid #fffaf2; }
.cake-button { display: inline-grid; justify-items: center; gap: 12px; padding: 0; background: none; border: 0; }
.cake-button img { width: min(54vw, 195px); height: auto; image-rendering: pixelated; border-radius: 12px; }
.cake-button.is-cut img { transform: rotate(-7deg) scale(.92); }
.cake-status { min-height: 1.5em; margin: 13px 0 0; color: #75234a; }
.confetti { position: absolute; left: 50%; top: 44%; pointer-events: none; width: 9px; height: 12px; background: var(--color); animation: scatter 740ms ease-out both; }
@keyframes scatter { to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(190deg); } }
.signoff { margin: 22px 0 0; }
.signoff strong { color: var(--pink); font-size: 24px; }
@media (min-width: 720px) { .cover { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

.cover {
  background-color: #fac3d6;
  background-image: linear-gradient(90deg,#ffffff50 50%,transparent 50%),linear-gradient(#ffffff50 50%,transparent 50%);
  background-size: 36px 36px;
}
.portrait { background: #fff9e4; }
.play-school { color: #55307d; background: #e8d7ff; margin: 8px 3px 0; }
.berry-game { max-width: 420px; margin: 20px auto 0; background: #fff1f8; border: 2px dashed #eda7bf; border-radius: 22px; padding: 20px 16px; }
.berry-game h3 { margin: 0; color: #8d2956; }
.game-grid { width: min(100%, 245px); margin: 0 auto 15px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-cell { aspect-ratio: 1; border: 1px solid #e6a9c1; background: #fff; border-radius: 13px; font-size: 25px; cursor: pointer; }
.game-cell:disabled { background: #f8e2ec; cursor: default; }
#game-restart { border: 1px solid #8e70aa; border-radius: 12px; padding: 9px 15px; background: #e8d7ff; color: #55307d; font: inherit; cursor: pointer; }

.cover { background: #bf326a; gap: 24px; }
.cover-copy { color: #fff; min-width: 0; }
.cover-copy .jump { color: #8d1746; }
.cover-collage {
  width: min(100%, 455px);
  aspect-ratio: 1.03;
  position: relative;
  isolation: isolate;
}
.party-frame {
  position: absolute;
  margin: 0;
  border: clamp(7px, 1.1vw, 12px) solid #fffcf3;
  background: #ffe8ef;
  box-shadow: 0 6px 16px #850a3e66, inset 0 0 4px #850a3e40;
}
.party-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-frame { z-index: 2; top: 1%; right: 6%; width: 56%; height: 76%; transform: rotate(8deg); }
.rosita-frame { top: 27%; left: 4%; width: 40%; height: 52%; transform: rotate(-9deg); background: #fff3bd; }
.date-frame {
  z-index: 3;
  bottom: 3%;
  left: 33%;
  width: 54%;
  min-height: 25%;
  padding: 7px 4px;
  display: grid;
  place-items: center;
  background: #fff8db;
  color: #861847;
  transform: rotate(-6deg);
}
.date-frame strong, .date-frame span { display: block; }
.date-frame strong { font-size: clamp(16px, 3vw, 23px); }
.date-frame span { font-size: clamp(12px, 2vw, 16px); }
.collage-bow { position: absolute; z-index: 4; width: 22%; height: auto; pointer-events: none; }
.bow-top { top: -5%; right: 0; transform: rotate(14deg); }
.bow-bottom { bottom: 15%; left: 4%; transform: rotate(-14deg); }

.fresilandia {
  display: grid;
  align-items: end;
  justify-items: center;
  width: min(100%, 680px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: 24px 16px max(40px, env(safe-area-inset-bottom));
  background: #57b9ee url('assets/fresilandia.webp') center / cover no-repeat;
}
#enter-fresilandia {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  background: none;
  cursor: pointer;
}
.welcome-envelope {
  position: relative;
  display: grid;
  place-items: center;
  width: min(72vw, 310px);
  aspect-ratio: 1.55;
  border: 3px solid #fff5ea;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffd0e0 52%, #f9a9c8 53%);
  box-shadow: 0 6px 18px #70214566;
}
.welcome-envelope::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #ee86b0;
  clip-path: polygon(0 0, 100% 0, 50% 69%);
  transform-origin: top;
  transition: transform 300ms ease;
}
#enter-fresilandia:hover .welcome-envelope::before { transform: rotateX(24deg); }
.welcome-envelope > img { z-index: 1; width: clamp(35px, 11vw, 53px); transform: translateY(16px); }
.welcome-envelope-label {
  padding: 9px 18px;
  border: 2px solid #fff5ea;
  border-radius: 32px;
  background: #a91f51;
  color: white;
  font: 800 clamp(19px, 5vw, 24px) Nunito, system-ui, sans-serif;
}
@media (prefers-reduced-motion: reduce) {
  .welcome-envelope::before { transition: none; }
}


.cover-copy .name-art {
  display: block;
  width: min(100%, 490px);
  height: auto;
  margin: auto;
  filter: drop-shadow(0 3px 2px #47632440);
}
.cover-copy h1 .age-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 15px);
  color: #fff8e8;
  font-size: clamp(25px, 6vw, 46px);
  margin-top: 5px;
}
.age-line img {
  width: clamp(100px, 34vw, 178px);
  height: auto;
  filter: drop-shadow(0 3px 2px #47632440);
}

/* Typography and colors shared by the invitation text. */
:root {
  --pink: #94214b;
  color: #29432b;
  font-family: Nunito, system-ui, sans-serif;
}
.cover-copy, .ticket, .lunch, .signoff { color: #29432b; }
h1, h2, .signoff strong, .berry-game h3 {
  font-family: Quicksand, Nunito, system-ui, sans-serif;
  font-weight: 700;
}
h2, .signoff strong, .berry-game h3, .date-frame, .cover-copy h1 .age-line {
  color: var(--pink);
}
.cover-copy h1 .age-line { letter-spacing: -.025em; }
.intro, .ticket strong, .lunch strong { font-weight: 800; }
.jump, .music, .cake-button span, #enter-fresilandia {
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 800;
}

.details {
  background: #c41461;
}
.details #recreo-title {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 500;
  letter-spacing: .09em;
  color: #fff8e8;
  font-size: clamp(33px, 7vw, 65px);
  line-height: 1.05;
  text-transform: uppercase;
}
.details .lunch { color: #fff8e8; }
.lunch-berries {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 12px;
}
.lunch-berries img {
  width: 30px;
  height: auto;
}
.lunch-berries img:first-child { transform: rotate(-19deg); }
.lunch-berries img:nth-child(2) { width: 43px; }
.lunch-berries img:last-child { transform: rotate(19deg); }
@media (min-width: 800px) {
  .details {
    background: url('assets/fresita-sticker.webp') left 6% center / 112px no-repeat,
      url('assets/fresita-sticker.webp') right 6% center / 112px no-repeat, #c41461;
  }
}

.cover-copy .intro,
.cover-copy > p.cover-invitation {
  color: #fff;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(15px, 3vw, 18px);
  text-shadow: 0 1px 3px #7c1740, 0 0 2px #7c1740;
}

.cover-copy h1 .age-line { color: #fff8e8; }

.berry-cover {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: clamp(30px, 5vw, 54px) 20px;
  background: repeating-conic-gradient(#f9d3e2 0 25%, #fce3ec 0 50%) 0 / 36px 36px;
}
.berry-cover h1 { width: min(100%, 450px); }
.berry-cover .name-art { display: block; width: 100%; height: auto; }
.keepsake { position: relative; width: min(76%, 310px); margin: 9px auto 0; }
.keepsake-photo {
  margin: 0;
  padding: 10px 10px 18px;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 9px 24px #88234c33;
}
.keepsake-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
  background: radial-gradient(ellipse at 50% 38%, #fff9ed, #f8c9dc);
}
.keepsake-bow { position: absolute; top: -19px; left: -26px; width: 75px; pointer-events: none; }
.age-surprise {
  position: absolute;
  right: clamp(-35px, -5vw, -16px);
  bottom: 1px;
  width: clamp(82px, 27vw, 137px);
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transform: rotate(7deg);
}
.age-surprise img { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 3px #88234c44); }
.age-surprise:hover { transform: rotate(0) scale(1.04); }
.berry-cover .keepsake-message { margin: 0; color: #8a2049; font: italic 700 clamp(17px, 4vw, 23px)/1.25 Georgia, serif; }
.keepsake-date { font-size: clamp(13px, 3.5vw, 16px); text-align: center; }
.surprise-note { margin: 0; color: #8a2049; font-weight: 800; }
.cover-berry { position: absolute; top: 75%; left: 50%; pointer-events: none; animation: scatter 800ms ease-out both; }
@media (prefers-reduced-motion: reduce) { .cover-berry { display: none; } }

.cake-section { background: #fce3ec; padding-top: 46px; }
.cake-button .cake-art {
  display: block;
  position: relative;
  padding: 0;
  margin-top: 24px;
  width: min(79vw, 330px);
  border: 0;
  border-radius: 0;
  background: none;
}
.cake-button .cake-art img { display: block; width: 100%; height: auto; image-rendering: auto; }
.birthday-candle {
  position: absolute;
  top: 0;
  left: 32%;
  width: 4%;
  height: 24%;
  border-radius: 5px 5px 2px 2px;
  background: repeating-linear-gradient(-35deg, #d04076 0 5px, #fff4db 5px 10px);
}
.birthday-candle:nth-of-type(2) { left: 48%; top: -5%; }
.birthday-candle:nth-of-type(3) { left: 64%; }
.birthday-candle::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: -7%;
  width: 114%;
  height: 42%;
  border-radius: 68% 32% 60% 50%;
  background: #ffc143;
  box-shadow: 0 0 11px #ffb02f;
  transform: rotate(-10deg);
}
.candles-out .birthday-candle::before { opacity: 0; }

.memory-open { margin: 8px 3px 0; color: #355723; background: #e5f5bd; }
#memory-grid .game-cell { background: #f9d9e7; color: #8a2049; }
#memory-grid .game-cell.is-revealed { background: #fffaf4; }
#memory-grid .game-cell:disabled { background: #e5f5bd; }

.prize-note { color: #604159; font-size: .92rem; }
.prize-claim { color: #fff; background: #94214b; }
.prize-form {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  max-width: 300px;
  margin: 14px auto;
  color: #604159;
  text-align: left;
}
.prize-form input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b87c98;
  border-radius: 12px;
  font: inherit;
}

.welcome-envelope { perspective: 620px; }
.welcome-envelope::before {
  z-index: 4;
  backface-visibility: hidden;
  transition: transform 420ms ease;
}
.welcome-card {
  position: absolute;
  z-index: 2;
  inset: 9% 8% 12%;
  display: grid;
  place-items: start center;
  padding: 12px 4px;
  border-radius: 9px;
  background: #fff8ed;
  color: #a91f51;
  font: 800 clamp(15px, 4vw, 23px) Nunito, system-ui, sans-serif;
  transition: transform 460ms 310ms ease;
}
.welcome-pocket {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: 9px;
  background: linear-gradient(145deg, #ffd0e0 52%, #f9a9c8 53%);
  clip-path: polygon(0 0, 50% 68%, 100% 0, 100% 100%, 0 100%);
}
.welcome-envelope > img { z-index: 5; transition: opacity 180ms; }
#enter-fresilandia.is-opening .welcome-envelope::before { transform: rotateX(175deg); }
.is-opening .welcome-envelope > img { opacity: 0; }
.is-opening .welcome-card { transform: translateY(-66%); }
.invitation-revealed .keepsake { animation: photo-arrive 380ms ease-out both; }
@keyframes photo-arrive { from { opacity: 0; transform: translateY(9px); } }
.age-hint {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 15px;
  background: #fff9ec;
  color: #8a2049;
  font: 800 .82rem Nunito, system-ui, sans-serif;
}
.prize-card {
  max-width: 330px;
  margin: 12px auto;
  padding: 14px;
  border-radius: 18px;
  background: #f9d9e7;
}
.prize-card h4 { margin: 0 0 8px; color: #8a2049; font-size: 1.2rem; }
.prize-card button { max-width: 100%; white-space: normal; }
@media (prefers-reduced-motion: reduce) {
  .welcome-envelope::before, .welcome-card, .welcome-envelope > img { transition: none; }
  .invitation-revealed .keepsake { animation: none; }
}

.snack-stickers {
  display: block;
  width: min(100%, 275px);
  aspect-ratio: 3;
  object-fit: contain;
  margin: -5px auto 10px;
}

.details .ticket time,
.details .ticket p,
.details .lunch {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(16px, 2.4vw, 19px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.details .ticket strong {
  font-family: Nunito, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}

.welcome-card {
  display: block;
  inset: 10% 12% auto;
  height: 76%;
  padding: 0;
  overflow: hidden;
  background: #ffd4e5;
  visibility: hidden;
}
.welcome-card-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.is-opening .welcome-card {
  visibility: visible;
  transform: translateY(-94%);
}

.details {
  position: relative;
  padding: clamp(30px, 6vw, 54px) clamp(15px, 4vw, 32px);
  background: #fbd8e5;
}
.details #recreo-title {
  max-width: 610px;
  margin: 0 auto 18px;
  color: #85234d;
  font: 700 clamp(29px, 6vw, 53px)/1.12 Quicksand, Nunito, sans-serif;
  letter-spacing: -.025em;
  text-transform: none;
}
.details .ticket {
  background: #fff;
  border: 2px solid #c8dda8;
}
.details .ticket time, .details .ticket p, .details .lunch {
  color: #3d5331;
  font: 700 clamp(16px, 2.5vw, 20px)/1.4 Nunito, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.details .lunch { margin-top: 16px; }
.details .ticket strong { color: #36502b; }
@media (min-width: 800px) {
  .details { padding-inline: clamp(125px, 16vw, 210px); }
}

.details #music-toggle,
.details #memory-open {
  min-height: 46px;
  margin: 6px 3px;
  padding: 9px 17px;
  border: 2px solid currentColor;
  border-radius: 14px;
  box-shadow: 0 4px 0 #781a4740;
  font: 500 clamp(16px, 3.6vw, 20px)/1.15 'Barlow Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.details #music-toggle { color: #872149; background: #fff6ec; }
.details #memory-open { color: #315327; background: #f0f9c9; }
.details #music-toggle:hover, .details #memory-open:hover { filter: brightness(.96); }
.details #music-toggle:active, .details #memory-open:active { transform: translateY(2px); }

.details #music-toggle, .details #memory-open {
  font: 800 clamp(15px, 3.5vw, 17px)/1.2 Nunito, system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.details #music-toggle { background: #fff; }
.details #memory-open { background: #e5f3ce; }

#recreo {
  padding: clamp(32px, 6vw, 58px) clamp(16px, 5vw, 38px);
  background: #d8f0fc;
  border-top: 7px solid #f395ad;
}
#recreo #recreo-title {
  width: fit-content;
  max-width: 100%;
  padding: .22em .62em .29em;
  border-radius: 18px;
  background: #f9b7c8;
  font: 700 clamp(30px, 6vw, 49px)/1.12 Quicksand, Nunito, sans-serif;
  color: #812541;
}
#recreo .ticket {
  background: #fffdf7;
  border: 2px solid #a9ca78;
  box-shadow: 0 5px 0 #dce9ba;
}
#recreo .lunch { margin: 18px auto 20px; }
#recreo #music-toggle {
  color: #164763;
  background: #d3effb;
  border-color: #79bfdc;
  box-shadow: 0 3px 0 #b2dff2;
}
#recreo #memory-open {
  color: #2c491e;
  background: #d8eeaf;
  border-color: #8bb655;
  box-shadow: 0 3px 0 #bddc91;
}
