/* ── Fuentes ─────────────────────────────────────────────────────────────── */
@font-face { font-family: "Caprasimo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/caprasimo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caprasimo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/caprasimo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;

  --color-accent-100: #fff2eb;
  --color-accent-400: #f6a06b;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-400: #aebf92;
  --color-accent-2-600: #728157;
  --color-accent-2-800: #3d472b;

  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  --petal: #f0b429;         /* lo sobreescribe app.js con config.petalo */
  --petal-claro: #f6c445;
  --ramo: 560px;
  --ease-bote: cubic-bezier(.34, 1.3, .5, 1);
  --ease-suave: cubic-bezier(.2, .8, .2, 1);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
}
body:has(dialog[open]) { overflow: hidden; }
h1, h2 {
  font-family: var(--font-heading); font-weight: 400;
  line-height: 1.12; letter-spacing: -0.015em; margin: 0;
}
p { margin: 0; }
img { display: block; max-width: 100%; }
button, a { touch-action: manipulation; }
button { font: inherit; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.washed { filter: saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94); }

/* ── Componentes ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-size: 15px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 12px 22px;
  transition: transform .2s var(--ease-bote), background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); box-shadow: 0 8px 18px color-mix(in srgb, var(--color-accent) 40%, transparent); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-ghost { color: var(--color-accent-700); padding-inline: 18px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }

.tag {
  display: inline-flex; align-items: center; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.02em; padding: 5px 12px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 {
  background: var(--color-accent-2-100); color: var(--color-accent-2-800);
  font-size: 13px; padding: 6px 14px; letter-spacing: 0.08em; text-transform: uppercase;
  animation: pop .7s var(--ease-bote) backwards;
}

/* ── Fondo: luces y pétalos ──────────────────────────────────────────────── */
.bokeh { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bokeh i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, .30), rgba(240, 180, 41, 0) 68%);
  animation: deriva var(--d) ease-in-out infinite alternate;
}
@keyframes deriva { to { transform: translate(var(--dx), var(--dy)) scale(1.12); } }

.petalos { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.petalo {
  position: absolute; top: -30px; left: var(--x);
  width: var(--s); height: calc(var(--s) * 1.5);
  background: var(--petal); opacity: var(--o);
  border-radius: 80% 0 80% 0;
  animation: caer var(--d) linear var(--delay) infinite;
  will-change: transform;
}
.petalo.calido { background: var(--color-accent-400); }
@keyframes caer {
  from { transform: translate3d(0, -8vh, 0) rotate(0deg); }
  50%  { transform: translate3d(calc(var(--dx) * .4), 55vh, 0) rotate(300deg); }
  to   { transform: translate3d(var(--dx), 112vh, 0) rotate(640deg); }
}

/* Lluvia de celebración: una sola pasada, por encima de todo */
.fiesta { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 15; }
.fiesta .petalo { animation: caer var(--d) ease-in var(--delay) 1 both; }
.carta .fiesta { position: absolute; z-index: 0; }

/* ── Página ──────────────────────────────────────────────────────────────── */
.pagina {
  position: relative; z-index: 1; min-height: 100vh;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 72px) 72px;
  padding-left: max(clamp(20px, 5vw, 72px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(20px, 5vw, 72px), env(safe-area-inset-right, 0px));
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}

.cabecera { max-width: 1180px; margin: 0 auto 40px; }
.cabecera h1 { font-size: clamp(38px, 6.2vw, 72px); line-height: 1.04; margin: 18px 0 0; max-width: 17ch; }
.pal.nombre { display: block; width: fit-content; color: var(--color-accent-700); }
.pal { display: inline-block; animation: entra-pal .9s var(--ease-suave) backwards; animation-delay: calc(var(--i) * .16s + .15s); }
.pal.brilla {
  background: linear-gradient(100deg, #201e1d 42%, #d18b0c 50%, #201e1d 58%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: entra-pal .9s var(--ease-suave) backwards, brillo-texto 6s ease-in-out 1.6s infinite;
  animation-delay: calc(var(--i) * .16s + .15s), 1.6s;
}
@keyframes entra-pal { from { opacity: 0; transform: translateY(.5em) rotate(3deg); filter: blur(8px); } }
@keyframes brillo-texto { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0 0; } }

.intro { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; max-width: 56ch; margin-top: 20px; text-wrap: pretty; animation: aparece .9s ease .9s backwards; }
.guino { font-size: 15px; color: var(--color-accent-700); margin-top: 10px; font-style: italic; animation: aparece .9s ease 1.3s backwards; }

.contenido {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px); align-items: start;
}
@media (min-width: 760px) {
  .contenido { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { position: sticky; top: 24px; }
}

/* ── Ramo ────────────────────────────────────────────────────────────────── */
.ramo-col { display: flex; justify-content: center; scroll-margin-top: 12px; }
.ramo {
  position: relative; width: 100%; max-width: var(--ramo); aspect-ratio: 1 / 1;
  transform: perspective(1100px) rotateY(calc(var(--mx, 0) * 7deg)) rotateX(calc(var(--my, 0) * -6deg));
  transition: transform .35s ease-out;
}

.ramo-rayos {
  position: absolute; left: 50%; top: 46%; width: 138%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: repeating-conic-gradient(rgba(240, 180, 41, .20) 0 5deg, rgba(240, 180, 41, 0) 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 66%);
          mask-image: radial-gradient(circle, #000 18%, transparent 66%);
  animation: rayos-in 1.6s ease .3s backwards, gira 120s linear infinite;
  pointer-events: none;
}
@keyframes rayos-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.5); } }
@keyframes gira { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.ramo-halo {
  position: absolute; left: 50%; top: 52%; width: 96%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%); border-radius: 999px;
  background: var(--color-accent-2-100); opacity: 0.5;
  animation: halo-in 1.1s var(--ease-suave) backwards, respira 7s ease-in-out 1.1s infinite alternate;
}
@keyframes halo-in { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
@keyframes respira { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.035); } }

