/* ========== Animations au chargement (page account) ========== */
@keyframes accountFadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes accountFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes accountScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes accountSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Révélation des cartes personnages : une par une, haut-gauche → bas-droite */
@keyframes accountCharacterCardReveal {
    from {
        opacity: 0;
        transform: scale(0.88) translate(-12px, -12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
}

/* Éléments animés au chargement - état initial puis animation */
.page-flower-bg .account-anim-fade-up,
.page-flower-bg .account-anim-fade-in,
.page-flower-bg .account-anim-scale,
.page-flower-bg .account-anim-slide-right {
    opacity: 0;
}

.page-flower-bg .account-anim-fade-up {
    animation: accountFadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--account-delay, 0s);
}

.page-flower-bg .account-anim-fade-in {
    animation: accountFadeIn 0.45s ease-out forwards;
    animation-delay: var(--account-delay, 0s);
}

.page-flower-bg .account-anim-scale {
    animation: accountScaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--account-delay, 0s);
}

.page-flower-bg .account-anim-slide-right {
    animation: accountSlideInRight 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--account-delay, 0s);
}

/* Cartes personnages : cascade une par une, haut-gauche → bas-droite (grille 6 colonnes × 2 lignes) */
/* L'animation est appliquée via .character-item-reveal pour pouvoir être relancée au changement de page */
.page-flower-bg .characters-list .character-item {
    opacity: 0;
}

.page-flower-bg .characters-list .character-item.character-item-reveal {
    animation: accountCharacterCardReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--reveal-delay, 0.10s);
}

/* Bouton favori (étoile) en haut à droite des cartes personnage */
.page-flower-bg .characters-list .character-item .favorite-star {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #9E9E9E;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
    z-index: 2;
}
/* Étoile grise : visible uniquement au survol de la carte */
.page-flower-bg .characters-list .character-item:hover .favorite-star {
    opacity: 1;
}
/* Étoile favori (jaune) : toujours visible */
.page-flower-bg .characters-list .character-item .favorite-star.is-favorite {
    opacity: 1;
    color: #FFC107;
}
.page-flower-bg .characters-list .character-item .favorite-star:hover {
    color: #FFC107;
    transform: scale(1.15);
}
.page-flower-bg .characters-list .character-item .favorite-star:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Étoile un peu plus à gauche quand l’icône boss est présente (boss = la plus à droite) */
.page-flower-bg .characters-list .character-item:has(.character-fighter-badge) .favorite-star {
    right: 38px;
}

/* Icône Fighter (boss) : même principe que l’étoile — pas de fond, pas d’ombre */
.page-flower-bg .characters-list .character-item .character-fighter-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
}

.page-flower-bg .characters-list .character-item .character-fighter-badge img {
    display: block;
    width: 20px;
    height: auto;
    max-height: 22px;
    object-fit: contain;
}

/* Bulle rouge + icône blanche sur la vidéo / cover (fighter, géré en JS) */
.page-flower-bg .character-video-fighter-badge {
    position: absolute;
    top: 18px;
    left: 8px;
    right: auto;
    z-index: 4;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #d32f2f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    line-height: 0;
}

/* flex ci-dessus gagne sur [hidden] du navigateur ; masquage explicite pour syncVideoFighterBadge */
.page-flower-bg .character-video-fighter-badge[hidden] {
    display: none !important;
}

