/* ============= Variables ============= */
:root {
    --gold-primary: #c9a961;
    --gold-deep: #a08020;
    --gold-light: #e8d4a0;
    --gold-pale: #f5edd6;
    --gold-shimmer: #d4af37;
    --white-pure: #ffffff;
    --white-warm: #ffffff;
    --white-cream: #ffffff;
    --ivory: #ffffff;
    --text-dark: #3a3220;
    --text-muted: #6b5d3f;
    --shadow-gold: rgba(201, 169, 97, 0.25);
    --shadow-soft: rgba(58, 50, 32, 0.12);
}

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

html, body {
    overflow: hidden;
}

html.invitation-active,
html.invitation-active body {
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

html.invitation-active .container {
    transform: none;
    zoom: 2.5;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body {
    animation: pageFadeIn 0.7s cubic-bezier(0.45, 0, 0.55, 1) both;
}

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    background: #ffffff;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dark);
    position: relative;
}

/* ============= Particules dorées ============= */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--gold-shimmer) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-10vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    width: 100%;
    max-width: 700px;
    position: relative;
    perspective: 1500px;
    z-index: 2;
    transform: scale(2.5);
    transform-origin: 50% 50%;
    flex-shrink: 0;
}

/* ============= Pages ============= */
.page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.45, 0, 0.55, 1);
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

.page.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
    position: relative;
}

.page-envelope {
    min-height: calc(100vh - 40px);
    min-height: calc(100dvh - 40px);
    justify-content: center;
}

/* ============= Enveloppe ============= */
/* Désactive le hover pendant l'animation pour éviter les conflits de transform */
.envelope-container.animating,
.envelope-container.animating .envelope {
    pointer-events: none !important;
    transition: none !important;
}

.envelope-container {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    will-change: transform, opacity;
}

.envelope {
    width: 420px;
    height: 270px;
    position: relative;
    perspective: 700px;
    transition: transform 1.2s cubic-bezier(0.45, 0, 0.55, 1);
}

.envelope-container:hover .envelope:not(.open) {
    transform: translateY(-8px) rotate(-1deg);
}

.envelope.open {
    transform: rotateX(15deg) translateY(-30px);
}



/* ============= Aperçu de la lettre intérieure ============= */
.letter-peek {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    width: auto;
    height: 135px;
    background: #fdfcf9;
    /* Même triangle que le rabat — la lettre épouse exactement la forme du pli */
    -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    /* Ombre derrière le triangle : le papier est posé dans la poche */
    filter: drop-shadow(0 4px 8px rgba(58, 50, 32, 0.35));
    z-index: 2;           /* sous le rabat (z-index:3) mais au-dessus du corps */
    opacity: 0;           /* invisible jusqu'à ce que le rabat tourne */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 24px 0;
    gap: 5px;
    overflow: hidden;
}

.lp-corner {
    display: none;
}

.lp-title {
    font-family: 'Great Vibes', cursive;
    font-size: 24px;
    color: var(--gold-deep);
    line-height: 1.1;
    flex-shrink: 0;
}

.lp-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 7px;
    letter-spacing: 3px;
    color: var(--gold-primary);
    text-transform: uppercase;
    flex-shrink: 0;
    margin-bottom: 4px;
}

/* Lignes de texte simulées */
.lp-text-line {
    height: 6px;
    background: linear-gradient(90deg,
        rgba(180, 160, 120, 0.15) 0%,
        rgba(180, 160, 120, 0.25) 40%,
        rgba(180, 160, 120, 0.15) 100%);
    border-radius: 4px;
    flex-shrink: 0;
    align-self: center;
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 2px solid var(--gold-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 28px;
    position: relative;
    box-shadow:
        0 25px 50px rgba(201, 169, 97, 0.3),
        0 8px 20px rgba(58, 50, 32, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    border-radius: 0 0 4px 4px;
}

/* Motif damassé très léger (sans tint crème) */
.envelope-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 15px,
            rgba(201, 169, 97, 0.025) 15px,
            rgba(201, 169, 97, 0.025) 16px
        );
    pointer-events: none;
}

/* Bordure intérieure dorée */
.envelope-body::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(201, 169, 97, 0.4);
    pointer-events: none;
    border-radius: 2px;
}

.envelope-inner-ornament {
    position: relative;
    width: 130px;
    opacity: 0.7;
    margin-bottom: 2px;
    line-height: 0;
}

.envelope-text {
    font-family: 'Great Vibes', cursive;
    font-size: 38px;
    color: var(--gold-deep);
    font-weight: 400;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(201, 169, 97, 0.2);
}