.ramo-tallos { position: absolute; inset: 0; width: 100%; height: 100%; }
.ramo-tallos path {
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: trazo 1.1s ease-out backwards; animation-delay: calc(var(--p) * .07s + .35s);
}
@keyframes trazo { from { stroke-dashoffset: 1; } }
.hoja { animation: aparece .6s ease backwards; animation-delay: calc(var(--h) * .15s + 1.1s); }

.ramo-cono {
  position: absolute; left: 50%; top: 78%; width: 44%; height: 23%; transform: translateX(-50%);
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-bg));
  clip-path: polygon(4% 0, 96% 0, 64% 100%, 36% 100%); border-radius: 10px;
  animation: pot .8s var(--ease-bote) .1s backwards;
}
.ramo-lazo {
  position: absolute; left: 50%; top: 76.5%; width: 30%; height: 6.5%; transform: translateX(-50%);
  background: var(--color-accent); border-radius: 999px; box-shadow: var(--shadow-sm);
  animation: pot .8s var(--ease-bote) .25s backwards;
}
@keyframes pot { from { transform: translateX(-50%) translateY(40%) scale(.7); opacity: 0; } }

/* Las flores */
.flor {
  --base: calc(var(--i, 0) * .12s + 1s);
  position: absolute; z-index: 1; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  transition: transform .35s var(--ease-bote), filter .35s;
  animation: florece .9s var(--ease-bote) var(--base) backwards;
  -webkit-tap-highlight-color: transparent;
}
.flor svg { display: block; width: 100%; height: 100%; overflow: visible; }
@media (hover: hover) {
  .flor:hover { transform: translate(-50%, -50%) scale(1.12); filter: drop-shadow(0 6px 12px rgba(120, 80, 25, .22)); }
}
.flor.activa {
  z-index: 4; transform: translate(-50%, -50%) scale(1.16);
  filter: drop-shadow(0 10px 18px rgba(120, 80, 25, .28));
}
.flor.activa::after {
  content: ""; position: absolute; inset: -6%; border-radius: 50%;
  border: 2px solid var(--petal); opacity: 0;
  animation: anillo 2s ease-out infinite; pointer-events: none;
}
@keyframes anillo { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes florece {
  from { transform: translate(-50%, -50%) scale(0) rotate(-40deg); opacity: 0; }
  55%  { opacity: 1; }
}

/* Cada pétalo se abre uno tras otro */
.pet {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: abre .7s var(--ease-bote) backwards;
  animation-delay: calc(var(--base) + var(--k) * .05s + .2s);
}
.centro {
  transform-box: fill-box; transform-origin: 50% 50%;
  animation: pop .6s var(--ease-bote) backwards; animation-delay: calc(var(--base) + .55s);
}
@keyframes abre { from { transform: scale(0) rotate(-25deg); opacity: 0; } }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* Vaivén suave, cada flor con su ritmo */
@keyframes vaiven { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.6deg); } }
.flor > svg { animation: vaiven 7s ease-in-out infinite; transform-origin: 50% 85%; }
.flor:nth-of-type(2n) > svg { animation-duration: 8.5s; animation-delay: -1.4s; }
.flor:nth-of-type(3n) > svg { animation-duration: 6.2s; animation-delay: -2.9s; }