.page-flower-bg .character-video-fighter-badge img {
    display: block;
    width: 22px;
    height: auto;
    max-height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Cartes rewards chargées dynamiquement : animation à l’apparition */
.page-flower-bg .account_reward_card {
    opacity: 0;
    animation: accountFadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-flower-bg .account-reward-section .account_reward_card:nth-child(1) { animation-delay: 0.05s; }
.page-flower-bg .account-reward-section .account_reward_card:nth-child(2) { animation-delay: 0.12s; }
.page-flower-bg .account-reward-section .account_reward_card:nth-child(3) { animation-delay: 0.19s; }
.page-flower-bg .account-reward-section .account_reward_card:nth-child(4) { animation-delay: 0.26s; }
.page-flower-bg .account-reward-section .account_reward_card:nth-child(5) { animation-delay: 0.33s; }

/* Carte caisse gratuite déjà réclamée : opacité réduite (l’animation d’entrée force opacity:1, d’où !important) */
.account_reward_card[data-reward-type="case_x1"].claimed {
    opacity: 0.55 !important;
    transition: opacity 0.35s ease;
}

.account-reward-section-content{
    margin-top: 3rem;
    padding-right: 2%;
}

.account-reward-section{
    display: flex;
    flex-direction: row;
    gap: 2%;
    width: 98%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible; /* Permet aux ombres de s'afficher */
    position: relative;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-left: 2%;
    padding-right: 2%;
    padding-bottom:2%;
    max-height: 290px; /* Limite la hauteur pour empêcher le scroll vertical */
}

.account-reward-section::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}



.account_reward_card{
    transform: scale(1);
    transform-origin: center center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 10px 0; /* Ajoute un peu d'espace pour les ombres */
    overflow: hidden; /* Pour clipper le reflet lumineux dans le border-radius */

    width: 48%;
    min-width: 48%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 2px;
    height: 250px;
    cursor: pointer;
}

/* Reflet lumineux qui traverse la carte (même effet que la section Discord) */
.account_reward_card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 15%,
        rgba(255, 255, 255, 0.18) 45%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.18) 55%,
        transparent 85%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 2;
    animation: discord-bubble-shine 6s ease-in-out 1.5s infinite;
}

/* Délais décalés pour que les reflets ne soient pas tous synchronisés */
.account-reward-section .account_reward_card:nth-child(1)::before { animation-delay: 1.5s; }
.account-reward-section .account_reward_card:nth-child(2)::before { animation-delay: 3.5s; }
.account-reward-section .account_reward_card:nth-child(3)::before { animation-delay: 0.5s; }
.account-reward-section .account_reward_card:nth-child(4)::before { animation-delay: 4s; }
.account-reward-section .account_reward_card:nth-child(5)::before { animation-delay: 2s; }
.account-reward-section .account_reward_card:nth-child(6)::before { animation-delay: 5s; }
.account-reward-section .account_reward_card:nth-child(7)::before { animation-delay: 2.5s; }
.account-reward-section .account_reward_card:nth-child(8)::before { animation-delay: 0s; }

