#coin-flip-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    font-family: 'Segoe UI', sans-serif;
}

.coin-wrapper {
    width: 300px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 30px;
}

#coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

/* Classes d'animation pilotées par JS */
.animate-heads { animation: flipHeads 3.2s forwards ease-in-out; }
.animate-tails { animation: flipTails 3.2s forwards ease-in-out; }

.side {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    backface-visibility: hidden;
    border: 15px solid #d4af37;
}

.heads { background: #ffd700; color: #555; }
.tails { background: #c0c0c0; color: #555; transform: rotateX(180deg); }

#flip-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

#flip-btn:hover { background: #555; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.close-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover { background: #555; }

.modal-content {
    background-color: rgba(255,255,255,0.2);
    margin: 15vh auto;
    padding: 20px;
    width: 90%;
    height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    border-radius: 20px;
    text-align: center;
}

/* Style pour la pièce à l'intérieur du modal */
#modal-coin-view {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.coin-mini {
    width: 150px;  /* Taille réduite pour le modal */
    height: 150px;
    position: relative;
}

.coin-mini .side {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 4px solid gold; /* Optionnel : pour faire ressortir la pièce */
    background-color: #f1f1f1;
    color: #333;
}

/* On s'assure que les couleurs correspondent à votre design */
.coin-mini .heads { background-color: #ffd700; color: #555; } 
.coin-mini .tails { background-color: #c0c0c0; color: #555; transform: rotateX(360deg); }

@keyframes flipHeads {
    from { transform: rotateX(0); }
    to { transform: rotateX(1800deg); } /* Multiples de 360 */
}

@keyframes flipTails {
    from { transform: rotateX(0); }
    to { transform: rotateX(1980deg); } /* Multiples de 360 + 180 */
}