/* La flor diez */
.flor-carta { --base: 0s; z-index: 3; animation-duration: 1.2s; }
.flor.flor-carta > svg { animation: vaiven 6s ease-in-out infinite, brillo 2.8s ease-in-out infinite; }
@keyframes brillo {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(246, 196, 69, .35)); }
  50%      { filter: drop-shadow(0 0 18px rgba(246, 196, 69, 1)); }
}

/* Estallidos de pétalos, ondas y polen */
.chispa {
  position: absolute; z-index: 7; pointer-events: none;
  width: var(--w); height: calc(var(--w) * 1.5);
  background: var(--c); border-radius: 80% 0 80% 0;
  animation: chispa .95s cubic-bezier(.15, .7, .3, 1) forwards;
}
.chispa.estrella { height: var(--w); border-radius: 50%; box-shadow: 0 0 8px 2px var(--c); }
@keyframes chispa {
  from { transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(.4); opacity: 1; }
  to   { transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1); opacity: 0; }
}
.onda {
  position: absolute; z-index: 2; width: 20%; aspect-ratio: 1 / 1; pointer-events: none;
  border: 3px solid var(--petal); border-radius: 50%;
  transform: translate(-50%, -50%) scale(.3);
  animation: onda 1.5s ease-out forwards;
}
@keyframes onda { from { opacity: .9; } to { opacity: 0; transform: translate(-50%, -50%) scale(5); } }

.polen {
  position: absolute; z-index: 5; width: 5px; height: 5px; border-radius: 50%; pointer-events: none;
  background: #fff6c9; box-shadow: 0 0 8px 2px rgba(246, 196, 69, .9);
  opacity: 0; animation: polen var(--d) ease-in-out var(--delay) infinite;
}
@keyframes polen {
  0%   { opacity: 0; transform: translate(0, 0) scale(.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -90px) scale(1.1); }
}

/* Visitantes: la abeja y la mariposa (las mueve app.js) */
.volador {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; will-change: transform;
  opacity: 0; animation: vuelo-in 1s ease 2.4s forwards;
}
.abeja { width: 10%; }
.mariposa { width: 12%; }
.ala { transform-box: fill-box; transform-origin: 50% 100%; animation: aleteo .11s ease-in-out infinite alternate; }
.ala.a2 { animation-delay: -.05s; }
@keyframes aleteo { from { transform: rotate(-22deg) scaleY(.85); } to { transform: rotate(14deg) scaleY(1.05); } }
.alas-m { transform-box: fill-box; transform-origin: 50% 50%; animation: aleteo-m .42s ease-in-out infinite alternate; }
@keyframes aleteo-m { from { transform: scaleX(1); } to { transform: scaleX(.22); } }

/* ── Panel de recuerdos ──────────────────────────────────────────────────── */
.panel { scroll-margin-top: 12px; }

.progreso { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; }
.puntos { display: flex; gap: 6px; }
.punto {
  width: 9px; height: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-text) 16%, transparent);
  transition: background .3s, transform .35s var(--ease-bote);
}
.punto.vista { background: var(--petal); animation: pop .5s var(--ease-bote); }
.punto.actual { transform: scale(1.4); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 40%, transparent); }
.conteo { font-size: 13px; opacity: .6; }

.tarjeta {
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px); box-shadow: var(--shadow-md);
  animation: aparece .9s ease 1.2s backwards;
}
#vacio { padding: clamp(8px, 1.2vw, 16px); }
.tarjeta-titulo { font-family: var(--font-heading); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }
.tarjeta-texto { font-size: 16px; line-height: 1.6; margin-top: 14px; opacity: .8; }

