/* =========================================================
   Variables
   ========================================================= */
:root {
    --blush:     #ffe3ec;
    --pink-soft: #ffc2d1;
    --pink:      #ff8fab;
    --rose:      #ff6f91;
    --deep-rose: #c9184a;
    --wine:      #5a2a3a;
    --cream:     #fff5f7;
    --leaf:      #6cba77;
    --white:     #fff;

    --text:      #5a2a3a;
    --text-soft: #8a6070;

    --shadow:    0 18px 50px rgba(201, 24, 74, .18);
    --shadow-sm: 0 8px 24px rgba(201, 24, 74, .12);
    --radius:    26px;

    --f-serif:  'Cormorant Garamond', Georgia, serif;
    --f-script: 'Dancing Script', cursive;
    --f-body:   'Poppins', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--f-body);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: linear-gradient(150deg, #fff5f7 0%, #ffe3ec 30%, #ffd6e4 62%, #ffc2d1 100%);
    background-attachment: fixed;
}

main { position: relative; z-index: 2; }

/* =========================================================
   Progreso de scroll
   ========================================================= */
.scroll-progress {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--pink), var(--deep-rose));
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 60;
}

/* =========================================================
   Pétalos y estallidos
   ========================================================= */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.petal {
    position: absolute; top: -40px;
    will-change: transform;
    animation: fall linear forwards;
}
@keyframes fall {
    0%   { transform: translateY(-40px) translateX(0) rotate(0); opacity: 0; }
    10%  { opacity: .85; }
    100% { transform: translateY(112vh) translateX(var(--drift, 40px)) rotate(460deg); opacity: .15; }
}

.burst {
    position: fixed;
    pointer-events: none;
    z-index: 70;
    animation: burstUp 1.1s ease-out forwards;
}
@keyframes burstUp {
    0%   { transform: translate(0, 0) scale(.6); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1.2); opacity: 0; }
}

/* =========================================================
   Barra superior
   ========================================================= */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    padding: .85rem 1.5rem;
    padding-top: calc(.85rem + env(safe-area-inset-top));
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, .45);
    border-bottom: 1px solid rgba(255, 143, 171, .25);
}
.brand {
    font-family: var(--f-script);
    font-size: 1.6rem; font-weight: 700;
    color: var(--deep-rose); text-decoration: none;
}
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.inline-form { display: inline; }
.nav-link, .nav-btn {
    border: none; cursor: pointer; text-decoration: none;
    font-family: var(--f-body); font-size: .9rem; font-weight: 500;
    padding: .5rem 1rem; border-radius: 999px;
    background: rgba(255, 143, 171, .18); color: var(--deep-rose);
    transition: all .25s ease;
}
.nav-link:hover, .nav-btn:hover { background: var(--rose); color: #fff; transform: translateY(-2px); }

/* =========================================================
   Portada + jardín 3D
   ========================================================= */
.hero {
    position: relative;
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
}
.garden-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block; z-index: 1;
    touch-action: pan-y;   /* deja hacer scroll vertical sobre el lienzo */
}
.garden-canvas.no-webgl { display: none; }

.hero-content {
    position: relative; z-index: 3;
    padding: 2rem;
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    pointer-events: none;       /* los toques pasan al jardín */
    max-width: 820px;
}
.hero-greeting {
    font-family: var(--f-script);
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    color: var(--deep-rose);
    text-shadow: 0 2px 14px rgba(255, 255, 255, .8);
}
.hero-title {
    font-family: var(--f-serif);
    font-weight: 600; line-height: 1.08;
    font-size: clamp(2.4rem, 8vw, 4.6rem);
    color: var(--wine);
    margin: .3rem 0 .8rem;
    text-shadow: 0 3px 22px rgba(255, 255, 255, .85);
}
.hero-sub {
    color: var(--deep-rose); font-size: clamp(.95rem, 2.4vw, 1.15rem);
    text-shadow: 0 2px 12px rgba(255, 255, 255, .9);
}

