﻿
/* styles.css */
:root {
    --tg-theme-bg-color: #15202b;
    --tg-theme-text-color: #ffffff;
    --tg-theme-button-color: #1da1f2;
    --tg-theme-secondary-bg-color: rgba(255, 255, 255, 0.1);
    --tg-theme-hint-color: #8899a6;
}

/* Adaptations pour le thème Telegram */
body {
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Cards personnalisées */
.card {
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

    .card:hover {
        transform: translateY(-2px);
    }

/* Boutons personnalisés */
.btn-primary {
    background-color: var(--tg-theme-button-color);
    border: none;
}

    .btn-primary:hover {
        background-color: var(--tg-theme-button-color);
        opacity: 0.9;
    }

/* Animation de chargement */
.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--tg-theme-hint-color);
    border-right-color: var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Formulaires */
.form-control {
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color);
}

    .form-control:focus {
        background-color: var(--tg-theme-secondary-bg-color);
        border-color: var(--tg-theme-button-color);
        color: var(--tg-theme-text-color);
        box-shadow: none;
    }

/* Accordéon FAQ */
.accordion-button {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

    .accordion-button:not(.collapsed) {
        background-color: var(--tg-theme-button-color);
        color: #ffffff;
    }

/* Transitions de page */
.section {
    transition: opacity 0.3s ease;
}

    .section.d-none {
        opacity: 0;
    }

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .card {
        margin-bottom: 15px;
    }
}

/* Mode clair/sombre adaptatif */
@media (prefers-color-scheme: light) {
    :root {
        --tg-theme-bg-color: #ffffff;
        --tg-theme-text-color: #15202b;
        --tg-theme-secondary-bg-color: rgba(0, 0, 0, 0.05);
    }
}

/* Ajouter ces styles dans votre fichier CSS ou dans une balise style */
#paymentHistoryToggle {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

    #paymentHistoryToggle:not(.hidden) {
        max-height: 500px;
        opacity: 1;
        margin-top: 1rem;
    }

/* Animation pour le chargement */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

#paymentsList p.text-center {
    animation: pulse 1.5s infinite;
}

@media (max-width: 640px) {
    .payment-card {
        padding: 0.75rem;
    }

    .qr-container {
        width: 120px;
        height: 120px;
    }

    .address-container {
        font-size: 0.65rem;
    }
}

/* Animation pour le statut en attente */
.pending-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}


@keyframes falling {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.coin {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('/medias/coin.png');
    /*background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f7b733"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.31-8.86c-1.77-.45-2.34-.94-2.34-1.67 0-.84.79-1.43 2.1-1.43 1.38 0 1.9.66 1.94 1.64h1.71c-.05-1.34-.87-2.57-2.49-2.97V5H10.9v1.69c-1.51.32-2.72 1.3-2.72 2.81 0 1.79 1.49 2.69 3.66 3.21 1.95.46 2.34 1.15 2.34 1.87 0 .53-.39 1.39-2.1 1.39-1.6 0-2.23-.72-2.32-1.64H8.04c.1 1.7 1.36 2.66 2.86 2.97V19h2.34v-1.67c1.52-.29 2.72-1.16 2.73-2.77-.01-2.2-1.9-2.96-3.66-3.42z"/></svg>');*/
    background-size: contain;
    animation: falling linear;
    z-index: 9999;
}

/* --- ANIMATIONS DE COMBAT (CINEMATIQUE) --- */

/* Le joueur charge vers la droite */
@keyframes charge-player {
    0% { transform: translateX(0) scale(1); }
    40% { transform: translateX(-30px) scale(0.9); } /* Recul pour élan */
    100% { transform: translateX(120%) scale(1.4); opacity: 0; } /* Impact violent */
}

/* L'ennemi charge vers la gauche */
@keyframes charge-opponent {
    0% { transform: translateX(0) scale(1); }
    40% { transform: translateX(30px) scale(0.9); }
    100% { transform: translateX(-120%) scale(1.4); opacity: 0; }
}

/* Tremblement d'écran à l'impact */
@keyframes impact-shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 90% { transform: translate(-5px, -5px); }
    20%, 80% { transform: translate(5px, 5px); }
    30%, 50%, 70% { transform: translate(-10px, 5px); }
    40%, 60% { transform: translate(10px, -10px); }
}

