.btn { border-radius: 5px; padding: 10px 20px; color: white; border: 0; margin: 0px auto; display: block; }
.btn.generate { background-color: var(--dark-buttons-bg); color: var(--dark-buttons-color) }
.btn.generate:hover { background-color: #ffffff; color:#2b2b2b;}

.centered-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}
.button-container {
    display: inline-flex;
    align-items: center;
}
.info-button {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    cursor: pointer;
    background-color: var(--dark-buttons-bg);
    color: var(--dark-buttons-color);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 50px;
}

.rarity-common { color: #CCCCCC; font-weight: bold; }
.rarity-rare { color: #1E90FF; font-weight: bold; }
.rarity-epic { color: #8A2BE2; font-weight: bold; }
.rarity-legendary { color: #FFD700; font-weight: bold; }


.card {
    width: 120px;
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.card.flip .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    color: #fff;
}

.card-front {
    background: url('../assets/lootbox/default-back.png') center;
    background-size: 50%;
    background-repeat: no-repeat;
    background-color: #222;
    border: 2px solid #a8a8a8;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 5px;
    position: absolute;
}

.front-text {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1em;
    color: #fff;
    font-weight: bold;
    padding: 0px 0px;
    border-radius: 4px;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}


.card-back {
    background-color: #333;
    color: white;
    transform: rotateY(180deg);
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 10px;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes disintegrate {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(4px);
    }
}

.disintegrate {
    animation: disintegrate 0.5s forwards;
}

.card-back.common {
    border: 2px solid #a8a8a8;
    animation: common-glow 2s infinite alternate;
}

.card-back.rare {
    border: 2px solid #1E90FF;
    animation: rare-glow 2s infinite alternate;
}

.card-back.epic {
    border: 2px solid #8A2BE2;
    animation: epic-glow 2s infinite alternate;
}

.card-back.legendary {
    border: 2px solid #FFD700;
    animation: legendary-glow 2s infinite alternate;
}

.reward-image-container {
    width: 100%;
    max-height: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.reward-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

.rewards-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    font-size: 0.9em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 5px;
    border-radius: 5px;
}

/* Effets rareté*/
@keyframes common-glow {
    0% {
        box-shadow: 0 0 1px #BEBEBE, 0 0 2px #BEBEBE, 0 0 3px #BEBEBE, 0 0 4px #BEBEBE;
    }
    50% {
        box-shadow: 0 0 2px #BEBEBE, 0 0 3px #BEBEBE, 0 0 4px #BEBEBE, 0 0 5px #BEBEBE;
    }
    100% {
        box-shadow: 0 0 1px #BEBEBE, 0 0 2px #BEBEBE, 0 0 3px #BEBEBE, 0 0 4px #BEBEBE;
    }
}

@keyframes rare-glow {
    0% {
        box-shadow: 0 0 1px #1E90FF, 0 0 2px #1E90FF, 0 0 3px #1E90FF, 0 0 4px #1E90FF;
    }
    50% {
        box-shadow: 0 0 2px #1E90FF, 0 0 3px #1E90FF, 0 0 4px #1E90FF, 0 0 5px #1E90FF;
    }
    100% {
        box-shadow: 0 0 1px #1E90FF, 0 0 2px #1E90FF, 0 0 3px #1E90FF, 0 0 4px #1E90FF;
    }
}

@keyframes epic-glow {
    0% {
        box-shadow: 0 0 2px #8A2BE2, 0 0 4px #8A2BE2, 0 0 6px #8A2BE2, 0 0 8px #8A2BE2;
    }
    50% {
        box-shadow: 0 0 4px #8A2BE2, 0 0 6px #8A2BE2, 0 0 8px #8A2BE2, 0 0 10px #8A2BE2;
    }
    100% {
        box-shadow: 0 0 2px #8A2BE2, 0 0 4px #8A2BE2, 0 0 6px #8A2BE2, 0 0 8px #8A2BE2;
    }
}

@keyframes legendary-glow {
    0% {
        box-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700, 0 0 15px #FFD700, 0 0 20px #FFD700;
    }
    50% {
        box-shadow: 0 0 10px #FFD700, 0 0 15px #FFD700, 0 0 20px #FFD700, 0 0 25px #FFD700;
    }
    100% {
        box-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700, 0 0 15px #FFD700, 0 0 20px #FFD700;
    }
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
    pointer-events: none;
    z-index: -1;
}

/* Anim flip*/
.card.flip-common .card-inner,
.card.flip-rare .card-inner {
    animation: flipBasic 0.8s ease-in-out;
}

.card.flip-epic .card-inner {
    animation: shakeAndLift 0.4s ease, flipEpic 1s ease-in-out 0.4s;
}

.card.flip-legendary .card-inner {
    animation: flipLegendary 1.5s ease-in-out;
}

@keyframes flipBasic {
    from { transform: rotateY(0); }
    to { transform: rotateY(180deg); }
}

@keyframes flipEpic {
    from { transform: rotateY(0); }
    to { transform: rotateY(180deg); }
}

@keyframes flipLegendary {
    0% { transform: rotateY(0); }
    30% { transform: rotateY(60deg) scale(1.2); }
    50% { transform: rotateY(90deg) scale(1.3); }
    70% { transform: rotateY(120deg) scale(1.1); }
    100% { transform: rotateY(180deg); }
}

.loot-card-stack {
    position: relative;
    width: 150px;
    height: 220px;
    margin: 0 auto;
    margin-bottom: 150px;
    left: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loot-card {
    width: 220px;
    height: 400px;
    background-color: #222222;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    background-size: cover;
    background-position: center;
    border: 2px solid #a8a8a8;
}

.loot-card.card1 {
    transform: translate(8px, -8px);
    background-image: url('../assets/lootbox/default-back.png');
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;
}

.loot-card.card2 {
    transform: translate(16px, -16px);
    background-image: url('../assets/lootbox/default-back.png');
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;
}

.loot-card.card3 {
    transform: translate(24px, -24px);
    background-image: url('../assets/lootbox/default-back.png');
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;
}

.card-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.key-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: var(--white-buttons-bg);
    font-size: 18px;
    font-weight: bold;
    color: var(--white-buttons-color);
    margin-right: 10px;
    margin-left: 10px;
}

.key-icon {
    margin-right: 5px;
    font-size: 20px;
    color: #333;
}

.key-selection-container {
    display: flex;
    position: relative;
}

.key-selection-container .arrow {
    transform: rotate(135deg) translate(-1px, -4px);
}

.key-selection-container .arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(5px, 2px);
    transition: transform 0.3s ease;
}

#key-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 100%;
}
  
.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
  
.dropdown-item:hover {
    background-color: #f1f1f1;
}

.swing-animation {
    animation: swing 1.5s ease-in-out;
}

@keyframes randomShake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 3px); }
    20% { transform: translate(5px, -3px); }
    30% { transform: translate(-3px, 5px); }
    40% { transform: translate(3px, -5px); }
    50% { transform: translate(-5px, -3px); }
    60% { transform: translate(5px, 3px); }
    70% { transform: translate(-3px, -5px); }
    80% { transform: translate(3px, 5px); }
    90% { transform: translate(-5px, 2px); }
    100% { transform: translate(0, 0); }
}

