/* ==========================================================
   Diseño "Bosque" · Infantil (cabaña de troncos, motivos genéricos)
   3 toques a la puerta → se abre en 3D → interior cálido con el retrato
   ========================================================== */

:root {
  --rosa: #e94e8a;
  --rosa-osc: #c23a72;
  --morado: #7b4fa0;
  --verde: #4c8a3f;
  --madera: #8a5a34;
  --madera-osc: #6e4424;
  --miel: #f2b134;
  --cacao: #6b3a1e;
  --crema: #fff6ec;

  --s-fondo: var(--crema);
  --s-tinta: #4a2c1a;
  --s-suave: #7a5a44;
  --s-acento: var(--rosa);
  --s-acento-tinta: #fff;
  --s-tarjeta: #ffffff;
  --s-borde: rgba(138, 90, 52, .25);
  --s-radio: 22px;
  --s-sombra: 0 14px 26px -16px rgba(74, 44, 26, .55);
  --s-fuente: "Fredoka", system-ui, sans-serif;
  --s-titulo: "Pacifico", "Fredoka", cursive;
  --s-titulo-tam: clamp(2rem, 9vw, 2.6rem);
  --s-etiqueta: "Fredoka", system-ui, sans-serif;
  --s-num: "Fredoka", system-ui, sans-serif;
  --s-titulo-color: var(--morado);
}

body {
  background:
    radial-gradient(circle, rgba(233, 78, 138, .12) 3px, transparent 3.5px) 0 0 / 34px 34px,
    radial-gradient(circle, rgba(76, 138, 63, .1) 3px, transparent 3.5px) 17px 17px / 34px 34px,
    var(--crema);
  color: var(--s-tinta);
  font-family: var(--s-fuente);
}

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.escena { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }

/* ---------- Interior (HERO) ---------- */
.interior {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 48px) 16px 0;
  text-align: center;
  background:
    radial-gradient(60% 38% at 50% 6%, rgba(255, 226, 160, .7), transparent 72%),
    radial-gradient(circle, rgba(123, 79, 160, .2) 2px, transparent 2.6px) 0 0 / 26px 26px,
    radial-gradient(circle, rgba(233, 78, 138, .24) 2px, transparent 2.6px) 13px 13px / 26px 26px,
    #fbe1ea;
}
.zocalo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .18), transparent 14px),
    repeating-linear-gradient(90deg, #a8703f 0 38px, var(--madera-osc) 38px 40px);
  border-top: 8px solid var(--madera-osc);
}
.banderines {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 6px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  border-top: 2px solid var(--madera);
}
.banderines i { width: 7.5%; max-width: 36px; aspect-ratio: 4 / 5; clip-path: polygon(0 0, 100% 0, 50% 100%); background: var(--rosa); transform-origin: 50% 0; animation: banderin 3s ease-in-out infinite; }
.banderines i:nth-child(4n + 2) { background: var(--morado); animation-delay: -.7s; }
.banderines i:nth-child(4n + 3) { background: var(--verde); animation-delay: -1.4s; }
.banderines i:nth-child(4n + 4) { background: var(--miel); animation-delay: -2.1s; }
@keyframes banderin { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.interior__bienvenida { position: relative; margin: 6px 0 0; font-weight: 600; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; color: var(--morado); }
.interior__nombre {
  position: relative;
  margin: 0 0 4px;
  font-family: "Pacifico", "Fredoka", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 13vw, 3.9rem);
  line-height: 1.2;
  color: var(--rosa);
  text-shadow: 0 3px 0 #fff, 0 7px 0 rgba(123, 79, 160, .35);
  overflow-wrap: anywhere;
}
.interior__nombre:focus { outline: none; }