.detalle { transition: opacity .18s ease, transform .18s ease; }
.detalle.sale { opacity: 0; transform: translateY(6px); }
.foto-marco { border-radius: var(--radius-lg); overflow: hidden; background: var(--color-neutral-200); }
.foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; height: auto; }
.detalle-texto { margin-top: 20px; }
.detalle-texto h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; margin-top: 12px; }
.detalle-texto p { font-size: clamp(16px, 1.5vw, 18px); line-height: 1.65; margin-top: 14px; text-wrap: pretty; }
.acciones { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* Entrada de cada recuerdo: la foto se revela en círculo, el texto sube escalonado */
.detalle.entra .foto-marco { animation: revela-foto .95s var(--ease-suave) both; }
.detalle.entra .foto { animation: zoom-lento 16s ease-out both; }
.detalle.entra .detalle-texto > *, .detalle.entra .acciones { animation: sube-texto .6s var(--ease-suave) both; }
.detalle.entra .detalle-texto > :nth-child(1) { animation-delay: .25s; }
.detalle.entra .detalle-texto > :nth-child(2) { animation-delay: .35s; }
.detalle.entra .detalle-texto > :nth-child(3) { animation-delay: .47s; }
.detalle.entra .acciones { animation-delay: .6s; }
@keyframes revela-foto {
  from { clip-path: circle(0% at 50% 62%); transform: scale(.94) rotate(-1.6deg); }
  to   { clip-path: circle(100% at 50% 50%); transform: none; }
}
@keyframes zoom-lento { from { transform: scale(1.16); } to { transform: scale(1); } }
@keyframes sube-texto { from { opacity: 0; transform: translateY(16px); } }

.aviso {
  margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--petal) 22%, var(--color-bg));
  border: 1px solid color-mix(in srgb, var(--petal) 55%, transparent);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  animation: aviso-in .8s var(--ease-bote) backwards, latir-aviso 2.4s ease-in-out .8s infinite;
}
.aviso p { font-size: 15px; line-height: 1.4; }
@keyframes aviso-in { from { opacity: 0; transform: translateY(20px) scale(.94); } }
@keyframes latir-aviso {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--petal) 45%, transparent); }
  50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--petal) 0%, transparent); }
}

/* ── Secciones nuevas ────────────────────────────────────────────────────── */
.bloque { max-width: 1180px; margin: clamp(64px, 9vw, 110px) auto 0; scroll-margin-top: 24px; }
.bloque-titulo { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.05; color: var(--color-accent-700); }
.bloque-intro { font-size: clamp(16px, 1.5vw, 18px); max-width: 52ch; margin-top: 14px; opacity: .8; text-wrap: pretty; }
.rejilla {
  display: grid; gap: clamp(14px, 2vw, 22px); margin-top: 30px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.15; margin: 0; }

/* Contador de días */
.contador { text-align: left; }
.contador-etiqueta { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-2-800); }
.contador-num { font-family: var(--font-heading); font-size: clamp(64px, 12vw, 132px); line-height: 1; color: var(--color-accent-700); margin-top: 6px; }
.contador-num small { font-size: .28em; margin-left: .3em; color: var(--color-text); letter-spacing: 0; }
.contador-detalle { font-size: clamp(16px, 1.5vw, 19px); margin-top: 8px; opacity: .8; }

/* Lo que me encanta de ti */
.amo-card {
  position: relative; display: flex; gap: 16px; align-items: flex-start;
  background: var(--color-surface); border-radius: 24px; padding: 22px 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-bote), box-shadow .35s, opacity .9s ease;
}
@media (hover: hover) {
  .js .amo-card.visto:hover { transform: translateY(-5px) rotate(-.7deg); box-shadow: var(--shadow-md); }
  .amo-card:hover .amo-flor { animation-duration: 1.6s; }
}
.amo-flor { flex: none; width: 46px; height: 46px; transform-origin: 50% 85%; animation: vaiven 6s ease-in-out infinite; }
.amo-card:nth-child(2n) .amo-flor { animation-delay: -1.5s; }
.amo-card:nth-child(3n) .amo-flor { animation-delay: -3s; }
.amo-card h3 { font-size: 21px; }
.amo-card p { font-size: 15px; line-height: 1.55; margin-top: 6px; opacity: .8; }

