/* ===================================
   CARTA 21 DE MARZO 2026
   Temática Amarilla / Dorada
   ================================== */

/* ===================================
   SOBRE (portada en el index)
   ================================== */

.carta-21marzo-container {
    text-align: center;
    margin: 60px auto;
    perspective: 1000px;
}

.marzo21-envelope {
    position: relative;
    width: 280px;
    height: 180px;
    margin: 0 auto 20px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.marzo21-envelope:hover  { transform: translateY(-15px) scale(1.05); }
.marzo21-envelope:active { transform: translateY(-10px)  scale(1.02); }

.marzo21-envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff 0%, #fffbec 100%);
    border-radius: 10px;
    box-shadow: 0 15px 50px rgba(210, 160, 0, 0.25);
    border: 3px solid #f0c040;
}

.marzo21-envelope-front {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.marzo21-envelope-flap {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 90px solid #f5c518;
    top: 0;
    left: 0;
    transform-origin: top center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 5px 15px rgba(210, 160, 0, 0.35));
}

.marzo21-envelope:hover .marzo21-envelope-flap {
    transform: rotateX(-180deg);
}

.marzo21-love-letter {
    position: absolute;
    width: 240px;
    height: 150px;
    background: linear-gradient(135deg, #fffef5 0%, #fffbe8 100%);
    top: 15px;
    left: 20px;
    border-radius: 5px;
    box-shadow: inset 0 0 20px rgba(210, 160, 0, 0.08), 0 5px 20px rgba(0, 0, 0, 0.12);
    padding: 15px;
    z-index: 1;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(240, 192, 64, 0.3);
}

.marzo21-envelope:hover .marzo21-love-letter {
    transform: translateY(-30px);
}

.marzo21-letter-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(210, 160, 0, 0.2);
}

.marzo21-letter-title {
    color: #c8920a;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(210, 160, 0, 0.2);
    font-family: 'Brush Script MT', cursive;
}

.marzo21-letter-date {
    color: #999;
    font-size: 0.7rem;
    font-style: italic;
}

.marzo21-letter-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.marzo21-letter-lines::before,
.marzo21-letter-lines::after {
    content: '';
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(210, 160, 0, 0.3), transparent);
    border-radius: 2px;
}

/* Manojo — esquina inferior derecha */
.marzo21-envelope-seal-img {
    position: absolute;
    bottom: -18px;
    right: 18px;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    z-index: 5;
    animation: marzo21Heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(210, 160, 0, 0.35));
}

@keyframes marzo21Heartbeat {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

.carta-21marzo-subtitle {
    color: #c8920a;
    font-size: 1rem;
    font-style: italic;
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(210, 160, 0, 0.2);
    animation: marzo21Pulse 2s ease-in-out infinite;
}

@keyframes marzo21Pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.75; }
}

/* Destellos hover */
.marzo21-envelope::before,
.marzo21-envelope::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.6s ease-out;
    pointer-events: none;
}

.marzo21-envelope::before { top: -20px;    left: -20px; }
.marzo21-envelope::after  { bottom: -20px; right: -20px; }

.marzo21-envelope:hover::before,
.marzo21-envelope:hover::after { opacity: 1; }

.marzo21-envelope:hover::before { transform: translate(-10px, -10px) rotate(-15deg); }
.marzo21-envelope:hover::after  { transform: translate(10px,  10px)  rotate(15deg);  }


/* ===================================
   MODAL FULLSCREEN — ESCENA 3D
   ================================== */

.carta21marzo-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    overflow: hidden;
}

.carta21marzo-modal.activo {
    display: block;
}

/* Canvas Three.js ocupa todo el modal */
.carta21marzo-modal canvas {
    display: block;
    position: absolute;
    inset: 0;
}

/* Botón cerrar */
.carta21marzo-close-btn {
    position: fixed;
    top: 16px;
    right: 24px;
    font-size: 2.2rem;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}

.carta21marzo-close-btn:hover {
    transform: scale(1.2);
    opacity: 1;
}

/* ---- Loading ---- */
.carta21marzo-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1200 0%, #0a0a0a 100%);
    z-index: 10;
    overflow: hidden;
}