.bloom-bubble {
    position: fixed; z-index: 55;
    transform: translate(-50%, -130%) scale(.85);
    max-width: min(78vw, 340px);
    padding: .85rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    font-family: var(--f-serif); font-style: italic;
    font-size: 1.05rem; color: var(--wine);
    opacity: 0; pointer-events: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
.bloom-bubble.show { opacity: 1; transform: translate(-50%, -145%) scale(1); }

.scroll-hint {
    position: absolute; bottom: calc(2rem + env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    z-index: 3;
    display: flex; flex-direction: column; align-items: center;
    color: var(--deep-rose); font-size: .75rem;
    letter-spacing: .2em; text-transform: uppercase;
    transition: opacity .4s ease;
}
.scroll-hint .arrow { font-size: 1.9rem; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* =========================================================
   Secciones
   ========================================================= */
.section {
    min-height: 70vh; min-height: 70dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 4.5rem 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
}
.full { width: 100%; max-width: 980px; }
.center { text-align: center; }

.section-title {
    font-family: var(--f-serif);
    font-size: clamp(1.8rem, 5vw, 2.9rem);
    font-weight: 600;
    color: var(--deep-rose);
    text-align: center;
    margin-bottom: 1.8rem;
}
.section-title::after {
    content: "🌷"; display: block; font-size: 1.1rem; margin-top: .35rem;
}

/* =========================================================
   Carta
   ========================================================= */
.letter {
    max-width: 660px; width: 100%;
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 3rem 2.4rem;
    position: relative;
}
.letter::before {
    content: ""; position: absolute; inset: 12px;
    border: 1.5px dashed rgba(255, 143, 171, .5);
    border-radius: calc(var(--radius) - 12px);
    pointer-events: none;
}
.letter-body { min-height: 8rem; }
.letter-body p {
    font-family: var(--f-serif);
    font-size: 1.22rem; line-height: 1.85;
    color: var(--text); margin-bottom: 1.1rem;
}
.caret {
    display: inline-block; width: 2px; height: 1.1em;
    background: var(--rose); vertical-align: text-bottom;
    animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.signature {
    font-family: var(--f-script); font-size: 1.7rem;
    color: var(--deep-rose); text-align: right; margin-top: 1.2rem;
}

/* =========================================================
   Contador
   ========================================================= */
.counter-card {
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.8rem 2rem;
    text-align: center; width: 100%; max-width: 700px;
}
.counter-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem;
}
.counter-unit {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .9rem .3rem;
    background: rgba(255, 143, 171, .13);
    border-radius: 16px;
}
.counter-unit b {
    font-family: var(--f-serif); font-weight: 600;
    font-size: clamp(1.5rem, 5.5vw, 2.6rem);
    color: var(--deep-rose); font-variant-numeric: tabular-nums;
}
.counter-unit span {
    font-size: .72rem; text-transform: uppercase;
    letter-spacing: .12em; color: var(--text-soft);
}
.counter-note { margin-top: 1.2rem; color: var(--text-soft); font-style: italic; }

/* =========================================================
   Mensajes dinámicos
   ========================================================= */
.msg-card {
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.8rem 2rem;
    text-align: center; min-height: 170px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem;
    cursor: pointer;
    transition: opacity .38s ease, transform .38s ease;
}
.msg-card.swap { opacity: 0; transform: translateY(12px) scale(.98); }
.msg-text {
    font-family: var(--f-serif); font-style: italic;
    font-size: clamp(1.25rem, 3.6vw, 1.85rem);
    line-height: 1.45; color: var(--wine);
}
.msg-tag {
    text-transform: uppercase; letter-spacing: .18em; font-size: .7rem;
    color: #fff; background: var(--rose);
    padding: .25rem .9rem; border-radius: 999px;
}
.msg-controls {
    display: flex; gap: .6rem; justify-content: center;
    flex-wrap: wrap; margin-top: 1.5rem;
}
.chip {
    border: none; cursor: pointer;
    font-family: var(--f-body); font-weight: 500; font-size: .92rem;
    padding: .55rem 1.2rem; border-radius: 999px;
    background: rgba(255, 255, 255, .7); color: var(--deep-rose);
    box-shadow: var(--shadow-sm);
    text-transform: capitalize;
    transition: all .25s ease;
}
.chip:hover, .chip.active { background: var(--rose); color: #fff; transform: translateY(-3px); }

/* =========================================================
   Galería
   ========================================================= */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.3rem;
}
.photo {
    position: relative; border-radius: 20px; overflow: hidden;
    box-shadow: var(--shadow-sm); cursor: pointer;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--pink-soft), var(--blush));
    transform-style: preserve-3d;
    transition: transform .35s ease, box-shadow .35s ease;
}
.photo:hover { box-shadow: var(--shadow); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.missing img { display: none; }
.photo.missing::after {
    content: "🌷 agrega tu foto";
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: var(--deep-rose); font-size: .9rem; opacity: .7;
}
.photo figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.5rem 1rem .9rem; color: #fff; font-size: .92rem;
    background: linear-gradient(transparent, rgba(90, 42, 58, .8));
    transform: translateY(8px); opacity: 0;
    transition: all .3s ease;
}
.photo:hover figcaption { transform: translateY(0); opacity: 1; }

/* =========================================================
   Corazón 3D
   ========================================================= */
.heart-canvas {
    width: 100%;
    max-width: 460px;
    height: min(52vh, 400px);
    margin: 0 auto;
    display: block;
    cursor: grab;
}
.heart-canvas:active { cursor: grabbing; }
.heart-canvas.no-webgl { display: none; }
.hint-text { margin-top: 1rem; color: var(--text-soft); font-size: .88rem; }

/* =========================================================
   Momento (reloj + ubicación)
   ========================================================= */
.moment-card {
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 3rem 2.4rem; text-align: center;
    width: 100%; max-width: 540px;
}
.clock {
    font-family: var(--f-serif); font-weight: 600;
    font-size: clamp(2.6rem, 9vw, 4.4rem);
    color: var(--deep-rose); font-variant-numeric: tabular-nums;
}
.date { color: var(--text-soft); margin: .3rem 0 1.3rem; text-transform: capitalize; }
.location {
    display: inline-block; background: rgba(255, 143, 171, .18);
    color: var(--deep-rose); padding: .55rem 1.3rem;
    border-radius: 999px; font-size: .95rem;
}

.footer {
    text-align: center;
    padding: 2.5rem 1rem calc(4.5rem + env(safe-area-inset-bottom));
    color: var(--text-soft); position: relative; z-index: 2;
}

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(90, 42, 58, .9);
    backdrop-filter: blur(6px);
    display: none; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem; padding: 2rem;
}
.lightbox.open { display: flex; animation: fadeIn .3s ease; }
.lightbox img {
    max-width: 92vw; max-height: 76dvh;
    border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.lightbox p { color: #fff; }
.lightbox-close {
    position: absolute;
    top: calc(1.2rem + env(safe-area-inset-top));
    right: calc(1.6rem + env(safe-area-inset-right));
    font-size: 2rem; color: #fff; cursor: pointer; opacity: .85;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   Reproductor de música
   ========================================================= */
.player {
    position: fixed; z-index: 45;
    bottom: calc(1.3rem + env(safe-area-inset-bottom));
    right: calc(1.3rem + env(safe-area-inset-right));
    display: flex; align-items: center; gap: .6rem;
    flex-direction: row-reverse;
}
.player-btn.main {
    width: 56px; height: 56px; border-radius: 50%;
    border: none; cursor: pointer; color: #fff; font-size: 1.35rem;
    display: grid; place-items: center; position: relative;
    background: linear-gradient(135deg, var(--rose), var(--deep-rose));
    box-shadow: 0 10px 26px rgba(201, 24, 74, .42);
    transition: transform .25s ease;
    flex-shrink: 0;
}
.player-btn.main:hover { transform: translateY(-3px) scale(1.05); }
.player-btn.main:active { transform: scale(.95); }
.player-btn.main.playing::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid rgba(255, 143, 171, .6);
    animation: ring 1.9s ease-out infinite;
}
@keyframes ring {
    0%   { transform: scale(.9); opacity: .8; }
    100% { transform: scale(1.45); opacity: 0; }
}
.player-btn.main.hint { animation: pulseGlow 1.7s ease-in-out infinite; }
@keyframes pulseGlow {
    0%,100% { box-shadow: 0 10px 26px rgba(201, 24, 74, .42); }
    50%     { box-shadow: 0 10px 46px rgba(201, 24, 74, .8); }
}

.player-panel {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: .7rem .9rem;
    display: flex; flex-direction: column; gap: .45rem;
    min-width: 180px; max-width: 240px;
}
.player-track {
    font-size: .8rem; color: var(--deep-rose); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-controls { display: flex; gap: .3rem; }
.player-controls button {
    border: none; background: rgba(255, 143, 171, .16);
    color: var(--deep-rose); cursor: pointer;
    border-radius: 10px; padding: .3rem .55rem; font-size: .85rem;
    transition: background .2s ease;
}
.player-controls button:hover { background: var(--rose); color: #fff; }
.player-controls button.active { background: var(--rose); color: #fff; }
.player-panel input[type=range] {
    width: 100%; accent-color: var(--rose); height: 4px; cursor: pointer;
}

@media (max-width: 719px) {
    .player-panel {
        display: none;
        position: absolute; bottom: 68px; right: 0;
    }
    .player-panel.open { display: flex; }
}

/* =========================================================
   Login / Error
   ========================================================= */
.login-scene { position: fixed; inset: 0; z-index: 0; }
.login-scene canvas { width: 100%; height: 100%; display: block; }

.auth-wrap {
    position: relative; z-index: 5; width: 100%;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
             max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}
.auth-card {
    width: 100%; max-width: 400px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.8rem 2.2rem; text-align: center;
}
.auth-tulip { font-size: 3rem; animation: sway 4s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.auth-title {
    font-family: var(--f-serif); font-size: 2.1rem; font-weight: 600;
    color: var(--deep-rose); margin: .5rem 0 .2rem;
}
.auth-sub { color: var(--text-soft); margin-bottom: 1.7rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.05rem; text-align: left; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field span { font-size: .84rem; color: var(--text-soft); font-weight: 500; padding-left: .4rem; }
.field input, .field select, .field textarea {
    font-family: var(--f-body);
    font-size: 1rem;                 /* 16px: evita el zoom automático de iOS */
    padding: .8rem 1rem;
    border: 1.5px solid rgba(255, 143, 171, .4);
    border-radius: 14px;
    background: rgba(255, 255, 255, .85);
    color: var(--text); outline: none; width: 100%;
    transition: border .25s ease, box-shadow .25s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--rose); box-shadow: 0 0 0 4px rgba(255, 143, 171, .18);
}
.btn-love {
    display: inline-block; text-align: center; text-decoration: none;
    border: none; cursor: pointer;
    font-family: var(--f-body); font-size: 1.05rem; font-weight: 600;
    color: #fff; background: linear-gradient(135deg, var(--rose), var(--deep-rose));
    padding: .9rem 1.4rem; border-radius: 14px; margin-top: .5rem;
    box-shadow: 0 12px 30px rgba(201, 24, 74, .35);
    transition: transform .25s ease, box-shadow .25s ease;
}
.btn-love:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(201, 24, 74, .45); }
.auth-error {
    background: rgba(201, 24, 74, .1); color: var(--deep-rose);
    border: 1px solid rgba(201, 24, 74, .25);
    border-radius: 12px; padding: .7rem 1rem; font-size: .9rem; margin-bottom: 1.1rem;
}
.req-id { margin-top: 1rem; font-size: .78rem; opacity: .6; }

/* =========================================================
   Reveal
   ========================================================= */
.reveal { opacity: 0; transform: translateY(42px); transition: opacity .9s ease, transform .9s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* =========================================================
   Accesibilidad
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Móvil
   ========================================================= */
@media (max-width: 560px) {
    .letter { padding: 2.2rem 1.4rem; }
    .letter-body p { font-size: 1.1rem; }
    .counter-grid { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 3.5rem 1.2rem; }
}

/* =========================================================
   ══ SOBRE 3D DE ENTRADA ══
   ========================================================= */
body.envelope-locked { overflow: hidden; }

.envelope-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2rem;
    background: linear-gradient(160deg, #ffeaf1 0%, #ffd6e4 45%, #ffc2d1 100%);
    transition: opacity .8s ease, transform .8s ease;
}
.envelope-overlay.lift { opacity: 0; transform: scale(1.18); pointer-events: none; }

/* Halo difuminado detrás del sobre */
.env-glow {
    position: absolute;
    width: min(70vw, 460px); aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,143,171,.35) 55%, transparent 70%);
    filter: blur(28px);
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%,100% { transform: scale(1); opacity: .85; }
    50%     { transform: scale(1.12); opacity: 1; }
}

.env-hint {
    position: relative; z-index: 2;
    font-family: var(--f-script);
    font-size: clamp(1.4rem, 4.5vw, 2rem);
    color: var(--deep-rose);
    animation: bob 2s ease-in-out infinite;
}

.envelope {
    position: relative; z-index: 2;
    width: min(78vw, 380px);
    aspect-ratio: 3 / 2;
    cursor: pointer;
    perspective: 1100px;
    transform-style: preserve-3d;
    transition: transform .5s cubic-bezier(.2, 1.3, .4, 1);
}
.envelope:hover { transform: translateY(-8px) scale(1.03); }
.envelope.open  { transform: translateY(-4px) scale(1.05); }

.env-back {
    position: absolute; inset: 0;
    background: linear-gradient(145deg, #ff9ebb, #ff6f91);
    border-radius: 12px;
    box-shadow: 0 26px 60px rgba(201,24,74,.4);
}
.env-front {
    position: absolute; inset: 0;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffb3c9, #ff8fab);
    clip-path: polygon(0 100%, 0 22%, 50% 62%, 100% 22%, 100% 100%);
    z-index: 3;
    box-shadow: inset 0 6px 18px rgba(255,255,255,.35);
}
.env-flap {
    position: absolute; left: 0; right: 0; top: 0;
    height: 62%;
    background: linear-gradient(160deg, #ffc2d1, #ff9ebb);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform .8s cubic-bezier(.5, -0.3, .3, 1.2), z-index 0s .4s;
    z-index: 4;
    border-radius: 12px 12px 0 0;
}
.envelope.open .env-flap { transform: rotateX(178deg); z-index: 1; }

.env-seal {
    position: absolute; z-index: 5;
    top: 52%; left: 50%;
    transform: translate(-50%, -50%);
    width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.5rem;
    background: radial-gradient(circle at 35% 30%, #ff8fab, #c9184a);
    box-shadow: 0 6px 18px rgba(201,24,74,.5);
    transition: opacity .35s ease, transform .5s ease;
}
.envelope.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(.4); }

.env-letter {
    position: absolute; z-index: 2;
    left: 7%; right: 7%; top: 10%;
    height: 88%;
    background: linear-gradient(#fffdfd, #fff5f8);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(90,42,58,.18);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .25rem;
    transform: translateY(0);
    transition: transform 1s cubic-bezier(.2, 1, .3, 1) .35s;
}
.envelope.open .env-letter { transform: translateY(-62%); }
.env-letter-tulip { font-size: 1.8rem; }
.env-letter-text {
    font-family: var(--f-script);
    font-size: clamp(1.2rem, 4vw, 1.7rem);
    color: var(--deep-rose);
}
.env-letter-sub { font-size: .78rem; color: var(--text-soft); }

.env-skip {
    position: relative; z-index: 2;
    border: none; cursor: pointer;
    background: rgba(255,255,255,.6);
    color: var(--deep-rose);
    padding: .5rem 1.2rem; border-radius: 999px;
    font-family: var(--f-body); font-size: .85rem;
    backdrop-filter: blur(8px);
    transition: background .25s ease;
}
.env-skip:hover { background: #fff; }

/* =========================================================
   ══ NIEBLA / BLUR SOBRE EL JARDÍN ══
   ========================================================= */
.hero-haze {
    position: absolute; inset: 0; z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 78%, transparent 45%, rgba(255,214,228,.55) 100%),
        linear-gradient(to bottom, rgba(255,245,247,.55) 0%, transparent 28%, transparent 72%, rgba(255,194,209,.45) 100%);
    backdrop-filter: blur(0.6px);
}

/* =========================================================
   ══ RAMO ENFOCADO ══
   ========================================================= */
.bouquet-overlay {
    position: fixed; inset: 0; z-index: 150;
    display: none; flex-direction: column;
    align-items: center; justify-content: center; gap: .6rem;
    padding: 2rem 1rem;
    background: rgba(90, 42, 58, .55);
    backdrop-filter: blur(16px);
    animation: fadeIn .35s ease;
}
.bouquet-overlay.open { display: flex; }
.bouquet-overlay canvas {
    width: min(92vw, 520px);
    height: min(58dvh, 460px);
    display: block;
    cursor: grab;
    touch-action: none;
}
.bouquet-overlay canvas:active { cursor: grabbing; }
.bouquet-title {
    font-family: var(--f-serif); font-weight: 600;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: #fff;
    text-shadow: 0 3px 18px rgba(0,0,0,.35);
}
.bouquet-sub { color: rgba(255,255,255,.9); font-size: .95rem; text-align: center; }
.bouquet-close {
    position: absolute;
    top: calc(1.2rem + env(safe-area-inset-top));
    right: calc(1.6rem + env(safe-area-inset-right));
    font-size: 2rem; color: #fff; cursor: pointer; opacity: .9;
}

/* =========================================================
   ══ CARRUSEL DE ESPECIES ══
   ========================================================= */
.species-stage {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    gap: .5rem;
    width: 100%;
}
.species-canvas {
    width: 100%; max-width: 440px;
    height: min(48dvh, 380px);
    display: block;
    cursor: grab;
    border-radius: 26px;
    background: radial-gradient(ellipse at 50% 80%, rgba(255,255,255,.5), transparent 65%);
}
.species-canvas:active { cursor: grabbing; }
.species-canvas.no-webgl { display: none; }

.species-nav {
    flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 50%;
    border: none; cursor: pointer;
    font-size: 1.6rem; line-height: 1;
    color: var(--deep-rose);
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all .25s ease;
}
.species-nav:hover { background: var(--rose); color: #fff; transform: scale(1.08); }

.species-name {
    font-family: var(--f-serif);
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: var(--deep-rose);
    margin-top: .4rem;
}
.species-dots { display: flex; gap: .45rem; justify-content: center; margin: .6rem 0 .2rem; }
.species-dots .dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: none; padding: 0; cursor: pointer;
    background: rgba(255,143,171,.4);
    transition: all .25s ease;
}
.species-dots .dot.on { background: var(--deep-rose); transform: scale(1.35); }

/* =========================================================
   ══ CORAZÓN QUE HABLA ══
   ========================================================= */
.heart-stage { position: relative; display: flex; justify-content: center; }
.heart-says {
    position: absolute;
    top: 8%; left: 50%;
    transform: translate(-50%, -6px) scale(.9);
    padding: .7rem 1.3rem;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    font-family: var(--f-script);
    font-size: clamp(1.3rem, 4.5vw, 1.9rem);
    color: var(--deep-rose);
    white-space: nowrap;
    opacity: 0; pointer-events: none;
}
.heart-says.show { animation: saysPop 2.8s ease forwards; }
@keyframes saysPop {
    0%   { opacity: 0; transform: translate(-50%, 6px) scale(.85); }
    12%  { opacity: 1; transform: translate(-50%, -10px) scale(1); }
    80%  { opacity: 1; transform: translate(-50%, -14px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -30px) scale(.95); }
}

/* =========================================================
   ══ DISTANCIA ══
   ========================================================= */
.distance-box {
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px dashed rgba(255,143,171,.5);
}
.dist-row {
    display: flex; align-items: center; justify-content: center;
    gap: .5rem; flex-wrap: nowrap;
    font-size: .82rem; color: var(--text-soft);
    margin-bottom: .6rem;
}
.dist-city {
    max-width: 34vw; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.dist-line { display: flex; align-items: center; gap: .3rem; flex: 1 1 auto; min-width: 40px; }
.dist-line i {
    flex: 1; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--pink), transparent);
}
.dist-km {
    font-family: var(--f-serif); font-weight: 600;
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    color: var(--deep-rose);
}
.dist-note { color: var(--text-soft); font-size: .9rem; margin-top: .4rem; font-style: italic; }

@media (max-width: 560px) {
    .species-nav { width: 38px; height: 38px; font-size: 1.3rem; }
}

/* =========================================================
   ══ CUENTA REGRESIVA PARA VERNOS ══
   ========================================================= */
.reunion-card {
    position: relative;
    overflow: hidden;
    width: 100%; max-width: 700px;
    padding: 3rem 2rem 2.4rem;
    text-align: center;
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.85), transparent 60%),
        rgba(255, 255, 255, .68);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,.7);
}
.reunion-card::before {
    content: "";
    position: absolute; inset: -40% -10% auto -10%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(255,143,171,.28), transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

.reunion-plane {
    font-size: 2rem;
    animation: flyBy 6s ease-in-out infinite;
    display: inline-block;
}
@keyframes flyBy {
    0%   { transform: translateX(-14px) translateY(0) rotate(-6deg); }
    50%  { transform: translateX(14px) translateY(-8px) rotate(4deg); }
    100% { transform: translateX(-14px) translateY(0) rotate(-6deg); }
}

.reunion-where {
    color: var(--text-soft);
    font-size: 1.02rem;
    margin-bottom: 1.5rem;
}
.reunion-where b { color: var(--deep-rose); }

.reunion-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: .6rem; position: relative;
}
.reunion-unit {
    display: flex; flex-direction: column; gap: .2rem;
    padding: 1rem .3rem;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255,143,171,.22), rgba(255,194,209,.12));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.reunion-unit b {
    font-family: var(--f-serif); font-weight: 600;
    font-size: clamp(1.7rem, 6.5vw, 3rem);
    color: var(--deep-rose);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.reunion-unit span {
    font-size: .7rem; text-transform: uppercase;
    letter-spacing: .12em; color: var(--text-soft);
}

.reunion-bar {
    margin: 1.5rem auto .8rem;
    height: 8px; width: 100%;
    border-radius: 999px;
    background: rgba(255,143,171,.2);
    overflow: hidden;
}
.reunion-bar i {
    display: block; height: 100%; width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pink), var(--deep-rose));
    transition: width 1s linear;
}

.reunion-note {
    color: var(--text-soft); font-style: italic; font-size: .98rem;
}

/* Cuando ya llegó el día */
.reunion-card.arrived {
    animation: arrivedGlow 2.2s ease-in-out infinite;
}
.reunion-card.arrived .reunion-unit b { color: var(--rose); }
@keyframes arrivedGlow {
    0%,100% { box-shadow: var(--shadow); }
    50%     { box-shadow: 0 18px 60px rgba(201,24,74,.45); }
}

@media (max-width: 560px) {
    .reunion-grid { grid-template-columns: repeat(2, 1fr); }
    .reunion-card { padding: 2.4rem 1.3rem 2rem; }
}

/* =========================================================
   ══ PUERTA: PALABRA CLAVE ══
   ========================================================= */
.hidden { display: none !important; }
body.locked { overflow: hidden; }

.gate {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
             max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
    background: linear-gradient(160deg, #fff5f7 0%, #ffe3ec 40%, #ffd6e4 75%, #ffc2d1 100%);
    transition: opacity .6s ease, transform .6s ease;
}
.gate.open { opacity: 0; transform: scale(1.1); pointer-events: none; }

.gate-glow {
    position: absolute;
    width: min(80vw, 520px); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,143,171,.3) 55%, transparent 72%);
    filter: blur(32px);
    animation: glowPulse 4s ease-in-out infinite;
}