.envelope-subtext {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    color: var(--gold-primary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ============= Rabat de l'enveloppe (luxueux) ============= */
.envelope-flap {
    width: 100%;
    height: 135px;
    position: absolute;
    top: 0;
    left: 0;
    /* Dégradé doré du rabat */
    background:
        linear-gradient(180deg,
            #e8d4a0 0%,
            #c9a961 50%,
            #a08020 100%);
    -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    will-change: transform, opacity;
    z-index: 3;
    /* Très légère ombre pour décoller le rabat du corps */
    filter: drop-shadow(0 2px 3px rgba(120, 90, 20, 0.18));
}

/* Contenu du rabat : surcouche + SVG */
.flap-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Surcouche : très léger ombrage vers la pointe + grain papier */
.flap-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            transparent 0%,
            transparent 70%,
            rgba(120, 90, 20, 0.08) 92%,
            rgba(120, 90, 20, 0.16) 100%);
    pointer-events: none;
}

/* Décoration SVG (pattern + bordures + ornements) */
.flap-decoration {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.envelope.open .envelope-flap {
    z-index: 0;
}



/* Ombre portée du rabat sur le corps de l'enveloppe */
/* Triangle légèrement plus grand que .letter-peek.
   z:1 = au-dessus du corps (z:auto) mais sous le peek (z:2).
   La partie centrale est couverte par le peek blanc — seul le
   bord de 5 px reste visible sur la surface du corps : c'est
   l'ombre de pli exactement sur la limite du flap. */
.flap-fold-shadow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 135px;
    -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background: rgba(40, 28, 10, 0.40);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.55s ease 0.30s;
}

.envelope.open .flap-fold-shadow {
    opacity: 1;
}

/* ============= Halo doré d'ouverture ============= */
.opening-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    background:
        radial-gradient(circle,
            rgba(255, 230, 140, 0.95) 0%,
            rgba(212, 175, 55, 0.7) 25%,
            rgba(212, 175, 55, 0.3) 50%,
            rgba(212, 175, 55, 0) 75%);
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    filter: blur(2px);
}

.envelope.open .opening-glow {
    animation: glowBurst 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes glowBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4);
    }
}

/* ============= Lettre flottante qui s'ouvre ============= */
.floating-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 280px;
    transform: translate(-50%, -50%) translateY(60px) scale(0.5) rotateX(70deg);
    opacity: 0;
    pointer-events: none;
    z-index: 6;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.letter-paper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

/* Chaque moitié de la lettre */
.letter-half {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background: #ffffff;
    border: 1px solid var(--gold-primary);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.18),
        0 6px 12px rgba(120, 90, 20, 0.15);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.letter-half-top {
    top: 0;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    transform-origin: bottom center;
    /* Légère ombre sur le bord inférieur (le pli) */
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.18),
        0 6px 12px rgba(120, 90, 20, 0.15),
        inset 0 -8px 12px rgba(120, 90, 20, 0.08);
}

.letter-half-bottom {
    top: 50%;
    border-top: none;
    border-radius: 0 0 3px 3px;
    transform-origin: top center;
    /* État initial : repliée vers le haut (cachée derrière la moitié sup.) */
    transform: rotateX(180deg);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.18),
        0 6px 12px rgba(120, 90, 20, 0.15),
        inset 0 8px 12px rgba(120, 90, 20, 0.08);
}

/* Cadre intérieur sur chaque moitié */
.letter-half::before {
    content: '';
    position: absolute;
    border: 1px solid rgba(201, 169, 97, 0.4);
    pointer-events: none;
}

.letter-half-top::before {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 0;
    border-bottom: none;
}

.letter-half-bottom::before {
    top: 0;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-top: none;
}

/* Contenu intérieur de chaque moitié (centré) */
.letter-half-content {
    position: absolute;
    inset: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
}

/* Coins ornementaux */
.letter-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--gold-primary);
    z-index: 2;
}

.letter-corner-tl { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.letter-corner-tr { top: 4px; right: 4px; border-left: none; border-bottom: none; }
.letter-corner-bl { bottom: 4px; left: 4px; border-right: none; border-top: none; }
.letter-corner-br { bottom: 4px; right: 4px; border-left: none; border-top: none; }

.letter-ornament,
.letter-ornament-bottom {
    font-size: 18px;
    color: var(--gold-shimmer);
    line-height: 1;
}

.letter-mini-title {
    font-family: 'Great Vibes', cursive;
    font-size: 18px;
    color: var(--gold-deep);
    line-height: 1;
}

.letter-mini-date {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--gold-deep);
    font-weight: 500;
}