.carta21marzo-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 520px;
    width: 90%;
    padding: 48px 40px;
    background: rgba(255, 200, 0, 0.04);
    border: 1px solid rgba(245, 197, 24, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.carta21marzo-loading-intro {
    font-family: 'Georgia', serif;
    font-size: 1.05rem;
    font-style: italic;
    color: rgba(253, 230, 138, 0.6);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

/* Carrusel de mensajes — controlado por JS */
.carta21marzo-loading-messages {
    position: relative;
    width: 100%;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carta21marzo-loading-messages p {
    position: absolute;
    width: 100%;
    margin: 0;
    font-family: 'Georgia', serif;
    font-size: 1.35rem;
    font-style: italic;
    color: #fff;
    text-align: center;
    line-height: 1.7;
    text-shadow: 0 2px 20px rgba(245, 197, 24, 0.4);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    pointer-events: none;
}

.carta21marzo-loading-messages p.visible {
    opacity: 1;
    transform: translateY(0);
}

.carta21marzo-loading-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.carta21marzo-loading-bottom span {
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(245, 197, 24, 0.7);
    letter-spacing: 0.06em;
}

.carta21marzo-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(245, 197, 24, 0.2);
    border-top-color: #f5c518;
    border-radius: 50%;
    animation: carta21marzo-spin 0.9s linear infinite;
}

@keyframes carta21marzo-spin {
    to { transform: rotate(360deg); }
}

/* ---- Cinta "para ti" ---- */
.carta21marzo-ribbon {
    position: fixed;
    bottom: 52px;
    left: -75px;
    width: 290px;
    background: linear-gradient(135deg, #e879a8, #be185d);
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 15px;
    font-style: italic;
    letter-spacing: 0.12em;
    text-align: center;
    padding: 9px 0;
    transform: rotate(45deg);
    transform-origin: center center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    z-index: 6;
    pointer-events: none;
}

/* ---- Sparkles ---- */
.carta21marzo-sparkle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 6;
    animation: carta21marzo-sparkle-anim ease-out forwards;
}

@keyframes carta21marzo-sparkle-anim {
    0%   { transform: scale(0);   opacity: 1; }
    50%  { transform: scale(1);   opacity: 1; }
    100% { transform: scale(0.2); opacity: 0; }
}

/* ---- Explosión de pétalos al click ---- */
.carta21marzo-petal-burst {
    position: fixed;
    border-radius: 150% 0 150% 0;
    pointer-events: none;
    z-index: 6;
    animation: carta21marzo-burst-anim ease-out forwards;
}

@keyframes carta21marzo-burst-anim {
    0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(var(--bx), var(--by)) rotate(540deg) scale(0.3); }
}

/* ---- Mensaje zoom-out ---- */
.carta21marzo-zoom-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Georgia', serif;
    font-size: 2rem;
    font-style: italic;
    color: #fff;
    text-shadow: 0 2px 16px rgba(180, 40, 100, 0.7);
    pointer-events: none;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.5s;
    text-align: center;
}

/* ---- Contador de segundos ---- */
.carta21marzo-segundos {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Georgia', serif;
    font-size: 1.15rem;
    font-style: italic;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 12px rgba(180, 40, 100, 0.8), 0 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.6s;
    text-align: center;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: rgba(200, 60, 120, 0.18);
    padding: 6px 18px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
}

/* ---- Enredaderas ---- */
.carta21marzo-enred-left,
.carta21marzo-enred-right {
    position: fixed;
    top: 0;
    width: 210px;
    pointer-events: none;
    z-index: 7;
}

.carta21marzo-enred-left  { left: 0;  transform: scaleX(-1); }
.carta21marzo-enred-right { right: 0; }

/* ---- Título ---- */
.carta21marzo-titulo {
    position: fixed;
    top: 32px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 6;
    pointer-events: none;
}

.carta21marzo-titulo span {
    font-family: 'Georgia', serif;
    font-size: 2.4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 12px rgba(180, 60, 100, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.02em;
}

.carta21marzo-titulo .carta21marzo-subtitulo {
    font-size: 1.1rem;
    font-weight: normal;
    font-style: italic;
    color: #fde68a;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.08em;
}

/* ---- Pétalos ---- */
.carta21marzo-petals {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.carta21marzo-petal {
    position: absolute;
    top: -60px;
    border-radius: 150% 0 150% 0;
    opacity: 0;
    animation: carta21marzo-caida linear infinite;
}

@keyframes carta21marzo-caida {
    0%   { transform: translateY(0) translateX(0) rotate(0deg);            opacity: 0;    }
    5%   { opacity: 0.85; }
    85%  { opacity: 0.7;  }
    100% { transform: translateY(110vh) translateX(var(--drift)) rotate(720deg); opacity: 0; }
}

/* ---- Texto lateral ---- */
.carta21marzo-side-line {
    position: fixed;
    line-height: 34px;
    font-size: 17px;
    font-family: Georgia, serif;
    font-style: italic;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 6px rgba(120, 30, 60, 0.4);
    white-space: nowrap;
    overflow: hidden;
    z-index: 6;
    pointer-events: none;
}