/* Vales: forma de ticket con muescas laterales */
.rejilla-vales, .rejilla:not(.rejilla-vales) { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.vale {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 24px 26px 22px; min-height: 190px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--petal) 34%, var(--color-neutral-100)), color-mix(in srgb, var(--petal) 16%, var(--color-neutral-100)));
  --m1: radial-gradient(circle 11px at 0 58%, transparent 97%, #000 100%);
  --m2: radial-gradient(circle 11px at 100% 58%, transparent 97%, #000 100%);
  -webkit-mask: var(--m1), var(--m2);
  -webkit-mask-composite: source-in;
          mask: var(--m1), var(--m2);
          mask-composite: intersect;
  border-radius: 18px;
  transition: transform .35s var(--ease-bote), filter .4s, opacity .9s ease;
}
.vale::before {
  content: ""; position: absolute; inset: 8px; border-radius: 12px; pointer-events: none;
  border: 1.5px dashed color-mix(in srgb, var(--color-accent-700) 35%, transparent);
}
.vale-num { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent-800); opacity: .7; }
.vale h3 { font-size: 24px; color: var(--color-accent-800); }
.vale p { font-size: 15px; line-height: 1.5; margin-top: 6px; }
.vale-cuerpo { flex: 1; }
.vale .btn { align-self: flex-start; padding: 10px 20px; font-size: 14px; }
.vale .btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
@media (hover: hover) { .js .vale.visto:not(.canjeado):not(.entregado):hover { transform: translateY(-5px) rotate(-.8deg); } }
.vale.canjeado, .vale.entregado { filter: saturate(.55) brightness(.98); }
.vale.canjeado .vale-cuerpo, .vale.entregado .vale-cuerpo { opacity: .55; }

.sello {
  position: absolute; right: 22px; bottom: 18px; display: none; place-items: center; text-align: center;
  padding: 8px 16px; border: 3px solid #b3372f; border-radius: 12px; color: #b3372f;
  font-family: var(--font-heading); font-size: 19px; letter-spacing: .06em; line-height: 1;
  transform: rotate(-12deg); mix-blend-mode: multiply; pointer-events: none;
}
.sello small { display: block; font-family: var(--font-body); font-weight: 700; font-size: 10px; letter-spacing: .12em; margin-top: 4px; }
.vale.canjeado .sello, .vale.entregado .sello { display: grid; animation: sello .55s var(--ease-bote); }
.vale.ya .sello { animation: none; }
.sello-entregado { border-color: var(--color-accent-2-700); color: var(--color-accent-2-700); }
@keyframes sello { from { opacity: 0; transform: rotate(-32deg) scale(2.8); } }

/* Aviso del límite mensual: naranja mientras el mes está ocupado, verde cuando queda libre */
.vales-estado {
  display: inline-flex; align-items: center; margin-top: 14px; max-width: 100%;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; line-height: 1.4;
  background: color-mix(in srgb, var(--petal) 20%, var(--color-bg));
  border: 1px solid color-mix(in srgb, var(--petal) 50%, transparent);
  color: var(--color-accent-800);
}
.vales-estado.libre {
  background: color-mix(in srgb, var(--color-accent-2-400) 24%, var(--color-bg));
  border-color: color-mix(in srgb, var(--color-accent-2-600) 45%, transparent);
  color: var(--color-accent-2-800);
}

/* Memorama */
.memo-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 24px; }
.memo-dato { font-family: var(--font-heading); font-size: 18px; color: var(--color-accent-800); }
.memo-barra .btn { padding: 8px 18px; font-size: 14px; }
.memo-tablero {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 1.6vw, 16px);
  max-width: 640px; margin-top: 22px;
}
.mcarta { position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; background: none; cursor: pointer; perspective: 800px; border-radius: 16px; -webkit-tap-highlight-color: transparent; }
.mcara {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .6s var(--ease-bote), box-shadow .3s;
}
.mfrente {
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, color-mix(in srgb, var(--petal) 40%, var(--color-neutral-100)), color-mix(in srgb, var(--petal) 20%, var(--color-neutral-100)));
  border: 2px dashed color-mix(in srgb, var(--color-accent-700) 40%, transparent);
}
.mfrente svg { width: 52%; height: 52%; }
.mdorso { transform: rotateY(180deg); background: var(--color-neutral-200); }
.mdorso img { width: 100%; height: 100%; object-fit: cover; }
.mcarta.volteada .mfrente, .mcarta.par .mfrente { transform: rotateY(-180deg); }
.mcarta.volteada .mdorso, .mcarta.par .mdorso { transform: rotateY(0deg); }
@media (hover: hover) { .mcarta:not(.volteada):not(.par):hover .mfrente { transform: translateY(-4px) rotate(-1.5deg); } }
.mcarta.par .mdorso { box-shadow: 0 0 0 3px var(--petal), 0 0 22px rgba(240, 180, 41, .75); animation: par-ok .6s var(--ease-bote); }
@keyframes par-ok { 40% { transform: rotateY(0deg) scale(1.1); } }
.memo-ganaste {
  margin-top: 22px; padding: 16px 22px; max-width: 640px; border-radius: var(--radius-lg);
  font-family: var(--font-heading); font-size: 20px; line-height: 1.3; color: var(--color-accent-800);
  background: color-mix(in srgb, var(--petal) 26%, var(--color-bg)); border: 1px solid color-mix(in srgb, var(--petal) 60%, transparent);
  animation: aviso-in .8s var(--ease-bote);
}