.retrato-zona { position: relative; z-index: 2; width: clamp(170px, min(64vw, calc((100svh - 410px) * .818)), 300px); padding-top: 28px; flex: none; }
.retrato__cordel { position: absolute; top: 0; left: 8%; width: 84%; height: 30px; overflow: visible; transform-origin: 50% 3px; }
.retrato__clavo { position: absolute; top: -2px; left: 50%; z-index: 2; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f1f1f1, #8c8c8c 70%); box-shadow: 0 2px 2px rgba(0, 0, 0, .3); }
.retrato {
  position: relative;
  margin: 0;
  aspect-ratio: 9 / 11;
  padding: 15px;
  border-radius: 12px;
  background: linear-gradient(135deg, #bf844b, var(--madera-osc) 48%, #b07843);
  box-shadow: inset 0 0 0 3px #5a361c, inset 0 0 0 7px #c58d55, inset 0 0 0 10px var(--miel), 0 20px 28px -12px rgba(74, 44, 26, .6);
  transform-origin: 50% -25px;         /* gira desde el clavo, igual que el cordel */
}
.retrato img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 4px; background: #f3e3d3; }
.retrato__cinta {
  position: absolute;
  left: 50%;
  bottom: -18px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 26px;
  background: var(--rosa);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  clip-path: polygon(0 0, 100% 0, 93% 50%, 100% 100%, 0 100%, 7% 50%);
  transform: translateX(-50%) rotate(-2deg);
}
.retrato__cinta b { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--miel); color: var(--cacao); font-size: 1.35rem; }
.personaje {
  position: absolute;
  left: -24%;
  bottom: -14%;
  z-index: 3;
  width: 54%;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(74, 44, 26, .4));
  opacity: 0;
  transform: translateX(-30%) rotate(-12deg);
  transform-origin: 50% 100%;
}

.interior__fecha { position: relative; z-index: 2; margin: 28px 0 0; padding: 4px 16px; border-radius: 999px; background: rgba(255, 255, 255, .7); font-weight: 600; font-size: 1rem; color: var(--cacao); }
.interior__fecha [data-pieza="semana"] { text-transform: capitalize; }

