/* =========================================
   CHALLENGES - CSS (Design Final)
   ========================================= */

/* Section Challenges */
.challenges-section {
    margin: 20px auto;
    padding: 0 20px;
    max-width: 800px;
}

.challenges-title {
    text-align: center;
    color: var(--color-dark);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Container des cartes */
.challenges-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Carte Challenge */
.challenge-card {
    width: 180px;
    border-radius: 20px;
    padding: 40px 15px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 35px;
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Couleurs des cartes */
.card-curieux {
    background: var(--color-green);
}

.card-maestro {
    background: var(--color-teal);
    padding-bottom: 45px;
}

.card-prodige {
    background: var(--color-dark);
}

/* Icône losange */
.challenge-card .card-icon {
    width: 70px;
    height: 70px;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
}

.challenge-card .card-icon svg {
    width: 100%;
    height: 100%;
}

/* Nom du pack */
.card-name {
    color: var(--color-bg);
    font-size: 0.85rem;
    font-weight: 400;
    margin: 0 0 3px 0;
    padding: 0;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Nombre de mots */
.card-words {
    color: var(--color-bg);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 3px 0;
    padding: 0;
    line-height: 1.2;
}

/* Prix */
.card-price {
    color: var(--color-bg);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 12px 0;
    padding: 0;
}

/* Bouton */
.card-btn {
    background: var(--color-bg);
    border: none;
    border-radius: 20px;
    padding: 10px 25px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-dark);
}

.card-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Badge Populaire */
.card-popular-badge {
    background: var(--color-green);
    color: var(--color-bg);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 20px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 20px 20px;
    margin: 0;
}

/* Infos de confiance */
.challenges-trust {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-dark);
}

.trust-item i {
    color: var(--color-green);
}

/* Responsive */
@media (max-width: 680px) {
    .challenges-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .challenge-card {
        width: 100%;
        max-width: 280px;
    }
    
    .challenges-trust {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* Badge étoile en haut à droite */
.card-star-badge {
    position: absolute;
    top: -12px;
    right: -8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.card-star-badge i {
    font-size: 38px;
    color: #f5c842;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.card-star-badge span {
    position: absolute;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: -2px;
}

/* Stats dans la carte */
.card-stats {
    margin: 8px 0 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
}

.card-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-bg);
    padding: 2px 0;
    opacity: 0.9;
}

.card-stat-row span:last-child {
    font-weight: 600;
}

/* Barre de progression dans la carte */
.card-progress {
    margin: 8px 0 10px;
}

.card-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: var(--color-bg);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.card-progress-text {
    font-size: 0.72rem;
    color: var(--color-bg);
    margin: 5px 0 0;
    opacity: 0.8;
}

/* Coming Soon Box */
/* =========================================
   CHALLENGE - MINI MAP (Nouveau design)
   ========================================= */

/* Page Challenge - Fond vert foncé */
.challenge-page {
    background: #1a4a3a;
    min-height: 100vh;
}

/* Header Challenge */
.challenge-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #153d30;
    color: var(--color-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.challenge-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.challenge-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.challenge-info-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    color: var(--color-bg);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.challenge-info-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.challenge-back,
.challenge-home {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.challenge-back:hover,
.challenge-home:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.challenge-icon-center {
    font-size: 1.8rem;
    color: #f5c842;
}

.challenge-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
}

.challenge-stars i {
    color: #f5c842;
}

/* Main Content */
.challenge-main {
    padding: 70px 15px 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Progression */
.challenge-progress-info {
    margin-bottom: 8px;
    text-align: center;
}

.progress-count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-bg);
}

/* Wrapper pour la minimap */
.challenge-minimap-wrapper {
    width: 100%;
    max-width: 350px;
    position: relative;
    margin: 0 auto;
}

/* Container scrollable pour la minimap */
.challenge-minimap-container {
    width: 100%;
    max-height: 55vh;
    overflow-y: auto;
    background: #153d30;
    border-radius: 12px;
    padding: 12px;
}

/* Dégradé en bas de la map - positionné sur le wrapper */
.challenge-minimap-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to top, #153d30 0%, #153d30 30%, transparent 100%);
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

/* Mini-map 1000 cases */
.challenge-minimap {
    display: grid;
    gap: 4px;
    width: 100%;
}

.minimap-cell {
    aspect-ratio: 1;
    background: rgba(254, 243, 216, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

.minimap-cell:hover {
    background: rgba(254, 243, 216, 0.4);
    transform: scale(1.15);
    z-index: 10;
}

.minimap-cell.found {
    background: var(--color-green);
}

.minimap-cell.found i.fa-check {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.minimap-cell.selected {
    outline: 2px solid var(--color-bg);
    outline-offset: 1px;
    transform: scale(1.2);
    z-index: 11;
}

.minimap-cell.locked {
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.minimap-cell.locked i.fa-lock {
    font-size: 12px;
    color: rgba(254, 243, 216, 0.45);
}

.minimap-cell.locked:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Mot sélectionné */
.challenge-selected {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #153d30;
    padding: 25px 20px 25px;
    text-align: center;
    border: none;
}

.selected-number {
    font-size: 0.9rem;
    color: var(--color-bg);
    margin-bottom: 10px;
    font-weight: 500;
    opacity: 0.8;
}

.btn-play-word {
    background: var(--color-green);
    color: var(--color-bg);
    border: none;
    padding: 14px 35px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-play-word:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.btn-play-word.disabled {
    background: rgba(254, 243, 216, 0.2);
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-play-word.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Modals */
.challenge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: var(--color-bg);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 350px;
    width: 100%;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-content h2 {
    color: var(--color-dark);
    font-size: 1.4rem;
    margin: 0 0 10px;
}

.modal-content p {
    color: var(--color-dark);
    font-size: 0.95rem;
    margin: 0 0 8px;
    opacity: 0.8;
}

/* Options d'achat */
.purchase-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0 20px;
}

.purchase-btn {
    background: var(--color-teal);
    color: var(--color-bg);
    border: none;
    padding: 18px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.purchase-btn.popular {
    background: var(--color-teal);
    border: 2px solid #f5c842;
}

.purchase-btn.best-value {
    background: var(--color-green);
}

.pack-badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background: #f5c842;
    color: var(--color-dark);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pack-savings {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 10px;
}

.pack-price-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pack-words {
    font-size: 1.1rem;
    font-weight: 600;
}

.pack-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pack-price {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--color-dark);
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.6;
    text-decoration: underline;
    padding: 10px;
}

.modal-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 400px) {
    .challenge-minimap-container {
        padding: 10px;
    }
    
    .challenge-minimap {
        gap: 3px;
    }
    
    .minimap-cell {
        border-radius: 2px;
    }
    
    .minimap-cell.locked i {
        font-size: 8px;
    }
    
    .minimap-cell.found i {
        font-size: 10px;
    }
    
    .btn-play-word {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .challenge-selected {
        padding: 12px 15px 20px;
    }
}
