body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    text-align: center;
    margin: 0;
    padding: 20px;
}

/* Container du compteur en haut */
#progress {
    background: white;
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#card-container {
    width: 340px;
    height: 440px;
    margin: 20px auto;
    perspective: 1000px; /* Profondeur pour l'effet 3D */
}

#card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s, background-color 0.3s;
    transform-style: preserve-3d;
    cursor: pointer;
    touch-action: none;
    border-radius: 25px;
}

/* Quand la carte est retournée */
#card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Cache l'autre face */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    background: white;
    padding: 20px;
    box-sizing: border-box;
}

/* Face arrière (Pinyin + Hanzi) */
.card-back {
    transform: rotateY(180deg);
    color: #1976d2;
}

.emoji {
    font-size: 90px;
    margin-bottom: 15px;
}

.buttons {
    margin-top: 30px;
}

button {
    font-size: 20px;
    padding: 12px 20px;
    margin: 6px;
    border: none;
    border-radius: 12px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #1565c0;
}

/* Bouton spécial "Réviser les rouges" qui clignote */
button[onclick="startReview()"] {
    background: #d32f2f;
    margin-top: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}