/* Style de la grille d'artefacts dans le SHOP */
.artifacts-pots-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.artifacts-pots-grid::-webkit-scrollbar {
    display: none;
}

.artifact-pot {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(76, 175, 80, 0.1);
    min-height: 400px;
    cursor: pointer;
    user-select: none;
}

.artifact-pot:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(76, 175, 80, 0.3);
}

.artifact-pot.locked {
    cursor: not-allowed;
}

/* Ajouter un style actif pour le feedback visuel */
.artifact-pot:active:not(.locked) {
    transform: scale(0.98);
}

.pot-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px; /* Pour éviter la superposition avec le message de verrouillage */
}

.pot-title {
    font-size: 2.5em;
    color: var(--primary-green);
    margin: 0;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.pot-description {
    color: var(--text-primary);
    font-size: 1.3em;
    line-height: 1.5;
    opacity: 0.9;
}

.rarity-rates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px; /* Espace pour le message de verrouillage */
}

.rarity-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.rarity-rate:hover {
    transform: scale(1.02);
    background-color: rgba(0, 0, 0, 0.3);
}

.pot-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.pot-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.3));
}

.common { color: #4CAF50; }
.rare { color: #3F51B5; }
.epic { color: #9C27B0; }
.legendary { color: #FFC107; }
.mythical { color: #FF5252; }

.token-cost {
    position: absolute;
    bottom: 30px;
    right: 30px; /* Changé de left à right */
    background-color: #8B0000;
    color: white;
    padding: 12px 24px;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 2; /* Pour s'assurer qu'il est au-dessus du message de verrouillage */
}

.token-cost:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
}

.locked-message {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(139, 0, 0, 0.95);
    color: white;
    padding: 8px; /* Réduit de 15px */
    text-align: center;
    border-radius: 0 0 20px 20px;
    font-size: 1em; /* Réduit de 1.2em */
    backdrop-filter: blur(5px);
    z-index: 1;
}

/* Style de la grille d'artefacts dans le JEU */

.artifacts-title {
    color: var(--primary-green);
    font-size: 1.2em;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.artifacts-container {
    position: fixed; /* Changé de absolute à fixed */
    top: 70px; /* Laisse de l'espace pour la barre supérieure */
    right: 20px;
    width: 200px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    z-index: 50; /* Assurez-vous qu'il reste au-dessus du jeu mais en-dessous des modales */
    height: auto;
    pointer-events: auto; /* Permet l'interaction avec les cartes */
}

.artifact-card {
    width: 85px;
    height: 85px;
    background: rgba(20, 20, 20, 0.5);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(5px);
}

.artifact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.artifact-type-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 3px;
    height: 12px;
    border-radius: 1px;
}

.artifact-type-badge.active {
    background: #ce52ff;
}

.artifact-type-badge.passive {
    background: #54af4c;
}

/* Badge de rareté en haut */
.rarity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Valeur principale au centre */
.main-stat-value {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.main-stat-name {
    font-size: 10px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

/* Style du popup détaillé */
.artifact-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: #1E1E1E;
    border: 2px solid var(--primary-green);
    border-radius: 12px;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.artifact-details-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.artifact-details-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.artifact-header-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.artifact-details-rarity {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.artifact-type-indicator {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
}

.artifact-type-indicator.active {
    background: rgba(206, 82, 255, 0.2);
    color: #ce52ff;
    border: 1px solid #ce52ff;
}

.artifact-type-indicator.passive {
    background: rgba(84, 175, 76, 0.2);
    color: #54af4c;
    border: 1px solid #54af4c;
}

.artifact-details-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
}

.artifact-details-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Amélioration visuelle des stats */
.main-stat-details, .sub-stat-details {
    position: relative;
    padding-left: 24px;
}

.main-stat-details {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
}

.sub-stat-details {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.main-stat-details::before, .sub-stat-details::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Overlay sombre derrière le popup */
.artifact-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

/* Styles pour la zone d'artéfacts */
/* Cacher la scrollbar mais garder la fonctionnalité */
.artifacts-container::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.artifacts-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.artifacts-container::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.5);
    border-radius: 5px;
}

.artifacts-container::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 175, 80, 0.7);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de brillance sur les artéfacts rares et plus */
.artifact-card[data-rarity="RARE"],
.artifact-card[data-rarity="EPIC"],
.artifact-card[data-rarity="LEGENDARY"],
.artifact-card[data-rarity="MYTHICAL"] {
    position: relative;
    overflow: hidden;
}

.artifact-card[data-rarity="RARE"]::after,
.artifact-card[data-rarity="EPIC"]::after,
.artifact-card[data-rarity="LEGENDARY"]::after,
.artifact-card[data-rarity="MYTHICAL"]::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        transform: translateX(100%) translateY(100%);
    }
}

.artifact-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.artifact-roulette {
    width: 800px;
    height: 200px;
    background: #141414;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.roulette-container {
    display: flex;
    position: absolute;
    left: 0;
    transition: transform 5s cubic-bezier(0.21, 0.53, 0.29, 0.99);
}

.roulette-item {
    min-width: 160px;
    height: 200px;
    padding: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.roulette-selector {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-green);
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 20px var(--primary-green);
}

.roulette-item-rarity {
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 12px;
    color: white;
}

.roulette-item-stat {
    text-align: center;
    font-size: 16px;
    color: white;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

.generator.awaiting-placement {
    cursor: pointer;
    border: 2px solid #ce52ff;
    box-shadow: 0 0 10px rgba(206, 82, 255, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(206, 82, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(206, 82, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(206, 82, 255, 0.3);
    }
}

.artifact-container {
    display: flex; /* ✅ Les artefacts seront alignés horizontalement */
    flex-wrap: wrap; /* ✅ Si trop d'artefacts, ils passeront à la ligne suivante */
    gap: 8px; /* ✅ Espacement entre chaque artefact */
    margin-top: 8px;
    justify-content: center; /* ✅ Centre les artefacts sous le générateur */
}

.generator-artifact-indicator {
    position: absolute;
    right: 230px; /* Positionné avant le bouton d'upgrade */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.95);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    backdrop-filter: blur(5px);
    min-width: 100px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 6px;
}

.artifact-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.artifact-indicator-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.artifact-rarity {
    font-weight: bold;
    font-size: 11px;
}

.artifact-bonus {
    font-size: 12px;
}

/* Suppression de l'opacité sur les artéfacts placés */
.artifact-card.placed {
    opacity: 1;
    position: relative;
}

.artifact-card.placed::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    border: 2px solid #ce52ff;
    pointer-events: none;
}