.letter-line {
    height: 2px;
    width: 75%;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold-primary) 50%,
        transparent 100%);
    border-radius: 2px;
}

.letter-line-short {
    width: 50%;
}

/* Animation principale : la lettre s'élève */
.envelope.open .floating-letter {
    animation: letterFloat 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

@keyframes letterFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(60px) scale(0.5) rotateX(70deg);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(0.8) rotateX(20deg);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-50px) scale(0.95) rotateX(0deg);
    }
    65% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-130px) scale(1) rotate(-2deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-300px) scale(1.1) rotate(-5deg);
    }
}

/* Animation de dépliage de la moitié inférieure */
.envelope.open .letter-half-bottom {
    animation: letterUnfold 0.8s cubic-bezier(0.34, 1.3, 0.64, 1) 1s forwards;
}

@keyframes letterUnfold {
    0% {
        transform: rotateX(180deg);
    }
    60% {
        transform: rotateX(-12deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

/* Effet d'ombre du pli pendant le dépliage */
.envelope.open .letter-half-top {
    animation: letterTopShade 0.8s ease 1s forwards;
}

@keyframes letterTopShade {
    0% {
        box-shadow:
            0 15px 30px rgba(0, 0, 0, 0.18),
            0 6px 12px rgba(120, 90, 20, 0.15),
            inset 0 -8px 12px rgba(120, 90, 20, 0.2);
    }
    100% {
        box-shadow:
            0 15px 30px rgba(0, 0, 0, 0.18),
            0 6px 12px rgba(120, 90, 20, 0.15),
            inset 0 -2px 4px rgba(120, 90, 20, 0.05);
    }
}

/* ============= Ornements / Pétales ============= */
.envelope-flowers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.ornament {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    filter: drop-shadow(0 4px 8px rgba(201, 169, 97, 0.3));
}

.envelope.open .ornament-1 {
    animation: petalFly1 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

.envelope.open .ornament-2 {
    animation: petalFly2 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

.envelope.open .ornament-3 {
    animation: petalFly3 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
}

.envelope.open .ornament-4 {
    animation: petalFly4 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s forwards;
}

.envelope.open .ornament-5 {
    animation: petalFly5 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s forwards;
}

@keyframes petalFly1 {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(45deg); }
    100% { opacity: 0; transform: translate(-250%, -250%) scale(1.2) rotate(540deg); }
}

@keyframes petalFly2 {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(-45deg); }
    100% { opacity: 0; transform: translate(150%, -250%) scale(1.3) rotate(-540deg); }
}

@keyframes petalFly3 {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(0.9) rotate(60deg); }
    100% { opacity: 0; transform: translate(-300%, -100%) scale(1.4) rotate(720deg); }
}

@keyframes petalFly4 {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-30deg); }
    100% { opacity: 0; transform: translate(200%, -100%) scale(1.1) rotate(-720deg); }
}

@keyframes petalFly5 {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(90deg); }
    100% { opacity: 0; transform: translate(0%, -350%) scale(1.5) rotate(900deg); }
}

/* ============= Hint ============= */
.click-hint {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: var(--gold-primary);
    opacity: 0.8;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    animation: fadeInOut 3s ease-in-out infinite;
}

.hint-icon {
    margin: 0 12px;
    color: var(--gold-shimmer);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============= Carte d'invitation ============= */
.invitation-card {
    width: 100%;
    max-width: 580px;
    padding: 70px 50px;
    background:
        #ffffff;
    border: 2.2px solid var(--gold-primary);
    box-shadow:
        0 30px 80px rgba(201, 169, 97, 0.2),
        0 10px 30px rgba(58, 50, 32, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    margin: 40px auto;
    border-radius: 4px;
    overflow: hidden;
    transform: perspective(1500px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Cadre intérieur — un seul liseré épais (ancien double cadre fusionné) */
.invitation-card::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    bottom: 18px;
    border: 4px solid rgba(201, 169, 97, 0.7);
    pointer-events: none;
    border-radius: 2px;
}

/* Le 2e cadre interne est désormais fusionné dans ::before — on le neutralise */
.invitation-card::after {
    content: none;
}

/* Coins ornementaux */
.corner {
    display: none;
}

.card-content {
    position: relative;
    z-index: 1;
}

/* Monogramme */
.monogram {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    animation: monogramSpin 30s linear infinite;
}

.monogram svg {
    width: 100%;
    height: 100%;
}

@keyframes monogramSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.monogram svg text {
    animation: monogramSpinReverse 30s linear infinite;
    transform-origin: 60px 60px;
}

@keyframes monogramSpinReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* En-tête */
.announcement {
    text-align: center;
    margin-bottom: 30px;
}

.overline {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: var(--gold-primary);
    margin-bottom: 12px;
    font-weight: 400;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    color: var(--gold-deep);
    font-weight: 500;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--gold-deep) 0%, var(--gold-shimmer) 50%, var(--gold-deep) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Diviseurs */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    gap: 14px;
}

.divider-line {
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold-primary) 50%,
        transparent 100%);
}

