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

:root {
    --primary-pink: #ff6b9d;
    --secondary-pink: #ff8fab;
    --warm-coral: #ff7f7f;
    --soft-peach: #ffb5a7;
    --golden-yellow: #ffd166;
    --cream: #fff5f5;
    --deep-rose: #c9184a;
    --light-rose: #ffe5ec;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--light-rose) 0%, var(--cream) 50%, var(--soft-peach) 100%);
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* ===== ÉCRAN ÉNIGME ===== */
#puzzle-screen {
    background: radial-gradient(ellipse at center, var(--cream) 0%, var(--light-rose) 70%, var(--soft-peach) 100%);
    overflow-y: auto;
    padding: 20px;
}

.puzzle-container {
    text-align: center;
    padding: 1.5rem;
    max-width: 500px;
    z-index: 10;
    margin: auto;
}

.puzzle-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--deep-rose);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.3);
    animation: pulse 2s infinite;
}

.puzzle-subtitle {
    font-size: 1.1rem;
    color: var(--warm-coral);
    margin-bottom: 1rem;
}

.puzzle-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.3);
    border: 3px solid var(--primary-pink);
}

.heart-puzzle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 260px;
    margin: 0 auto 1rem;
}

.puzzle-piece {
    font-size: 2.2rem;
    padding: 12px;
    background: linear-gradient(145deg, var(--cream), var(--light-rose));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--secondary-pink);
    user-select: none;
}

.puzzle-piece:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.puzzle-piece.wrong {
    background: linear-gradient(145deg, #ffcccc, #ff9999);
    animation: shake 0.5s ease;
}

.puzzle-piece.beating {
    font-size: 2.5rem;
    animation: heartbeat 0.5s infinite;
    background: linear-gradient(145deg, var(--golden-yellow), var(--warm-coral));
}

.puzzle-hint {
    color: var(--deep-rose);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 1rem;
}

.wrong-message {
    color: #e74c3c;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 0.5rem;
    animation: fadeInUp 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.puzzle-message,
.puzzle-success {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--secondary-pink);
    animation: fadeInUp 0.8s ease;
}

.puzzle-message h2,
.puzzle-success h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--deep-rose);
    margin-bottom: 0.5rem;
}

.puzzle-message p,
.puzzle-success p {
    font-size: 0.95rem;
    color: var(--warm-coral);
    margin-bottom: 0.5rem;
}

/* ===== BOUTONS ===== */
.btn-love {
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
    padding: 12px 30px;
    background: linear-gradient(145deg, var(--primary-pink), var(--deep-rose));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(201, 24, 74, 0.4);
    margin-top: 0.5rem;
}

.btn-love:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(201, 24, 74, 0.5);
}

.btn-love:active {
    transform: scale(0.98);
}

/* ===== CARTE AU TRÉSOR (fond rose avec cœurs) ===== */
#treasure-map {
    background: radial-gradient(ellipse at center, var(--cream) 0%, var(--light-rose) 70%, var(--soft-peach) 100%) !important;
    overflow: visible !important;
    display: block !important;
}

/* Pas de pseudo-éléments pour le fond parchemin */
#treasure-map::before,
#treasure-map::after {
    display: none;
}

/* Fond parchemin (désactivé) */
.parchment-bg {
    display: none;
}

/* ===== NOUVEAU SYSTÈME DE PHOTOS ===== */

/* Photo précédente (à gauche - taille similaire à l'ancien centre) */
.prev-memory {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 40;
}

.prev-memory.visible {
    opacity: 0.9;
}

.prev-memory .album-photos-small {
    position: relative;
    width: 220px;
    height: 180px;
}

.photo-frame-small {
    position: absolute;
    background: #fff;
    padding: 5px 5px 20px 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    border-radius: 2px;
}

.photo-frame-small img {
    width: 90px;
    height: 110px;
    object-fit: cover;
    display: block;
    background: #f0e6d3;
}

.photo-left-small {
    left: 0;
    top: 5px;
    transform: rotate(-8deg);
    z-index: 1;
}

.photo-right-small {
    left: 70px;
    top: 15px;
    transform: rotate(6deg);
    z-index: 2;
}

/* Photo actuelle (2 photos en X, au centre - TRÈS GRANDES) */
.current-memory {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
}

.album-photos {
    position: relative;
    width: 520px;
    height: 400px;
}