.random-shake {
    animation: randomShake 0.1s ease-in-out infinite;
}

@keyframes disintegration {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.8) rotate(10deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.5) rotate(20deg);
        opacity: 0;
    }
}


@media (max-width: 480px) {
    .loot-card-stack {
        margin-left: 1rem !important;
        margin-bottom: 1rem;;
    }

    .loot-card {
        width: 7rem;
        height: 12rem;
    }

    .container.main {
        margin: 0;
    }

    .card-container { 
        max-width: 40rem;
        margin-bottom: -2rem;
        width: 105%;
    }

    #crate {
        display: flex;
        justify-content: center;
        align-items: center;
        list-style: none;
        height: 16rem;
        width: 40rem;
        padding: 0;
        margin: 0;
    }

    #crate .card {
        margin: 0 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .front-text { 
        top: 30px;
        font-size: 0.5em;
    }

    .rewards-info {
        font-size: 0.4em;
        padding: 3px;
        bottom: 5px;
        left: 5px;
        right: 5px;
    }
}

.card.dashed-line .card-back {
    overflow: hidden;
}

.card.dashed-line .card-back::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 15px,
        black 15px,
        black 20px
    );
    z-index: 2;
    animation: diagonal-dash-move 2s linear infinite;
}

@keyframes diagonal-dash-move {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50px);
    }
}

/* Info modal*/
.modal-lootbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-infos {
    background: var(--navbar-bg);
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
    overflow-y: auto;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 15px;
}

::-webkit-scrollbar-thumb {
    background-color: #b3b1b1;
    border-radius: 10px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.3s ease;
    z-index: 1001;
}

.close-button:hover {
    color: #d31c1c;
    transform: scale(1.05);
}

.close-button i {
    font-size: inherit;
}


.info-tooltip {
    text-align: center;
    margin: 20px 0;
}

.info-tooltip div {
    margin: 5px 0;
}

.rarity-common {
    color: #a8a8a8;
}

.rarity-rare {
    color: #1e90ff;
}

.rarity-epic {
    color: #9932cc;
}

.rarity-legendary {
    color: #ffd700;
}

#reward-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.filter-button {
    padding: 10px 15px;
    background-color: var(--white-buttons-bg);
    color: var(--white-buttons-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

.filter-button:hover {
    background-color: #d0d0d0;
}

#rewards-container {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.reward-card {
    width: 16vh;
    height: 24vh;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background-color: #2b2b2b;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.reward-card .name {
    font-size: 1rem;
}

.reward-card .rarity {
    font-size: 1rem;
}

.reward-card img {
    width: 100%;
    height: 14vh;
    object-fit: contain;
    border-radius: 8px;
}

.reward-card .rarity {
    margin-top: 5px;
    font-weight: bold;
}

.rarity-common {
    color: gray;
}

.rarity-rare {
    color: blue;
}

.rarity-epic {
    color: purple;
}

.rarity-legendary {
    color: gold;
}