.divider-icon {
    color: var(--gold-shimmer);
    font-size: 18px;
}

/* Description */
.description {
    text-align: center;
    margin-bottom: 30px;
}

.message {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
    font-style: italic;
}

.couple-names {
    margin: 28px 0;
    line-height: 1.4;
}

.name-line {
    display: block;
    font-family: 'Great Vibes', cursive;
    font-size: 52px;
    color: var(--gold-deep);
    font-weight: 400;
    line-height: 1.5;
    padding-top: 0.15em;
    padding-bottom: 0.05em;
    background: linear-gradient(135deg, var(--gold-deep) 0%, var(--gold-shimmer) 50%, var(--gold-deep) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.and {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    margin: 8px 0;
    color: var(--gold-primary);
    font-weight: 300;
    font-style: italic;
}

/* Date */
.date-section {
    margin: 30px 0;
}

.date-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        ". month ."
        "left day right"
        ". year .";
    align-items: center;
    column-gap: 28px;
    padding: 24px 16px;
    border-top: 1px solid var(--gold-primary);
    border-bottom: 1px solid var(--gold-primary);
    position: relative;
    text-align: center;
}

.date-display::before,
.date-display::after {
    content: '✦';
    position: absolute;
    color: var(--gold-shimmer);
    font-size: 12px;
    background: #ffffff;
    padding: 0 8px;
    line-height: 1;
}

.date-display::before {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.date-display::after {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.date-side-label {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--gold-primary);
    text-transform: uppercase;
}

.date-left {
    grid-area: left;
    text-align: right;
}

.date-right {
    grid-area: right;
    text-align: left;
}

.date-month {
    grid-area: month;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--gold-primary);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.date-day {
    grid-area: day;
    font-family: 'Cormorant Garamond', serif;
    font-size: 56px;
    line-height: 1;
    color: var(--gold-deep);
    font-weight: 500;
    padding: 0 18px;
    border-left: 1px solid rgba(201, 169, 97, 0.4);
    border-right: 1px solid rgba(201, 169, 97, 0.4);
}

.date-day span {
    display: inline-block;
    transform: translateY(-14px);
}

.date-year {
    grid-area: year;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--gold-primary);
    margin-top: 2px;
}

/* Compte à rebours */
.countdown {
    text-align: center;
    margin: 30px 0;
}

.countdown-label {
    font-family: 'Great Vibes', cursive;
    font-size: 24px;
    color: var(--gold-primary);
    margin-bottom: 14px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 4px;
    background: #ffffff;
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.2);
}

.countdown-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--gold-deep);
    line-height: 1;
}

.countdown-text {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--gold-primary);
    text-transform: uppercase;
    margin-top: 6px;
}

/* Sections */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    letter-spacing: 4px;
    color: var(--gold-deep);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Programme */
.program-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    margin: 0 auto;
}

.program-item {
    display: grid;
    grid-template-columns: 32px 60px 1fr;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-bottom: 1px dotted rgba(201, 169, 97, 0.4);
    transition: background 0.3s ease;
}

.program-item:hover {
    background: rgba(201, 169, 97, 0.04);
}

.program-item:last-child {
    border-bottom: none;
}

.program-icon {
    font-size: 22px;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 1px 2px rgba(120, 90, 20, 0.25));
    transition: transform 0.3s ease;
}

.program-item:hover .program-icon {
    transform: scale(1.15) rotate(-5deg);
}

.program-time {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--gold-deep);
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
}

.program-event {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--text-muted);
    font-style: italic;
}

/* Lieu */
.location-section {
    text-align: center;
}

.location-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: var(--gold-deep);
    margin-bottom: 8px;
    font-weight: 500;
}

