/* ===== Body ===== */
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #1b263b 100%);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    overflow: hidden;
}

/* ===== Carte ===== */
.card-container {
    perspective: 1200px;
}

.card {
    width: 340px;
    height: 240px;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    cursor: pointer;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border-radius: 25px;
}

.card.flipped {
    transform: rotateY(180deg) scale(1.05);
}

/* ===== Faces ===== */
.card .front, .card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    transition: transform 0.6s, opacity 0.6s;
    box-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.card .front {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    color: #fff;
    font-weight: bold;
    text-align: center;
    transform: scale(1);
    animation: glowFront 2s infinite alternate;
}

.card .back {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    transform: rotateY(180deg) scale(0.95);
    text-align: center;
    padding: 30px;
    animation: fadeIn 1s ease forwards;
}

/* ===== Animations texte ===== */
h1, h2, p {
    margin: 10px 0;
    animation: popFade 0.7s ease forwards;
}

@keyframes popFade {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: rotateY(180deg) scale(0.8); }
    100% { opacity: 1; transform: rotateY(180deg) scale(1); }
}

@keyframes glowFront {
    0% { box-shadow: 0 0 20px rgba(255,255,255,0.2); }
    100% { box-shadow: 0 0 50px rgba(255,255,255,0.5); }
}

/* ===== Bouton ===== */
button {
    margin-top: 15px;
    padding: 12px 24px;
    border: none;
    background: #ff6b81;
    color: #fff;
    font-size: 16px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

button:hover {
    background: #ff3b58;
    transform: scale(1.15);
    box-shadow: 0 0 20px #ff3b58;
}

/* ===== Cœurs ===== */
.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: red;
    transform: rotate(45deg);
    animation: floatUp 3s linear forwards;
}

.heart::before,
.heart::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 50%;
}

.heart::before { top: -10px; left: 0; }
.heart::after { left: 10px; top: 0; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(45deg); opacity: 1; }
    100% { transform: translateY(-250px) rotate(45deg) scale(0); opacity: 0; }
}

/* ===== Étoiles ===== */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}