/* Flash blanc aveuglant */
@keyframes impact-flash {
    0% { opacity: 0; background-color: white; }
    10% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Classes utilitaires JS */
.anim-charge-p { animation: charge-player 0.6s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.anim-charge-o { animation: charge-opponent 0.6s cubic-bezier(0.7, 0, 0.3, 1) forwards; }

.screen-shake {
    animation: impact-shake 0.5s ease-out;
}

#flash-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}
.flash-active {
    animation: impact-flash 0.8s ease-out forwards;
}


/* ========================================
   MYSTERY CARD 3D EFFECT
   ======================================== */

.mystery-card-container {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.mystery-card {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 2/3;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.mystery-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(138, 43, 226, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.5));
}

/* Effet de brillance holographique */
.mystery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 255, 0.2) 0%,
        rgba(0, 255, 255, 0.2) 25%,
        rgba(255, 255, 0, 0.2) 50%,
        rgba(0, 255, 255, 0.2) 75%,
        rgba(255, 0, 255, 0.2) 100%
    );
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

.mystery-card:active::before {
    opacity: 0.6;
}

/* Animation de flottement */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
    }
    50% {
        transform: translateY(0px) rotateX(0deg) rotateY(2deg);
    }
    75% {
        transform: translateY(-5px) rotateX(-2deg) rotateY(0deg);
    }
}

.mystery-card.floating {
    /* Animation de flottement désactivée */
    /* animation: float 6s ease-in-out infinite; */
}

/* Animation flottante pour le Kynini 3D */
.animate-float-3d {
    animation: float 6s ease-in-out infinite;
}

.perspective-1000 {
    perspective: 1000px;
}

/* Effet de pulsation lumineuse */
@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(138, 43, 226, 0.8)) 
                drop-shadow(0 0 60px rgba(0, 255, 255, 0.4));
    }
}

.mystery-card img {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* Particules magiques autour de la carte */
.mystery-card-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(138, 43, 226, 1) 0%, rgba(138, 43, 226, 0) 70%);
    border-radius: 50%;
    animation: particle-float 4s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-30px) translateX(15px) scale(1.5);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .mystery-card {
        max-width: 280px;
    }
}


/* ========================================
   MYSTERY CARD COMPACT (Onboarding)
   ======================================== */

.mystery-card-container-small {
    perspective: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.mystery-card-small {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 2/3;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.mystery-card-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(138, 43, 226, 0.3);
    filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.5));
    animation: glow-pulse 3s ease-in-out infinite;
}

/* Effet de brillance holographique pour version compacte */
.mystery-card-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 255, 0.2) 0%,
        rgba(0, 255, 255, 0.2) 25%,
        rgba(255, 255, 0, 0.2) 50%,
        rgba(0, 255, 0, 0.2) 75%,
        rgba(255, 0, 255, 0.2) 100%
    );
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.mystery-card-small:active::before {
    opacity: 0.5;
}

.mystery-card-small.floating {
    /* Animation de flottement désactivée */
    /* animation: float-small 4s ease-in-out infinite; */
}

@keyframes float-small {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: translateY(-5px) rotateX(1deg) rotateY(-1deg);
    }
}

/* Responsive pour version compacte */
@media (max-width: 400px) {
    .mystery-card-small {
        max-width: 95px;
    }
}


/* ============================================
   MYSTERY CARD CENTER - Pour layout 3 colonnes (dominante)
   v7.3.9
   ============================================ */

.mystery-card-container-center {
    perspective: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mystery-card-center {
    width: 100%;
    max-width: 130px;
    aspect-ratio: 2/3;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.mystery-card-center img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(138, 43, 226, 0.4);
    filter: drop-shadow(0 0 12px rgba(138, 43, 226, 0.6));
    animation: glow-pulse 3s ease-in-out infinite;
}

.mystery-card-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 255, 0.2) 0%,
        rgba(0, 255, 255, 0.2) 25%,
        rgba(255, 255, 0, 0.2) 50%,
        rgba(0, 255, 0, 0.2) 75%,
        rgba(255, 0, 255, 0.2) 100%
    );
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.mystery-card-center:active::before {
    opacity: 0.5;
}

/* Responsive pour version center */
@media (max-width: 360px) {
    .mystery-card-center {
        max-width: 100px;
    }
    
    .mystery-card-center img {
        border-radius: 8px;
    }
}