.location-address {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
    font-style: italic;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--gold-primary);
    text-decoration: none;
    text-transform: uppercase;
    padding: 8px 20px;
    border: 1px solid var(--gold-primary);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.map-link:hover {
    background: var(--gold-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
    transform: translateY(-2px);
}

/* Dress code */
.dress-code {
    text-align: center;
    display: none;
}

.dress-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

/* RSVP */
.rsvp-section {
    text-align: center;
}

.rsvp-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

.rsvp-text strong {
    color: var(--gold-deep);
    font-weight: 600;
}

.rsvp-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    margin-top: 8px;
}

.btn {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 14px 26px;
    border: none;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-accept {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-shimmer) 50%, var(--gold-deep) 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.4);
}

.btn-accept:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(201, 169, 97, 0.5);
}

.btn-decline {
    background: white;
    color: var(--gold-deep);
    border: 1px solid var(--gold-primary);
}

.btn-decline:hover {
    background: rgba(201, 169, 97, 0.1);
    transform: translateY(-3px);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.rsvp-contact {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

.rsvp-contact a {
    color: var(--gold-deep);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--gold-primary);
    padding-bottom: 1px;
}

/* ============= Formulaire RSVP ============= */
.rsvp-form {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-deep);
}

.form-group input,
.form-group textarea {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-bottom: 1px solid rgba(201, 169, 97, 0.5);
    padding: 10px 4px;
    outline: none;
    width: 100%;
    transition: border-color 0.3s ease, background 0.3s ease;
    border-radius: 0;
    -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(107, 93, 63, 0.45);
    font-style: italic;
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: var(--gold-shimmer);
    background: rgba(255, 255, 255, 0.9);
}

.form-group textarea {
    resize: none;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
}

.footer-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 6px;
}

.footer-author {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--gold-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Bouton retour */
.back-btn {
    margin-top: 30px;
    margin-bottom: 30px;
    background: transparent;
    border: 1px solid var(--gold-primary);
    color: var(--gold-deep);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--gold-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.4);
}

/* ============= Bouton musique ============= */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-shimmer) 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.4);
    z-index: 100;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
}

html.invitation-active .music-toggle {
    display: flex;
}

.music-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

.music-toggle.playing {
    animation: musicPulse 2s ease-in-out infinite;
}

.music-icon {
    font-size: 22px;
}

.music-toggle.playing .music-icon {
    animation: musicSpin 3s linear infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 6px 16px rgba(201, 169, 97, 0.4); }
    50% { box-shadow: 0 6px 16px rgba(201, 169, 97, 0.7), 0 0 0 8px rgba(201, 169, 97, 0.1); }
}

@keyframes musicSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============= Modal ============= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(58, 50, 32, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 200;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #ffffff;
    padding: 50px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 30px 80px rgba(58, 50, 32, 0.3);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--gold-primary);
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(201, 169, 97, 0.15);
    transform: rotate(90deg);
}

.modal-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: modalIconBounce 1s ease-out;
}

@keyframes modalIconBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: var(--gold-deep);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.modal-message {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 24px;
    line-height: 1.5;
}

.btn-modal {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-shimmer) 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.4);
}

/* ============= Page Organisateur ============= */
.page-organizer {
    width: 100%;
}

.organizer-card {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    padding: 50px 40px;
    background: #ffffff;
    border: 1px solid var(--gold-primary);
    border-radius: 6px;
    box-shadow:
        0 30px 80px rgba(201, 169, 97, 0.15),
        0 10px 30px rgba(58, 50, 32, 0.08);
    position: relative;
}

.organizer-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.3);
}

.organizer-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: var(--gold-deep);
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 500;
    background: linear-gradient(135deg, var(--gold-deep), var(--gold-shimmer), var(--gold-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.organizer-subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: var(--gold-primary);
    margin-top: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 36px;
}

.stat-card {
    padding: 24px 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(201, 169, 97, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-shimmer), var(--gold-primary));
}

.stat-icon {
    display: block;
    font-size: 22px;
    color: var(--gold-primary);
    margin-bottom: 6px;
}

.stat-number {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 44px;
    font-weight: 600;
    color: var(--gold-deep);
    line-height: 1;
}

.stat-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-primary);
    margin-top: 8px;
}

.stat-people {
    display: block;
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 4px;
}

.responses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.responses-section {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 6px;
    padding: 20px;
}

.responses-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.responses-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-present {
    background: #4a8b5a;
    box-shadow: 0 0 0 3px rgba(74, 139, 90, 0.2);
}

.dot-absent {
    background: #c44;
    box-shadow: 0 0 0 3px rgba(196, 68, 68, 0.2);
}

.responses-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.responses-list::-webkit-scrollbar {
    width: 5px;
}