.gate-card {
    position: relative; z-index: 2;
    width: 100%; max-width: 400px;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.8rem 2.2rem;
    text-align: center;
}
.gate-card.shake { animation: shake .45s ease; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-9px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.gate-tulip { font-size: 3rem; animation: sway 4s ease-in-out infinite; }
.gate-title {
    font-family: var(--f-serif); font-size: 2.1rem; font-weight: 600;
    color: var(--deep-rose); margin: .5rem 0 .2rem;
}
.gate-sub { color: var(--text-soft); margin-bottom: 1.7rem; }
.gate-form { display: flex; flex-direction: column; gap: 1.05rem; text-align: left; }

.gate-error {
    margin-top: .9rem; min-height: 1.2em;
    color: var(--deep-rose); font-size: .9rem;
    opacity: 0; transition: opacity .3s ease;
}
.gate-error.show { opacity: 1; }

.gate-hint-btn {
    margin-top: .8rem; border: none; cursor: pointer;
    background: transparent; color: var(--text-soft);
    font-family: var(--f-body); font-size: .85rem;
    text-decoration: underline dotted;
}
.gate-hint-btn:hover { color: var(--deep-rose); }
.gate-hint {
    margin-top: .6rem; font-size: .92rem; color: var(--deep-rose);
    font-style: italic; opacity: 0; transition: opacity .4s ease;
}
.gate-hint.show { opacity: 1; }