/* Sobres «Ábrelo cuando…» */
.rejilla-sobres { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px 22px; margin-top: 60px; }
.sobre {
  position: relative; aspect-ratio: 1.55 / 1; padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 700px; -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ease-bote), opacity .9s ease;
}
.sobre > span { position: absolute; display: block; }
.sobre-cuerpo {
  inset: 0; z-index: 2; border-radius: 14px; box-shadow: var(--shadow-md);
  background:
    linear-gradient(to top right, transparent 49.5%, rgba(140, 73, 26, .18) 50%, transparent 51%) left bottom / 50% 60% no-repeat,
    linear-gradient(to top left, transparent 49.5%, rgba(140, 73, 26, .18) 50%, transparent 51%) right bottom / 50% 60% no-repeat,
    linear-gradient(160deg, color-mix(in srgb, var(--petal) 45%, var(--color-neutral-100)), color-mix(in srgb, var(--petal) 26%, var(--color-neutral-100)));
}
.sobre-carta {
  left: 8%; right: 8%; top: 6%; bottom: 10%; z-index: 1; border-radius: 8px;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .6s var(--ease-bote);
}
.sobre-solapa {
  left: 0; right: 0; top: 0; height: 58%; z-index: 3; transform-origin: 50% 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--petal) 60%, var(--color-accent-400)), color-mix(in srgb, var(--petal) 42%, var(--color-neutral-100)));
  transition: transform .55s ease, z-index 0s .25s;
}
.sobre-sello {
  left: 50%; top: 42%; width: 15%; aspect-ratio: 1 / 1; z-index: 4; transform: translate(-50%, -50%);
  display: grid !important; place-items: center; border-radius: 50%; background: #c8463d; color: #fff; box-shadow: var(--shadow-sm);
  transition: opacity .25s;
}
.sobre-sello svg { width: 58%; height: 58%; }
.sobre-etq { left: 0; right: 0; bottom: 9%; z-index: 4; text-align: center; line-height: 1.15; }
.sobre-etq small { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent-800); opacity: .75; }
.sobre-etq b { font-family: var(--font-heading); font-weight: 400; font-size: clamp(19px, 2vw, 23px); color: var(--color-accent-800); }
.sobre-leida { right: 10px; top: 8px; z-index: 5; font-size: 11px; font-weight: 700; color: var(--color-accent-2-800); background: var(--color-accent-2-100); padding: 2px 9px; border-radius: 999px; display: none !important; }
.sobre.leida .sobre-leida { display: block !important; }
@media (hover: hover) {
  .js .sobre.visto:not(.abierto):hover { transform: translateY(-5px) rotate(-1deg); }
  .sobre:not(.abierto):hover .sobre-solapa { transform: rotateX(28deg); }
}
.sobre.abierto .sobre-solapa { transform: rotateX(180deg); z-index: 0; }
.sobre.abierto .sobre-sello { opacity: 0; }
.sobre.abierto .sobre-carta { transform: translateY(-30%); }

/* Mensaje de voz */
.reproductor {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 22px); max-width: 720px; margin-top: 30px;
  padding: clamp(14px, 2vw, 20px) clamp(16px, 2.4vw, 26px); border-radius: 999px;
  background: var(--color-surface); box-shadow: var(--shadow-md);
}
.rep-play {
  flex: none; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-bg); box-shadow: 0 6px 16px color-mix(in srgb, var(--color-accent) 45%, transparent);
  transition: transform .2s var(--ease-bote), background .2s;
}
.rep-play:hover { transform: scale(1.08); background: var(--color-accent-600); }
.rep-play:active { transform: scale(.94); }
.rep-play .ic-pausa, .suena .rep-play .ic-play { display: none; }
.suena .rep-play .ic-pausa { display: block; }
.rep-onda { flex: 1; min-width: 0; height: 56px; display: flex; align-items: center; gap: 3px; cursor: pointer; border-radius: 12px; touch-action: none; }
.rep-onda i {
  flex: 1; min-width: 2px; height: calc(var(--h) * 100%); border-radius: 3px;
  background: color-mix(in srgb, var(--color-text) 20%, transparent); transition: background .25s;
}
.rep-onda i.hecha { background: var(--color-accent); }
.suena .rep-onda i { animation: baila .9s ease-in-out infinite alternate; animation-delay: calc(var(--n) * -.07s); }
@keyframes baila { from { transform: scaleY(.7); } to { transform: scaleY(1.12); } }
.rep-tiempo { flex: none; font-variant-numeric: tabular-nums; font-size: 14px; opacity: .7; min-width: 3.4em; text-align: right; }

