/* ===== Calendario: temas, puertas, modal, intro ===== */
.adv, .adv-modal, .intro { --gold: #e3b341; --gold-2: #b8862a; --cream: #fbf5ea; --ink: #2d1c17; }
.c-rojo  { --main: #b3202b; --main-2: #7c141c; --main-soft: #f6dcd9; }
.c-verde { --main: #1f6a44; --main-2: #10452b; --main-soft: #d8ecdf; }

.adv { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 16px 18px; background: var(--cream); color: var(--ink);
  box-shadow: 0 18px 50px -20px rgba(60, 20, 10, .45); isolation: isolate; }
.adv-head { text-align: center; margin-bottom: 16px; position: relative; z-index: 2; }
.adv-kicker { margin: 0; font: 700 .72rem/1 'Nunito Sans', system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--main); }
.adv-title { margin: .35em 0 .1em; font: 600 clamp(1.6rem, 6vw, 2.3rem)/1.1 'Fraunces', Georgia, serif; }
.adv-sub { margin: 0; font-style: italic; opacity: .75; }
.adv-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(6px, 1.6vw, 12px); }
.adv-compact { padding: 12px; border-radius: 16px; }
.adv-compact .adv-grid { gap: 5px; }

/* --- puerta --- */
.door { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; perspective: 700px; font: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent; }
.door-24 { grid-column: span 2; aspect-ratio: auto; }
.door-inside { position: absolute; inset: 0; border-radius: 10px; background: #2b1712 center/cover no-repeat; display: grid; place-items: center;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .55); font-size: clamp(1rem, 4vw, 1.6rem); }
.door-leaf { position: absolute; inset: 0; border-radius: 10px; transform-origin: left center; transition: transform .75s cubic-bezier(.3, .7, .3, 1.1);
  background: var(--main); color: var(--cream); display: grid; place-items: center; backface-visibility: hidden; transform-style: preserve-3d;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18), 0 6px 14px -6px rgba(0, 0, 0, .45); }
.door-num { font: 600 clamp(1.05rem, 4.4vw, 1.9rem)/1 'Fraunces', Georgia, serif; }
.door-24 .door-num { font-size: clamp(1.5rem, 6vw, 2.6rem); }
.door:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 12px; }
.door.state-opened .door-leaf { transform: rotateY(-70deg); filter: brightness(.85); }
.door-inside { background-color: #f3e3c4; color: var(--main); }
.door-inside span { filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.door.state-ready .door-leaf { animation: glow 2.4s ease-in-out infinite; }
.door.is-today .door-leaf { animation: glow 1.4s ease-in-out infinite; }
.door-today { position: absolute; top: -7px; right: -5px; z-index: 3; background: var(--gold); color: #3a2405; font: 800 .62rem/1 'Nunito Sans', sans-serif;
  padding: 4px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.door.is-shaking { animation: shake .45s; }
@keyframes glow { 0%, 100% { box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 0 0 0 rgba(227,179,65,0); } 50% { box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 0 0 4px rgba(227,179,65,.55); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(2deg); } }

/* puerta 24 */
.s-lazo .door-24 .door-leaf { background-image: linear-gradient(90deg, transparent 46%, var(--gold) 46%, var(--gold) 54%, transparent 54%),
  linear-gradient(0deg, transparent 44%, var(--gold) 44%, var(--gold) 56%, transparent 56%); }
.door-bow { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: clamp(1.2rem, 5vw, 2rem); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.s-lazo .door-24 .door-num { background: var(--cream); color: var(--main); border-radius: 999px; padding: .15em .45em; }
.s-dorada .door-24 .door-leaf { background: linear-gradient(135deg, #f8e38c, #d4a033 40%, #fbe9a4 55%, #b9832a); color: #4a2e05; }
.s-doble .door-24 .door-leaf { width: 50%; }
.s-doble .door-24 .leaf-r { left: 50%; transform-origin: right center; }
.s-doble .door-24 .leaf-l { border-radius: 10px 4px 4px 10px; }
.s-doble .door-24 .leaf-r { border-radius: 4px 10px 10px 4px; }
.s-doble .door-24 .leaf-l .door-num { transform: translateX(50%); position: relative; z-index: 2; }
.s-doble .door-24.state-opened .leaf-r { transform: rotateY(70deg); }
.s-doble .door-24 .leaf-l::after, .s-doble .door-24 .leaf-r::after { content: ''; position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.s-doble .door-24 .leaf-l::after { right: 6px; }
.s-doble .door-24 .leaf-r::after { left: 6px; }

/* --- diseño: papel de regalo --- */
.d-papel { background: var(--cream) radial-gradient(circle at 20% 20%, rgba(0,0,0,.035) 2px, transparent 2.5px) 0 0/18px 18px; }
.d-papel .door-leaf { background-color: var(--main);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 6px, transparent 6px 14px); }
.d-papel .door:nth-child(3n) .door-leaf { background-image: radial-gradient(rgba(255,255,255,.28) 2px, transparent 2.6px); background-size: 11px 11px; }
.d-papel .door:nth-child(4n+1) .door-leaf { background-color: var(--main-2); }
.d-papel .door:not(.door-24) .door-num { background: var(--cream); color: var(--main); width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* --- diseño: liso --- */
.d-liso { background: #fffaf2; }
.d-liso .door-leaf { background: var(--main); border: 2px solid rgba(255,255,255,.18); }
.d-liso .door:nth-child(even) .door-leaf { background: var(--main-2); }

/* --- diseño: noche de Navidad --- */
.d-noche { background: radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 9%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 40% 30%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 88% 40%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 25% 75%, #fff8 50%, transparent 51%), linear-gradient(180deg, #0b1636, #1b2c5c 70%, #24386e); color: #f5ecd9; }
.d-noche .adv-kicker { color: var(--gold); }
.d-noche .door-leaf { background: linear-gradient(160deg, #1d3270, #12204a); color: var(--gold); border: 1px solid rgba(227,179,65,.45); }
.d-noche .door-24 .door-leaf { background-color: var(--main); color: var(--cream); }
.d-noche:not(.s-lazo):not(.s-dorada) .door-24 .door-leaf { background-image: none; }
.d-noche.s-dorada .door-24 .door-leaf { background: linear-gradient(135deg, #f8e38c, #d4a033 40%, #fbe9a4 55%, #b9832a); color: #4a2e05; }
.adv-snow { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.adv-snow i { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: snow linear infinite; }
@keyframes snow { to { top: 105%; margin-left: 30px; } }

/* --- diseño: troquelado (cartón kraft) --- */
.d-troquel { background: #c9a06b linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.06)); color: #3b2414; }
.d-troquel .adv-kicker { color: #6b3f1d; }
.d-troquel .door-leaf { background: #d7b483 radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%); color: var(--main);
  outline: 2px dashed rgba(70, 40, 15, .38); outline-offset: -5px; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 10px -5px rgba(0,0,0,.5); }
.d-troquel .door-inside { background-color: #4a2c16; }

@media (prefers-reduced-motion: reduce) {
  .door-leaf { transition: none; }
  .door.state-ready .door-leaf, .door.is-today .door-leaf, .adv-snow { animation: none; display: revert; }
  .adv-snow { display: none; }
}

/* ===== Modal de puerta ===== */
.adv-modal { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); overflow: visible; }
.adv-modal::backdrop { background: rgba(25, 10, 8, .62); backdrop-filter: blur(3px); }
.adv-modal[open] { animation: pop .38s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.m-card { background: var(--cream); color: var(--ink); border-radius: 22px; overflow: auto; max-height: calc(100dvh - 24px); box-shadow: 0 30px 80px rgba(0,0,0,.45);
  border-top: 8px solid var(--main); }
.is-24 .m-card { border-top-color: var(--gold); }
.m-head { display: flex; gap: 14px; align-items: center; padding: 18px 18px 10px; position: sticky; top: 0; background: var(--cream); z-index: 2; }
.m-num { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--main); color: var(--cream); display: grid; place-items: center; font: 600 1.5rem 'Fraunces', serif; }
.is-24 .m-num { background: linear-gradient(135deg, #f8e38c, #d4a033); color: #4a2e05; }
.m-date { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--main); font-weight: 700; }
.m-title { margin: 2px 0 0; font: 600 1.35rem/1.2 'Fraunces', Georgia, serif; }
.m-close { margin-left: auto; align-self: flex-start; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.06); font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; }
.m-body { padding: 6px 18px 22px; display: grid; gap: 16px; }
.m-text { white-space: pre-wrap; font: 400 1.08rem/1.65 'Fraunces', Georgia, serif; }
.m-photos { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); }
.m-photos.n1 { grid-template-columns: 1fr; }
.m-photos.n2 { grid-template-columns: 1fr 1fr; }
.m-photo { padding: 0; border: 0; background: #eee; border-radius: 12px; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; }
.m-photos.n1 .m-photo { aspect-ratio: auto; }
.m-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-photos.n1 .m-photo img { max-height: 60vh; object-fit: contain; background: #111; }
.m-voucher { position: relative; border: 2px dashed var(--main); border-radius: 16px; padding: 18px; text-align: center; background: var(--main-soft); display: grid; gap: 4px; }
.m-voucher-k { font: 800 .75rem 'Nunito Sans', sans-serif; letter-spacing: .25em; text-transform: uppercase; color: var(--main); }
.m-voucher-v { font: 600 1.4rem/1.2 'Fraunces', serif; }
.m-voucher-f { font-size: .8rem; opacity: .7; }
.m-audio p { margin: 0 0 6px; font-weight: 700; }
.m-audio audio { width: 100%; }
.m-embed { border-radius: 14px; overflow: hidden; background: #000; }
.m-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.m-16x9 { aspect-ratio: 16 / 9; }
.m-spotify { height: 152px; background: transparent; }
.m-spotify.tall { height: 352px; }
.m-link { display: block; text-align: center; padding: 14px; border-radius: 14px; background: var(--main); color: var(--cream); font-weight: 800; text-decoration: none; }
.m-empty { text-align: center; opacity: .7; }
.adv-lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; }
.adv-lightbox::backdrop { background: rgba(0,0,0,.9); }
.adv-lightbox img { max-width: 96vw; max-height: 94dvh; display: block; border-radius: 8px; }

.adv-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; transition: .3s; z-index: 1000; background: #2d1c17; color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100vw - 32px); text-align: center; pointer-events: none; }
.adv-toast.show { opacity: 1; transform: translate(-50%, 0); }
.adv-confetti { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }

/* ===== Intro: sobre / caja / puerta ===== */
body.intro-on { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; justify-items: center; gap: 28px; padding: 16px;
  background: radial-gradient(circle at 50% 40%, #3a1d17, #140806); transition: opacity .6s; }
.intro.is-leaving { opacity: 0; }
.intro-stage { cursor: pointer; outline: none; perspective: 900px; }
.intro-hint { margin: 0; color: #f3e6cf; font: 700 .95rem 'Nunito Sans', sans-serif; letter-spacing: .08em; animation: pulse 1.8s infinite; }
.intro.is-open .intro-hint { visibility: hidden; }
@keyframes pulse { 50% { opacity: .45; } }

/* sobre */
.env { position: relative; width: min(320px, 82vw); aspect-ratio: 3 / 2; margin-top: 70px; }
.env > * { position: absolute; inset: 0; }
.env-back { background: var(--main-2); border-radius: 8px; }
.env-letter { inset: 8px 14px; background: var(--cream); border-radius: 6px; display: grid; place-content: center; text-align: center; gap: 4px; color: var(--ink);
  transition: transform .9s .55s cubic-bezier(.3, .8, .3, 1); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.env-letter span { font: 700 .75rem 'Nunito Sans', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--main); }
.env-letter strong { font: 600 1.7rem/1.1 'Fraunces', serif; }
.env-letter em { font-size: .85rem; opacity: .7; }
.env-front { background: var(--main); clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); border-radius: 8px; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 14%; color: var(--cream); font: italic 600 1.15rem 'Fraunces', serif; }
.env-flap { background: var(--main-2); filter: brightness(1.15); clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: top; transition: transform .6s, z-index 0s .3s; z-index: 3; }
.env-seal { inset: auto; left: 50%; top: 46%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6d57a, #b88326);
  display: grid; place-items: center; color: #5a3a08; font-size: 1.2rem; z-index: 4; transition: opacity .3s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.intro-sobre.is-open .env-seal { opacity: 0; }
.intro-sobre.is-open .env-flap { transform: rotateX(180deg); z-index: 0; }
.intro-sobre.is-open .env-letter { transform: translateY(-62%); }

/* caja */
.box { position: relative; width: min(240px, 66vw); margin-top: 60px; }
.box-body { height: 180px; background: var(--main) linear-gradient(90deg, transparent 44%, var(--gold) 44%, var(--gold) 56%, transparent 56%); border-radius: 6px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px; }
.box-tag { background: var(--cream); color: var(--ink); font: italic 600 1rem 'Fraunces', serif; padding: 6px 14px; border-radius: 6px; transform: rotate(-4deg); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.box-lid { position: relative; height: 46px; margin: 0 -14px -4px; background: var(--main-2) linear-gradient(90deg, transparent 45%, var(--gold) 45%, var(--gold) 55%, transparent 55%);
  border-radius: 6px; z-index: 2; transition: transform .9s cubic-bezier(.3, .8, .3, 1), opacity .9s; box-shadow: 0 6px 10px rgba(0,0,0,.3); }
.box-bow { position: absolute; left: 50%; top: -46px; transform: translateX(-50%); font-size: 3.4rem; }
.intro-caja.is-open .box-lid { transform: translate(40px, -160px) rotate(24deg); opacity: 0; }
.intro-caja.is-open .box-body { animation: boxglow 1.2s .4s forwards; }
@keyframes boxglow { to { box-shadow: 0 -40px 80px 20px rgba(255, 220, 120, .7); } }

/* puerta */
.gate { position: relative; width: min(260px, 70vw); aspect-ratio: 3 / 4.2; perspective: 1000px; }
.gate-light { position: absolute; inset: 0; background: radial-gradient(circle, #fff6d6, #f1c35c 60%, #c7862a); border-radius: 120px 120px 6px 6px; display: grid; place-items: center; font-size: 3rem; }
.gate-leaf { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--main) repeating-linear-gradient(180deg, transparent 0 34px, rgba(0,0,0,.12) 34px 36px);
  transition: transform 1.1s cubic-bezier(.4, .1, .3, 1); box-shadow: inset 0 0 0 6px var(--main-2); }
.gate-l { left: 0; border-radius: 120px 0 0 6px; transform-origin: left; }
.gate-r { right: 0; border-radius: 0 120px 6px 0; transform-origin: right; }
.gate-knob { position: absolute; top: 55%; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.gate-l .gate-knob { right: 12px; }
.gate-r .gate-knob { left: 12px; }
.gate-wreath { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: grid; justify-items: center; font-size: 3.4rem; z-index: 2; transition: opacity .4s; }
.gate-wreath span { font: italic 600 1rem 'Fraunces', serif; color: var(--cream); background: var(--main-2); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.intro-puerta.is-open .gate-wreath { opacity: 0; }
.intro-puerta.is-open .gate-l { transform: rotateY(-100deg); }
.intro-puerta.is-open .gate-r { transform: rotateY(100deg); }

/* ===== Efectos ===== */
.adv:not(.d-noche) .fx-nieve i { background: var(--main); }
.adv:not(.d-noche).d-troquel .fx-nieve i { background: #fff; }
.fx-corazones i, .fx-estrellas i { width: auto; height: auto; background: none; font-size: 14px; line-height: 1; }
.fx-corazones i { color: #e8547a; }
.fx-estrellas i { color: var(--gold); }

/* ===== Reacciones en la puerta ===== */
.m-react { border-top: 1px dashed rgba(0,0,0,.15); padding-top: 14px; display: grid; gap: 10px; }
.m-react p { margin: 0; font-weight: 700; font-size: .92rem; }
.m-emojis { display: flex; gap: 6px; flex-wrap: wrap; }
.m-emojis button { font-size: 1.45rem; width: 48px; height: 48px; border-radius: 50%; border: 2px solid transparent; background: rgba(0,0,0,.05); cursor: pointer; transition: transform .15s; }
.m-emojis button:hover { transform: scale(1.12); }
.m-emojis button[aria-pressed="true"] { border-color: var(--main); background: var(--main-soft); transform: scale(1.12); }
.m-reply { display: flex; gap: 8px; }
.m-reply input { flex: 1; min-width: 0; font: inherit; border: 2px solid rgba(0,0,0,.1); border-radius: 12px; padding: 10px 12px; background: #fff; }
.m-send { border: 0; border-radius: 12px; padding: 0 16px; background: var(--main); color: #fff; font-weight: 800; cursor: pointer; }
.m-react .m-react-ok { color: #1f6a44; font-weight: 800; }

/* ===== Foto de portada en la intro ===== */
.intro-cover { display: block; object-fit: cover; border-radius: 50%; }
.env-letter.has-cover { padding-top: 6px; gap: 2px; }
.env-letter .intro-cover { width: 62px; height: 62px; margin: 0 auto 4px; border: 3px solid var(--main); }
.env-letter.has-cover strong { font-size: 1.35rem; }
.env-letter.has-cover em { display: none; }
.intro-sobre.is-open .env-letter.has-cover { transform: translateY(-75%); }
.box-body { position: relative; }
.box-body .intro-cover { position: absolute; left: 50%; top: 30px; width: 84px; height: 84px; margin-left: -42px; border: 4px solid var(--cream); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.gate-light .intro-cover { width: 70%; height: auto; aspect-ratio: 1; border: 5px solid #fff6d6; }
/* orden de capas del sobre: la solapa abierta queda detrás de la carta */
.env-letter { z-index: 1; }
.env-front { z-index: 2; }
.intro-sobre.is-open .env-flap { z-index: 0; }

/* ===== Más incrustados y tipos de contenido ===== */
.m-vertical { aspect-ratio: 9 / 16; max-height: 70vh; max-width: 360px; margin: 0 auto; width: 100%; background: #000; }
.m-apple { height: 175px; background: transparent; }
.m-apple.tall, .m-deezer.tall { height: 450px; }
.m-soundcloud { height: 300px; background: transparent; }
.m-deezer { height: 150px; background: transparent; }
.m-map { aspect-ratio: 4 / 3; background: #e8e2d6; }
.m-place p { margin: 0 0 8px; font-weight: 800; }
.m-place .m-link-soft { margin-top: 8px; }
.m-link-soft { background: var(--main-soft) !important; color: var(--main) !important; }
.m-riddle { background: #fff7e2; border: 2px dashed var(--gold); border-radius: 16px; padding: 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.m-riddle-q { margin: 0; font: 600 1.15rem/1.4 'Fraunces', serif; }
.m-riddle-btn { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--main); color: #fff; font-weight: 800; cursor: pointer; }
.m-riddle-a { margin: 0; font: 600 1.25rem 'Fraunces', serif; color: var(--main); animation: pop .35s; }