.account_reward_card:hover{
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.account_reward_price_badge{
    position: absolute;
    top: -1px;
    right: -1px;
    border-radius: 0 29px 0 29px;
    width: 140px;
    height: 40px;
    align-items: center;
    justify-content: center;
    display: flex;
    line-height: 1;
    margin: 0;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.account_reward_card:hover .account_reward_price_badge {
    filter: brightness(1.2);
}

.account_reward_text{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
    padding-left: 10%;
}

.account_reward_button{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    min-width: 200px;
    max-height: 50px;
    margin-top: 20px !important;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Bouton Angry Extra Command : couleur unie (teinte la plus claire / jaune du dégradé) */
.account_reward_button.color_extra_angry {
    background: #ffa614;
    border: 2px solid #ffa614;
}

.account_reward_button:hover {
    filter: brightness(1.1);
}

.account_reward_media{
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden; /* Empêche le débordement */

    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.account_reward_media img{
    height: 320px;
    width: 320px;
    object-fit: contain;
    margin-left: auto;
}

.account_reward_media video{
    height: 360px;
    width: 360px;
    object-fit: cover;
    margin: 0;
}

/* Récompenses ExtraCommands : vidéo légèrement réduite */
.account_reward_card.extra-command-reward .account_reward_media video {
    transform: scale(0.8);
    transform-origin: center center;
}

/* Cartes spéciales (cover en boucle + effets) : pile alignée sur la même grille que les vidéos */
.account_reward_card.extra-command-reward .account-reward-card-visual__stack {
    position: relative;
    width: 360px;
    height: 360px;
    flex-shrink: 0;
    margin: 0;
}

.account_reward_card.extra-command-reward .account-reward-card-visual__stack video {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 360px;
    object-fit: cover;
    margin: 0;
}

.account_reward_card.extra-command-reward .account-reward-card-visual__overlay {
    z-index: 1;
}

/* !shadow (carte) : jeu d’opacité sur le personnage (cover en boucle) */
@keyframes account-reward-shadow-opacity {
    0% {
        opacity: 1;
    }
    12% {
        opacity: 0.5;
    }
    22% {
        opacity: 0.68;
    }
    30% {
        opacity: 0.3;
    }
    72% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.account_reward_card.extra-command-reward .account-reward-card-visual--shadow .account-reward-card-visual__cover {
    animation: account-reward-shadow-opacity 9s ease-in-out infinite;
}

/* Styles génériques pour toutes les récompenses Extra Commands
   Les couleurs proviennent uniquement de css/colors_specials.css via :
   - .color_extra_*_full sur la carte
   - .color_extra_* sur le bouton et le badge
   Chaque palette définit --reward-main-color, réutilisée ci‑dessous. */

/* Titre de la carte = couleur principale */
.account_reward_card.extra-command-reward .account_reward_text p:nth-child(1) {
    color: var(--reward-main-color, #2C123B) !important;
}

/* Sous-titre en violet foncé par défaut pour la lisibilité */
.account_reward_card.extra-command-reward .account_reward_text p:nth-child(2) {
    color: #2C123B !important;
}

/* Badge "Free" : même couleur que la commande, texte toujours blanc */
.account_reward_card.extra-command-reward .account_reward_price_badge {
    background: var(--reward-main-color, #4CAF50) !important;
    color: #ffffff !important;
}

/* Boutons de commandes : fond = couleur principale, pas de contour, texte blanc */
.account_reward_button.color_extra_angry,
.account_reward_button.color_extra_pat,
.account_reward_button.color_extra_power,
.account_reward_button.color_extra_shadow,
.account_reward_button.color_extra_heal {
    background: var(--reward-main-color, #4CAF50) !important;
    border: none !important;
    color: #ffffff !important;
}

/* Smooth scrolling for rewards */
.rewards-container {
    transition: transform 0.3s ease;
}

/* Rewards pagination buttons - same style as My Characters */
#rewardsPagination button {
    transition: all 0.2s ease;
}

#rewardsPagination button:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

#rewardsPagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 1300px){
    .account_reward_card {
        width: 48%;
        min-width: 48%;
    }
}

@media (max-width: 1100px){
    .account_reward_card {
        width: 100%;
        min-width: 100%;
    }
    
    /* Keep horizontal layout even on small screens */
    .account-reward-section {
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        /* Hide scrollbar on mobile */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .account-reward-section::-webkit-scrollbar {
        display: none;
    }
    
    .account_reward_card {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        flex-shrink: 0;
    }
}

@media (max-width: 768px){
    .account_reward_card {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
    
    /* On very small screens, ensure full width cards */
    .account-reward-section {
        gap: 10px;
    }
}






@media (max-width: 880px){
    .account_reward_media,
    .account_reward_media video,
    .account_reward_media img{
        height: 320px;
        width: 320px;
        margin-right: -10px;
    }
}

@media (max-width: 770px){
    /* Gardé vide au besoin pour ajustements spécifiques */
}

@media (max-width: 500px){
    .account_reward_media,
    .account_reward_media video,
    .account_reward_media img{
        height: 220px;
        width: 220px;
        margin-right: -10px;
    }
}

/* Récompense case légendaire (compte) — même traitement couleur que case_opening légendaire */
.account-reward-legendary-case-media .video-fallback video,
.account-reward-legendary-case-media .video-fallback img.video-fallback-image {
    filter: hue-rotate(210deg) contrast(1.5) saturate(1.32);
}

/* Désactiver le reflet lumineux si l'utilisateur préfère moins d'animations */
@media (prefers-reduced-motion: reduce) {
    .account_reward_card::before {
        animation: none;
        display: none;
    }
}