/* Vale premio del memorama */
.vale-premio {
  background: linear-gradient(135deg, color-mix(in srgb, var(--petal) 62%, #fff), color-mix(in srgb, var(--petal) 30%, #fff));
}
.vale-premio::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 18px;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) -150% 0 / 60% 100% no-repeat;
  animation: brilla-vale 4.5s ease-in-out 1s infinite;
}
@keyframes brilla-vale { 0% { background-position: -150% 0; } 45%, 100% { background-position: 250% 0; } }

/* ── Cierre ──────────────────────────────────────────────────────────────── */
.cierre { max-width: 1180px; margin: clamp(56px, 8vw, 110px) auto 0; }
.cierre-nota { font-size: 15px; color: var(--color-accent-2-800); margin-bottom: 14px; }
.cierre-titulo { font-size: clamp(40px, 7vw, 86px); line-height: 1; color: var(--color-accent-700); }
.cierre-texto { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; max-width: 52ch; margin-top: 22px; text-wrap: pretty; }
.firma { font-family: var(--font-heading); font-size: 22px; margin-top: 26px; }
.cierre-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.latido { display: inline-block; width: .62em; height: .62em; vertical-align: -.02em; color: #d2453d; transform-origin: 50% 60%; animation: latido 1.7s ease-in-out infinite; }
@keyframes latido {
  0%, 60%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  26% { transform: scale(1.02); }
  38% { transform: scale(1.16); }
}

.js .revela { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s var(--ease-suave); transition-delay: calc(var(--k, 0) * .12s); }
.js .amo-card.revela, .js .vale.revela { transition: opacity .9s ease calc(var(--k, 0) * .12s), transform .9s var(--ease-suave) calc(var(--k, 0) * .12s), box-shadow .35s, filter .4s; }
.js .revela.visto { opacity: 1; transform: none; }

/* ── La carta ────────────────────────────────────────────────────────────── */
.carta {
  border: 0; padding: 0; margin: 0; background: none; color: inherit;
  width: 100%; height: 100dvh; max-width: none; max-height: none; overflow: hidden;
}
.carta::backdrop { background: color-mix(in srgb, #2e2b25 58%, transparent); backdrop-filter: blur(4px); }
.carta[open]::backdrop { animation: aparece .5s ease; }
.carta-marco {
  position: relative; z-index: 1; height: 100%; overflow: auto; overscroll-behavior: contain;
  display: flex; padding: 16px;
}
.carta-papel {
  position: relative; margin: auto; width: min(560px, 100%);
  background: var(--color-neutral-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(28px, 5vw, 44px);
  animation: sube .7s var(--ease-bote);
}
.carta-papel::before {
  content: ""; position: absolute; inset: 8px; border-radius: calc(var(--radius-lg) - 8px); pointer-events: none;
  border: 1.5px dashed color-mix(in srgb, var(--petal) 65%, transparent);
}
.carta-flor {
  width: 68px; height: 68px; margin: 0 auto 12px; display: block; transform-origin: 50% 85%;
  animation: entra-flor 1.3s var(--ease-bote) backwards, vaiven 6s ease-in-out 1.3s infinite;
}
@keyframes entra-flor { from { transform: scale(0) rotate(-200deg); opacity: 0; } }
.carta-papel h2 { font-size: clamp(28px, 4.4vw, 38px); text-align: center; color: var(--color-accent-700); }
.carta-papel h2:focus-visible { outline: none; }
#cartaCuerpo { margin-top: 22px; }
#cartaCuerpo p {
  font-size: 17px; line-height: 1.75; margin-top: 14px; text-wrap: pretty;
  animation: aparece .9s ease both; animation-delay: calc(.6s + var(--i) * .6s);
}
.carta-papel .firma { margin: 26px 0 24px; text-align: right; animation: aparece .9s ease both; animation-delay: calc(.6s + var(--n) * .6s); }
.carta-papel form { text-align: center; }

@keyframes aparece { from { opacity: 0; transform: translateY(8px); } }
@keyframes sube { from { opacity: 0; transform: translateY(40px) scale(.94) rotate(-1.5deg); } }
@keyframes vuelo-in { to { opacity: 1; } }

/* ── Controles flotantes ─────────────────────────────────────────────────── */
.ctl {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; cursor: pointer;
  background: var(--color-surface); color: var(--color-accent-700);
  border: 1px solid var(--color-divider); box-shadow: var(--shadow-md);
  transition: transform .2s var(--ease-bote), background .2s;
}
.ctl:hover { transform: translateY(-2px); background: var(--color-neutral-100); }
.musica { right: calc(16px + env(safe-area-inset-right, 0px)); width: 46px; height: 46px; border-radius: 50%; padding: 0; display: grid; place-items: center; }
.musica[aria-pressed="true"] { background: var(--color-accent); color: var(--color-bg); }
.musica[aria-pressed="true"] .musica-tacha { display: none; }
.anim-btn {
  left: calc(16px + env(safe-area-inset-left, 0px)); height: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
}
.anim-btn[aria-pressed="false"] { background: var(--color-accent); color: var(--color-bg); }

/* ── Móvil ───────────────────────────────────────────────────────────────── */
@media (max-width: 759px) {
  .cabecera { margin-bottom: 28px; }
  .acciones .btn { flex: 1 1 auto; }
  html:not(.gyro) .ramo { transform: none; }
  .btn { min-height: 44px; }
  .anim-btn[aria-pressed="true"] { padding: 0 11px; }
  .memo-tablero { grid-template-columns: repeat(3, 1fr); }
  .reproductor { border-radius: 28px; flex-wrap: wrap; }
  .rep-onda { order: 3; flex-basis: 100%; }
  .rep-tiempo { margin-left: auto; }
  .anim-btn[aria-pressed="true"] #animTxt { display: none; }
}

/* ── Portada ─────────────────────────────────────────────────────────────── */
.portada-activa body { overflow: hidden; }
.portada-activa .pagina *, .portada-activa .pagina *::before, .portada-activa .pagina *::after { animation-play-state: paused !important; }
.portada {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  padding: 24px; background: radial-gradient(circle at 50% 36%, #fbf1dc, var(--color-bg) 72%);
  transition: opacity .8s ease, transform .8s var(--ease-suave), visibility 0s .8s;
}
.portada.sale { opacity: 0; transform: scale(1.08); visibility: hidden; pointer-events: none; }
.portada::before {
  content: ""; position: absolute; left: 50%; top: 36%; width: 170vmax; aspect-ratio: 1 / 1; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(rgba(240, 180, 41, .17) 0 5deg, rgba(240, 180, 41, 0) 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 60%); mask-image: radial-gradient(circle, #000 8%, transparent 60%);
  animation: gira 90s linear infinite;
}
.portada-caja { position: relative; width: min(380px, 100%); text-align: center; padding-bottom: env(safe-area-inset-bottom, 0px); }
.portada-flor {
  width: clamp(96px, 30vw, 128px); height: auto; margin: 0 auto 18px; display: block; transform-origin: 50% 85%;
  animation: entra-flor 1.2s var(--ease-bote) backwards, vaiven 6s ease-in-out 1.2s infinite, brillo 3s ease-in-out 1.2s infinite;
}
.portada h2 { font-size: clamp(30px, 9vw, 42px); line-height: 1.08; color: var(--color-accent-700); animation: aparece .9s ease .5s backwards; }
.portada p { font-size: 16px; line-height: 1.55; margin-top: 12px; opacity: .8; animation: aparece .9s ease .75s backwards; }
.portada-botones { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; animation: aparece .9s ease 1s backwards; }
.portada-botones .btn { width: 100%; min-height: 52px; font-size: 17px; }
#portadaMusica { animation: latir-aviso 2.4s ease-in-out 1.6s infinite; }

/* Con giroscopio el ramo sigue un poco al celular */
.gyro .ramo { transition-duration: .18s; transition-timing-function: linear; }

/* ── Sin animaciones (lo decide app.js: opción del sistema o botón) ──────── */
.sin-anim *, .sin-anim *::before, .sin-anim *::after { animation: none !important; transition: none !important; }
.sin-anim .bokeh, .sin-anim .petalos, .sin-anim .fiesta, .sin-anim .volador,
.sin-anim .polen, .sin-anim .chispa, .sin-anim .onda, .sin-anim .ramo-rayos { display: none !important; }
.sin-anim .ramo { transform: none !important; }
.sin-anim .portada::before { display: none; }
.sin-anim .revela { opacity: 1 !important; transform: none !important; }