.photo-frame {
    position: absolute;
    background: #fff;
    padding: 10px 10px 40px 10px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.photo-frame img {
    width: 210px;
    height: 260px;
    object-fit: cover;
    display: block;
    background: #f0e6d3;
}

.photo-left {
    left: 50px;
    top: 15px;
    transform: rotate(-8deg);
    z-index: 1;
}

.photo-right {
    right: 50px;
    top: 35px;
    transform: rotate(6deg);
    z-index: 2;
}

.photo-frame:hover {
    z-index: 10;
    transform: rotate(0deg) scale(1.08);
    box-shadow: 0 18px 50px rgba(0,0,0,0.4);
}

/* ===== POINTILLÉS ===== */

/* Pointillés d'entrée (gauche - avant première étape) - connecte au bord gauche des images centrales */
.path-entry {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 30;
    width: calc(50% - 280px);
}

.path-entry.visible {
    opacity: 1;
}

.dotted-line-entry {
    flex: 1;
    height: 50px;
}

.path-arrow-entry {
    font-size: 2.5rem;
    color: #8B4513;
    font-weight: bold;
}

/* Pointillés entre les images (connecte prev à current) */
.path-between {
    position: fixed;
    left: 195px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 35;
    width: calc(50% - 195px - 280px);
}

.path-between.visible {
    opacity: 1;
}

.dotted-line-between {
    flex: 1;
    height: 50px;
}

.path-x-marker {
    font-size: 1.5rem;
    color: #8B4513;
    font-weight: bold;
    margin-right: 5px;
}

.path-arrow-marker {
    font-size: 2.5rem;
    color: #8B4513;
    font-weight: bold;
}

/* Pointillés de sortie (droite - serpente vers X) */
.path-exit {
    position: fixed;
    left: calc(50% + 260px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 30;
    width: calc(50% - 280px);
}

.path-exit.visible {
    opacity: 1;
}

.dotted-line-exit {
    flex: 1;
    height: 60px;
}

.path-x-exit {
    font-size: 2rem;
    color: #8B4513;
    font-weight: bold;
    margin-left: 5px;
}

/* Texte de la mémoire */
.memory-text {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: var(--deep-rose);
    text-align: center;
    max-width: 500px;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.8);
    background: rgba(255, 255, 255, 0.85);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.3);
    z-index: 60;
}

/* Navigation carte */
.map-navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.progress-indicator {
    background: rgba(255, 107, 157, 0.9);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.1rem;
    border: 2px solid var(--deep-rose);
}

/* Coffre au trésor */
.treasure-chest {
    position: absolute;
    z-index: 15;
    text-align: center;
    animation: bounce 1s infinite;
}

.chest-emoji {
    font-size: 4rem;
    display: block;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.treasure-chest p {
    font-family: 'Dancing Script', cursive;
    color: #654321;
    font-size: 1.2rem;
    margin-top: 10px;
}

/* ===== ÉCRAN FINAL ===== */
#final-screen {
    background: radial-gradient(ellipse at center, var(--cream) 0%, var(--light-rose) 60%, var(--primary-pink) 100%);
}

.final-container {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.final-question {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--deep-rose);
    margin-bottom: 3rem;
    text-shadow: 3px 3px 6px rgba(255, 107, 157, 0.4);
    animation: pulse 2s infinite;
}

.final-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.btn-yes {
    font-size: 2rem;
    padding: 20px 50px;
    animation: wiggle 1s infinite;
}

.btn-yes:nth-child(2) {
    animation-delay: 0.5s;
}

/* ===== ÉCRAN CÉLÉBRATION ===== */
#celebration-screen {
    background: radial-gradient(ellipse at center, var(--cream) 0%, var(--light-rose) 100%);
    overflow: hidden;
    padding: 20px;
}

.hearts-explosion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-heart {
    position: absolute;
    font-size: 2rem;
    animation: floatUp 4s ease-in-out forwards;
    opacity: 0;
}

/* Layout en largeur: vidéo à gauche, poème à droite */
.celebration-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.celebration-video {
    flex: 1;
    max-width: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(255, 107, 157, 0.5);
    border: 5px solid var(--primary-pink);
    background: #000;
}

.celebration-video video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.poem-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px 25px;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
    border: 4px solid var(--primary-pink);
    z-index: 10;
    animation: fadeInUp 1.5s ease;
}

.poem-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--deep-rose);
    margin-bottom: 1rem;
}

.poem-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.1rem;
    color: var(--warm-coral);
    line-height: 1.6;
}

.poem-text p {
    margin: 3px 0;
}

.poem-signature {
    font-size: 1.3rem;
    color: var(--deep-rose);
    margin-top: 1rem !important;
    font-weight: bold;
}

/* Responsive: empiler sur mobile */
@media (max-width: 900px) {
    .celebration-content {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    .celebration-video, .poem-container {
        max-width: 100%;
        flex: none;
    }
    .celebration-video video {
        max-height: 40vh;
    }
    .poem-container {
        max-height: 45vh;
    }
}

/* ===== CŒURS FLOTTANTS EN ARRIÈRE-PLAN ===== */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.bg-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatAround 15s ease-in-out infinite;
}

/* E ❤️ G en arrière-plan estompé */
.bg-initials {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Dancing Script', cursive;
    font-size: 22rem;
    font-weight: 700;
    color: rgba(220, 80, 120, 0.25);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    letter-spacing: 0.15em;
    text-shadow: 0 0 80px rgba(255, 100, 150, 0.15);
    display: none;
    align-items: center;
    gap: 0.1em;
}

.bg-heart-icon {
    width: 2.1em;
    height: 2.1em;
    display: inline-block;
}

.bg-heart-icon svg {
    width: 100%;
    height: 100%;
    stroke: rgba(220, 60, 100, 0.35);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes pulseInitials {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes heartbeatBg {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.1); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(100vh) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1.5);
    }
}

@keyframes floatAround {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(10deg);
    }
    50% {
        transform: translateY(0) translateX(20px) rotate(-5deg);
    }
    75% {
        transform: translateY(20px) translateX(10px) rotate(5deg);
    }
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .puzzle-title, .poem-title {
        font-size: 2.5rem;
    }

    .final-question {
        font-size: 2.5rem;
    }

    .memory-card {
        width: 320px;
    }

    .memory-card img, .memory-card video {
        height: 200px;
    }

    .poem-container {
        padding: 30px;
        margin: 20px;
    }

    .btn-love {
        font-size: 1.2rem;
        padding: 12px 30px;
    }
}