.responses-list::-webkit-scrollbar-track {
    background: rgba(201, 169, 97, 0.05);
}

.responses-list::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 3px;
}

.responses-list li {
    padding: 12px 14px;
    border-bottom: 1px dotted rgba(201, 169, 97, 0.3);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    transition: background 0.2s ease;
}

.responses-list li:hover {
    background: rgba(201, 169, 97, 0.05);
}

.responses-list li:last-child {
    border-bottom: none;
}

.response-info {
    flex: 1;
    min-width: 0;
}

.response-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--gold-deep);
}

.response-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: italic;
}

.response-comment {
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(201, 169, 97, 0.06);
    border-left: 2px solid var(--gold-primary);
    border-radius: 2px;
    font-style: italic;
}

.response-delete {
    background: transparent;
    border: none;
    color: rgba(196, 68, 68, 0.6);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.response-delete:hover {
    background: rgba(196, 68, 68, 0.1);
    color: #c44;
}

.responses-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 30px 14px !important;
    border-bottom: none !important;
}

.organizer-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn-action {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-shimmer) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gold-deep);
    border: 1px solid var(--gold-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(201, 169, 97, 0.08);
}

.btn-action:hover {
    transform: translateY(-2px);
}

label.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.organizer-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding: 14px;
    background: rgba(201, 169, 97, 0.06);
    border-radius: 4px;
    line-height: 1.5;
}

.organizer-note code {
    background: rgba(201, 169, 97, 0.12);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--gold-deep);
}

/* ============= Responsive ============= */
/* ============= RESPONSIVE MOBILE ============= */

/* ===== Neutralisation du zoom natif sur mobile / tablette =====
   Le zoom 2.5x ajouté sur .container est uniquement pertinent pour
   les grands écrans. Sur mobile/tablette, il faut absolument l'annuler
   sinon tout déborde du viewport. !important pour battre toute
   spécificité ; -webkit-/-moz- pour couvrir d'éventuelles variantes. */
@media (max-width: 1024px) {
    .container,
    html.invitation-active .container {
        transform: none !important;
        -webkit-transform: none !important;
        -moz-transform: none !important;
        zoom: 1 !important;
    }
}

/* Tablette et téléphones moyens (≤ 768px) */
@media (max-width: 768px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .container {
        max-width: 100%;
    }

    .invitation-card {
        padding: 56px 30px;
        margin: 24px auto;
    }
}

