/* On surcharge le body pour la page carte */
body.page-carte { background: var(--bg); height: 100vh; }


        :root {
            --bg: #f0f2f5;
            --paper: #fffef0;
            --envelope: #ffffff;
            --ink: #2c3e50;
        }

        html, body { 
            margin: 0; padding: 0; background: var(--bg); 
            font-family: 'Poppins', sans-serif; height: 100vh;
        }
        
        body.open { overflow: hidden; }

        .page-wrapper {
            display: flex; flex-direction: column; align-items: center;
            height: 100vh; width: 100%; position: relative;
            padding: 5px 20px 40px 20px;
            box-sizing: border-box;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* --- BARRE D'ACTIONS --- */
        .action-bar {
            display: flex; gap: 15px; padding: 12px 25px;
            background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
            border-radius: 50px; border: 1px solid rgba(255,255,255,0.8);
            box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
            margin-bottom: 25px;
            opacity: 0; transform: translateY(-15px);
            transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            pointer-events: none;
            z-index: 200;
        }
        .action-bar.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

        .btn-action {
            display: flex; align-items: center; gap: 10px; padding: 10px 20px;
            border-radius: 25px; text-decoration: none; font-size: 0.85rem;
            font-weight: 600; color: var(--ink); background: #fff; border: 1px solid #e0e0e0;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: all 0.3s ease;
            cursor: pointer;
        }
        
        .btn-action:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
        .btn-whatsapp i { color: #25D366; }
        .btn-email i { color: #ea4335; }
        .btn-main { background: var(--ink); color: #fff; border: none; }

        /* --- ENVELOPPE --- */
        .envelope-wrapper {
            position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 300px; height: 200px;
            background: var(--envelope); border-radius: 0 0 5px 5px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.1);
            cursor: pointer; z-index: 100;
            transition: all 1s ease-in-out;
        }
        .envelope-wrapper::before {
            content: ""; position: absolute; top: 0; left: 0; z-index: 102;
            border-left: 150px solid transparent; border-right: 150px solid transparent;
            border-top: 100px solid #f8f9fa; transform-origin: top;
            transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .envelope-wrapper::after {
            content: ""; position: absolute; top: 0; left: 0; z-index: 101;
            width: 100%; height: 100%; background: white;
            clip-path: polygon(0 0, 150px 105px, 100% 0, 100% 100%, 0 100%);
        }

        /* --- ANIMATION FLOTTANTE --- */
        @keyframes floatCard {
            0% { transform: rotate(-1.5deg) translateY(0px) translateZ(0); }
            50% { transform: rotate(-1deg) translateY(-15px) translateZ(0); }
            100% { transform: rotate(-1.5deg) translateY(0px) translateZ(0); }
        }

        .card-container {
            display: flex; flex-direction: column; align-items: center;
            width: 100%; max-width: 750px;
            opacity: 0; 
            transform: scale(0.2) translateY(100px);
            transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
            z-index: 10; pointer-events: none;
            margin: auto 0;
        }

        body.open .card-container { 
            opacity: 1; transform: scale(1) translateY(0); pointer-events: auto;
            margin-top: 10px;
            margin-bottom: 40px;
            transition-delay: 0.4s;
        }

        .postcard {
            background: var(--paper);
            background-image: radial-gradient(#dcdcdc 0.5px, transparent 0.5px);
            background-size: 10px 10px;
            width: 100%; padding: 30px; border-radius: 4px;
            display: grid; grid-template-columns: 1fr 2px 1fr; gap: 40px;
            box-shadow: 0 30px 60px rgba(0,0,0,0.15);
            box-sizing: border-box;
            transform: rotate(-1.5deg);
            /* Amélioration rendu oblique */
            transform-style: preserve-3d;
            -webkit-font-smoothing: antialiased;
            backface-visibility: hidden;
        }

        body.open .postcard {
            animation: floatCard 4s ease-in-out infinite;
            animation-delay: 1.4s;
        }

 
.img-container {
    grid-column: span 3;
    margin-bottom: 10px;
    text-align: center;
    transform: translateX(-10px); 
    overflow: hidden; /* Pour lisser les bords de la vidéo agrandie */
}

        .img-container img, .img-container video {
            width: 100%; border: 10px solid white; border-radius: 2px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.1); max-height: 400px; 
            object-fit: cover; object-position: center 20%;
            /* Fix Pixélisation Video & Image oblique */
            transform: scale(1.01) translateZ(0); 
            backface-visibility: hidden;
            outline: 1px solid transparent;
        }

        .message-area { 
            font-family: 'La Belle Aurore', cursive; 
            font-size: 1.6rem; line-height: 1.4; color: var(--ink); 
        }

        .handwritten-line {
            display: block;
            transform-origin: left center;
            margin-bottom: 5px;
        }

        .divider { background: linear-gradient(to bottom, transparent, #ccc, transparent); width: 2px; }
        .address-area { display: flex; flex-direction: column; justify-content: flex-start; }
        
        .stamp { 
            align-self: flex-end; width: 65px; height: 85px; border: 2px dashed #b1b1b1; 
            font-size: 0.6rem; color: #888; display: flex; align-items: center; 
            justify-content: center; text-align: center; margin-bottom: 25px; transform: rotate(5deg); 
        }

        .info-line { border-bottom: 1px solid #e0e0e0; margin-bottom: 15px; padding-bottom: 5px; font-size: 0.9rem; color: #7f8c8d; }
        .info-line b { font-family: 'La Belle Aurore', cursive; font-size: 1.4rem; color: var(--ink); margin-left: 10px; }

        body.open .envelope-wrapper::before { transform: rotateX(180deg); }
        body.open .envelope-wrapper { transform: translate(-50%, 400px); opacity: 0; pointer-events: none; }
        
        .click-hint { position: absolute; bottom: -50px; width: 100%; text-align: center; color: #6366f1; font-weight: 600; animation: bounce 2s infinite; }
        @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

        /* --- MOBILE ADJUSTMENTS --- */
        @media (max-width: 600px) {
            .action-bar span { display: none; }
            .btn-main span { display: inline; }
            .postcard { 
                grid-template-columns: 1fr; 
                gap: 20px; 
                padding: 20px; 
                /* On garde l'animation mais on réduit l'inclinaison pour éviter les débordements */
                transform: rotate(-0.5deg); 
            }
            .img-container img, .img-container video { max-height: 250px; }
            
            /* Flottaison plus douce sur mobile */
            @keyframes floatCardMobile {
                0% { transform: rotate(-0.5deg) translateY(0px) translateZ(0); }
                50% { transform: rotate(0deg) translateY(-8px) translateZ(0); }
                100% { transform: rotate(-0.5deg) translateY(0px) translateZ(0); }
            }
            body.open .postcard {
                animation: floatCardMobile 4s ease-in-out infinite;
                animation-delay: 1.4s;
            }
        }