/* Mesa con mermeladas, panqueques y taza humeante */
.mesa { position: relative; z-index: 2; align-self: stretch; margin: auto -16px 0; padding-top: 12px; }
.mesa__cosas { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: center; gap: clamp(6px, 3vw, 18px); margin-bottom: -4px; }
.mesa__cosas > * { flex: none; display: block; height: auto; }
.frasco--1 { width: clamp(40px, 11vw, 56px); }
.frasco--2 { width: clamp(32px, 9vw, 44px); }
.panqueques { width: clamp(80px, 22vw, 112px); }
.taza { position: relative; width: clamp(48px, 13vw, 64px); }
.taza svg { display: block; width: 100%; height: auto; }
.vapor { position: absolute; left: 8%; bottom: 90%; width: 64%; height: 42px; display: flex; justify-content: space-around; align-items: flex-end; filter: drop-shadow(0 0 2px rgba(110, 68, 36, .4)); }
.vapor i { width: 9px; height: 24px; border-left: 3px solid rgba(255, 255, 255, .95); border-radius: 50%; opacity: 0; animation: vapor 2.6s ease-in infinite; }
.vapor i:nth-child(2) { animation-delay: .85s; }
.vapor i:nth-child(3) { animation-delay: 1.7s; }
@keyframes vapor { 0% { opacity: 0; transform: translateY(10px) scaleX(1); } 30% { opacity: .95; } 100% { opacity: 0; transform: translateY(-28px) scaleX(-1); } }
.mesa__tabla { height: 16px; background: linear-gradient(180deg, #c08850, var(--madera)); border-radius: 8px 8px 0 0; box-shadow: 0 4px 0 var(--madera-osc); }
.mesa__mantel {
  height: calc(env(safe-area-inset-bottom) + 74px);
  background:
    radial-gradient(circle at 50% 100%, #fff 0 6px, transparent 6.5px) 0 100% / 18px 9px repeat-x,
    repeating-linear-gradient(90deg, rgba(233, 78, 138, .45) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(0deg, rgba(233, 78, 138, .45) 0 14px, transparent 14px 28px),
    #fff;
  box-shadow: inset 0 8px 10px -6px rgba(0, 0, 0, .25);
}

/* Entrada del interior */
.escena.dentro .interior__bienvenida { animation: subir .7s ease .2s both; }
.escena.dentro .interior__nombre { animation: rebote .9s cubic-bezier(.3, 1.6, .5, 1) .35s both; }
.escena.dentro .retrato, .escena.dentro .retrato__cordel { animation: colgar 1.1s cubic-bezier(.3, 1.5, .5, 1) .3s both, columpio 4.5s ease-in-out 1.5s infinite; }
.escena.dentro .retrato__clavo { animation: subir .4s ease .2s both; }
.escena.dentro .interior__fecha { animation: subir .7s ease 1s both; }
.escena.dentro .mesa__cosas > * { animation: brinco .7s cubic-bezier(.3, 1.8, .5, 1) both; }
.escena.dentro .mesa__cosas > :nth-child(1) { animation-delay: .6s; }
.escena.dentro .mesa__cosas > :nth-child(2) { animation-delay: .75s; }
.escena.dentro .mesa__cosas > :nth-child(3) { animation-delay: .9s; }
.escena.dentro .mesa__cosas > :nth-child(4) { animation-delay: 1.05s; }
.escena.dentro .personaje { animation: asomar .9s cubic-bezier(.3, 1.5, .5, 1) 1.5s forwards; }
@keyframes subir { from { opacity: 0; transform: translateY(16px); } }
@keyframes rebote { from { opacity: 0; transform: scale(.5); } }
@keyframes colgar { from { opacity: 0; transform: translateY(-70px) rotate(-9deg); } }
@keyframes columpio { 0%, 100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); } }
@keyframes brinco { from { opacity: 0; transform: translateY(24px) scale(.6); } }
@keyframes asomar { to { opacity: 1; transform: none; } }

/* ---------- Exterior (INTRO) ---------- */
.exterior {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #f6c7dc 0%, #fbe0cf 40%, #eaf2d3 72%);
  transition: transform 1.5s cubic-bezier(.6, 0, .35, 1), opacity .7s ease .85s;
}
.exterior.entrando { transform: scale(7); opacity: 0; pointer-events: none; }
.sol { position: absolute; top: 14%; left: 50%; width: 180px; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 170, .95) 0 32%, rgba(242, 177, 52, .35) 33% 52%, transparent 70%); }
.nube { position: absolute; height: 26px; border-radius: 26px; background: #fff; opacity: .9; animation: nube 40s linear infinite; }
.nube::before, .nube::after { content: ""; position: absolute; bottom: 8px; border-radius: 50%; background: #fff; }
.nube::before { left: 14%; width: 40%; height: 180%; }
.nube::after { left: 44%; width: 34%; height: 140%; }
.nube--1 { top: 10%; left: 8%; width: 110px; }
.nube--2 { top: 22%; left: 62%; width: 80px; animation-duration: 55s; animation-delay: -20s; }
@keyframes nube { from { translate: -40vw 0; } to { translate: 60vw 0; } }

.abedul { position: absolute; top: -2%; z-index: 3; height: 104%; width: clamp(18px, 6vw, 34px); overflow: visible; }
.abedul--1 { left: 3%; }
.abedul--2 { left: 15%; top: 6%; height: 80%; width: clamp(12px, 4vw, 22px); z-index: 1; opacity: .8; }
.abedul--3 { right: 4%; }
.abedul--4 { right: 17%; top: 10%; height: 76%; width: clamp(12px, 4vw, 22px); z-index: 1; opacity: .8; }

.exterior__cielo { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: calc(env(safe-area-inset-top) + 16svh) 16px 0; }
.exterior__cielo::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 42%;
  background:
    radial-gradient(55% 100% at 18% 100%, #7cb867 0 62%, transparent 63%),
    radial-gradient(55% 100% at 84% 100%, #68a656 0 62%, transparent 63%);
}
.exterior__t { position: absolute; top: calc(env(safe-area-inset-top) + 6svh); left: 16px; right: 16px; z-index: 4; margin: 0; font-family: "Pacifico", "Fredoka", cursive; font-size: clamp(1.8rem, 8vw, 2.5rem); color: var(--morado); text-shadow: 0 3px 0 #fff; }
.cabana { position: relative; z-index: 2; width: clamp(240px, min(86vw, calc(50svh * 1.15)), 400px); perspective: 700px; }
.cabana__casa { display: block; width: 100%; height: auto; overflow: visible; }
.puerta {
  all: unset;
  position: absolute;
  left: 39.333%;
  top: 57.692%;
  width: 21.333%;
  height: 38.462%;
  min-width: 44px;
  cursor: pointer;
  transform-origin: 0 50%;
  transition: transform 1.2s cubic-bezier(.5, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.puerta svg { display: block; width: 100%; height: 100%; transition: filter 1s; }
.puerta:focus-visible { outline: 3px dashed var(--morado); outline-offset: 4px; border-radius: 40% 40% 4px 4px; }
.puerta.tiembla { animation: tiembla .35s ease; }
@keyframes tiembla { 20% { transform: rotate(-2.5deg) translateX(-2px); } 40% { transform: rotate(2.5deg) translateX(2px); } 60% { transform: rotate(-1deg); } 80% { transform: rotate(1deg); } }
.cabana.abierta .puerta { transform: rotateY(-112deg); pointer-events: none; }
.cabana.abierta .puerta svg { filter: brightness(.7); }
.luz-puerta { position: absolute; left: 39.333%; top: 96%; width: 21.333%; height: 22%; background: linear-gradient(180deg, rgba(255, 220, 140, .9), rgba(255, 220, 140, 0)); clip-path: polygon(0 0, 100% 0, 150% 100%, -50% 100%); opacity: 0; transition: opacity .8s ease .3s; z-index: 1; }
.cabana.abierta .luz-puerta { opacity: 1; }
.toc-globo {
  position: absolute;
  left: 60%;
  top: 38%;
  z-index: 4;
  padding: 6px 12px;
  border-radius: 16px;
  background: #fff;
  color: var(--rosa);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(74, 44, 26, .25);
  transform: scale(0) rotate(-8deg);
  transform-origin: 0 100%;
  transition: transform .3s cubic-bezier(.3, 1.8, .5, 1);
  pointer-events: none;
}
.toc-globo::after { content: ""; position: absolute; left: 12px; bottom: -9px; border: 6px solid transparent; border-top: 9px solid #fff; border-left-width: 2px; }
.toc-globo.ver { transform: scale(1) rotate(-6deg); }
.humo { position: absolute; left: 70.667%; top: 9%; width: 0; height: 0; }
.humo i { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .8); opacity: 0; animation: humo 4s ease-out infinite; }
.humo i:nth-child(2) { animation-delay: 1.3s; }
.humo i:nth-child(3) { animation-delay: 2.6s; }
@keyframes humo { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 20% { opacity: .9; } 100% { opacity: 0; transform: translate(28px, -84px) scale(1.9); } }

.suelo {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 24svh;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #6fae5a, var(--verde));
}
.suelo::before { content: ""; position: absolute; top: 0; left: 50%; width: 34%; height: 100%; transform: translateX(-50%); background: #e2c99a; clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); opacity: .75; }
.toques { position: relative; display: flex; gap: 12px; }
.toques i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 2px #fff; transition: background-color .3s, transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.toques i.lleno { background: var(--rosa); transform: scale(1.3); }
.exterior__hint { position: relative; margin: 0; font-weight: 700; font-size: 1.15rem; color: #fff; text-shadow: 0 2px 3px rgba(0, 0, 0, .3); animation: botar 1.4s ease-in-out infinite; }
@keyframes botar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.exterior.abierta .suelo > *, .exterior.abierta .exterior__t { opacity: 0; transition: opacity .5s; }

.hoja-cae { position: absolute; top: -30px; z-index: 5; width: 16px; height: 16px; border-radius: 0 80% 0 80%; background: var(--c, var(--verde)); opacity: .9; animation: caer var(--d, 9s) linear infinite; pointer-events: none; }
.hoja-cae--1 { left: 8%; --c: var(--verde); --d: 9s; }
.hoja-cae--2 { left: 28%; --c: var(--miel); --d: 11s; animation-delay: -4s; }
.hoja-cae--3 { left: 46%; --c: var(--rosa); --d: 10s; animation-delay: -7s; width: 12px; height: 12px; }
.hoja-cae--4 { left: 63%; --c: #6fae5a; --d: 12s; animation-delay: -2s; }
.hoja-cae--5 { left: 79%; --c: var(--miel); --d: 9.5s; animation-delay: -6s; width: 13px; height: 13px; }
.hoja-cae--6 { left: 92%; --c: var(--verde); --d: 11.5s; animation-delay: -9s; }
@keyframes caer {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, 26svh) rotate(90deg); }
  50% { transform: translate(-12px, 52svh) rotate(200deg); }
  75% { transform: translate(26px, 78svh) rotate(290deg); }
  100% { transform: translate(0, 106svh) rotate(390deg); }
}

.escena .desliza-c { color: var(--morado); z-index: 5; text-shadow: 0 1px 0 #fff; }

/* ---------- Secciones ---------- */
.receta-sec { padding-top: 80px; }
.receta {
  position: relative;
  width: min(100%, 380px);
  padding: 74px 24px 28px;
  margin-top: 60px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(123, 79, 160, .14) 31px 32px) 0 120px,
    #fffdf8;
  border: 3px dashed rgba(233, 78, 138, .45);
  box-shadow: 0 20px 30px -18px rgba(74, 44, 26, .55);
}
.receta__foto {
  position: absolute;
  left: 50%;
  top: -64px;
  width: 120px;
  aspect-ratio: 9 / 11;
  margin: 0 0 0 -60px;
  padding: 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, #bf844b, var(--madera-osc));
  box-shadow: 0 10px 16px -8px rgba(74, 44, 26, .6);
  transform: rotate(-4deg);
}
.receta__foto img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 5px; }
.receta__t { margin: 0 0 10px; font-family: "Pacifico", "Fredoka", cursive; font-weight: 400; font-size: 1.6rem; line-height: 1.3; color: var(--rosa); }
.receta__p { margin: 0; font-size: 1.08rem; line-height: 2; }

.s-titulo { text-shadow: 0 3px 0 rgba(242, 177, 52, .45); }
.s-cuenta__caja { border: 2px solid rgba(233, 78, 138, .3); }
.s-cuenta__caja:nth-child(odd) { background: #fff4f8; }
.s-cuenta__num { font-weight: 700; color: var(--rosa); }
.s-cuenta__fin { font-family: "Pacifico", cursive; color: var(--rosa); }
.s-evento { border: 3px solid rgba(138, 90, 52, .25); background: #fff linear-gradient(180deg, rgba(242, 177, 52, .12), transparent 40%); }
.s-evento__icono { color: #fff; background: var(--verde); border-color: var(--verde); }
.s-evento__hora { font-weight: 700; color: var(--morado); }
.s-vestimenta__tipo { font-weight: 700; font-size: 1.4rem; color: var(--verde); font-family: var(--s-fuente); }
.s-rsvp__saludo { font-family: "Pacifico", cursive; font-size: 1.3rem; color: var(--morado); }
.s-btn { font-weight: 700; letter-spacing: .06em; }
.s-btn--linea, .s-btn--mini { border-color: var(--rosa); background: #fff; }
.s-btn--lleno { background: linear-gradient(180deg, #f472a4, var(--rosa)); box-shadow: 0 6px 0 var(--rosa-osc), 0 14px 20px rgba(74, 44, 26, .3); }
.s-btn--lleno:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--rosa-osc); }
.s-pie__n { font-family: "Pacifico", cursive; color: var(--rosa); }
.btn-musica { background: var(--rosa); color: #fff; box-shadow: 0 4px 0 var(--rosa-osc); }

@media (max-height: 640px) {
  .exterior__cielo { padding-top: calc(env(safe-area-inset-top) + 12svh); }
  .mesa__mantel { height: calc(env(safe-area-inset-bottom) + 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .banderines i, .nube, .hoja-cae, .humo i, .vapor i, .exterior__hint { animation: none !important; }
  .hoja-cae, .humo i { display: none; }
  .vapor i { opacity: .8; }
  .exterior { transition-duration: .5s, .4s; transition-delay: 0s, .1s; }
  .escena.dentro .retrato, .escena.dentro .retrato__cordel { animation: colgar .01s both; }
  .escena.dentro .interior__bienvenida, .escena.dentro .interior__nombre, .escena.dentro .interior__fecha,
  .escena.dentro .mesa__cosas > *, .escena.dentro .personaje, .escena.dentro .retrato__clavo { animation-duration: .01s !important; animation-delay: 0s !important; }
}