/* Téléphones (≤ 600px) — refonte complète pour éviter tout débordement */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }

    .page-envelope {
        min-height: calc(100vh - 16px);
        min-height: calc(100dvh - 16px);
    }

    /* ===== Enveloppe : taille fluide basée sur la largeur du viewport ===== */
    .envelope {
        width: min(360px, 92vw);
        height: calc(min(360px, 92vw) * 0.643); /* ratio 270/420 */
    }

    .envelope-flap {
        /* On retire les vieux border-left/right qui ne servent plus
           (le clip-path gère la forme du V) */
        border: none;
        height: 50%;
    }

    .envelope-container {
        gap: 24px;
    }

    .click-hint {
        font-size: 11px;
        letter-spacing: 2px;
        padding: 0 12px;
    }

    .hint-icon {
        margin: 0 8px;
    }

    .envelope-body::after {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .envelope-text {
        font-size: clamp(22px, 7vw, 32px);
    }

    .envelope-subtext {
        font-size: 11px;
        letter-spacing: 3px;
    }

    .envelope-inner-ornament {
        width: clamp(80px, 28vw, 120px);
    }

    .envelope-body {
        padding-bottom: 18px;
    }

    /* ===== Letter peek (lettre triangulaire sous le rabat) ===== */
    .letter-peek {
        top: 8px;
        left: 10px;
        right: 10px;
        height: calc(50% - 4px);
        font-size: 12px;
        padding: 16px 16px 0;
    }

    .flap-fold-shadow {
        top: 5px;
        left: 5px;
        right: 5px;
        height: calc(50% + 3px);
    }

    .lp-title {
        font-size: clamp(16px, 5.5vw, 22px);
    }

    .lp-subtitle {
        font-size: clamp(10px, 3vw, 13px);
    }

    /* ===== Carte d'invitation ===== */
    .invitation-card {
        padding: 56px 32px;
        margin: 16px auto;
        border-width: 2px;
    }

    /* Cadre interne fusionné, plus épais (anciennement deux liserés) */
    .invitation-card::before {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-width: 3px;
    }
    /* ::after déjà neutralisé dans le CSS de base */

    .monogram {
        width: 80px;
        height: 80px;
    }

    .overline {
        font-size: 22px;
    }

    .title {
        font-size: clamp(18px, 5.5vw, 24px);
        letter-spacing: 3px;
    }

    .message {
        font-size: 16px;
    }

    .name-line {
        font-size: clamp(34px, 10vw, 44px);
    }

    .and {
        font-size: 24px;
    }

    /* ===== Date ===== */
    .date-day {
        font-size: clamp(38px, 12vw, 48px);
        padding: 0 12px;
    }

    .date-display {
        padding: 18px 6px;
        column-gap: 12px;
    }

    .date-side-label,
    .date-month,
    .date-year {
        font-size: 12px;
        letter-spacing: 2px;
    }

    /* ===== Compte à rebours ===== */
    .countdown-grid {
        gap: 6px;
    }

    .countdown-item {
        padding: 10px 2px;
    }

    .countdown-number {
        font-size: clamp(18px, 6.5vw, 26px);
    }

    .countdown-text {
        font-size: 11px;
        letter-spacing: 1px;
    }

    /* ===== Programme ===== */
    .program-item {
        grid-template-columns: 28px 50px 1fr;
        gap: 10px;
        padding: 10px 8px;
    }

    .program-icon {
        font-size: 18px;
    }

    .program-time {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .program-event {
        font-size: 16px;
    }

    .section-title {
        font-size: 15px;
        letter-spacing: 2px;
    }

    /* ===== Lieu ===== */
    .location-name {
        font-size: 19px;
    }

    .location-address {
        font-size: 14px;
    }

    /* ===== Dress code ===== */
    .dress-text {
        font-size: 15px;
    }

    /* ===== RSVP ===== */
    .rsvp-text {
        font-size: 14px;
    }

    .rsvp-form {
        max-width: 100%;
    }

    /* Empêche le zoom auto sur iOS quand on focus un input (font-size ≥ 16px) */
    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 12px;
    }

    .form-group label {
        font-size: 12px;
    }

    .rsvp-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn {
        padding: 16px 20px;
        font-size: 14px;
        min-height: 48px; /* Cible tactile confortable */
    }

    .rsvp-contact {
        font-size: 15px;
    }

    /* ===== Footer ===== */
    .footer-quote {
        font-size: 16px;
    }

    .footer-author {
        font-size: 12px;
    }

    /* ===== Bouton retour ===== */
    .back-btn {
        padding: 14px 24px;
        font-size: 13px;
        min-height: 44px;
    }

    /* ===== Bouton musique ===== */
    .music-toggle {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .music-icon {
        font-size: 18px;
    }

    /* ===== Modal ===== */
    .modal {
        padding: 16px;
    }

    .modal-content {
        padding: 36px 22px;
    }

    .modal-icon {
        font-size: 44px;
    }

    .modal-title {
        font-size: 16px;
        letter-spacing: 1.5px;
    }

    .modal-message {
        font-size: 16px;
    }

    /* ===== Lettre flottante (animation d'ouverture) ===== */
    .floating-letter {
        width: min(180px, 60vw);
        height: min(230px, 76vw);
    }

    /* ===== Page organisateur ===== */
    .organizer-card {
        padding: 32px 16px;
        margin: 16px auto;
    }

    .organizer-title {
        font-size: 18px;
        letter-spacing: 3px;
    }

    .organizer-subtitle {
        font-size: 22px;
    }

    .stats-grid {
        gap: 6px;
    }

    .stat-card {
        padding: 14px 4px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-number {
        font-size: 28px;
    }

    .stat-label {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .stat-people {
        font-size: 12px;
    }

    .responses-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .responses-section {
        padding: 14px;
    }

    .responses-title {
        font-size: 14px;
    }

    .response-name {
        font-size: 17px;
    }

    .organizer-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* ===== Halo & particules ===== */
    .opening-glow {
        width: 140px;
        height: 140px;
    }
}

/* Petits téléphones (≤ 380px — iPhone SE, vieux Android) */
@media (max-width: 380px) {
    body {
        padding: 6px;
    }

    .invitation-card {
        padding: 50px 26px;
    }

    .invitation-card::before {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-width: 2.5px;
    }
    /* ::after déjà neutralisé dans le CSS de base */

    .monogram {
        width: 70px;
        height: 70px;
    }

    .name-line {
        font-size: clamp(28px, 9.5vw, 36px);
    }

    .and {
        font-size: 20px;
    }

    .countdown-item {
        padding: 8px 2px;
    }

    .countdown-number {
        font-size: 20px;
    }

    .countdown-text {
        font-size: 10px;
    }

    .program-item {
        grid-template-columns: 24px 42px 1fr;
        gap: 8px;
        padding: 8px 6px;
    }

    .program-icon {
        font-size: 16px;
    }

    .program-time {
        font-size: 13px;
    }

    .program-event {
        font-size: 15px;
    }

    .stats-grid {
        gap: 4px;
    }

    .stat-card {
        padding: 12px 3px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 10px;
    }
}

/* Très petits écrans en mode paysage (≤ 500px de haut) */
@media (max-height: 500px) and (max-width: 900px) {
    .page-envelope {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 12px 0;
    }

    .envelope {
        width: min(380px, 60vw);
        height: calc(min(380px, 60vw) * 0.643);
    }
}

/* ============= Image d'en-tête (hero) ============= */
/* Photo en haut de la carte d'invitation avec fondu doux vers la carte.
   On déborde généreusement (au-delà des bordures et du padding) ; le
   overflow:hidden de .invitation-card clippe à ses bords arrondis exacts. */
.hero-image {
    display: block;
    width: calc(100% + 120px);          /* +60px de chaque côté */
    margin: -80px -60px 24px;            /* dépasse padding 70px + border 2.2px */
    height: 240px;
    object-fit: cover;
    object-position: center;
    /* Fondu progressif : visible en haut, transparent en bas */
    -webkit-mask-image: linear-gradient(180deg,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 55%,
        rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(180deg,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 55%,
        rgba(0,0,0,0) 100%);
    /* Animation d'apparition à l'ouverture de l'invitation */
    opacity: 0;
    animation: heroFadeIn 1.6s ease-out 0.3s forwards;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(1.04);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Adaptation mobile — padding 56px/30px → marges négatives plus larges */
@media (max-width: 768px) {
    .hero-image {
        width: calc(100% + 90px);
        margin: -70px -45px 20px;
        height: 180px;
    }
}

/* ≤ 600px : padding horizontal passe à 32px */
@media (max-width: 600px) {
    .hero-image {
        width: calc(100% + 96px);
        margin: -70px -48px 18px;
        height: 170px;
    }
}

/* ≤ 380px : padding 50px / 26px */
@media (max-width: 380px) {
    .hero-image {
        width: calc(100% + 80px);
        margin: -64px -40px 16px;
        height: 150px;
    }
}

/* ============= Décorations florales ============= */

/* Fond subtil avec petites fleurs — affichées à taille naturelle (non étirées)
   et ancrées au bas de la carte pour habiller la zone du pied de page */
.floral-bg {
    position: absolute;
    inset: auto 0 0 0;       /* ancrée en bas, pleine largeur */
    width: 100%;
    height: auto;
    max-height: 55%;          /* limitée à 55% de la carte → pas de sur-étirement */
    object-fit: contain;
    object-position: center bottom;
    opacity: 0.13;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    -webkit-user-drag: none;
}

/* Chaînes de fleurs en arrière-plan, floues et subtiles (comme little_flowers) */
.floral-chain {
    position: absolute;
    width: 200%;
    max-width: none;
    height: auto;
    left: 50%;
    margin: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0.1;
    filter: blur(2px);
    z-index: 0;
}

.floral-chain-top {
    top: 0%;
    transform: translateX(-50%) rotate(30deg);
}

.floral-chain-bottom {
    display: none;
}

/* Feuilles dorées de chaque côté des noms du couple */
.couple-names-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 28px 0;
    overflow: visible;
}

.couple-names-wrapper .couple-names {
    flex: 0 1 auto;
    margin: 0;
    overflow: visible;
}

.floral-leaves {
    flex: 0 0 auto;
    width: 80px;
    height: auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0.85;
    filter: drop-shadow(0 1px 2px rgba(120, 90, 20, 0.15));
}

.floral-leaves-right {
    transform: scaleX(-1);
}

/* Le contenu de la carte doit passer au-dessus du fond floral */
.card-content {
    position: relative;
    z-index: 2;
}

/* ============= Responsive florales ============= */
@media (max-width: 600px) {
    .floral-bg {
        opacity: 0.11;
    }

    .floral-chain {
        width: 180%;
        opacity: 0.08;
    }

    .floral-leaves {
        width: 52px;
    }

    .couple-names-wrapper {
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .floral-chain {
        width: 200%;
    }

    .floral-leaves {
        width: 38px;
    }

    .couple-names-wrapper {
        gap: 6px;
    }
}

/* Réduire les animations pour les utilisateurs préférant moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
